storage_resources.proto 35 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952
  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.v1;
  16. import "google/protobuf/timestamp.proto";
  17. import "google/protobuf/wrappers.proto";
  18. option go_package = "google.golang.org/genproto/googleapis/storage/v1;storage";
  19. option java_multiple_files = true;
  20. option java_outer_classname = "CloudStorageResourcesProto";
  21. option java_package = "com.google.storage.v1";
  22. // A bucket.
  23. message Bucket {
  24. // Billing properties of a bucket.
  25. message Billing {
  26. // When set to true, Requester Pays is enabled for this bucket.
  27. bool requester_pays = 1;
  28. }
  29. // Cross-Origin Response sharing (CORS) properties for a bucket.
  30. // For more on GCS and CORS, see
  31. // https://cloud.google.com/storage/docs/cross-origin.
  32. // For more on CORS in general, see https://tools.ietf.org/html/rfc6454.
  33. message Cors {
  34. // The list of Origins eligible to receive CORS response headers. See
  35. // [https://tools.ietf.org/html/rfc6454][RFC 6454] for more on origins.
  36. // Note: "*" is permitted in the list of origins, and means "any Origin".
  37. repeated string origin = 1;
  38. // The list of HTTP methods on which to include CORS response headers,
  39. // (`GET`, `OPTIONS`, `POST`, etc) Note: "*" is permitted in the list of
  40. // methods, and means "any method".
  41. repeated string method = 2;
  42. // The list of HTTP headers other than the
  43. // [https://www.w3.org/TR/cors/#simple-response-header][simple response
  44. // headers] to give permission for the user-agent to share across domains.
  45. repeated string response_header = 3;
  46. // The value, in seconds, to return in the
  47. // [https://www.w3.org/TR/cors/#access-control-max-age-response-header][Access-Control-Max-Age
  48. // header] used in preflight responses.
  49. int32 max_age_seconds = 4;
  50. }
  51. // Encryption properties of a bucket.
  52. message Encryption {
  53. // A Cloud KMS key that will be used to encrypt objects inserted into this
  54. // bucket, if no encryption method is specified.
  55. string default_kms_key_name = 1;
  56. }
  57. // Bucket restriction options currently enforced on the bucket.
  58. message IamConfiguration {
  59. message UniformBucketLevelAccess {
  60. // If set, access checks only use bucket-level IAM policies or above.
  61. bool enabled = 1;
  62. // The deadline time for changing
  63. // <code>iamConfiguration.uniformBucketLevelAccess.enabled</code> from
  64. // true to false in [https://tools.ietf.org/html/rfc3339][RFC 3339]. After
  65. // the deadline is passed the field is immutable.
  66. google.protobuf.Timestamp locked_time = 2;
  67. }
  68. // Public Access Prevention configuration values.
  69. enum PublicAccessPrevention {
  70. // No specified PublicAccessPrevention.
  71. PUBLIC_ACCESS_PREVENTION_UNSPECIFIED = 0;
  72. // Prevents access from being granted to public members 'allUsers' and
  73. // 'allAuthenticatedUsers'. Prevents attempts to grant new access to
  74. // public members.
  75. ENFORCED = 1;
  76. // This setting is inherited from Org Policy. Does not prevent access from
  77. // being granted to public members 'allUsers' or 'allAuthenticatedUsers'.
  78. INHERITED = 2;
  79. }
  80. UniformBucketLevelAccess uniform_bucket_level_access = 1;
  81. // Whether IAM will enforce public access prevention.
  82. PublicAccessPrevention public_access_prevention = 2;
  83. }
  84. // Lifecycle properties of a bucket.
  85. // For more information, see https://cloud.google.com/storage/docs/lifecycle.
  86. message Lifecycle {
  87. // A lifecycle Rule, combining an action to take on an object and a
  88. // condition which will trigger that action.
  89. message Rule {
  90. // An action to take on an object.
  91. message Action {
  92. // Type of the action. Currently, only `Delete`, `SetStorageClass`, and
  93. // `AbortIncompleteMultipartUpload` are supported.
  94. string type = 1;
  95. // Target storage class. Required iff the type of the action is
  96. // SetStorageClass.
  97. string storage_class = 2;
  98. }
  99. // A condition of an object which triggers some action.
  100. message Condition {
  101. // Age of an object (in days). This condition is satisfied when an
  102. // object reaches the specified age.
  103. int32 age = 1;
  104. // A date in [RFC 3339][1] format with only the date part (for
  105. // instance, "2013-01-15"). This condition is satisfied when an
  106. // object is created before midnight of the specified date in UTC.
  107. // [1]: https://tools.ietf.org/html/rfc3339
  108. google.protobuf.Timestamp created_before = 2;
  109. // Relevant only for versioned objects. If the value is
  110. // `true`, this condition matches live objects; if the value
  111. // is `false`, it matches archived objects.
  112. google.protobuf.BoolValue is_live = 3;
  113. // Relevant only for versioned objects. If the value is N, this
  114. // condition is satisfied when there are at least N versions (including
  115. // the live version) newer than this version of the object.
  116. int32 num_newer_versions = 4;
  117. // Objects having any of the storage classes specified by this condition
  118. // will be matched. Values include `MULTI_REGIONAL`, `REGIONAL`,
  119. // `NEARLINE`, `COLDLINE`, `STANDARD`, and
  120. // `DURABLE_REDUCED_AVAILABILITY`.
  121. repeated string matches_storage_class = 5;
  122. // A regular expression that satisfies the RE2 syntax. This condition is
  123. // satisfied when the name of the object matches the RE2 pattern. Note:
  124. // This feature is currently in the "Early Access" launch stage and is
  125. // only available to an allowlisted set of users; that means that this
  126. // feature may be changed in backward-incompatible ways and that it is
  127. // not guaranteed to be released.
  128. string matches_pattern = 6;
  129. // Number of days that has elapsed since the custom timestamp set on an
  130. // object.
  131. int32 days_since_custom_time = 7;
  132. // An object matches this condition if the custom timestamp set on the
  133. // object is before this timestamp.
  134. google.protobuf.Timestamp custom_time_before = 8;
  135. // This condition is relevant only for versioned objects. An object
  136. // version satisfies this condition only if these many days have been
  137. // passed since it became noncurrent. The value of the field must be a
  138. // nonnegative integer. If it's zero, the object version will become
  139. // eligible for Lifecycle action as soon as it becomes noncurrent.
  140. int32 days_since_noncurrent_time = 9;
  141. // This condition is relevant only for versioned objects. An object
  142. // version satisfies this condition only if it became noncurrent before
  143. // the specified timestamp.
  144. google.protobuf.Timestamp noncurrent_time_before = 10;
  145. // List of object name prefixes. If any prefix exactly matches the
  146. // beginning of the object name, the condition evaluates to true.
  147. repeated string matches_prefix = 11;
  148. // List of object name suffixes. If any suffix exactly matches the
  149. // end of the object name, the condition evaluates to true.
  150. repeated string matches_suffix = 12;
  151. }
  152. // The action to take.
  153. Action action = 1;
  154. // The condition(s) under which the action will be taken.
  155. Condition condition = 2;
  156. }
  157. // A lifecycle management rule, which is made of an action to take and the
  158. // condition(s) under which the action will be taken.
  159. repeated Rule rule = 1;
  160. }
  161. // Logging-related properties of a bucket.
  162. message Logging {
  163. // The destination bucket where the current bucket's logs should be placed.
  164. string log_bucket = 1;
  165. // A prefix for log object names.
  166. string log_object_prefix = 2;
  167. }
  168. // Retention policy properties of a bucket.
  169. message RetentionPolicy {
  170. // Server-determined value that indicates the time from which policy was
  171. // enforced and effective. This value is in
  172. // [https://tools.ietf.org/html/rfc3339][RFC 3339] format.
  173. google.protobuf.Timestamp effective_time = 1;
  174. // Once locked, an object retention policy cannot be modified.
  175. bool is_locked = 2;
  176. // The duration in seconds that objects need to be retained. Retention
  177. // duration must be greater than zero and less than 100 years. Note that
  178. // enforcement of retention periods less than a day is not guaranteed. Such
  179. // periods should only be used for testing purposes.
  180. int64 retention_period = 3;
  181. }
  182. // Properties of a bucket related to versioning.
  183. // For more on GCS versioning, see
  184. // https://cloud.google.com/storage/docs/object-versioning.
  185. message Versioning {
  186. // While set to true, versioning is fully enabled for this bucket.
  187. bool enabled = 1;
  188. }
  189. // Properties of a bucket related to accessing the contents as a static
  190. // website. For more on hosting a static website via GCS, see
  191. // https://cloud.google.com/storage/docs/hosting-static-website.
  192. message Website {
  193. // If the requested object path is missing, the service will ensure the path
  194. // has a trailing '/', append this suffix, and attempt to retrieve the
  195. // resulting object. This allows the creation of `index.html`
  196. // objects to represent directory pages.
  197. string main_page_suffix = 1;
  198. // If the requested object path is missing, and any
  199. // `mainPageSuffix` object is missing, if applicable, the service
  200. // will return the named object from this bucket as the content for a
  201. // [https://tools.ietf.org/html/rfc7231#section-6.5.4][404 Not Found]
  202. // result.
  203. string not_found_page = 2;
  204. }
  205. // Configuration for a bucket's Autoclass feature.
  206. message Autoclass {
  207. // Enables Autoclass.
  208. bool enabled = 1;
  209. // Latest instant at which the `enabled` bit was flipped.
  210. google.protobuf.Timestamp toggle_time = 2;
  211. }
  212. // Access controls on the bucket.
  213. repeated BucketAccessControl acl = 1;
  214. // Default access controls to apply to new objects when no ACL is provided.
  215. repeated ObjectAccessControl default_object_acl = 2;
  216. // The bucket's lifecycle configuration. See
  217. // [https://developers.google.com/storage/docs/lifecycle]Lifecycle Management]
  218. // for more information.
  219. Lifecycle lifecycle = 3;
  220. // The creation time of the bucket in
  221. // [https://tools.ietf.org/html/rfc3339][RFC 3339] format.
  222. // Attempting to set or update this field will result in a
  223. // [FieldViolation][google.rpc.BadRequest.FieldViolation].
  224. google.protobuf.Timestamp time_created = 4;
  225. // The ID of the bucket. For buckets, the `id` and `name` properties are the
  226. // same.
  227. // Attempting to update this field after the bucket is created will result in
  228. // a [FieldViolation][google.rpc.BadRequest.FieldViolation].
  229. string id = 5;
  230. // The name of the bucket.
  231. // Attempting to update this field after the bucket is created will result in
  232. // an error.
  233. string name = 6;
  234. // The project number of the project the bucket belongs to.
  235. // Attempting to set or update this field will result in a
  236. // [FieldViolation][google.rpc.BadRequest.FieldViolation].
  237. int64 project_number = 7;
  238. // The metadata generation of this bucket.
  239. // Attempting to set or update this field will result in a
  240. // [FieldViolation][google.rpc.BadRequest.FieldViolation].
  241. int64 metageneration = 8;
  242. // The bucket's [https://www.w3.org/TR/cors/][Cross-Origin Resource Sharing]
  243. // (CORS) configuration.
  244. repeated Cors cors = 9;
  245. // The location of the bucket. Object data for objects in the bucket resides
  246. // in physical storage within this region. Defaults to `US`. See the
  247. // [https://developers.google.com/storage/docs/concepts-techniques#specifyinglocations"][developer's
  248. // guide] for the authoritative list. Attempting to update this field after
  249. // the bucket is created will result in an error.
  250. string location = 10;
  251. // The bucket's default storage class, used whenever no storageClass is
  252. // specified for a newly-created object. This defines how objects in the
  253. // bucket are stored and determines the SLA and the cost of storage.
  254. // If this value is not specified when the bucket is created, it will default
  255. // to `STANDARD`. For more information, see
  256. // https://developers.google.com/storage/docs/storage-classes.
  257. string storage_class = 11;
  258. // HTTP 1.1 [https://tools.ietf.org/html/rfc7232#section-2.3"]Entity tag]
  259. // for the bucket.
  260. // Attempting to set or update this field will result in a
  261. // [FieldViolation][google.rpc.BadRequest.FieldViolation].
  262. string etag = 12;
  263. // The modification time of the bucket.
  264. // Attempting to set or update this field will result in a
  265. // [FieldViolation][google.rpc.BadRequest.FieldViolation].
  266. google.protobuf.Timestamp updated = 13;
  267. // The default value for event-based hold on newly created objects in this
  268. // bucket. Event-based hold is a way to retain objects indefinitely until an
  269. // event occurs, signified by the
  270. // hold's release. After being released, such objects will be subject to
  271. // bucket-level retention (if any). One sample use case of this flag is for
  272. // banks to hold loan documents for at least 3 years after loan is paid in
  273. // full. Here, bucket-level retention is 3 years and the event is loan being
  274. // paid in full. In this example, these objects will be held intact for any
  275. // number of years until the event has occurred (event-based hold on the
  276. // object is released) and then 3 more years after that. That means retention
  277. // duration of the objects begins from the moment event-based hold
  278. // transitioned from true to false. Objects under event-based hold cannot be
  279. // deleted, overwritten or archived until the hold is removed.
  280. bool default_event_based_hold = 14;
  281. // User-provided labels, in key/value pairs.
  282. map<string, string> labels = 15;
  283. // The bucket's website configuration, controlling how the service behaves
  284. // when accessing bucket contents as a web site. See the
  285. // [https://cloud.google.com/storage/docs/static-website][Static Website
  286. // Examples] for more information.
  287. Website website = 16;
  288. // The bucket's versioning configuration.
  289. Versioning versioning = 17;
  290. // The bucket's logging configuration, which defines the destination bucket
  291. // and optional name prefix for the current bucket's logs.
  292. Logging logging = 18;
  293. // The owner of the bucket. This is always the project team's owner group.
  294. Owner owner = 19;
  295. // Encryption configuration for a bucket.
  296. Encryption encryption = 20;
  297. // The bucket's billing configuration.
  298. Billing billing = 21;
  299. // The bucket's retention policy. The retention policy enforces a minimum
  300. // retention time for all objects contained in the bucket, based on their
  301. // creation time. Any attempt to overwrite or delete objects younger than the
  302. // retention period will result in a PERMISSION_DENIED error. An unlocked
  303. // retention policy can be modified or removed from the bucket via a
  304. // storage.buckets.update operation. A locked retention policy cannot be
  305. // removed or shortened in duration for the lifetime of the bucket.
  306. // Attempting to remove or decrease period of a locked retention policy will
  307. // result in a PERMISSION_DENIED error.
  308. RetentionPolicy retention_policy = 22;
  309. // The location type of the bucket (region, dual-region, multi-region, etc).
  310. string location_type = 23;
  311. // The bucket's IAM configuration.
  312. IamConfiguration iam_configuration = 24;
  313. // The zone or zones from which the bucket is intended to use zonal quota.
  314. // Requests for data from outside the specified affinities are still allowed
  315. // but won't be able to use zonal quota. The values are case-insensitive.
  316. // Attempting to update this field after bucket is created will result in an
  317. // error.
  318. repeated string zone_affinity = 25 [deprecated = true];
  319. // Reserved for future use.
  320. bool satisfies_pzs = 26;
  321. // The bucket's autoclass configuration. If there is no configuration, the
  322. // Autoclass feature will be disabled and have no effect on the bucket.
  323. Autoclass autoclass = 28;
  324. }
  325. // An access-control entry.
  326. message BucketAccessControl {
  327. // The access permission for the entity.
  328. string role = 1;
  329. // HTTP 1.1 ["https://tools.ietf.org/html/rfc7232#section-2.3][Entity tag]
  330. // for the access-control entry.
  331. string etag = 2;
  332. // The ID of the access-control entry.
  333. string id = 3;
  334. // The name of the bucket.
  335. string bucket = 4;
  336. // The entity holding the permission, in one of the following forms:
  337. // * `user-{userid}`
  338. // * `user-{email}`
  339. // * `group-{groupid}`
  340. // * `group-{email}`
  341. // * `domain-{domain}`
  342. // * `project-{team-projectid}`
  343. // * `allUsers`
  344. // * `allAuthenticatedUsers`
  345. // Examples:
  346. // * The user `liz@example.com` would be `user-liz@example.com`.
  347. // * The group `example@googlegroups.com` would be
  348. // `group-example@googlegroups.com`
  349. // * All members of the Google Apps for Business domain `example.com` would be
  350. // `domain-example.com`
  351. string entity = 6;
  352. // The ID for the entity, if any.
  353. string entity_id = 7;
  354. // The email address associated with the entity, if any.
  355. string email = 8;
  356. // The domain associated with the entity, if any.
  357. string domain = 9;
  358. // The project team associated with the entity, if any.
  359. ProjectTeam project_team = 10;
  360. }
  361. // The response to a call to BucketAccessControls.ListBucketAccessControls.
  362. message ListBucketAccessControlsResponse {
  363. // The list of items.
  364. repeated BucketAccessControl items = 1;
  365. }
  366. // The result of a call to Buckets.ListBuckets
  367. message ListBucketsResponse {
  368. // The list of items.
  369. repeated Bucket items = 1;
  370. // The continuation token, used to page through large result sets. Provide
  371. // this value in a subsequent request to return the next page of results.
  372. string next_page_token = 2;
  373. }
  374. // An notification channel used to watch for resource changes.
  375. message Channel {
  376. // A UUID or similar unique string that identifies this channel.
  377. string id = 1;
  378. // An opaque ID that identifies the resource being watched on this channel.
  379. // Stable across different API versions.
  380. string resource_id = 2;
  381. // A version-specific identifier for the watched resource.
  382. string resource_uri = 3;
  383. // An arbitrary string delivered to the target address with each notification
  384. // delivered over this channel. Optional.
  385. string token = 4;
  386. // Date and time of notification channel expiration. Optional.
  387. google.protobuf.Timestamp expiration = 5;
  388. // The type of delivery mechanism used for this channel.
  389. string type = 6;
  390. // The address where notifications are delivered for this channel.
  391. string address = 7;
  392. // Additional parameters controlling delivery channel behavior. Optional.
  393. map<string, string> params = 8;
  394. // A Boolean value to indicate whether payload is wanted. Optional.
  395. bool payload = 9;
  396. }
  397. // The result of a call to Channels.ListChannels
  398. message ListChannelsResponse {
  399. message Items {
  400. // User-specified name for a channel. Needed to unsubscribe.
  401. string channel_id = 1;
  402. // Opaque value generated by GCS representing a bucket. Needed to
  403. // unsubscribe.
  404. string resource_id = 2;
  405. // Url used to identify where notifications are sent to.
  406. string push_url = 3;
  407. // Email address of the subscriber.
  408. string subscriber_email = 4;
  409. // Time when the channel was created.
  410. google.protobuf.Timestamp creation_time = 5;
  411. }
  412. // The list of notification channels for a bucket.
  413. repeated Items items = 1;
  414. }
  415. // Message used to convey content being read or written, along with its
  416. // checksum.
  417. message ChecksummedData {
  418. // The data.
  419. bytes content = 1;
  420. // CRC32C digest of the contents.
  421. google.protobuf.UInt32Value crc32c = 2;
  422. }
  423. // Message used for storing full (not subrange) object checksums.
  424. message ObjectChecksums {
  425. // CRC32C digest of the object data. Computed by the GCS service for
  426. // all written objects, and validated by the GCS service against
  427. // client-supplied values if present in an InsertObjectRequest.
  428. google.protobuf.UInt32Value crc32c = 1;
  429. // Hex-encoded MD5 hash of the object data (hexdigest). Whether/how this
  430. // checksum is provided and validated is service-dependent.
  431. string md5_hash = 2;
  432. }
  433. // A collection of enums used in multiple places throughout the API.
  434. message CommonEnums {
  435. // A set of properties to return in a response.
  436. enum Projection {
  437. // No specified projection.
  438. PROJECTION_UNSPECIFIED = 0;
  439. // Omit `owner`, `acl`, and `defaultObjectAcl` properties.
  440. NO_ACL = 1;
  441. // Include all properties.
  442. FULL = 2;
  443. }
  444. // Predefined or "canned" aliases for sets of specific bucket ACL entries.
  445. enum PredefinedBucketAcl {
  446. // No predefined ACL.
  447. PREDEFINED_BUCKET_ACL_UNSPECIFIED = 0;
  448. // Project team owners get `OWNER` access, and
  449. // `allAuthenticatedUsers` get `READER` access.
  450. BUCKET_ACL_AUTHENTICATED_READ = 1;
  451. // Project team owners get `OWNER` access.
  452. BUCKET_ACL_PRIVATE = 2;
  453. // Project team members get access according to their roles.
  454. BUCKET_ACL_PROJECT_PRIVATE = 3;
  455. // Project team owners get `OWNER` access, and
  456. // `allUsers` get `READER` access.
  457. BUCKET_ACL_PUBLIC_READ = 4;
  458. // Project team owners get `OWNER` access, and
  459. // `allUsers` get `WRITER` access.
  460. BUCKET_ACL_PUBLIC_READ_WRITE = 5;
  461. }
  462. // Predefined or "canned" aliases for sets of specific object ACL entries.
  463. enum PredefinedObjectAcl {
  464. // No predefined ACL.
  465. PREDEFINED_OBJECT_ACL_UNSPECIFIED = 0;
  466. // Object owner gets `OWNER` access, and
  467. // `allAuthenticatedUsers` get `READER` access.
  468. OBJECT_ACL_AUTHENTICATED_READ = 1;
  469. // Object owner gets `OWNER` access, and project team owners get
  470. // `OWNER` access.
  471. OBJECT_ACL_BUCKET_OWNER_FULL_CONTROL = 2;
  472. // Object owner gets `OWNER` access, and project team owners get
  473. // `READER` access.
  474. OBJECT_ACL_BUCKET_OWNER_READ = 3;
  475. // Object owner gets `OWNER` access.
  476. OBJECT_ACL_PRIVATE = 4;
  477. // Object owner gets `OWNER` access, and project team members get
  478. // access according to their roles.
  479. OBJECT_ACL_PROJECT_PRIVATE = 5;
  480. // Object owner gets `OWNER` access, and `allUsers`
  481. // get `READER` access.
  482. OBJECT_ACL_PUBLIC_READ = 6;
  483. }
  484. }
  485. // Specifies a requested range of bytes to download.
  486. message ContentRange {
  487. // The starting offset of the object data.
  488. int64 start = 1;
  489. // The ending offset of the object data.
  490. int64 end = 2;
  491. // The complete length of the object data.
  492. int64 complete_length = 3;
  493. }
  494. // Hmac Key Metadata, which includes all information other than the secret.
  495. message HmacKeyMetadata {
  496. // Resource name ID of the key in the format <projectId>/<accessId>.
  497. string id = 1;
  498. // Globally unique id for keys.
  499. string access_id = 2;
  500. // The project ID that the hmac key is contained in.
  501. string project_id = 3;
  502. // Email of the service account the key authenticates as.
  503. string service_account_email = 4;
  504. // State of the key. One of ACTIVE, INACTIVE, or DELETED.
  505. string state = 5;
  506. // The creation time of the HMAC key in RFC 3339 format.
  507. google.protobuf.Timestamp time_created = 6;
  508. // The last modification time of the HMAC key metadata in RFC 3339 format.
  509. google.protobuf.Timestamp updated = 7;
  510. // Tag updated with each key update.
  511. string etag = 8;
  512. }
  513. // A subscription to receive Google PubSub notifications.
  514. message Notification {
  515. // The Cloud PubSub topic to which this subscription publishes. Formatted as:
  516. // '//pubsub.googleapis.com/projects/{project-identifier}/topics/{my-topic}'
  517. string topic = 1;
  518. // If present, only send notifications about listed event types. If empty,
  519. // sent notifications for all event types.
  520. repeated string event_types = 2;
  521. // An optional list of additional attributes to attach to each Cloud PubSub
  522. // message published for this notification subscription.
  523. map<string, string> custom_attributes = 3;
  524. // HTTP 1.1 [https://tools.ietf.org/html/rfc7232#section-2.3][Entity tag]
  525. // for this subscription notification.
  526. string etag = 4;
  527. // If present, only apply this notification configuration to object names that
  528. // begin with this prefix.
  529. string object_name_prefix = 5;
  530. // The desired content of the Payload.
  531. string payload_format = 6;
  532. // The ID of the notification.
  533. string id = 7;
  534. }
  535. // The result of a call to Notifications.ListNotifications
  536. message ListNotificationsResponse {
  537. // The list of items.
  538. repeated Notification items = 1;
  539. }
  540. // An object.
  541. message Object {
  542. // Describes the customer-specified mechanism used to store the data at rest.
  543. message CustomerEncryption {
  544. // The encryption algorithm.
  545. string encryption_algorithm = 1;
  546. // SHA256 hash value of the encryption key.
  547. string key_sha256 = 2;
  548. }
  549. // Content-Encoding of the object data, matching
  550. // [https://tools.ietf.org/html/rfc7231#section-3.1.2.2][RFC 7231 §3.1.2.2]
  551. string content_encoding = 1;
  552. // Content-Disposition of the object data, matching
  553. // [https://tools.ietf.org/html/rfc6266][RFC 6266].
  554. string content_disposition = 2;
  555. // Cache-Control directive for the object data, matching
  556. // [https://tools.ietf.org/html/rfc7234#section-5.2"][RFC 7234 §5.2].
  557. // If omitted, and the object is accessible to all anonymous users, the
  558. // default will be `public, max-age=3600`.
  559. string cache_control = 3;
  560. // Access controls on the object.
  561. repeated ObjectAccessControl acl = 4;
  562. // Content-Language of the object data, matching
  563. // [https://tools.ietf.org/html/rfc7231#section-3.1.3.2][RFC 7231 §3.1.3.2].
  564. string content_language = 5;
  565. // The version of the metadata for this object at this generation. Used for
  566. // preconditions and for detecting changes in metadata. A metageneration
  567. // number is only meaningful in the context of a particular generation of a
  568. // particular object.
  569. // Attempting to set or update this field will result in a
  570. // [FieldViolation][google.rpc.BadRequest.FieldViolation].
  571. int64 metageneration = 6;
  572. // The deletion time of the object. Will be returned if and only if this
  573. // version of the object has been deleted.
  574. // Attempting to set or update this field will result in a
  575. // [FieldViolation][google.rpc.BadRequest.FieldViolation].
  576. google.protobuf.Timestamp time_deleted = 7;
  577. // Content-Type of the object data, matching
  578. // [https://tools.ietf.org/html/rfc7231#section-3.1.1.5][RFC 7231 §3.1.1.5].
  579. // If an object is stored without a Content-Type, it is served as
  580. // `application/octet-stream`.
  581. string content_type = 8;
  582. // Content-Length of the object data in bytes, matching
  583. // [https://tools.ietf.org/html/rfc7230#section-3.3.2][RFC 7230 §3.3.2].
  584. // Attempting to set or update this field will result in a
  585. // [FieldViolation][google.rpc.BadRequest.FieldViolation].
  586. int64 size = 9;
  587. // The creation time of the object.
  588. // Attempting to set or update this field will result in a
  589. // [FieldViolation][google.rpc.BadRequest.FieldViolation].
  590. google.protobuf.Timestamp time_created = 10;
  591. // CRC32c checksum. For more information about using the CRC32c
  592. // checksum, see
  593. // [https://cloud.google.com/storage/docs/hashes-etags#json-api][Hashes and
  594. // ETags: Best Practices]. This is a server determined value and should not be
  595. // supplied by the user when sending an Object. The server will ignore any
  596. // value provided. Users should instead use the object_checksums field on the
  597. // InsertObjectRequest when uploading an object.
  598. google.protobuf.UInt32Value crc32c = 11;
  599. // Number of underlying components that make up this object. Components are
  600. // accumulated by compose operations.
  601. // Attempting to set or update this field will result in a
  602. // [FieldViolation][google.rpc.BadRequest.FieldViolation].
  603. int32 component_count = 12;
  604. // MD5 hash of the data; encoded using base64 as per
  605. // [https://tools.ietf.org/html/rfc4648#section-4][RFC 4648 §4]. For more
  606. // information about using the MD5 hash, see
  607. // [https://cloud.google.com/storage/docs/hashes-etags#json-api][Hashes and
  608. // ETags: Best Practices]. This is a server determined value and should not be
  609. // supplied by the user when sending an Object. The server will ignore any
  610. // value provided. Users should instead use the object_checksums field on the
  611. // InsertObjectRequest when uploading an object.
  612. string md5_hash = 13;
  613. // HTTP 1.1 Entity tag for the object. See
  614. // [https://tools.ietf.org/html/rfc7232#section-2.3][RFC 7232 §2.3].
  615. // Attempting to set or update this field will result in a
  616. // [FieldViolation][google.rpc.BadRequest.FieldViolation].
  617. string etag = 14;
  618. // The modification time of the object metadata.
  619. // Attempting to set or update this field will result in a
  620. // [FieldViolation][google.rpc.BadRequest.FieldViolation].
  621. google.protobuf.Timestamp updated = 15;
  622. // Storage class of the object.
  623. string storage_class = 16;
  624. // Cloud KMS Key used to encrypt this object, if the object is encrypted by
  625. // such a key.
  626. string kms_key_name = 17;
  627. // The time at which the object's storage class was last changed. When the
  628. // object is initially created, it will be set to time_created.
  629. // Attempting to set or update this field will result in a
  630. // [FieldViolation][google.rpc.BadRequest.FieldViolation].
  631. google.protobuf.Timestamp time_storage_class_updated = 18;
  632. // Whether an object is under temporary hold. While this flag is set to true,
  633. // the object is protected against deletion and overwrites. A common use case
  634. // of this flag is regulatory investigations where objects need to be retained
  635. // while the investigation is ongoing. Note that unlike event-based hold,
  636. // temporary hold does not impact retention expiration time of an object.
  637. bool temporary_hold = 19;
  638. // A server-determined value that specifies the earliest time that the
  639. // object's retention period expires. This value is in
  640. // [https://tools.ietf.org/html/rfc3339][RFC 3339] format.
  641. // Note 1: This field is not provided for objects with an active event-based
  642. // hold, since retention expiration is unknown until the hold is removed.
  643. // Note 2: This value can be provided even when temporary hold is set (so that
  644. // the user can reason about policy without having to first unset the
  645. // temporary hold).
  646. google.protobuf.Timestamp retention_expiration_time = 20;
  647. // User-provided metadata, in key/value pairs.
  648. map<string, string> metadata = 21;
  649. // Whether an object is under event-based hold. Event-based hold is a way to
  650. // retain objects until an event occurs, which is signified by the
  651. // hold's release (i.e. this value is set to false). After being released (set
  652. // to false), such objects will be subject to bucket-level retention (if any).
  653. // One sample use case of this flag is for banks to hold loan documents for at
  654. // least 3 years after loan is paid in full. Here, bucket-level retention is 3
  655. // years and the event is the loan being paid in full. In this example, these
  656. // objects will be held intact for any number of years until the event has
  657. // occurred (event-based hold on the object is released) and then 3 more years
  658. // after that. That means retention duration of the objects begins from the
  659. // moment event-based hold transitioned from true to false.
  660. google.protobuf.BoolValue event_based_hold = 29;
  661. // The name of the object.
  662. // Attempting to update this field after the object is created will result in
  663. // an error.
  664. string name = 23;
  665. // The ID of the object, including the bucket name, object name, and
  666. // generation number.
  667. // Attempting to update this field after the object is created will result in
  668. // an error.
  669. string id = 24;
  670. // The name of the bucket containing this object.
  671. // Attempting to update this field after the object is created will result in
  672. // an error.
  673. string bucket = 25;
  674. // The content generation of this object. Used for object versioning.
  675. // Attempting to set or update this field will result in a
  676. // [FieldViolation][google.rpc.BadRequest.FieldViolation].
  677. int64 generation = 26;
  678. // The owner of the object. This will always be the uploader of the object.
  679. // Attempting to set or update this field will result in a
  680. // [FieldViolation][google.rpc.BadRequest.FieldViolation].
  681. Owner owner = 27;
  682. // Metadata of customer-supplied encryption key, if the object is encrypted by
  683. // such a key.
  684. CustomerEncryption customer_encryption = 28;
  685. // A user-specified timestamp set on an object.
  686. google.protobuf.Timestamp custom_time = 30;
  687. }
  688. // An access-control entry.
  689. message ObjectAccessControl {
  690. // The access permission for the entity.
  691. string role = 1;
  692. // HTTP 1.1 Entity tag for the access-control entry.
  693. // See [https://tools.ietf.org/html/rfc7232#section-2.3][RFC 7232 §2.3].
  694. string etag = 2;
  695. // The ID of the access-control entry.
  696. string id = 3;
  697. // The name of the bucket.
  698. string bucket = 4;
  699. // The name of the object, if applied to an object.
  700. string object = 5;
  701. // The content generation of the object, if applied to an object.
  702. int64 generation = 6;
  703. // The entity holding the permission, in one of the following forms:
  704. // * `user-{userid}`
  705. // * `user-{email}`
  706. // * `group-{groupid}`
  707. // * `group-{email}`
  708. // * `domain-{domain}`
  709. // * `project-{team-projectid}`
  710. // * `allUsers`
  711. // * `allAuthenticatedUsers`
  712. // Examples:
  713. // * The user `liz@example.com` would be `user-liz@example.com`.
  714. // * The group `example@googlegroups.com` would be
  715. // `group-example@googlegroups.com`.
  716. // * All members of the Google Apps for Business domain `example.com` would be
  717. // `domain-example.com`.
  718. string entity = 7;
  719. // The ID for the entity, if any.
  720. string entity_id = 8;
  721. // The email address associated with the entity, if any.
  722. string email = 9;
  723. // The domain associated with the entity, if any.
  724. string domain = 10;
  725. // The project team associated with the entity, if any.
  726. ProjectTeam project_team = 11;
  727. }
  728. // The result of a call to ObjectAccessControls.ListObjectAccessControls.
  729. message ListObjectAccessControlsResponse {
  730. // The list of items.
  731. repeated ObjectAccessControl items = 1;
  732. }
  733. // The result of a call to Objects.ListObjects
  734. message ListObjectsResponse {
  735. // The list of prefixes of objects matching-but-not-listed up to and including
  736. // the requested delimiter.
  737. repeated string prefixes = 1;
  738. // The list of items.
  739. repeated Object items = 2;
  740. // The continuation token, used to page through large result sets. Provide
  741. // this value in a subsequent request to return the next page of results.
  742. string next_page_token = 3;
  743. }
  744. // Represents the Viewers, Editors, or Owners of a given project.
  745. message ProjectTeam {
  746. // The project number.
  747. string project_number = 1;
  748. // The team.
  749. string team = 2;
  750. }
  751. // A subscription to receive Google PubSub notifications.
  752. message ServiceAccount {
  753. // The ID of the notification.
  754. string email_address = 1;
  755. }
  756. // The owner of a specific resource.
  757. message Owner {
  758. // The entity, in the form `user-`*userId*.
  759. string entity = 1;
  760. // The ID for the entity.
  761. string entity_id = 2;
  762. }