storage.proto 93 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400
  1. // Copyright 2022 Google LLC
  2. //
  3. // Licensed under the Apache License, Version 2.0 (the "License");
  4. // you may not use this file except in compliance with the License.
  5. // You may obtain a copy of the License at
  6. //
  7. // http://www.apache.org/licenses/LICENSE-2.0
  8. //
  9. // Unless required by applicable law or agreed to in writing, software
  10. // distributed under the License is distributed on an "AS IS" BASIS,
  11. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. // See the License for the specific language governing permissions and
  13. // limitations under the License.
  14. syntax = "proto3";
  15. package google.storage.v2;
  16. import "google/api/client.proto";
  17. import "google/api/field_behavior.proto";
  18. import "google/api/resource.proto";
  19. import "google/api/routing.proto";
  20. import "google/iam/v1/iam_policy.proto";
  21. import "google/iam/v1/policy.proto";
  22. import "google/protobuf/empty.proto";
  23. import "google/protobuf/field_mask.proto";
  24. import "google/protobuf/timestamp.proto";
  25. import "google/type/date.proto";
  26. option go_package = "google.golang.org/genproto/googleapis/storage/v2;storage";
  27. option java_multiple_files = true;
  28. option java_outer_classname = "StorageProto";
  29. option java_package = "com.google.storage.v2";
  30. option (google.api.resource_definition) = {
  31. type: "cloudkms.googleapis.com/CryptoKey"
  32. pattern: "projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}"
  33. };
  34. // ## API Overview and Naming Syntax
  35. //
  36. // The Cloud Storage gRPC API allows applications to read and write data through
  37. // the abstractions of buckets and objects. For a description of these
  38. // abstractions please see https://cloud.google.com/storage/docs.
  39. //
  40. // Resources are named as follows:
  41. // - Projects are referred to as they are defined by the Resource Manager API,
  42. // using strings like `projects/123456` or `projects/my-string-id`.
  43. // - Buckets are named using string names of the form:
  44. // `projects/{project}/buckets/{bucket}`
  45. // For globally unique buckets, `_` may be substituted for the project.
  46. // - Objects are uniquely identified by their name along with the name of the
  47. // bucket they belong to, as separate strings in this API. For example:
  48. //
  49. // ReadObjectRequest {
  50. // bucket: 'projects/_/buckets/my-bucket'
  51. // object: 'my-object'
  52. // }
  53. // Note that object names can contain `/` characters, which are treated as
  54. // any other character (no special directory semantics).
  55. service Storage {
  56. option (google.api.default_host) = "storage.googleapis.com";
  57. option (google.api.oauth_scopes) =
  58. "https://www.googleapis.com/auth/cloud-platform,"
  59. "https://www.googleapis.com/auth/cloud-platform.read-only,"
  60. "https://www.googleapis.com/auth/devstorage.full_control,"
  61. "https://www.googleapis.com/auth/devstorage.read_only,"
  62. "https://www.googleapis.com/auth/devstorage.read_write";
  63. // Permanently deletes an empty bucket.
  64. rpc DeleteBucket(DeleteBucketRequest) returns (google.protobuf.Empty) {
  65. option (google.api.routing) = {
  66. routing_parameters {
  67. field: "name"
  68. path_template: "{bucket=**}"
  69. }
  70. };
  71. option (google.api.method_signature) = "name";
  72. }
  73. // Returns metadata for the specified bucket.
  74. rpc GetBucket(GetBucketRequest) returns (Bucket) {
  75. option (google.api.routing) = {
  76. routing_parameters {
  77. field: "name"
  78. path_template: "{bucket=**}"
  79. }
  80. };
  81. option (google.api.method_signature) = "name";
  82. }
  83. // Creates a new bucket.
  84. rpc CreateBucket(CreateBucketRequest) returns (Bucket) {
  85. option (google.api.routing) = {
  86. routing_parameters {
  87. field: "parent"
  88. path_template: "{project=**}"
  89. }
  90. };
  91. option (google.api.method_signature) = "parent,bucket,bucket_id";
  92. }
  93. // Retrieves a list of buckets for a given project.
  94. rpc ListBuckets(ListBucketsRequest) returns (ListBucketsResponse) {
  95. option (google.api.routing) = {
  96. routing_parameters {
  97. field: "parent"
  98. path_template: "{project=**}"
  99. }
  100. };
  101. option (google.api.method_signature) = "parent";
  102. }
  103. // Locks retention policy on a bucket.
  104. rpc LockBucketRetentionPolicy(LockBucketRetentionPolicyRequest) returns (Bucket) {
  105. option (google.api.routing) = {
  106. routing_parameters {
  107. field: "bucket"
  108. path_template: "{bucket=**}"
  109. }
  110. };
  111. option (google.api.method_signature) = "bucket";
  112. }
  113. // Gets the IAM policy for a specified bucket or object.
  114. rpc GetIamPolicy(google.iam.v1.GetIamPolicyRequest) returns (google.iam.v1.Policy) {
  115. option (google.api.routing) = {
  116. routing_parameters {
  117. field: "resource"
  118. path_template: "{bucket=**}"
  119. }
  120. routing_parameters {
  121. field: "resource"
  122. path_template: "{bucket=projects/*/buckets/*}/objects/**"
  123. }
  124. };
  125. option (google.api.method_signature) = "resource";
  126. }
  127. // Updates an IAM policy for the specified bucket or object.
  128. rpc SetIamPolicy(google.iam.v1.SetIamPolicyRequest) returns (google.iam.v1.Policy) {
  129. option (google.api.routing) = {
  130. routing_parameters {
  131. field: "resource"
  132. path_template: "{bucket=**}"
  133. }
  134. routing_parameters {
  135. field: "resource"
  136. path_template: "{bucket=projects/*/buckets/*}/objects/**"
  137. }
  138. };
  139. option (google.api.method_signature) = "resource,policy";
  140. }
  141. // Tests a set of permissions on the given bucket or object to see which, if
  142. // any, are held by the caller.
  143. rpc TestIamPermissions(google.iam.v1.TestIamPermissionsRequest) returns (google.iam.v1.TestIamPermissionsResponse) {
  144. option (google.api.routing) = {
  145. routing_parameters {
  146. field: "resource"
  147. path_template: "{bucket=**}"
  148. }
  149. routing_parameters {
  150. field: "resource"
  151. path_template: "{bucket=projects/*/buckets/*}/objects/**"
  152. }
  153. };
  154. option (google.api.method_signature) = "resource,permissions";
  155. }
  156. // Updates a bucket. Equivalent to JSON API's storage.buckets.patch method.
  157. rpc UpdateBucket(UpdateBucketRequest) returns (Bucket) {
  158. option (google.api.routing) = {
  159. routing_parameters {
  160. field: "bucket.name"
  161. path_template: "{bucket=**}"
  162. }
  163. };
  164. option (google.api.method_signature) = "bucket,update_mask";
  165. }
  166. // Permanently deletes a notification subscription.
  167. rpc DeleteNotification(DeleteNotificationRequest) returns (google.protobuf.Empty) {
  168. option (google.api.routing) = {
  169. routing_parameters {
  170. field: "name"
  171. path_template: "{bucket=projects/*/buckets/*}/**"
  172. }
  173. };
  174. option (google.api.method_signature) = "name";
  175. }
  176. // View a notification config.
  177. rpc GetNotification(GetNotificationRequest) returns (Notification) {
  178. option (google.api.routing) = {
  179. routing_parameters {
  180. field: "name"
  181. path_template: "{bucket=projects/*/buckets/*}/**"
  182. }
  183. };
  184. option (google.api.method_signature) = "name";
  185. }
  186. // Creates a notification subscription for a given bucket.
  187. // These notifications, when triggered, publish messages to the specified
  188. // Pub/Sub topics.
  189. // See https://cloud.google.com/storage/docs/pubsub-notifications.
  190. rpc CreateNotification(CreateNotificationRequest) returns (Notification) {
  191. option (google.api.routing) = {
  192. routing_parameters {
  193. field: "parent"
  194. path_template: "{bucket=**}"
  195. }
  196. };
  197. option (google.api.method_signature) = "parent,notification";
  198. }
  199. // Retrieves a list of notification subscriptions for a given bucket.
  200. rpc ListNotifications(ListNotificationsRequest) returns (ListNotificationsResponse) {
  201. option (google.api.routing) = {
  202. routing_parameters {
  203. field: "parent"
  204. path_template: "{bucket=**}"
  205. }
  206. };
  207. option (google.api.method_signature) = "parent";
  208. }
  209. // Concatenates a list of existing objects into a new object in the same
  210. // bucket.
  211. rpc ComposeObject(ComposeObjectRequest) returns (Object) {
  212. option (google.api.routing) = {
  213. routing_parameters {
  214. field: "destination.bucket"
  215. path_template: "{bucket=**}"
  216. }
  217. };
  218. }
  219. // Deletes an object and its metadata. Deletions are permanent if versioning
  220. // is not enabled for the bucket, or if the `generation` parameter is used.
  221. rpc DeleteObject(DeleteObjectRequest) returns (google.protobuf.Empty) {
  222. option (google.api.routing) = {
  223. routing_parameters {
  224. field: "bucket"
  225. path_template: "{bucket=**}"
  226. }
  227. };
  228. option (google.api.method_signature) = "bucket,object";
  229. option (google.api.method_signature) = "bucket,object,generation";
  230. }
  231. // Cancels an in-progress resumable upload.
  232. rpc CancelResumableWrite(CancelResumableWriteRequest) returns (CancelResumableWriteResponse) {
  233. option (google.api.routing) = {
  234. routing_parameters {
  235. field: "upload_id"
  236. path_template: "{bucket=projects/*/buckets/*}/**"
  237. }
  238. };
  239. option (google.api.method_signature) = "upload_id";
  240. }
  241. // Retrieves an object's metadata.
  242. rpc GetObject(GetObjectRequest) returns (Object) {
  243. option (google.api.routing) = {
  244. routing_parameters {
  245. field: "bucket"
  246. path_template: "{bucket=**}"
  247. }
  248. };
  249. option (google.api.method_signature) = "bucket,object";
  250. option (google.api.method_signature) = "bucket,object,generation";
  251. }
  252. // Reads an object's data.
  253. rpc ReadObject(ReadObjectRequest) returns (stream ReadObjectResponse) {
  254. option (google.api.routing) = {
  255. routing_parameters {
  256. field: "bucket"
  257. path_template: "{bucket=**}"
  258. }
  259. };
  260. option (google.api.method_signature) = "bucket,object";
  261. option (google.api.method_signature) = "bucket,object,generation";
  262. }
  263. // Updates an object's metadata.
  264. // Equivalent to JSON API's storage.objects.patch.
  265. rpc UpdateObject(UpdateObjectRequest) returns (Object) {
  266. option (google.api.routing) = {
  267. routing_parameters {
  268. field: "object.bucket"
  269. path_template: "{bucket=**}"
  270. }
  271. };
  272. option (google.api.method_signature) = "object,update_mask";
  273. }
  274. // Stores a new object and metadata.
  275. //
  276. // An object can be written either in a single message stream or in a
  277. // resumable sequence of message streams. To write using a single stream,
  278. // the client should include in the first message of the stream an
  279. // `WriteObjectSpec` describing the destination bucket, object, and any
  280. // preconditions. Additionally, the final message must set 'finish_write' to
  281. // true, or else it is an error.
  282. //
  283. // For a resumable write, the client should instead call
  284. // `StartResumableWrite()`, populating a `WriteObjectSpec` into that request.
  285. // They should then attach the returned `upload_id` to the first message of
  286. // each following call to `WriteObject`. If the stream is closed before
  287. // finishing the upload (either explicitly by the client or due to a network
  288. // error or an error response from the server), the client should do as
  289. // follows:
  290. // - Check the result Status of the stream, to determine if writing can be
  291. // resumed on this stream or must be restarted from scratch (by calling
  292. // `StartResumableWrite()`). The resumable errors are DEADLINE_EXCEEDED,
  293. // INTERNAL, and UNAVAILABLE. For each case, the client should use binary
  294. // exponential backoff before retrying. Additionally, writes can be
  295. // resumed after RESOURCE_EXHAUSTED errors, but only after taking
  296. // appropriate measures, which may include reducing aggregate send rate
  297. // across clients and/or requesting a quota increase for your project.
  298. // - If the call to `WriteObject` returns `ABORTED`, that indicates
  299. // concurrent attempts to update the resumable write, caused either by
  300. // multiple racing clients or by a single client where the previous
  301. // request was timed out on the client side but nonetheless reached the
  302. // server. In this case the client should take steps to prevent further
  303. // concurrent writes (e.g., increase the timeouts, stop using more than
  304. // one process to perform the upload, etc.), and then should follow the
  305. // steps below for resuming the upload.
  306. // - For resumable errors, the client should call `QueryWriteStatus()` and
  307. // then continue writing from the returned `persisted_size`. This may be
  308. // less than the amount of data the client previously sent. Note also that
  309. // it is acceptable to send data starting at an offset earlier than the
  310. // returned `persisted_size`; in this case, the service will skip data at
  311. // offsets that were already persisted (without checking that it matches
  312. // the previously written data), and write only the data starting from the
  313. // persisted offset. This behavior can make client-side handling simpler
  314. // in some cases.
  315. //
  316. // The service will not view the object as complete until the client has
  317. // sent a `WriteObjectRequest` with `finish_write` set to `true`. Sending any
  318. // requests on a stream after sending a request with `finish_write` set to
  319. // `true` will cause an error. The client **should** check the response it
  320. // receives to determine how much data the service was able to commit and
  321. // whether the service views the object as complete.
  322. //
  323. // Attempting to resume an already finalized object will result in an OK
  324. // status, with a WriteObjectResponse containing the finalized object's
  325. // metadata.
  326. rpc WriteObject(stream WriteObjectRequest) returns (WriteObjectResponse) {
  327. option (google.api.routing) = {
  328. routing_parameters {
  329. field: "write_object_spec.resource.bucket"
  330. path_template: "{bucket=**}"
  331. }
  332. routing_parameters {
  333. field: "upload_id"
  334. path_template: "{bucket=projects/*/buckets/*}/**"
  335. }
  336. };
  337. }
  338. // Retrieves a list of objects matching the criteria.
  339. rpc ListObjects(ListObjectsRequest) returns (ListObjectsResponse) {
  340. option (google.api.routing) = {
  341. routing_parameters {
  342. field: "parent"
  343. path_template: "{bucket=**}"
  344. }
  345. };
  346. option (google.api.method_signature) = "parent";
  347. }
  348. // Rewrites a source object to a destination object. Optionally overrides
  349. // metadata.
  350. rpc RewriteObject(RewriteObjectRequest) returns (RewriteResponse) {
  351. option (google.api.routing) = {
  352. routing_parameters {
  353. field: "source_bucket"
  354. }
  355. routing_parameters {
  356. field: "destination_bucket"
  357. path_template: "{bucket=**}"
  358. }
  359. };
  360. }
  361. // Starts a resumable write. How long the write operation remains valid, and
  362. // what happens when the write operation becomes invalid, are
  363. // service-dependent.
  364. rpc StartResumableWrite(StartResumableWriteRequest) returns (StartResumableWriteResponse) {
  365. option (google.api.routing) = {
  366. routing_parameters {
  367. field: "write_object_spec.resource.bucket"
  368. path_template: "{bucket=**}"
  369. }
  370. };
  371. }
  372. // Determines the `persisted_size` for an object that is being written, which
  373. // can then be used as the `write_offset` for the next `Write()` call.
  374. //
  375. // If the object does not exist (i.e., the object has been deleted, or the
  376. // first `Write()` has not yet reached the service), this method returns the
  377. // error `NOT_FOUND`.
  378. //
  379. // The client **may** call `QueryWriteStatus()` at any time to determine how
  380. // much data has been processed for this object. This is useful if the
  381. // client is buffering data and needs to know which data can be safely
  382. // evicted. For any sequence of `QueryWriteStatus()` calls for a given
  383. // object name, the sequence of returned `persisted_size` values will be
  384. // non-decreasing.
  385. rpc QueryWriteStatus(QueryWriteStatusRequest) returns (QueryWriteStatusResponse) {
  386. option (google.api.routing) = {
  387. routing_parameters {
  388. field: "upload_id"
  389. path_template: "{bucket=projects/*/buckets/*}/**"
  390. }
  391. };
  392. option (google.api.method_signature) = "upload_id";
  393. }
  394. // Retrieves the name of a project's Google Cloud Storage service account.
  395. rpc GetServiceAccount(GetServiceAccountRequest) returns (ServiceAccount) {
  396. option (google.api.routing) = {
  397. routing_parameters {
  398. field: "project"
  399. }
  400. };
  401. option (google.api.method_signature) = "project";
  402. }
  403. // Creates a new HMAC key for the given service account.
  404. rpc CreateHmacKey(CreateHmacKeyRequest) returns (CreateHmacKeyResponse) {
  405. option (google.api.routing) = {
  406. routing_parameters {
  407. field: "project"
  408. }
  409. };
  410. option (google.api.method_signature) = "project,service_account_email";
  411. }
  412. // Deletes a given HMAC key. Key must be in an INACTIVE state.
  413. rpc DeleteHmacKey(DeleteHmacKeyRequest) returns (google.protobuf.Empty) {
  414. option (google.api.routing) = {
  415. routing_parameters {
  416. field: "project"
  417. }
  418. };
  419. option (google.api.method_signature) = "access_id,project";
  420. }
  421. // Gets an existing HMAC key metadata for the given id.
  422. rpc GetHmacKey(GetHmacKeyRequest) returns (HmacKeyMetadata) {
  423. option (google.api.routing) = {
  424. routing_parameters {
  425. field: "project"
  426. }
  427. };
  428. option (google.api.method_signature) = "access_id,project";
  429. }
  430. // Lists HMAC keys under a given project with the additional filters provided.
  431. rpc ListHmacKeys(ListHmacKeysRequest) returns (ListHmacKeysResponse) {
  432. option (google.api.routing) = {
  433. routing_parameters {
  434. field: "project"
  435. }
  436. };
  437. option (google.api.method_signature) = "project";
  438. }
  439. // Updates a given HMAC key state between ACTIVE and INACTIVE.
  440. rpc UpdateHmacKey(UpdateHmacKeyRequest) returns (HmacKeyMetadata) {
  441. option (google.api.routing) = {
  442. routing_parameters {
  443. field: "hmac_key.project"
  444. path_template: "{project=**}"
  445. }
  446. };
  447. option (google.api.method_signature) = "hmac_key,update_mask";
  448. }
  449. }
  450. // Request message for DeleteBucket.
  451. message DeleteBucketRequest {
  452. // Required. Name of a bucket to delete.
  453. string name = 1 [
  454. (google.api.field_behavior) = REQUIRED,
  455. (google.api.resource_reference) = {
  456. type: "storage.googleapis.com/Bucket"
  457. }
  458. ];
  459. // If set, only deletes the bucket if its metageneration matches this value.
  460. optional int64 if_metageneration_match = 2;
  461. // If set, only deletes the bucket if its metageneration does not match this
  462. // value.
  463. optional int64 if_metageneration_not_match = 3;
  464. }
  465. // Request message for GetBucket.
  466. message GetBucketRequest {
  467. // Required. Name of a bucket.
  468. string name = 1 [
  469. (google.api.field_behavior) = REQUIRED,
  470. (google.api.resource_reference) = {
  471. type: "storage.googleapis.com/Bucket"
  472. }
  473. ];
  474. // If set, and if the bucket's current metageneration does not match the
  475. // specified value, the request will return an error.
  476. optional int64 if_metageneration_match = 2;
  477. // If set, and if the bucket's current metageneration matches the specified
  478. // value, the request will return an error.
  479. optional int64 if_metageneration_not_match = 3;
  480. // Mask specifying which fields to read.
  481. // A "*" field may be used to indicate all fields.
  482. // If no mask is specified, will default to all fields.
  483. optional google.protobuf.FieldMask read_mask = 5;
  484. }
  485. // Request message for CreateBucket.
  486. message CreateBucketRequest {
  487. // Required. The project to which this bucket will belong.
  488. string parent = 1 [
  489. (google.api.field_behavior) = REQUIRED,
  490. (google.api.resource_reference) = {
  491. type: "cloudresourcemanager.googleapis.com/Project"
  492. }
  493. ];
  494. // Properties of the new bucket being inserted.
  495. // The project and name of the bucket are specified in the parent and
  496. // bucket_id fields, respectively. Populating those fields in `bucket` will
  497. // result in an error.
  498. Bucket bucket = 2;
  499. // Required. The ID to use for this bucket, which will become the final component of
  500. // the bucket's resource name. For example, the value `foo` might result in
  501. // a bucket with the name `projects/123456/buckets/foo`.
  502. string bucket_id = 3 [(google.api.field_behavior) = REQUIRED];
  503. // Apply a predefined set of access controls to this bucket.
  504. // Valid values are "authenticatedRead", "private", "projectPrivate",
  505. // "publicRead", or "publicReadWrite".
  506. string predefined_acl = 6;
  507. // Apply a predefined set of default object access controls to this bucket.
  508. // Valid values are "authenticatedRead", "bucketOwnerFullControl",
  509. // "bucketOwnerRead", "private", "projectPrivate", or "publicRead".
  510. string predefined_default_object_acl = 7;
  511. }
  512. // Request message for ListBuckets.
  513. message ListBucketsRequest {
  514. // Required. The project whose buckets we are listing.
  515. string parent = 1 [
  516. (google.api.field_behavior) = REQUIRED,
  517. (google.api.resource_reference) = {
  518. type: "cloudresourcemanager.googleapis.com/Project"
  519. }
  520. ];
  521. // Maximum number of buckets to return in a single response. The service will
  522. // use this parameter or 1,000 items, whichever is smaller. If "acl" is
  523. // present in the read_mask, the service will use this parameter of 200 items,
  524. // whichever is smaller.
  525. int32 page_size = 2;
  526. // A previously-returned page token representing part of the larger set of
  527. // results to view.
  528. string page_token = 3;
  529. // Filter results to buckets whose names begin with this prefix.
  530. string prefix = 4;
  531. // Mask specifying which fields to read from each result.
  532. // If no mask is specified, will default to all fields except items.owner,
  533. // items.acl, and items.default_object_acl.
  534. // * may be used to mean "all fields".
  535. optional google.protobuf.FieldMask read_mask = 5;
  536. }
  537. // The result of a call to Buckets.ListBuckets
  538. message ListBucketsResponse {
  539. // The list of items.
  540. repeated Bucket buckets = 1;
  541. // The continuation token, used to page through large result sets. Provide
  542. // this value in a subsequent request to return the next page of results.
  543. string next_page_token = 2;
  544. }
  545. // Request message for LockBucketRetentionPolicyRequest.
  546. message LockBucketRetentionPolicyRequest {
  547. // Required. Name of a bucket.
  548. string bucket = 1 [
  549. (google.api.field_behavior) = REQUIRED,
  550. (google.api.resource_reference) = {
  551. type: "storage.googleapis.com/Bucket"
  552. }
  553. ];
  554. // Required. Makes the operation conditional on whether bucket's current metageneration
  555. // matches the given value. Must be positive.
  556. int64 if_metageneration_match = 2 [(google.api.field_behavior) = REQUIRED];
  557. }
  558. // Request for UpdateBucket method.
  559. message UpdateBucketRequest {
  560. // Required. The bucket to update.
  561. // The bucket's `name` field will be used to identify the bucket.
  562. Bucket bucket = 1 [(google.api.field_behavior) = REQUIRED];
  563. // If set, will only modify the bucket if its metageneration matches this
  564. // value.
  565. optional int64 if_metageneration_match = 2;
  566. // If set, will only modify the bucket if its metageneration does not match
  567. // this value.
  568. optional int64 if_metageneration_not_match = 3;
  569. // Apply a predefined set of access controls to this bucket.
  570. // Valid values are "authenticatedRead", "private", "projectPrivate",
  571. // "publicRead", or "publicReadWrite".
  572. string predefined_acl = 8;
  573. // Apply a predefined set of default object access controls to this bucket.
  574. // Valid values are "authenticatedRead", "bucketOwnerFullControl",
  575. // "bucketOwnerRead", "private", "projectPrivate", or "publicRead".
  576. string predefined_default_object_acl = 9;
  577. // Required. List of fields to be updated.
  578. //
  579. // To specify ALL fields, equivalent to the JSON API's "update" function,
  580. // specify a single field with the value `*`. Note: not recommended. If a new
  581. // field is introduced at a later time, an older client updating with the `*`
  582. // may accidentally reset the new field's value.
  583. //
  584. // Not specifying any fields is an error.
  585. // Not specifying a field while setting that field to a non-default value is
  586. // an error.
  587. google.protobuf.FieldMask update_mask = 6 [(google.api.field_behavior) = REQUIRED];
  588. }
  589. // Request message for DeleteNotification.
  590. message DeleteNotificationRequest {
  591. // Required. The parent bucket of the notification.
  592. string name = 1 [
  593. (google.api.field_behavior) = REQUIRED,
  594. (google.api.resource_reference) = {
  595. type: "storage.googleapis.com/Notification"
  596. }
  597. ];
  598. }
  599. // Request message for GetNotification.
  600. message GetNotificationRequest {
  601. // Required. The parent bucket of the notification.
  602. // Format:
  603. // `projects/{project}/buckets/{bucket}/notificationConfigs/{notification}`
  604. string name = 1 [
  605. (google.api.field_behavior) = REQUIRED,
  606. (google.api.resource_reference) = {
  607. type: "storage.googleapis.com/Bucket"
  608. }
  609. ];
  610. }
  611. // Request message for CreateNotification.
  612. message CreateNotificationRequest {
  613. // Required. The bucket to which this notification belongs.
  614. string parent = 1 [
  615. (google.api.field_behavior) = REQUIRED,
  616. (google.api.resource_reference) = {
  617. child_type: "storage.googleapis.com/Bucket"
  618. }
  619. ];
  620. // Required. Properties of the notification to be inserted.
  621. Notification notification = 2 [(google.api.field_behavior) = REQUIRED];
  622. }
  623. // Request message for ListNotifications.
  624. message ListNotificationsRequest {
  625. // Required. Name of a Google Cloud Storage bucket.
  626. string parent = 1 [
  627. (google.api.field_behavior) = REQUIRED,
  628. (google.api.resource_reference) = {
  629. child_type: "storage.googleapis.com/Bucket"
  630. }
  631. ];
  632. // The maximum number of notifications to return. The service may return fewer
  633. // than this value.
  634. // The default value is 100. Specifying a value above 100 will result in a
  635. // page_size of 100.
  636. int32 page_size = 2;
  637. // A page token, received from a previous `ListNotifications` call.
  638. // Provide this to retrieve the subsequent page.
  639. //
  640. // When paginating, all other parameters provided to `ListNotifications` must
  641. // match the call that provided the page token.
  642. string page_token = 3;
  643. }
  644. // The result of a call to Notifications.ListNotifications
  645. message ListNotificationsResponse {
  646. // The list of items.
  647. repeated Notification notifications = 1;
  648. // A token, which can be sent as `page_token` to retrieve the next page.
  649. // If this field is omitted, there are no subsequent pages.
  650. string next_page_token = 2;
  651. }
  652. // Request message for ComposeObject.
  653. message ComposeObjectRequest {
  654. // Description of a source object for a composition request.
  655. message SourceObject {
  656. // Preconditions for a source object of a composition request.
  657. message ObjectPreconditions {
  658. // Only perform the composition if the generation of the source object
  659. // that would be used matches this value. If this value and a generation
  660. // are both specified, they must be the same value or the call will fail.
  661. optional int64 if_generation_match = 1;
  662. }
  663. // Required. The source object's name. All source objects must reside in the same
  664. // bucket.
  665. string name = 1 [(google.api.field_behavior) = REQUIRED];
  666. // The generation of this object to use as the source.
  667. int64 generation = 2;
  668. // Conditions that must be met for this operation to execute.
  669. ObjectPreconditions object_preconditions = 3;
  670. }
  671. // Required. Properties of the resulting object.
  672. Object destination = 1 [(google.api.field_behavior) = REQUIRED];
  673. // The list of source objects that will be concatenated into a single object.
  674. repeated SourceObject source_objects = 2;
  675. // Apply a predefined set of access controls to the destination object.
  676. // Valid values are "authenticatedRead", "bucketOwnerFullControl",
  677. // "bucketOwnerRead", "private", "projectPrivate", or "publicRead".
  678. string destination_predefined_acl = 9;
  679. // Makes the operation conditional on whether the object's current generation
  680. // matches the given value. Setting to 0 makes the operation succeed only if
  681. // there are no live versions of the object.
  682. optional int64 if_generation_match = 4;
  683. // Makes the operation conditional on whether the object's current
  684. // metageneration matches the given value.
  685. optional int64 if_metageneration_match = 5;
  686. // Resource name of the Cloud KMS key, of the form
  687. // `projects/my-project/locations/my-location/keyRings/my-kr/cryptoKeys/my-key`,
  688. // that will be used to encrypt the object. Overrides the object
  689. // metadata's `kms_key_name` value, if any.
  690. string kms_key = 6 [(google.api.resource_reference) = {
  691. type: "cloudkms.googleapis.com/CryptoKey"
  692. }];
  693. // A set of parameters common to Storage API requests concerning an object.
  694. CommonObjectRequestParams common_object_request_params = 7;
  695. }
  696. // Message for deleting an object.
  697. // `bucket` and `object` **must** be set.
  698. message DeleteObjectRequest {
  699. // Required. Name of the bucket in which the object resides.
  700. string bucket = 1 [(google.api.field_behavior) = REQUIRED];
  701. // Required. The name of the object to delete (when not using a resumable write).
  702. string object = 2 [(google.api.field_behavior) = REQUIRED];
  703. // If present, permanently deletes a specific revision of this object (as
  704. // opposed to the latest version, the default).
  705. int64 generation = 4;
  706. // Makes the operation conditional on whether the object's current generation
  707. // matches the given value. Setting to 0 makes the operation succeed only if
  708. // there are no live versions of the object.
  709. optional int64 if_generation_match = 5;
  710. // Makes the operation conditional on whether the object's live generation
  711. // does not match the given value. If no live object exists, the precondition
  712. // fails. Setting to 0 makes the operation succeed only if there is a live
  713. // version of the object.
  714. optional int64 if_generation_not_match = 6;
  715. // Makes the operation conditional on whether the object's current
  716. // metageneration matches the given value.
  717. optional int64 if_metageneration_match = 7;
  718. // Makes the operation conditional on whether the object's current
  719. // metageneration does not match the given value.
  720. optional int64 if_metageneration_not_match = 8;
  721. // A set of parameters common to Storage API requests concerning an object.
  722. CommonObjectRequestParams common_object_request_params = 10;
  723. }
  724. // Message for canceling an in-progress resumable upload.
  725. // `upload_id` **must** be set.
  726. message CancelResumableWriteRequest {
  727. // Required. The upload_id of the resumable upload to cancel. This should be copied
  728. // from the `upload_id` field of `StartResumableWriteResponse`.
  729. string upload_id = 1 [(google.api.field_behavior) = REQUIRED];
  730. }
  731. // Empty response message for canceling an in-progress resumable upload, will be
  732. // extended as needed.
  733. message CancelResumableWriteResponse {
  734. }
  735. // Request message for ReadObject.
  736. message ReadObjectRequest {
  737. // Required. The name of the bucket containing the object to read.
  738. string bucket = 1 [(google.api.field_behavior) = REQUIRED];
  739. // Required. The name of the object to read.
  740. string object = 2 [(google.api.field_behavior) = REQUIRED];
  741. // If present, selects a specific revision of this object (as opposed
  742. // to the latest version, the default).
  743. int64 generation = 3;
  744. // The offset for the first byte to return in the read, relative to the start
  745. // of the object.
  746. //
  747. // A negative `read_offset` value will be interpreted as the number of bytes
  748. // back from the end of the object to be returned. For example, if an object's
  749. // length is 15 bytes, a ReadObjectRequest with `read_offset` = -5 and
  750. // `read_limit` = 3 would return bytes 10 through 12 of the object. Requesting
  751. // a negative offset with magnitude larger than the size of the object will
  752. // return the entire object.
  753. int64 read_offset = 4;
  754. // The maximum number of `data` bytes the server is allowed to return in the
  755. // sum of all `Object` messages. A `read_limit` of zero indicates that there
  756. // is no limit, and a negative `read_limit` will cause an error.
  757. //
  758. // If the stream returns fewer bytes than allowed by the `read_limit` and no
  759. // error occurred, the stream includes all data from the `read_offset` to the
  760. // end of the resource.
  761. int64 read_limit = 5;
  762. // Makes the operation conditional on whether the object's current generation
  763. // matches the given value. Setting to 0 makes the operation succeed only if
  764. // there are no live versions of the object.
  765. optional int64 if_generation_match = 6;
  766. // Makes the operation conditional on whether the object's live generation
  767. // does not match the given value. If no live object exists, the precondition
  768. // fails. Setting to 0 makes the operation succeed only if there is a live
  769. // version of the object.
  770. optional int64 if_generation_not_match = 7;
  771. // Makes the operation conditional on whether the object's current
  772. // metageneration matches the given value.
  773. optional int64 if_metageneration_match = 8;
  774. // Makes the operation conditional on whether the object's current
  775. // metageneration does not match the given value.
  776. optional int64 if_metageneration_not_match = 9;
  777. // A set of parameters common to Storage API requests concerning an object.
  778. CommonObjectRequestParams common_object_request_params = 10;
  779. // Mask specifying which fields to read.
  780. // The checksummed_data field and its children will always be present.
  781. // If no mask is specified, will default to all fields except metadata.owner
  782. // and metadata.acl.
  783. // * may be used to mean "all fields".
  784. optional google.protobuf.FieldMask read_mask = 12;
  785. }
  786. // Request message for GetObject.
  787. message GetObjectRequest {
  788. // Required. Name of the bucket in which the object resides.
  789. string bucket = 1 [(google.api.field_behavior) = REQUIRED];
  790. // Required. Name of the object.
  791. string object = 2 [(google.api.field_behavior) = REQUIRED];
  792. // If present, selects a specific revision of this object (as opposed to the
  793. // latest version, the default).
  794. int64 generation = 3;
  795. // Makes the operation conditional on whether the object's current generation
  796. // matches the given value. Setting to 0 makes the operation succeed only if
  797. // there are no live versions of the object.
  798. optional int64 if_generation_match = 4;
  799. // Makes the operation conditional on whether the object's live generation
  800. // does not match the given value. If no live object exists, the precondition
  801. // fails. Setting to 0 makes the operation succeed only if there is a live
  802. // version of the object.
  803. optional int64 if_generation_not_match = 5;
  804. // Makes the operation conditional on whether the object's current
  805. // metageneration matches the given value.
  806. optional int64 if_metageneration_match = 6;
  807. // Makes the operation conditional on whether the object's current
  808. // metageneration does not match the given value.
  809. optional int64 if_metageneration_not_match = 7;
  810. // A set of parameters common to Storage API requests concerning an object.
  811. CommonObjectRequestParams common_object_request_params = 8;
  812. // Mask specifying which fields to read.
  813. // If no mask is specified, will default to all fields except metadata.acl and
  814. // metadata.owner.
  815. // * may be used to mean "all fields".
  816. optional google.protobuf.FieldMask read_mask = 10;
  817. }
  818. // Response message for ReadObject.
  819. message ReadObjectResponse {
  820. // A portion of the data for the object. The service **may** leave `data`
  821. // empty for any given `ReadResponse`. This enables the service to inform the
  822. // client that the request is still live while it is running an operation to
  823. // generate more data.
  824. ChecksummedData checksummed_data = 1;
  825. // The checksums of the complete object. The client should compute one of
  826. // these checksums over the downloaded object and compare it against the value
  827. // provided here.
  828. ObjectChecksums object_checksums = 2;
  829. // If read_offset and or read_limit was specified on the
  830. // ReadObjectRequest, ContentRange will be populated on the first
  831. // ReadObjectResponse message of the read stream.
  832. ContentRange content_range = 3;
  833. // Metadata of the object whose media is being returned.
  834. // Only populated in the first response in the stream.
  835. Object metadata = 4;
  836. }
  837. // Describes an attempt to insert an object, possibly over multiple requests.
  838. message WriteObjectSpec {
  839. // Required. Destination object, including its name and its metadata.
  840. Object resource = 1 [(google.api.field_behavior) = REQUIRED];
  841. // Apply a predefined set of access controls to this object.
  842. // Valid values are "authenticatedRead", "bucketOwnerFullControl",
  843. // "bucketOwnerRead", "private", "projectPrivate", or "publicRead".
  844. string predefined_acl = 7;
  845. // Makes the operation conditional on whether the object's current
  846. // generation matches the given value. Setting to 0 makes the operation
  847. // succeed only if there are no live versions of the object.
  848. optional int64 if_generation_match = 3;
  849. // Makes the operation conditional on whether the object's live
  850. // generation does not match the given value. If no live object exists, the
  851. // precondition fails. Setting to 0 makes the operation succeed only if
  852. // there is a live version of the object.
  853. optional int64 if_generation_not_match = 4;
  854. // Makes the operation conditional on whether the object's current
  855. // metageneration matches the given value.
  856. optional int64 if_metageneration_match = 5;
  857. // Makes the operation conditional on whether the object's current
  858. // metageneration does not match the given value.
  859. optional int64 if_metageneration_not_match = 6;
  860. // The expected final object size being uploaded.
  861. // If this value is set, closing the stream after writing fewer or more than
  862. // `object_size` bytes will result in an OUT_OF_RANGE error.
  863. //
  864. // This situation is considered a client error, and if such an error occurs
  865. // you must start the upload over from scratch, this time sending the correct
  866. // number of bytes.
  867. //
  868. // The `object_size` value is ignored for one-shot (non-resumable) writes.
  869. optional int64 object_size = 8;
  870. }
  871. // Request message for WriteObject.
  872. message WriteObjectRequest {
  873. // The first message of each stream should set one of the following.
  874. oneof first_message {
  875. // For resumable uploads. This should be the `upload_id` returned from a
  876. // call to `StartResumableWriteResponse`.
  877. string upload_id = 1;
  878. // For non-resumable uploads. Describes the overall upload, including the
  879. // destination bucket and object name, preconditions, etc.
  880. WriteObjectSpec write_object_spec = 2;
  881. }
  882. // Required. The offset from the beginning of the object at which the data should be
  883. // written.
  884. //
  885. // In the first `WriteObjectRequest` of a `WriteObject()` action, it
  886. // indicates the initial offset for the `Write()` call. The value **must** be
  887. // equal to the `persisted_size` that a call to `QueryWriteStatus()` would
  888. // return (0 if this is the first write to the object).
  889. //
  890. // On subsequent calls, this value **must** be no larger than the sum of the
  891. // first `write_offset` and the sizes of all `data` chunks sent previously on
  892. // this stream.
  893. //
  894. // An incorrect value will cause an error.
  895. int64 write_offset = 3 [(google.api.field_behavior) = REQUIRED];
  896. // A portion of the data for the object.
  897. oneof data {
  898. // The data to insert. If a crc32c checksum is provided that doesn't match
  899. // the checksum computed by the service, the request will fail.
  900. ChecksummedData checksummed_data = 4;
  901. }
  902. // Checksums for the complete object. If the checksums computed by the service
  903. // don't match the specifified checksums the call will fail. May only be
  904. // provided in the first or last request (either with first_message, or
  905. // finish_write set).
  906. ObjectChecksums object_checksums = 6;
  907. // If `true`, this indicates that the write is complete. Sending any
  908. // `WriteObjectRequest`s subsequent to one in which `finish_write` is `true`
  909. // will cause an error.
  910. // For a non-resumable write (where the upload_id was not set in the first
  911. // message), it is an error not to set this field in the final message of the
  912. // stream.
  913. bool finish_write = 7;
  914. // A set of parameters common to Storage API requests concerning an object.
  915. CommonObjectRequestParams common_object_request_params = 8;
  916. }
  917. // Response message for WriteObject.
  918. message WriteObjectResponse {
  919. // The response will set one of the following.
  920. oneof write_status {
  921. // The total number of bytes that have been processed for the given object
  922. // from all `WriteObject` calls. Only set if the upload has not finalized.
  923. int64 persisted_size = 1;
  924. // A resource containing the metadata for the uploaded object. Only set if
  925. // the upload has finalized.
  926. Object resource = 2;
  927. }
  928. }
  929. // Request message for ListObjects.
  930. message ListObjectsRequest {
  931. // Required. Name of the bucket in which to look for objects.
  932. string parent = 1 [
  933. (google.api.field_behavior) = REQUIRED,
  934. (google.api.resource_reference) = {
  935. child_type: "storage.googleapis.com/Bucket"
  936. }
  937. ];
  938. // Maximum number of `items` plus `prefixes` to return
  939. // in a single page of responses. As duplicate `prefixes` are
  940. // omitted, fewer total results may be returned than requested. The service
  941. // will use this parameter or 1,000 items, whichever is smaller.
  942. int32 page_size = 2;
  943. // A previously-returned page token representing part of the larger set of
  944. // results to view.
  945. string page_token = 3;
  946. // If set, returns results in a directory-like mode. `items` will contain
  947. // only objects whose names, aside from the `prefix`, do not
  948. // contain `delimiter`. Objects whose names, aside from the
  949. // `prefix`, contain `delimiter` will have their name,
  950. // truncated after the `delimiter`, returned in
  951. // `prefixes`. Duplicate `prefixes` are omitted.
  952. string delimiter = 4;
  953. // If true, objects that end in exactly one instance of `delimiter`
  954. // will have their metadata included in `items` in addition to
  955. // `prefixes`.
  956. bool include_trailing_delimiter = 5;
  957. // Filter results to objects whose names begin with this prefix.
  958. string prefix = 6;
  959. // If `true`, lists all versions of an object as distinct results.
  960. // For more information, see
  961. // [Object
  962. // Versioning](https://cloud.google.com/storage/docs/object-versioning).
  963. bool versions = 7;
  964. // Mask specifying which fields to read from each result.
  965. // If no mask is specified, will default to all fields except items.acl and
  966. // items.owner.
  967. // * may be used to mean "all fields".
  968. optional google.protobuf.FieldMask read_mask = 8;
  969. // Filter results to objects whose names are lexicographically equal to or
  970. // after lexicographic_start. If lexicographic_end is also set, the objects
  971. // listed have names between lexicographic_start (inclusive) and
  972. // lexicographic_end (exclusive).
  973. string lexicographic_start = 10;
  974. // Filter results to objects whose names are lexicographically before
  975. // lexicographic_end. If lexicographic_start is also set, the objects listed
  976. // have names between lexicographic_start (inclusive) and lexicographic_end
  977. // (exclusive).
  978. string lexicographic_end = 11;
  979. }
  980. // Request object for `QueryWriteStatus`.
  981. message QueryWriteStatusRequest {
  982. // Required. The name of the resume token for the object whose write status is being
  983. // requested.
  984. string upload_id = 1 [(google.api.field_behavior) = REQUIRED];
  985. // A set of parameters common to Storage API requests concerning an object.
  986. CommonObjectRequestParams common_object_request_params = 2;
  987. }
  988. // Response object for `QueryWriteStatus`.
  989. message QueryWriteStatusResponse {
  990. // The response will set one of the following.
  991. oneof write_status {
  992. // The total number of bytes that have been processed for the given object
  993. // from all `WriteObject` calls. This is the correct value for the
  994. // 'write_offset' field to use when resuming the `WriteObject` operation.
  995. // Only set if the upload has not finalized.
  996. int64 persisted_size = 1;
  997. // A resource containing the metadata for the uploaded object. Only set if
  998. // the upload has finalized.
  999. Object resource = 2;
  1000. }
  1001. }
  1002. // Request message for RewriteObject.
  1003. // If the source object is encrypted using a Customer-Supplied Encryption Key
  1004. // the key information must be provided in the copy_source_encryption_algorithm,
  1005. // copy_source_encryption_key_bytes, and copy_source_encryption_key_sha256_bytes
  1006. // fields. If the destination object should be encrypted the keying information
  1007. // should be provided in the encryption_algorithm, encryption_key_bytes, and
  1008. // encryption_key_sha256_bytes fields of the
  1009. // common_object_request_params.customer_encryption field.
  1010. message RewriteObjectRequest {
  1011. // Required. Immutable. The name of the destination object.
  1012. // See the
  1013. // [Naming Guidelines](https://cloud.google.com/storage/docs/naming-objects).
  1014. // Example: `test.txt`
  1015. // The `name` field by itself does not uniquely identify a Cloud Storage
  1016. // object. A Cloud Storage object is uniquely identified by the tuple of
  1017. // (bucket, object, generation).
  1018. string destination_name = 24 [
  1019. (google.api.field_behavior) = REQUIRED,
  1020. (google.api.field_behavior) = IMMUTABLE
  1021. ];
  1022. // Required. Immutable. The name of the bucket containing the destination object.
  1023. string destination_bucket = 25 [
  1024. (google.api.field_behavior) = REQUIRED,
  1025. (google.api.field_behavior) = IMMUTABLE,
  1026. (google.api.resource_reference) = {
  1027. type: "storage.googleapis.com/Bucket"
  1028. }
  1029. ];
  1030. // The name of the Cloud KMS key that will be used to encrypt the destination
  1031. // object. The Cloud KMS key must be located in same location as the object.
  1032. // If the parameter is not specified, the request uses the destination
  1033. // bucket's default encryption key, if any, or else the Google-managed
  1034. // encryption key.
  1035. string destination_kms_key = 27 [(google.api.resource_reference) = {
  1036. type: "cloudkms.googleapis.com/CryptoKey"
  1037. }];
  1038. // Properties of the destination, post-rewrite object.
  1039. // The `name`, `bucket` and `kms_key` fields must not be populated (these
  1040. // values are specified in the `destination_name`, `destination_bucket`, and
  1041. // `destination_kms_key` fields).
  1042. // If `destination` is present it will be used to construct the destination
  1043. // object's metadata; otherwise the destination object's metadata will be
  1044. // copied from the source object.
  1045. Object destination = 1;
  1046. // Required. Name of the bucket in which to find the source object.
  1047. string source_bucket = 2 [(google.api.field_behavior) = REQUIRED];
  1048. // Required. Name of the source object.
  1049. string source_object = 3 [(google.api.field_behavior) = REQUIRED];
  1050. // If present, selects a specific revision of the source object (as opposed to
  1051. // the latest version, the default).
  1052. int64 source_generation = 4;
  1053. // Include this field (from the previous rewrite response) on each rewrite
  1054. // request after the first one, until the rewrite response 'done' flag is
  1055. // true. Calls that provide a rewriteToken can omit all other request fields,
  1056. // but if included those fields must match the values provided in the first
  1057. // rewrite request.
  1058. string rewrite_token = 5;
  1059. // Apply a predefined set of access controls to the destination object.
  1060. // Valid values are "authenticatedRead", "bucketOwnerFullControl",
  1061. // "bucketOwnerRead", "private", "projectPrivate", or "publicRead".
  1062. string destination_predefined_acl = 28;
  1063. // Makes the operation conditional on whether the object's current generation
  1064. // matches the given value. Setting to 0 makes the operation succeed only if
  1065. // there are no live versions of the object.
  1066. optional int64 if_generation_match = 7;
  1067. // Makes the operation conditional on whether the object's live generation
  1068. // does not match the given value. If no live object exists, the precondition
  1069. // fails. Setting to 0 makes the operation succeed only if there is a live
  1070. // version of the object.
  1071. optional int64 if_generation_not_match = 8;
  1072. // Makes the operation conditional on whether the destination object's current
  1073. // metageneration matches the given value.
  1074. optional int64 if_metageneration_match = 9;
  1075. // Makes the operation conditional on whether the destination object's current
  1076. // metageneration does not match the given value.
  1077. optional int64 if_metageneration_not_match = 10;
  1078. // Makes the operation conditional on whether the source object's live
  1079. // generation matches the given value.
  1080. optional int64 if_source_generation_match = 11;
  1081. // Makes the operation conditional on whether the source object's live
  1082. // generation does not match the given value.
  1083. optional int64 if_source_generation_not_match = 12;
  1084. // Makes the operation conditional on whether the source object's current
  1085. // metageneration matches the given value.
  1086. optional int64 if_source_metageneration_match = 13;
  1087. // Makes the operation conditional on whether the source object's current
  1088. // metageneration does not match the given value.
  1089. optional int64 if_source_metageneration_not_match = 14;
  1090. // The maximum number of bytes that will be rewritten per rewrite request.
  1091. // Most callers
  1092. // shouldn't need to specify this parameter - it is primarily in place to
  1093. // support testing. If specified the value must be an integral multiple of
  1094. // 1 MiB (1048576). Also, this only applies to requests where the source and
  1095. // destination span locations and/or storage classes. Finally, this value must
  1096. // not change across rewrite calls else you'll get an error that the
  1097. // `rewriteToken` is invalid.
  1098. int64 max_bytes_rewritten_per_call = 15;
  1099. // The algorithm used to encrypt the source object, if any. Used if the source
  1100. // object was encrypted with a Customer-Supplied Encryption Key.
  1101. string copy_source_encryption_algorithm = 16;
  1102. // The raw bytes (not base64-encoded) AES-256 encryption key used to encrypt
  1103. // the source object, if it was encrypted with a Customer-Supplied Encryption
  1104. // Key.
  1105. bytes copy_source_encryption_key_bytes = 21;
  1106. // The raw bytes (not base64-encoded) SHA256 hash of the encryption key used
  1107. // to encrypt the source object, if it was encrypted with a Customer-Supplied
  1108. // Encryption Key.
  1109. bytes copy_source_encryption_key_sha256_bytes = 22;
  1110. // A set of parameters common to Storage API requests concerning an object.
  1111. CommonObjectRequestParams common_object_request_params = 19;
  1112. }
  1113. // A rewrite response.
  1114. message RewriteResponse {
  1115. // The total bytes written so far, which can be used to provide a waiting user
  1116. // with a progress indicator. This property is always present in the response.
  1117. int64 total_bytes_rewritten = 1;
  1118. // The total size of the object being copied in bytes. This property is always
  1119. // present in the response.
  1120. int64 object_size = 2;
  1121. // `true` if the copy is finished; otherwise, `false` if
  1122. // the copy is in progress. This property is always present in the response.
  1123. bool done = 3;
  1124. // A token to use in subsequent requests to continue copying data. This token
  1125. // is present in the response only when there is more data to copy.
  1126. string rewrite_token = 4;
  1127. // A resource containing the metadata for the copied-to object. This property
  1128. // is present in the response only when copying completes.
  1129. Object resource = 5;
  1130. }
  1131. // Request message StartResumableWrite.
  1132. message StartResumableWriteRequest {
  1133. // Required. The destination bucket, object, and metadata, as well as any preconditions.
  1134. WriteObjectSpec write_object_spec = 1 [(google.api.field_behavior) = REQUIRED];
  1135. // A set of parameters common to Storage API requests concerning an object.
  1136. CommonObjectRequestParams common_object_request_params = 3;
  1137. }
  1138. // Response object for `StartResumableWrite`.
  1139. message StartResumableWriteResponse {
  1140. // The upload_id of the newly started resumable write operation. This
  1141. // value should be copied into the `WriteObjectRequest.upload_id` field.
  1142. string upload_id = 1;
  1143. }
  1144. // Request message for UpdateObject.
  1145. message UpdateObjectRequest {
  1146. // Required. The object to update.
  1147. // The object's bucket and name fields are used to identify the object to
  1148. // update. If present, the object's generation field selects a specific
  1149. // revision of this object whose metadata should be updated. Otherwise,
  1150. // assumes the live version of the object.
  1151. Object object = 1 [(google.api.field_behavior) = REQUIRED];
  1152. // Makes the operation conditional on whether the object's current generation
  1153. // matches the given value. Setting to 0 makes the operation succeed only if
  1154. // there are no live versions of the object.
  1155. optional int64 if_generation_match = 2;
  1156. // Makes the operation conditional on whether the object's live generation
  1157. // does not match the given value. If no live object exists, the precondition
  1158. // fails. Setting to 0 makes the operation succeed only if there is a live
  1159. // version of the object.
  1160. optional int64 if_generation_not_match = 3;
  1161. // Makes the operation conditional on whether the object's current
  1162. // metageneration matches the given value.
  1163. optional int64 if_metageneration_match = 4;
  1164. // Makes the operation conditional on whether the object's current
  1165. // metageneration does not match the given value.
  1166. optional int64 if_metageneration_not_match = 5;
  1167. // Apply a predefined set of access controls to this object.
  1168. // Valid values are "authenticatedRead", "bucketOwnerFullControl",
  1169. // "bucketOwnerRead", "private", "projectPrivate", or "publicRead".
  1170. string predefined_acl = 10;
  1171. // Required. List of fields to be updated.
  1172. //
  1173. // To specify ALL fields, equivalent to the JSON API's "update" function,
  1174. // specify a single field with the value `*`. Note: not recommended. If a new
  1175. // field is introduced at a later time, an older client updating with the `*`
  1176. // may accidentally reset the new field's value.
  1177. //
  1178. // Not specifying any fields is an error.
  1179. // Not specifying a field while setting that field to a non-default value is
  1180. // an error.
  1181. google.protobuf.FieldMask update_mask = 7 [(google.api.field_behavior) = REQUIRED];
  1182. // A set of parameters common to Storage API requests concerning an object.
  1183. CommonObjectRequestParams common_object_request_params = 8;
  1184. }
  1185. // Request message for GetServiceAccount.
  1186. message GetServiceAccountRequest {
  1187. // Required. Project ID, in the format of "projects/<projectIdentifier>".
  1188. // <projectIdentifier> can be the project ID or project number.
  1189. string project = 1 [
  1190. (google.api.field_behavior) = REQUIRED,
  1191. (google.api.resource_reference) = {
  1192. type: "cloudresourcemanager.googleapis.com/Project"
  1193. }
  1194. ];
  1195. }
  1196. // Request message for CreateHmacKey.
  1197. message CreateHmacKeyRequest {
  1198. // Required. The project that the HMAC-owning service account lives in, in the format of
  1199. // "projects/<projectIdentifier>".
  1200. // <projectIdentifier> can be the project ID or project number.
  1201. string project = 1 [
  1202. (google.api.field_behavior) = REQUIRED,
  1203. (google.api.resource_reference) = {
  1204. type: "cloudresourcemanager.googleapis.com/Project"
  1205. }
  1206. ];
  1207. // Required. The service account to create the HMAC for.
  1208. string service_account_email = 2 [(google.api.field_behavior) = REQUIRED];
  1209. }
  1210. // Create hmac response. The only time the secret for an HMAC will be returned.
  1211. message CreateHmacKeyResponse {
  1212. // Key metadata.
  1213. HmacKeyMetadata metadata = 1;
  1214. // HMAC key secret material.
  1215. // In raw bytes format (not base64-encoded).
  1216. bytes secret_key_bytes = 3;
  1217. }
  1218. // Request object to delete a given HMAC key.
  1219. message DeleteHmacKeyRequest {
  1220. // Required. The identifying key for the HMAC to delete.
  1221. string access_id = 1 [(google.api.field_behavior) = REQUIRED];
  1222. // Required. The project that owns the HMAC key, in the format of
  1223. // "projects/<projectIdentifier>".
  1224. // <projectIdentifier> can be the project ID or project number.
  1225. string project = 2 [
  1226. (google.api.field_behavior) = REQUIRED,
  1227. (google.api.resource_reference) = {
  1228. type: "cloudresourcemanager.googleapis.com/Project"
  1229. }
  1230. ];
  1231. }
  1232. // Request object to get metadata on a given HMAC key.
  1233. message GetHmacKeyRequest {
  1234. // Required. The identifying key for the HMAC to delete.
  1235. string access_id = 1 [(google.api.field_behavior) = REQUIRED];
  1236. // Required. The project the HMAC key lies in, in the format of
  1237. // "projects/<projectIdentifier>".
  1238. // <projectIdentifier> can be the project ID or project number.
  1239. string project = 2 [
  1240. (google.api.field_behavior) = REQUIRED,
  1241. (google.api.resource_reference) = {
  1242. type: "cloudresourcemanager.googleapis.com/Project"
  1243. }
  1244. ];
  1245. }
  1246. // Request to fetch a list of HMAC keys under a given project.
  1247. message ListHmacKeysRequest {
  1248. // Required. The project to list HMAC keys for, in the format of
  1249. // "projects/<projectIdentifier>".
  1250. // <projectIdentifier> can be the project ID or project number.
  1251. string project = 1 [
  1252. (google.api.field_behavior) = REQUIRED,
  1253. (google.api.resource_reference) = {
  1254. type: "cloudresourcemanager.googleapis.com/Project"
  1255. }
  1256. ];
  1257. // The maximum number of keys to return.
  1258. int32 page_size = 2;
  1259. // A previously returned token from ListHmacKeysResponse to get the next page.
  1260. string page_token = 3;
  1261. // If set, filters to only return HMAC keys for specified service account.
  1262. string service_account_email = 4;
  1263. // If set, return deleted keys that have not yet been wiped out.
  1264. bool show_deleted_keys = 5;
  1265. }
  1266. // Hmac key list response with next page information.
  1267. message ListHmacKeysResponse {
  1268. // The list of items.
  1269. repeated HmacKeyMetadata hmac_keys = 1;
  1270. // The continuation token, used to page through large result sets. Provide
  1271. // this value in a subsequent request to return the next page of results.
  1272. string next_page_token = 2;
  1273. }
  1274. // Request object to update an HMAC key state.
  1275. // HmacKeyMetadata.state is required and the only writable field in
  1276. // UpdateHmacKey operation. Specifying fields other than state will result in an
  1277. // error.
  1278. message UpdateHmacKeyRequest {
  1279. // Required. The HMAC key to update.
  1280. // If present, the hmac_key's `id` field will be used to identify the key.
  1281. // Otherwise, the hmac_key's access_id and project fields will be used to
  1282. // identify the key.
  1283. HmacKeyMetadata hmac_key = 1 [(google.api.field_behavior) = REQUIRED];
  1284. // Update mask for hmac_key.
  1285. // Not specifying any fields will mean only the `state` field is updated to
  1286. // the value specified in `hmac_key`.
  1287. google.protobuf.FieldMask update_mask = 3;
  1288. }
  1289. // Parameters that can be passed to any object request.
  1290. message CommonObjectRequestParams {
  1291. // Encryption algorithm used with the Customer-Supplied Encryption Keys
  1292. // feature.
  1293. string encryption_algorithm = 1;
  1294. // Encryption key used with the Customer-Supplied Encryption Keys feature.
  1295. // In raw bytes format (not base64-encoded).
  1296. bytes encryption_key_bytes = 4;
  1297. // SHA256 hash of encryption key used with the Customer-Supplied Encryption
  1298. // Keys feature.
  1299. bytes encryption_key_sha256_bytes = 5;
  1300. }
  1301. // Shared constants.
  1302. message ServiceConstants {
  1303. // A collection of constant values meaningful to the Storage API.
  1304. enum Values {
  1305. option allow_alias = true;
  1306. // Unused. Proto3 requires first enum to be 0.
  1307. VALUES_UNSPECIFIED = 0;
  1308. // The maximum size chunk that can will be returned in a single
  1309. // ReadRequest.
  1310. // 2 MiB.
  1311. MAX_READ_CHUNK_BYTES = 2097152;
  1312. // The maximum size chunk that can be sent in a single WriteObjectRequest.
  1313. // 2 MiB.
  1314. MAX_WRITE_CHUNK_BYTES = 2097152;
  1315. // The maximum size of an object in MB - whether written in a single stream
  1316. // or composed from multiple other objects.
  1317. // 5 TiB.
  1318. MAX_OBJECT_SIZE_MB = 5242880;
  1319. // The maximum length field name that can be sent in a single
  1320. // custom metadata field.
  1321. // 1 KiB.
  1322. MAX_CUSTOM_METADATA_FIELD_NAME_BYTES = 1024;
  1323. // The maximum length field value that can be sent in a single
  1324. // custom_metadata field.
  1325. // 4 KiB.
  1326. MAX_CUSTOM_METADATA_FIELD_VALUE_BYTES = 4096;
  1327. // The maximum total bytes that can be populated into all field names and
  1328. // values of the custom_metadata for one object.
  1329. // 8 KiB.
  1330. MAX_CUSTOM_METADATA_TOTAL_SIZE_BYTES = 8192;
  1331. // The maximum total bytes that can be populated into all bucket metadata
  1332. // fields.
  1333. // 20 KiB.
  1334. MAX_BUCKET_METADATA_TOTAL_SIZE_BYTES = 20480;
  1335. // The maximum number of NotificationConfigs that can be registered
  1336. // for a given bucket.
  1337. MAX_NOTIFICATION_CONFIGS_PER_BUCKET = 100;
  1338. // The maximum number of LifecycleRules that can be registered for a given
  1339. // bucket.
  1340. MAX_LIFECYCLE_RULES_PER_BUCKET = 100;
  1341. // The maximum number of custom attributes per NotificationConfigs.
  1342. MAX_NOTIFICATION_CUSTOM_ATTRIBUTES = 5;
  1343. // The maximum length of a custom attribute key included in
  1344. // NotificationConfig.
  1345. MAX_NOTIFICATION_CUSTOM_ATTRIBUTE_KEY_LENGTH = 256;
  1346. // The maximum length of a custom attribute value included in a
  1347. // NotificationConfig.
  1348. MAX_NOTIFICATION_CUSTOM_ATTRIBUTE_VALUE_LENGTH = 1024;
  1349. // The maximum number of key/value entries per bucket label.
  1350. MAX_LABELS_ENTRIES_COUNT = 64;
  1351. // The maximum character length of the key or value in a bucket
  1352. // label map.
  1353. MAX_LABELS_KEY_VALUE_LENGTH = 63;
  1354. // The maximum byte size of the key or value in a bucket label
  1355. // map.
  1356. MAX_LABELS_KEY_VALUE_BYTES = 128;
  1357. // The maximum number of object IDs that can be included in a
  1358. // DeleteObjectsRequest.
  1359. MAX_OBJECT_IDS_PER_DELETE_OBJECTS_REQUEST = 1000;
  1360. // The maximum number of days for which a token returned by the
  1361. // GetListObjectsSplitPoints RPC is valid.
  1362. SPLIT_TOKEN_MAX_VALID_DAYS = 14;
  1363. }
  1364. }
  1365. // A bucket.
  1366. message Bucket {
  1367. option (google.api.resource) = {
  1368. type: "storage.googleapis.com/Bucket"
  1369. pattern: "projects/{project}/buckets/{bucket}"
  1370. };
  1371. // Billing properties of a bucket.
  1372. message Billing {
  1373. // When set to true, Requester Pays is enabled for this bucket.
  1374. bool requester_pays = 1;
  1375. }
  1376. // Cross-Origin Response sharing (CORS) properties for a bucket.
  1377. // For more on Cloud Storage and CORS, see
  1378. // https://cloud.google.com/storage/docs/cross-origin.
  1379. // For more on CORS in general, see https://tools.ietf.org/html/rfc6454.
  1380. message Cors {
  1381. // The list of Origins eligible to receive CORS response headers. See
  1382. // [https://tools.ietf.org/html/rfc6454][RFC 6454] for more on origins.
  1383. // Note: "*" is permitted in the list of origins, and means "any Origin".
  1384. repeated string origin = 1;
  1385. // The list of HTTP methods on which to include CORS response headers,
  1386. // (`GET`, `OPTIONS`, `POST`, etc) Note: "*" is permitted in the list of
  1387. // methods, and means "any method".
  1388. repeated string method = 2;
  1389. // The list of HTTP headers other than the
  1390. // [https://www.w3.org/TR/cors/#simple-response-header][simple response
  1391. // headers] to give permission for the user-agent to share across domains.
  1392. repeated string response_header = 3;
  1393. // The value, in seconds, to return in the
  1394. // [https://www.w3.org/TR/cors/#access-control-max-age-response-header][Access-Control-Max-Age
  1395. // header] used in preflight responses.
  1396. int32 max_age_seconds = 4;
  1397. }
  1398. // Encryption properties of a bucket.
  1399. message Encryption {
  1400. // The name of the Cloud KMS key that will be used to encrypt objects
  1401. // inserted into this bucket, if no encryption method is specified.
  1402. string default_kms_key = 1 [(google.api.resource_reference) = {
  1403. type: "cloudkms.googleapis.com/CryptoKey"
  1404. }];
  1405. }
  1406. // Bucket restriction options.
  1407. message IamConfig {
  1408. // Settings for Uniform Bucket level access.
  1409. // See https://cloud.google.com/storage/docs/uniform-bucket-level-access.
  1410. message UniformBucketLevelAccess {
  1411. // If set, access checks only use bucket-level IAM policies or above.
  1412. bool enabled = 1;
  1413. // The deadline time for changing
  1414. // `iamConfig.uniformBucketLevelAccess.enabled` from `true` to `false`.
  1415. // Mutable until the specified deadline is reached, but not afterward.
  1416. google.protobuf.Timestamp lock_time = 2;
  1417. }
  1418. // Bucket restriction options currently enforced on the bucket.
  1419. UniformBucketLevelAccess uniform_bucket_level_access = 1;
  1420. // Whether IAM will enforce public access prevention. Valid values are
  1421. // "enforced" or "inherited".
  1422. string public_access_prevention = 3;
  1423. }
  1424. // Lifecycle properties of a bucket.
  1425. // For more information, see https://cloud.google.com/storage/docs/lifecycle.
  1426. message Lifecycle {
  1427. // A lifecycle Rule, combining an action to take on an object and a
  1428. // condition which will trigger that action.
  1429. message Rule {
  1430. // An action to take on an object.
  1431. message Action {
  1432. // Type of the action. Currently, only `Delete`, `SetStorageClass`, and
  1433. // `AbortIncompleteMultipartUpload` are supported.
  1434. string type = 1;
  1435. // Target storage class. Required iff the type of the action is
  1436. // SetStorageClass.
  1437. string storage_class = 2;
  1438. }
  1439. // A condition of an object which triggers some action.
  1440. message Condition {
  1441. // Age of an object (in days). This condition is satisfied when an
  1442. // object reaches the specified age.
  1443. // A value of 0 indicates that all objects immediately match this
  1444. // condition.
  1445. optional int32 age_days = 1;
  1446. // This condition is satisfied when an object is created before midnight
  1447. // of the specified date in UTC.
  1448. google.type.Date created_before = 2;
  1449. // Relevant only for versioned objects. If the value is
  1450. // `true`, this condition matches live objects; if the value
  1451. // is `false`, it matches archived objects.
  1452. optional bool is_live = 3;
  1453. // Relevant only for versioned objects. If the value is N, this
  1454. // condition is satisfied when there are at least N versions (including
  1455. // the live version) newer than this version of the object.
  1456. optional int32 num_newer_versions = 4;
  1457. // Objects having any of the storage classes specified by this condition
  1458. // will be matched. Values include `MULTI_REGIONAL`, `REGIONAL`,
  1459. // `NEARLINE`, `COLDLINE`, `STANDARD`, and
  1460. // `DURABLE_REDUCED_AVAILABILITY`.
  1461. repeated string matches_storage_class = 5;
  1462. // Number of days that have elapsed since the custom timestamp set on an
  1463. // object.
  1464. // The value of the field must be a nonnegative integer.
  1465. optional int32 days_since_custom_time = 7;
  1466. // An object matches this condition if the custom timestamp set on the
  1467. // object is before the specified date in UTC.
  1468. google.type.Date custom_time_before = 8;
  1469. // This condition is relevant only for versioned objects. An object
  1470. // version satisfies this condition only if these many days have been
  1471. // passed since it became noncurrent. The value of the field must be a
  1472. // nonnegative integer. If it's zero, the object version will become
  1473. // eligible for Lifecycle action as soon as it becomes noncurrent.
  1474. optional int32 days_since_noncurrent_time = 9;
  1475. // This condition is relevant only for versioned objects. An object
  1476. // version satisfies this condition only if it became noncurrent before
  1477. // the specified date in UTC.
  1478. google.type.Date noncurrent_time_before = 10;
  1479. // List of object name prefixes. If any prefix exactly matches the
  1480. // beginning of the object name, the condition evaluates to true.
  1481. repeated string matches_prefix = 11;
  1482. // List of object name suffixes. If any suffix exactly matches the
  1483. // end of the object name, the condition evaluates to true.
  1484. repeated string matches_suffix = 12;
  1485. }
  1486. // The action to take.
  1487. Action action = 1;
  1488. // The condition(s) under which the action will be taken.
  1489. Condition condition = 2;
  1490. }
  1491. // A lifecycle management rule, which is made of an action to take and the
  1492. // condition(s) under which the action will be taken.
  1493. repeated Rule rule = 1;
  1494. }
  1495. // Logging-related properties of a bucket.
  1496. message Logging {
  1497. // The destination bucket where the current bucket's logs should be placed,
  1498. // using path format (like `projects/123456/buckets/foo`).
  1499. string log_bucket = 1;
  1500. // A prefix for log object names.
  1501. string log_object_prefix = 2;
  1502. }
  1503. // Retention policy properties of a bucket.
  1504. message RetentionPolicy {
  1505. // Server-determined value that indicates the time from which policy was
  1506. // enforced and effective.
  1507. google.protobuf.Timestamp effective_time = 1;
  1508. // Once locked, an object retention policy cannot be modified.
  1509. bool is_locked = 2;
  1510. // The duration in seconds that objects need to be retained. Retention
  1511. // duration must be greater than zero and less than 100 years. Note that
  1512. // enforcement of retention periods less than a day is not guaranteed. Such
  1513. // periods should only be used for testing purposes.
  1514. optional int64 retention_period = 3;
  1515. }
  1516. // Properties of a bucket related to versioning.
  1517. // For more on Cloud Storage versioning, see
  1518. // https://cloud.google.com/storage/docs/object-versioning.
  1519. message Versioning {
  1520. // While set to true, versioning is fully enabled for this bucket.
  1521. bool enabled = 1;
  1522. }
  1523. // Properties of a bucket related to accessing the contents as a static
  1524. // website. For more on hosting a static website via Cloud Storage, see
  1525. // https://cloud.google.com/storage/docs/hosting-static-website.
  1526. message Website {
  1527. // If the requested object path is missing, the service will ensure the path
  1528. // has a trailing '/', append this suffix, and attempt to retrieve the
  1529. // resulting object. This allows the creation of `index.html`
  1530. // objects to represent directory pages.
  1531. string main_page_suffix = 1;
  1532. // If the requested object path is missing, and any
  1533. // `mainPageSuffix` object is missing, if applicable, the service
  1534. // will return the named object from this bucket as the content for a
  1535. // [https://tools.ietf.org/html/rfc7231#section-6.5.4][404 Not Found]
  1536. // result.
  1537. string not_found_page = 2;
  1538. }
  1539. // Configuration for Custom Dual Regions. It should specify precisely two
  1540. // eligible regions within the same Multiregion. More information on regions
  1541. // may be found [https://cloud.google.com/storage/docs/locations][here].
  1542. message CustomPlacementConfig {
  1543. // List of locations to use for data placement.
  1544. repeated string data_locations = 1;
  1545. }
  1546. // Configuration for a bucket's Autoclass feature.
  1547. message Autoclass {
  1548. // Enables Autoclass.
  1549. bool enabled = 1;
  1550. // Output only. Latest instant at which the `enabled` field was set to true after being
  1551. // disabled/unconfigured or set to false after being enabled. If Autoclass
  1552. // is enabled when the bucket is created, the toggle_time is set to the
  1553. // bucket creation time.
  1554. google.protobuf.Timestamp toggle_time = 2 [(google.api.field_behavior) = OUTPUT_ONLY];
  1555. }
  1556. // Immutable. The name of the bucket.
  1557. string name = 1 [(google.api.field_behavior) = IMMUTABLE];
  1558. // Output only. The user-chosen part of the bucket name. The `{bucket}` portion of the
  1559. // `name` field. For globally unique buckets, this is equal to the "bucket
  1560. // name" of other Cloud Storage APIs. Example: "pub".
  1561. string bucket_id = 2 [(google.api.field_behavior) = OUTPUT_ONLY];
  1562. // The etag of the bucket.
  1563. // If included in the metadata of an UpdateBucketRequest, the operation will
  1564. // only be performed if the etag matches that of the bucket.
  1565. string etag = 29;
  1566. // Immutable. The project which owns this bucket, in the format of
  1567. // "projects/<projectIdentifier>".
  1568. // <projectIdentifier> can be the project ID or project number.
  1569. string project = 3 [
  1570. (google.api.field_behavior) = IMMUTABLE,
  1571. (google.api.resource_reference) = {
  1572. type: "cloudresourcemanager.googleapis.com/Project"
  1573. }
  1574. ];
  1575. // Output only. The metadata generation of this bucket.
  1576. // Attempting to set or update this field will result in a
  1577. // [FieldViolation][google.rpc.BadRequest.FieldViolation].
  1578. int64 metageneration = 4 [(google.api.field_behavior) = OUTPUT_ONLY];
  1579. // Immutable. The location of the bucket. Object data for objects in the bucket resides
  1580. // in physical storage within this region. Defaults to `US`. See the
  1581. // [https://developers.google.com/storage/docs/concepts-techniques#specifyinglocations"][developer's
  1582. // guide] for the authoritative list. Attempting to update this field after
  1583. // the bucket is created will result in an error.
  1584. string location = 5 [(google.api.field_behavior) = IMMUTABLE];
  1585. // Output only. The location type of the bucket (region, dual-region, multi-region, etc).
  1586. string location_type = 6 [(google.api.field_behavior) = OUTPUT_ONLY];
  1587. // The bucket's default storage class, used whenever no storageClass is
  1588. // specified for a newly-created object. This defines how objects in the
  1589. // bucket are stored and determines the SLA and the cost of storage.
  1590. // If this value is not specified when the bucket is created, it will default
  1591. // to `STANDARD`. For more information, see
  1592. // https://developers.google.com/storage/docs/storage-classes.
  1593. string storage_class = 7;
  1594. // The recovery point objective for cross-region replication of the bucket.
  1595. // Applicable only for dual- and multi-region buckets. "DEFAULT" uses default
  1596. // replication. "ASYNC_TURBO" enables turbo replication, valid for dual-region
  1597. // buckets only. If rpo is not specified when the bucket is created, it
  1598. // defaults to "DEFAULT". For more information, see
  1599. // https://cloud.google.com/storage/docs/turbo-replication.
  1600. string rpo = 27;
  1601. // Access controls on the bucket.
  1602. // If iamConfig.uniformBucketLevelAccess is enabled on this bucket,
  1603. // requests to set, read, or modify acl is an error.
  1604. repeated BucketAccessControl acl = 8;
  1605. // Default access controls to apply to new objects when no ACL is provided.
  1606. // If iamConfig.uniformBucketLevelAccess is enabled on this bucket,
  1607. // requests to set, read, or modify acl is an error.
  1608. repeated ObjectAccessControl default_object_acl = 9;
  1609. // The bucket's lifecycle config. See
  1610. // [https://developers.google.com/storage/docs/lifecycle]Lifecycle Management]
  1611. // for more information.
  1612. Lifecycle lifecycle = 10;
  1613. // Output only. The creation time of the bucket.
  1614. // Attempting to set or update this field will result in a
  1615. // [FieldViolation][google.rpc.BadRequest.FieldViolation].
  1616. google.protobuf.Timestamp create_time = 11 [(google.api.field_behavior) = OUTPUT_ONLY];
  1617. // The bucket's [https://www.w3.org/TR/cors/][Cross-Origin Resource Sharing]
  1618. // (CORS) config.
  1619. repeated Cors cors = 12;
  1620. // Output only. The modification time of the bucket.
  1621. // Attempting to set or update this field will result in a
  1622. // [FieldViolation][google.rpc.BadRequest.FieldViolation].
  1623. google.protobuf.Timestamp update_time = 13 [(google.api.field_behavior) = OUTPUT_ONLY];
  1624. // The default value for event-based hold on newly created objects in this
  1625. // bucket. Event-based hold is a way to retain objects indefinitely until an
  1626. // event occurs, signified by the
  1627. // hold's release. After being released, such objects will be subject to
  1628. // bucket-level retention (if any). One sample use case of this flag is for
  1629. // banks to hold loan documents for at least 3 years after loan is paid in
  1630. // full. Here, bucket-level retention is 3 years and the event is loan being
  1631. // paid in full. In this example, these objects will be held intact for any
  1632. // number of years until the event has occurred (event-based hold on the
  1633. // object is released) and then 3 more years after that. That means retention
  1634. // duration of the objects begins from the moment event-based hold
  1635. // transitioned from true to false. Objects under event-based hold cannot be
  1636. // deleted, overwritten or archived until the hold is removed.
  1637. bool default_event_based_hold = 14;
  1638. // User-provided labels, in key/value pairs.
  1639. map<string, string> labels = 15;
  1640. // The bucket's website config, controlling how the service behaves
  1641. // when accessing bucket contents as a web site. See the
  1642. // [https://cloud.google.com/storage/docs/static-website][Static Website
  1643. // Examples] for more information.
  1644. Website website = 16;
  1645. // The bucket's versioning config.
  1646. Versioning versioning = 17;
  1647. // The bucket's logging config, which defines the destination bucket
  1648. // and name prefix (if any) for the current bucket's logs.
  1649. Logging logging = 18;
  1650. // Output only. The owner of the bucket. This is always the project team's owner group.
  1651. Owner owner = 19 [(google.api.field_behavior) = OUTPUT_ONLY];
  1652. // Encryption config for a bucket.
  1653. Encryption encryption = 20;
  1654. // The bucket's billing config.
  1655. Billing billing = 21;
  1656. // The bucket's retention policy. The retention policy enforces a minimum
  1657. // retention time for all objects contained in the bucket, based on their
  1658. // creation time. Any attempt to overwrite or delete objects younger than the
  1659. // retention period will result in a PERMISSION_DENIED error. An unlocked
  1660. // retention policy can be modified or removed from the bucket via a
  1661. // storage.buckets.update operation. A locked retention policy cannot be
  1662. // removed or shortened in duration for the lifetime of the bucket.
  1663. // Attempting to remove or decrease period of a locked retention policy will
  1664. // result in a PERMISSION_DENIED error.
  1665. RetentionPolicy retention_policy = 22;
  1666. // The bucket's IAM config.
  1667. IamConfig iam_config = 23;
  1668. // Reserved for future use.
  1669. bool satisfies_pzs = 25;
  1670. // Configuration that, if present, specifies the data placement for a
  1671. // [https://cloud.google.com/storage/docs/use-dual-regions][Dual Region].
  1672. CustomPlacementConfig custom_placement_config = 26;
  1673. // The bucket's Autoclass configuration. If there is no configuration, the
  1674. // Autoclass feature will be disabled and have no effect on the bucket.
  1675. Autoclass autoclass = 28;
  1676. }
  1677. // An access-control entry.
  1678. message BucketAccessControl {
  1679. // The access permission for the entity.
  1680. string role = 1;
  1681. // The ID of the access-control entry.
  1682. string id = 2;
  1683. // The entity holding the permission, in one of the following forms:
  1684. // * `user-{userid}`
  1685. // * `user-{email}`
  1686. // * `group-{groupid}`
  1687. // * `group-{email}`
  1688. // * `domain-{domain}`
  1689. // * `project-{team}-{projectnumber}`
  1690. // * `project-{team}-{projectid}`
  1691. // * `allUsers`
  1692. // * `allAuthenticatedUsers`
  1693. // Examples:
  1694. // * The user `liz@example.com` would be `user-liz@example.com`.
  1695. // * The group `example@googlegroups.com` would be
  1696. // `group-example@googlegroups.com`
  1697. // * All members of the Google Apps for Business domain `example.com` would be
  1698. // `domain-example.com`
  1699. // For project entities, `project-{team}-{projectnumber}` format will be
  1700. // returned on response.
  1701. string entity = 3;
  1702. // Output only. The alternative entity format, if exists. For project entities,
  1703. // `project-{team}-{projectid}` format will be returned on response.
  1704. string entity_alt = 9 [(google.api.field_behavior) = OUTPUT_ONLY];
  1705. // The ID for the entity, if any.
  1706. string entity_id = 4;
  1707. // The etag of the BucketAccessControl.
  1708. // If included in the metadata of an update or delete request message, the
  1709. // operation operation will only be performed if the etag matches that of the
  1710. // bucket's BucketAccessControl.
  1711. string etag = 8;
  1712. // The email address associated with the entity, if any.
  1713. string email = 5;
  1714. // The domain associated with the entity, if any.
  1715. string domain = 6;
  1716. // The project team associated with the entity, if any.
  1717. ProjectTeam project_team = 7;
  1718. }
  1719. // Message used to convey content being read or written, along with an optional
  1720. // checksum.
  1721. message ChecksummedData {
  1722. // The data.
  1723. bytes content = 1;
  1724. // If set, the CRC32C digest of the content field.
  1725. optional fixed32 crc32c = 2;
  1726. }
  1727. // Message used for storing full (not subrange) object checksums.
  1728. message ObjectChecksums {
  1729. // CRC32C digest of the object data. Computed by the Cloud Storage service for
  1730. // all written objects.
  1731. // If set in an WriteObjectRequest, service will validate that the stored
  1732. // object matches this checksum.
  1733. optional fixed32 crc32c = 1;
  1734. // 128 bit MD5 hash of the object data.
  1735. // For more information about using the MD5 hash, see
  1736. // [https://cloud.google.com/storage/docs/hashes-etags#json-api][Hashes and
  1737. // ETags: Best Practices].
  1738. // Not all objects will provide an MD5 hash. For example, composite objects
  1739. // provide only crc32c hashes.
  1740. // This value is equivalent to running `cat object.txt | openssl md5 -binary`
  1741. bytes md5_hash = 2;
  1742. }
  1743. // Hmac Key Metadata, which includes all information other than the secret.
  1744. message HmacKeyMetadata {
  1745. // Immutable. Resource name ID of the key in the format
  1746. // <projectIdentifier>/<accessId>.
  1747. // <projectIdentifier> can be the project ID or project number.
  1748. string id = 1 [(google.api.field_behavior) = IMMUTABLE];
  1749. // Immutable. Globally unique id for keys.
  1750. string access_id = 2 [(google.api.field_behavior) = IMMUTABLE];
  1751. // Immutable. Identifies the project that owns the service account of the specified HMAC
  1752. // key, in the format "projects/<projectIdentifier>". <projectIdentifier> can
  1753. // be the project ID or project number.
  1754. string project = 3 [
  1755. (google.api.field_behavior) = IMMUTABLE,
  1756. (google.api.resource_reference) = {
  1757. type: "cloudresourcemanager.googleapis.com/Project"
  1758. }
  1759. ];
  1760. // Output only. Email of the service account the key authenticates as.
  1761. string service_account_email = 4 [(google.api.field_behavior) = OUTPUT_ONLY];
  1762. // State of the key. One of ACTIVE, INACTIVE, or DELETED.
  1763. // Writable, can be updated by UpdateHmacKey operation.
  1764. string state = 5;
  1765. // Output only. The creation time of the HMAC key.
  1766. google.protobuf.Timestamp create_time = 6 [(google.api.field_behavior) = OUTPUT_ONLY];
  1767. // Output only. The last modification time of the HMAC key metadata.
  1768. google.protobuf.Timestamp update_time = 7 [(google.api.field_behavior) = OUTPUT_ONLY];
  1769. // The etag of the HMAC key.
  1770. string etag = 8;
  1771. }
  1772. // A directive to publish Pub/Sub notifications upon changes to a bucket.
  1773. message Notification {
  1774. option (google.api.resource) = {
  1775. type: "storage.googleapis.com/Notification"
  1776. pattern: "projects/{project}/buckets/{bucket}/notificationConfigs/{notification}"
  1777. };
  1778. // Required. The resource name of this notification.
  1779. // Format:
  1780. // `projects/{project}/buckets/{bucket}/notificationConfigs/{notification}`
  1781. // The `{project}` portion may be `_` for globally unique buckets.
  1782. string name = 1 [(google.api.field_behavior) = REQUIRED];
  1783. // Required. The Pub/Sub topic to which this subscription publishes. Formatted as:
  1784. // '//pubsub.googleapis.com/projects/{project-identifier}/topics/{my-topic}'
  1785. string topic = 2 [(google.api.field_behavior) = REQUIRED];
  1786. // The etag of the Notification.
  1787. // If included in the metadata of GetNotificationRequest, the operation will
  1788. // only be performed if the etag matches that of the Notification.
  1789. string etag = 7;
  1790. // If present, only send notifications about listed event types. If empty,
  1791. // sent notifications for all event types.
  1792. repeated string event_types = 3;
  1793. // A list of additional attributes to attach to each Pub/Sub
  1794. // message published for this notification subscription.
  1795. map<string, string> custom_attributes = 4;
  1796. // If present, only apply this notification config to object names that
  1797. // begin with this prefix.
  1798. string object_name_prefix = 5;
  1799. // Required. The desired content of the Payload.
  1800. string payload_format = 6 [(google.api.field_behavior) = REQUIRED];
  1801. }
  1802. // Describes the Customer-Supplied Encryption Key mechanism used to store an
  1803. // Object's data at rest.
  1804. message CustomerEncryption {
  1805. // The encryption algorithm.
  1806. string encryption_algorithm = 1;
  1807. // SHA256 hash value of the encryption key.
  1808. // In raw bytes format (not base64-encoded).
  1809. bytes key_sha256_bytes = 3;
  1810. }
  1811. // An object.
  1812. message Object {
  1813. // Immutable. The name of this object. Nearly any sequence of unicode characters is
  1814. // valid. See
  1815. // [Guidelines](https://cloud.google.com/storage/docs/naming-objects).
  1816. // Example: `test.txt`
  1817. // The `name` field by itself does not uniquely identify a Cloud Storage
  1818. // object. A Cloud Storage object is uniquely identified by the tuple of
  1819. // (bucket, object, generation).
  1820. string name = 1 [(google.api.field_behavior) = IMMUTABLE];
  1821. // Immutable. The name of the bucket containing this object.
  1822. string bucket = 2 [
  1823. (google.api.field_behavior) = IMMUTABLE,
  1824. (google.api.resource_reference) = {
  1825. type: "storage.googleapis.com/Bucket"
  1826. }
  1827. ];
  1828. // The etag of the object.
  1829. // If included in the metadata of an update or delete request message, the
  1830. // operation will only be performed if the etag matches that of the live
  1831. // object.
  1832. string etag = 27;
  1833. // Immutable. The content generation of this object. Used for object versioning.
  1834. // Attempting to set or update this field will result in a
  1835. // [FieldViolation][google.rpc.BadRequest.FieldViolation].
  1836. int64 generation = 3 [(google.api.field_behavior) = IMMUTABLE];
  1837. // Output only. The version of the metadata for this generation of this object. Used for
  1838. // preconditions and for detecting changes in metadata. A metageneration
  1839. // number is only meaningful in the context of a particular generation of a
  1840. // particular object.
  1841. // Attempting to set or update this field will result in a
  1842. // [FieldViolation][google.rpc.BadRequest.FieldViolation].
  1843. int64 metageneration = 4 [(google.api.field_behavior) = OUTPUT_ONLY];
  1844. // Storage class of the object.
  1845. string storage_class = 5;
  1846. // Output only. Content-Length of the object data in bytes, matching
  1847. // [https://tools.ietf.org/html/rfc7230#section-3.3.2][RFC 7230 §3.3.2].
  1848. // Attempting to set or update this field will result in a
  1849. // [FieldViolation][google.rpc.BadRequest.FieldViolation].
  1850. int64 size = 6 [(google.api.field_behavior) = OUTPUT_ONLY];
  1851. // Content-Encoding of the object data, matching
  1852. // [https://tools.ietf.org/html/rfc7231#section-3.1.2.2][RFC 7231 §3.1.2.2]
  1853. string content_encoding = 7;
  1854. // Content-Disposition of the object data, matching
  1855. // [https://tools.ietf.org/html/rfc6266][RFC 6266].
  1856. string content_disposition = 8;
  1857. // Cache-Control directive for the object data, matching
  1858. // [https://tools.ietf.org/html/rfc7234#section-5.2"][RFC 7234 §5.2].
  1859. // If omitted, and the object is accessible to all anonymous users, the
  1860. // default will be `public, max-age=3600`.
  1861. string cache_control = 9;
  1862. // Access controls on the object.
  1863. // If iamConfig.uniformBucketLevelAccess is enabled on the parent
  1864. // bucket, requests to set, read, or modify acl is an error.
  1865. repeated ObjectAccessControl acl = 10;
  1866. // Content-Language of the object data, matching
  1867. // [https://tools.ietf.org/html/rfc7231#section-3.1.3.2][RFC 7231 §3.1.3.2].
  1868. string content_language = 11;
  1869. // Output only. The deletion time of the object. Will be returned if and only if this
  1870. // version of the object has been deleted.
  1871. // Attempting to set or update this field will result in a
  1872. // [FieldViolation][google.rpc.BadRequest.FieldViolation].
  1873. google.protobuf.Timestamp delete_time = 12 [(google.api.field_behavior) = OUTPUT_ONLY];
  1874. // Content-Type of the object data, matching
  1875. // [https://tools.ietf.org/html/rfc7231#section-3.1.1.5][RFC 7231 §3.1.1.5].
  1876. // If an object is stored without a Content-Type, it is served as
  1877. // `application/octet-stream`.
  1878. string content_type = 13;
  1879. // Output only. The creation time of the object.
  1880. // Attempting to set or update this field will result in a
  1881. // [FieldViolation][google.rpc.BadRequest.FieldViolation].
  1882. google.protobuf.Timestamp create_time = 14 [(google.api.field_behavior) = OUTPUT_ONLY];
  1883. // Output only. Number of underlying components that make up this object. Components are
  1884. // accumulated by compose operations.
  1885. // Attempting to set or update this field will result in a
  1886. // [FieldViolation][google.rpc.BadRequest.FieldViolation].
  1887. int32 component_count = 15 [(google.api.field_behavior) = OUTPUT_ONLY];
  1888. // Output only. Hashes for the data part of this object.
  1889. ObjectChecksums checksums = 16 [(google.api.field_behavior) = OUTPUT_ONLY];
  1890. // Output only. The modification time of the object metadata.
  1891. // Set initially to object creation time and then updated whenever any
  1892. // metadata of the object changes. This includes changes made by a requester,
  1893. // such as modifying custom metadata, as well as changes made by Cloud Storage
  1894. // on behalf of a requester, such as changing the storage class based on an
  1895. // Object Lifecycle Configuration.
  1896. // Attempting to set or update this field will result in a
  1897. // [FieldViolation][google.rpc.BadRequest.FieldViolation].
  1898. google.protobuf.Timestamp update_time = 17 [(google.api.field_behavior) = OUTPUT_ONLY];
  1899. // Cloud KMS Key used to encrypt this object, if the object is encrypted by
  1900. // such a key.
  1901. string kms_key = 18 [(google.api.resource_reference) = {
  1902. type: "cloudkms.googleapis.com/CryptoKey"
  1903. }];
  1904. // Output only. The time at which the object's storage class was last changed. When the
  1905. // object is initially created, it will be set to time_created.
  1906. // Attempting to set or update this field will result in a
  1907. // [FieldViolation][google.rpc.BadRequest.FieldViolation].
  1908. google.protobuf.Timestamp update_storage_class_time = 19 [(google.api.field_behavior) = OUTPUT_ONLY];
  1909. // Whether an object is under temporary hold. While this flag is set to true,
  1910. // the object is protected against deletion and overwrites. A common use case
  1911. // of this flag is regulatory investigations where objects need to be retained
  1912. // while the investigation is ongoing. Note that unlike event-based hold,
  1913. // temporary hold does not impact retention expiration time of an object.
  1914. bool temporary_hold = 20;
  1915. // A server-determined value that specifies the earliest time that the
  1916. // object's retention period expires.
  1917. // Note 1: This field is not provided for objects with an active event-based
  1918. // hold, since retention expiration is unknown until the hold is removed.
  1919. // Note 2: This value can be provided even when temporary hold is set (so that
  1920. // the user can reason about policy without having to first unset the
  1921. // temporary hold).
  1922. google.protobuf.Timestamp retention_expire_time = 21;
  1923. // User-provided metadata, in key/value pairs.
  1924. map<string, string> metadata = 22;
  1925. // Whether an object is under event-based hold.
  1926. // An event-based hold is a way to force the retention of an object until
  1927. // after some event occurs. Once the hold is released by explicitly setting
  1928. // this field to false, the object will become subject to any bucket-level
  1929. // retention policy, except that the retention duration will be calculated
  1930. // from the time the event based hold was lifted, rather than the time the
  1931. // object was created.
  1932. //
  1933. // In a WriteObject request, not setting this field implies that the value
  1934. // should be taken from the parent bucket's "default_event_based_hold" field.
  1935. // In a response, this field will always be set to true or false.
  1936. optional bool event_based_hold = 23;
  1937. // Output only. The owner of the object. This will always be the uploader of the object.
  1938. // Attempting to set or update this field will result in a
  1939. // [FieldViolation][google.rpc.BadRequest.FieldViolation].
  1940. Owner owner = 24 [(google.api.field_behavior) = OUTPUT_ONLY];
  1941. // Metadata of Customer-Supplied Encryption Key, if the object is encrypted by
  1942. // such a key.
  1943. CustomerEncryption customer_encryption = 25;
  1944. // A user-specified timestamp set on an object.
  1945. google.protobuf.Timestamp custom_time = 26;
  1946. }
  1947. // An access-control entry.
  1948. message ObjectAccessControl {
  1949. // The access permission for the entity.
  1950. string role = 1;
  1951. // The ID of the access-control entry.
  1952. string id = 2;
  1953. // The entity holding the permission, in one of the following forms:
  1954. // * `user-{userid}`
  1955. // * `user-{email}`
  1956. // * `group-{groupid}`
  1957. // * `group-{email}`
  1958. // * `domain-{domain}`
  1959. // * `project-{team}-{projectnumber}`
  1960. // * `project-{team}-{projectid}`
  1961. // * `allUsers`
  1962. // * `allAuthenticatedUsers`
  1963. // Examples:
  1964. // * The user `liz@example.com` would be `user-liz@example.com`.
  1965. // * The group `example@googlegroups.com` would be
  1966. // `group-example@googlegroups.com`.
  1967. // * All members of the Google Apps for Business domain `example.com` would be
  1968. // `domain-example.com`.
  1969. // For project entities, `project-{team}-{projectnumber}` format will be
  1970. // returned on response.
  1971. string entity = 3;
  1972. // Output only. The alternative entity format, if exists. For project entities,
  1973. // `project-{team}-{projectid}` format will be returned on response.
  1974. string entity_alt = 9 [(google.api.field_behavior) = OUTPUT_ONLY];
  1975. // The ID for the entity, if any.
  1976. string entity_id = 4;
  1977. // The etag of the ObjectAccessControl.
  1978. // If included in the metadata of an update or delete request message, the
  1979. // operation will only be performed if the etag matches that of the live
  1980. // object's ObjectAccessControl.
  1981. string etag = 8;
  1982. // The email address associated with the entity, if any.
  1983. string email = 5;
  1984. // The domain associated with the entity, if any.
  1985. string domain = 6;
  1986. // The project team associated with the entity, if any.
  1987. ProjectTeam project_team = 7;
  1988. }
  1989. // The result of a call to Objects.ListObjects
  1990. message ListObjectsResponse {
  1991. // The list of items.
  1992. repeated Object objects = 1;
  1993. // The list of prefixes of objects matching-but-not-listed up to and including
  1994. // the requested delimiter.
  1995. repeated string prefixes = 2;
  1996. // The continuation token, used to page through large result sets. Provide
  1997. // this value in a subsequent request to return the next page of results.
  1998. string next_page_token = 3;
  1999. }
  2000. // Represents the Viewers, Editors, or Owners of a given project.
  2001. message ProjectTeam {
  2002. // The project number.
  2003. string project_number = 1;
  2004. // The team.
  2005. string team = 2;
  2006. }
  2007. // A service account, owned by Cloud Storage, which may be used when taking
  2008. // action on behalf of a given project, for example to publish Pub/Sub
  2009. // notifications or to retrieve security keys.
  2010. message ServiceAccount {
  2011. // The ID of the notification.
  2012. string email_address = 1;
  2013. }
  2014. // The owner of a specific resource.
  2015. message Owner {
  2016. // The entity, in the form `user-`*userId*.
  2017. string entity = 1;
  2018. // The ID for the entity.
  2019. string entity_id = 2;
  2020. }
  2021. // Specifies a requested range of bytes to download.
  2022. message ContentRange {
  2023. // The starting offset of the object data.
  2024. int64 start = 1;
  2025. // The ending offset of the object data.
  2026. int64 end = 2;
  2027. // The complete length of the object data.
  2028. int64 complete_length = 3;
  2029. }