Debian Codegraph @

docs/dyn/storage_v1.objects.html

raw
1 <html><body>
2 <style>
3
4 body, h1, h2, h3, div, span, p, pre, a {
5 margin: 0;
6 padding: 0;
7 border: 0;
8 font-weight: inherit;
9 font-style: inherit;
10 font-size: 100%;
11 font-family: inherit;
12 vertical-align: baseline;
13 }
14
15 body {
16 font-size: 13px;
17 padding: 1em;
18 }
19
20 h1 {
21 font-size: 26px;
22 margin-bottom: 1em;
23 }
24
25 h2 {
26 font-size: 24px;
27 margin-bottom: 1em;
28 }
29
30 h3 {
31 font-size: 20px;
32 margin-bottom: 1em;
33 margin-top: 1em;
34 }
35
36 pre, code {
37 line-height: 1.5;
38 font-family: Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Lucida Console', monospace;
39 }
40
41 pre {
42 margin-top: 0.5em;
43 }
44
45 h1, h2, h3, p {
46 font-family: Arial, sans serif;
47 }
48
49 h1, h2, h3 {
50 border-bottom: solid #CCC 1px;
51 }
52
53 .toc_element {
54 margin-top: 0.5em;
55 }
56
57 .firstline {
58 margin-left: 2 em;
59 }
60
61 .method {
62 margin-top: 1em;
63 border: solid 1px #CCC;
64 padding: 1em;
65 background: #EEE;
66 }
67
68 .details {
69 font-weight: bold;
70 font-size: 14px;
71 }
72
73 </style>
74
75 <h1><a href="storage_v1.html">Cloud Storage JSON API</a> . <a href="storage_v1.objects.html">objects</a></h1>
76 <h2>Instance Methods</h2>
77 <p class="toc_element">
78 <code><a href="#bulkRestore">bulkRestore(bucket, body=None)</a></code></p>
79 <p class="firstline">Initiates a long-running bulk restore operation on the specified bucket.</p>
80 <p class="toc_element">
81 <code><a href="#close">close()</a></code></p>
82 <p class="firstline">Close httplib2 connections.</p>
83 <p class="toc_element">
84 <code><a href="#compose">compose(destinationBucket, destinationObject, body=None, destinationPredefinedAcl=None, dropContextGroups=None, ifGenerationMatch=None, ifMetagenerationMatch=None, kmsKeyName=None, userProject=None)</a></code></p>
85 <p class="firstline">Concatenates a list of existing objects into a new object in the same bucket.</p>
86 <p class="toc_element">
87 <code><a href="#copy">copy(sourceBucket, sourceObject, destinationBucket, destinationObject, body=None, destinationKmsKeyName=None, destinationPredefinedAcl=None, ifGenerationMatch=None, ifGenerationNotMatch=None, ifMetagenerationMatch=None, ifMetagenerationNotMatch=None, ifSourceGenerationMatch=None, ifSourceGenerationNotMatch=None, ifSourceMetagenerationMatch=None, ifSourceMetagenerationNotMatch=None, projection=None, sourceGeneration=None, userProject=None)</a></code></p>
88 <p class="firstline">Copies a source object to a destination object. Optionally overrides metadata.</p>
89 <p class="toc_element">
90 <code><a href="#delete">delete(bucket, object, generation=None, ifGenerationMatch=None, ifGenerationNotMatch=None, ifMetagenerationMatch=None, ifMetagenerationNotMatch=None, userProject=None)</a></code></p>
91 <p class="firstline">Deletes an object and its metadata. Deletions are permanent if versioning is not enabled for the bucket, or if the generation parameter is used.</p>
92 <p class="toc_element">
93 <code><a href="#get">get(bucket, object, generation=None, ifGenerationMatch=None, ifGenerationNotMatch=None, ifMetagenerationMatch=None, ifMetagenerationNotMatch=None, projection=None, restoreToken=None, softDeleted=None, userProject=None)</a></code></p>
94 <p class="firstline">Retrieves an object or its metadata.</p>
95 <p class="toc_element">
96 <code><a href="#getIamPolicy">getIamPolicy(bucket, object, generation=None, userProject=None)</a></code></p>
97 <p class="firstline">Returns an IAM policy for the specified object.</p>
98 <p class="toc_element">
99 <code><a href="#get_media">get_media(bucket, object, generation=None, ifGenerationMatch=None, ifGenerationNotMatch=None, ifMetagenerationMatch=None, ifMetagenerationNotMatch=None, projection=None, restoreToken=None, softDeleted=None, userProject=None)</a></code></p>
100 <p class="firstline">Retrieves an object or its metadata.</p>
101 <p class="toc_element">
102 <code><a href="#insert">insert(bucket, body=None, contentEncoding=None, ifGenerationMatch=None, ifGenerationNotMatch=None, ifMetagenerationMatch=None, ifMetagenerationNotMatch=None, kmsKeyName=None, media_body=None, media_mime_type=None, name=None, predefinedAcl=None, projection=None, userProject=None)</a></code></p>
103 <p class="firstline">Stores a new object and metadata.</p>
104 <p class="toc_element">
105 <code><a href="#list">list(bucket, delimiter=None, endOffset=None, filter=None, includeFoldersAsPrefixes=None, includeTrailingDelimiter=None, matchGlob=None, maxResults=None, pageToken=None, prefix=None, projection=None, softDeleted=None, startOffset=None, userProject=None, versions=None)</a></code></p>
106 <p class="firstline">Retrieves a list of objects matching the criteria.</p>
107 <p class="toc_element">
108 <code><a href="#list_next">list_next()</a></code></p>
109 <p class="firstline">Retrieves the next page of results.</p>
110 <p class="toc_element">
111 <code><a href="#move">move(bucket, sourceObject, destinationObject, ifGenerationMatch=None, ifGenerationNotMatch=None, ifMetagenerationMatch=None, ifMetagenerationNotMatch=None, ifSourceGenerationMatch=None, ifSourceGenerationNotMatch=None, ifSourceMetagenerationMatch=None, ifSourceMetagenerationNotMatch=None, projection=None, userProject=None)</a></code></p>
112 <p class="firstline">Moves the source object to the destination object in the same bucket.</p>
113 <p class="toc_element">
114 <code><a href="#patch">patch(bucket, object, body=None, generation=None, ifGenerationMatch=None, ifGenerationNotMatch=None, ifMetagenerationMatch=None, ifMetagenerationNotMatch=None, overrideUnlockedRetention=None, predefinedAcl=None, projection=None, userProject=None)</a></code></p>
115 <p class="firstline">Patches an object's metadata.</p>
116 <p class="toc_element">
117 <code><a href="#restore">restore(bucket, object, generation, copySourceAcl=None, ifGenerationMatch=None, ifGenerationNotMatch=None, ifMetagenerationMatch=None, ifMetagenerationNotMatch=None, projection=None, restoreToken=None, userProject=None)</a></code></p>
118 <p class="firstline">Restores a soft-deleted object.</p>
119 <p class="toc_element">
120 <code><a href="#rewrite">rewrite(sourceBucket, sourceObject, destinationBucket, destinationObject, body=None, destinationKmsKeyName=None, destinationPredefinedAcl=None, dropContextGroups=None, ifGenerationMatch=None, ifGenerationNotMatch=None, ifMetagenerationMatch=None, ifMetagenerationNotMatch=None, ifSourceGenerationMatch=None, ifSourceGenerationNotMatch=None, ifSourceMetagenerationMatch=None, ifSourceMetagenerationNotMatch=None, maxBytesRewrittenPerCall=None, projection=None, rewriteToken=None, sourceGeneration=None, userProject=None)</a></code></p>
121 <p class="firstline">Rewrites a source object to a destination object. Optionally overrides metadata.</p>
122 <p class="toc_element">
123 <code><a href="#setIamPolicy">setIamPolicy(bucket, object, body=None, generation=None, userProject=None)</a></code></p>
124 <p class="firstline">Updates an IAM policy for the specified object.</p>
125 <p class="toc_element">
126 <code><a href="#testIamPermissions">testIamPermissions(bucket, object, permissions, generation=None, userProject=None)</a></code></p>
127 <p class="firstline">Tests a set of permissions on the given object to see which, if any, are held by the caller.</p>
128 <p class="toc_element">
129 <code><a href="#update">update(bucket, object, body=None, generation=None, ifGenerationMatch=None, ifGenerationNotMatch=None, ifMetagenerationMatch=None, ifMetagenerationNotMatch=None, overrideUnlockedRetention=None, predefinedAcl=None, projection=None, userProject=None)</a></code></p>
130 <p class="firstline">Updates an object's metadata.</p>
131 <p class="toc_element">
132 <code><a href="#watchAll">watchAll(bucket, body=None, delimiter=None, endOffset=None, includeTrailingDelimiter=None, maxResults=None, pageToken=None, prefix=None, projection=None, startOffset=None, userProject=None, versions=None)</a></code></p>
133 <p class="firstline">Watch for changes on all objects in a bucket.</p>
134 <h3>Method Details</h3>
135 <div class="method">
136 <code class="details" id="bulkRestore">bulkRestore(bucket, body=None)</code>
137 <pre>Initiates a long-running bulk restore operation on the specified bucket.
138
139 Args:
140 bucket: string, Name of the bucket in which the object resides. (required)
141 body: object, The request body.
142 The object takes the form of:
143
144 { # A bulk restore objects request.
145 &quot;allowOverwrite&quot;: True or False, # If false (default), the restore will not overwrite live objects with the same name at the destination. This means some deleted objects may be skipped. If true, live objects will be overwritten resulting in a noncurrent object (if versioning is enabled). If versioning is not enabled, overwriting the object will result in a soft-deleted object. In either case, if a noncurrent object already exists with the same name, a live version can be written without issue.
146 &quot;copySourceAcl&quot;: True or False, # If true, copies the source object&#x27;s ACL; otherwise, uses the bucket&#x27;s default object ACL. The default is false.
147 &quot;createdAfterTime&quot;: &quot;A String&quot;, # Restores only the objects that were created after this time.
148 &quot;createdBeforeTime&quot;: &quot;A String&quot;, # Restores only the objects that were created before this time.
149 &quot;matchGlobs&quot;: [ # Restores only the objects matching any of the specified glob(s). If this parameter is not specified, all objects will be restored within the specified time range.
150 &quot;A String&quot;,
151 ],
152 &quot;softDeletedAfterTime&quot;: &quot;A String&quot;, # Restores only the objects that were soft-deleted after this time.
153 &quot;softDeletedBeforeTime&quot;: &quot;A String&quot;, # Restores only the objects that were soft-deleted before this time.
154 }
155
156
157 Returns:
158 An object of the form:
159
160 { # This resource represents a long-running operation that is the result of a network API call.
161 &quot;done&quot;: True or False, # If the value is &quot;false&quot;, it means the operation is still in progress. If &quot;true&quot;, the operation is completed, and either &quot;error&quot; or &quot;response&quot; is available.
162 &quot;error&quot;: { # The &quot;Status&quot; type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. It is used by [gRPC](https://github.com/grpc). Each &quot;Status&quot; message contains three pieces of data: error code, error message, and error details. You can find out more about this error model and how to work with it in the [API Design Guide](https://cloud.google.com/apis/design/errors). # The error result of the operation in case of failure or cancellation.
163 &quot;code&quot;: 42, # The status code, which should be an enum value of google.rpc.Code.
164 &quot;details&quot;: [ # A list of messages that carry the error details. There is a common set of message types for APIs to use.
165 {
166 &quot;a_key&quot;: &quot;&quot;, # Properties of the object. Contains field @type with type URL.
167 },
168 ],
169 &quot;message&quot;: &quot;A String&quot;, # A developer-facing error message, which should be in English.
170 },
171 &quot;kind&quot;: &quot;storage#operation&quot;, # The kind of item this is. For operations, this is always storage#operation.
172 &quot;metadata&quot;: { # Service-specific metadata associated with the operation. It typically contains progress information and common metadata such as create time. Some services might not provide such metadata. Any method that returns a long-running operation should document the metadata type, if any.
173 &quot;a_key&quot;: &quot;&quot;, # Properties of the object. Contains field @type with type URL.
174 },
175 &quot;name&quot;: &quot;A String&quot;, # The server-assigned name, which is only unique within the same service that originally returns it. If you use the default HTTP mapping, the &quot;name&quot; should be a resource name ending with &quot;operations/{operationId}&quot;.
176 &quot;response&quot;: { # The normal response of the operation in case of success. If the original method returns no data on success, such as &quot;Delete&quot;, the response is google.protobuf.Empty. If the original method is standard Get/Create/Update, the response should be the resource. For other methods, the response should have the type &quot;XxxResponse&quot;, where &quot;Xxx&quot; is the original method name. For example, if the original method name is &quot;TakeSnapshot()&quot;, the inferred response type is &quot;TakeSnapshotResponse&quot;.
177 &quot;a_key&quot;: &quot;&quot;, # Properties of the object. Contains field @type with type URL.
178 },
179 &quot;selfLink&quot;: &quot;A String&quot;, # The link to this long running operation.
180 }</pre>
181 </div>
182
183 <div class="method">
184 <code class="details" id="close">close()</code>
185 <pre>Close httplib2 connections.</pre>
186 </div>
187
188 <div class="method">
189 <code class="details" id="compose">compose(destinationBucket, destinationObject, body=None, destinationPredefinedAcl=None, dropContextGroups=None, ifGenerationMatch=None, ifMetagenerationMatch=None, kmsKeyName=None, userProject=None)</code>
190 <pre>Concatenates a list of existing objects into a new object in the same bucket.
191
192 Args:
193 destinationBucket: string, Name of the bucket containing the source objects. The destination object is stored in this bucket. (required)
194 destinationObject: string, Name of the new object. For information about how to URL encode object names to be path safe, see [Encoding URI Path Parts](https://cloud.google.com/storage/docs/request-endpoints#encoding). (required)
195 body: object, The request body.
196 The object takes the form of:
197
198 { # A Compose request.
199 &quot;deleteSourceObjects&quot;: True or False, # If true, the source objects will be deleted.
200 &quot;destination&quot;: { # An object. # Properties of the resulting object.
201 &quot;acl&quot;: [ # Access controls on the object.
202 { # An access-control entry.
203 &quot;bucket&quot;: &quot;A String&quot;, # The name of the bucket.
204 &quot;domain&quot;: &quot;A String&quot;, # The domain associated with the entity, if any.
205 &quot;email&quot;: &quot;A String&quot;, # The email address associated with the entity, if any.
206 &quot;entity&quot;: &quot;A String&quot;, # The entity holding the permission, in one of the following forms:
207 # - user-userId
208 # - user-email
209 # - group-groupId
210 # - group-email
211 # - domain-domain
212 # - project-team-projectId
213 # - allUsers
214 # - allAuthenticatedUsers Examples:
215 # - The user [email protected] would be [email protected].
216 # - The group [email protected] would be [email protected].
217 # - To refer to all members of the Google Apps for Business domain example.com, the entity would be domain-example.com.
218 &quot;entityId&quot;: &quot;A String&quot;, # The ID for the entity, if any.
219 &quot;etag&quot;: &quot;A String&quot;, # HTTP 1.1 Entity tag for the access-control entry.
220 &quot;generation&quot;: &quot;A String&quot;, # The content generation of the object, if applied to an object.
221 &quot;id&quot;: &quot;A String&quot;, # The ID of the access-control entry.
222 &quot;kind&quot;: &quot;storage#objectAccessControl&quot;, # The kind of item this is. For object access control entries, this is always storage#objectAccessControl.
223 &quot;object&quot;: &quot;A String&quot;, # The name of the object, if applied to an object.
224 &quot;projectTeam&quot;: { # The project team associated with the entity, if any.
225 &quot;projectNumber&quot;: &quot;A String&quot;, # The project number.
226 &quot;team&quot;: &quot;A String&quot;, # The team.
227 },
228 &quot;role&quot;: &quot;A String&quot;, # The access permission for the entity.
229 &quot;selfLink&quot;: &quot;A String&quot;, # The link to this access-control entry.
230 },
231 ],
232 &quot;bucket&quot;: &quot;A String&quot;, # The name of the bucket containing this object.
233 &quot;cacheControl&quot;: &quot;A String&quot;, # Cache-Control directive for the object data. If omitted, and the object is accessible to all anonymous users, the default will be public, max-age=3600.
234 &quot;componentCount&quot;: 42, # Number of underlying components that make up this object. Components are accumulated by compose operations.
235 &quot;contentDisposition&quot;: &quot;A String&quot;, # Content-Disposition of the object data.
236 &quot;contentEncoding&quot;: &quot;A String&quot;, # Content-Encoding of the object data.
237 &quot;contentLanguage&quot;: &quot;A String&quot;, # Content-Language of the object data.
238 &quot;contentType&quot;: &quot;A String&quot;, # Content-Type of the object data. If an object is stored without a Content-Type, it is served as application/octet-stream.
239 &quot;contexts&quot;: { # User-defined or system-defined object contexts. Each object context is a key-payload pair, where the key provides the identification and the payload holds the associated value and additional metadata.
240 &quot;custom&quot;: { # User-defined object contexts.
241 &quot;a_key&quot;: { # The payload of a single user-defined object context. # A single user-defined object context.
242 &quot;createTime&quot;: &quot;A String&quot;, # The time at which the object context was created in RFC 3339 format.
243 &quot;updateTime&quot;: &quot;A String&quot;, # The time at which the object context was last updated in RFC 3339 format.
244 &quot;value&quot;: &quot;A String&quot;, # The value of the object context.
245 },
246 },
247 },
248 &quot;crc32c&quot;: &quot;A String&quot;, # CRC32c checksum, as described in RFC 4960, Appendix B; encoded using base64 in big-endian byte order. For more information about using the CRC32c checksum, see [Data Validation and Change Detection](https://cloud.google.com/storage/docs/data-validation).
249 &quot;customTime&quot;: &quot;A String&quot;, # A timestamp in RFC 3339 format specified by the user for an object.
250 &quot;customerEncryption&quot;: { # Metadata of customer-supplied encryption key, if the object is encrypted by such a key.
251 &quot;encryptionAlgorithm&quot;: &quot;A String&quot;, # The encryption algorithm.
252 &quot;keySha256&quot;: &quot;A String&quot;, # SHA256 hash value of the encryption key.
253 },
254 &quot;etag&quot;: &quot;A String&quot;, # HTTP 1.1 Entity tag for the object.
255 &quot;eventBasedHold&quot;: True or False, # Whether an object is under event-based hold. Event-based hold is a way to retain objects until an event occurs, which is signified by the hold&#x27;s release (i.e. this value is set to false). After being released (set to false), such objects will be subject to bucket-level retention (if any). One sample use case of this flag is for banks to hold loan documents for at least 3 years after loan is paid in full. Here, bucket-level retention is 3 years and the event is the loan being paid in full. In this example, these objects will be held intact for any number of years until the event has occurred (event-based hold on the object is released) and then 3 more years after that. That means retention duration of the objects begins from the moment event-based hold transitioned from true to false.
256 &quot;generation&quot;: &quot;A String&quot;, # The content generation of this object. Used for object versioning.
257 &quot;hardDeleteTime&quot;: &quot;A String&quot;, # This is the time (in the future) when the soft-deleted object will no longer be restorable. It is equal to the soft delete time plus the current soft delete retention duration of the bucket.
258 &quot;id&quot;: &quot;A String&quot;, # The ID of the object, including the bucket name, object name, and generation number.
259 &quot;kind&quot;: &quot;storage#object&quot;, # The kind of item this is. For objects, this is always storage#object.
260 &quot;kmsKeyName&quot;: &quot;A String&quot;, # Not currently supported. Specifying the parameter causes the request to fail with status code 400 - Bad Request.
261 &quot;md5Hash&quot;: &quot;A String&quot;, # MD5 hash of the data; encoded using base64. For more information about using the MD5 hash, see [Data Validation and Change Detection](https://cloud.google.com/storage/docs/data-validation).
262 &quot;mediaLink&quot;: &quot;A String&quot;, # Media download link.
263 &quot;metadata&quot;: { # User-provided metadata, in key/value pairs.
264 &quot;a_key&quot;: &quot;A String&quot;, # An individual metadata entry.
265 },
266 &quot;metageneration&quot;: &quot;A String&quot;, # The version of the metadata for this object at this generation. Used for preconditions and for detecting changes in metadata. A metageneration number is only meaningful in the context of a particular generation of a particular object.
267 &quot;name&quot;: &quot;A String&quot;, # The name of the object. Required if not specified by URL parameter.
268 &quot;owner&quot;: { # The owner of the object. This will always be the uploader of the object.
269 &quot;entity&quot;: &quot;A String&quot;, # The entity, in the form user-userId.
270 &quot;entityId&quot;: &quot;A String&quot;, # The ID for the entity.
271 },
272 &quot;restoreToken&quot;: &quot;A String&quot;, # Restore token used to differentiate deleted objects with the same name and generation. This field is only returned for deleted objects in hierarchical namespace buckets.
273 &quot;retention&quot;: { # A collection of object level retention parameters.
274 &quot;mode&quot;: &quot;A String&quot;, # The bucket&#x27;s object retention mode, can only be Unlocked or Locked.
275 &quot;retainUntilTime&quot;: &quot;A String&quot;, # A time in RFC 3339 format until which object retention protects this object.
276 },
277 &quot;retentionExpirationTime&quot;: &quot;A String&quot;, # A server-determined value that specifies the earliest time that the object&#x27;s retention period expires. This value is in RFC 3339 format. Note 1: This field is not provided for objects with an active event-based hold, since retention expiration is unknown until the hold is removed. Note 2: This value can be provided even when temporary hold is set (so that the user can reason about policy without having to first unset the temporary hold).
278 &quot;selfLink&quot;: &quot;A String&quot;, # The link to this object.
279 &quot;size&quot;: &quot;A String&quot;, # Content-Length of the data in bytes.
280 &quot;softDeleteTime&quot;: &quot;A String&quot;, # The time at which the object became soft-deleted in RFC 3339 format.
281 &quot;storageClass&quot;: &quot;A String&quot;, # Storage class of the object.
282 &quot;temporaryHold&quot;: True or False, # Whether an object is under temporary hold. While this flag is set to true, the object is protected against deletion and overwrites. A common use case of this flag is regulatory investigations where objects need to be retained while the investigation is ongoing. Note that unlike event-based hold, temporary hold does not impact retention expiration time of an object.
283 &quot;timeCreated&quot;: &quot;A String&quot;, # The creation time of the object in RFC 3339 format.
284 &quot;timeDeleted&quot;: &quot;A String&quot;, # The time at which the object became noncurrent in RFC 3339 format. Will be returned if and only if this version of the object has been deleted.
285 &quot;timeFinalized&quot;: &quot;A String&quot;, # The time when the object was finalized.
286 &quot;timeStorageClassUpdated&quot;: &quot;A String&quot;, # The time at which the object&#x27;s storage class was last changed. When the object is initially created, it will be set to timeCreated.
287 &quot;updated&quot;: &quot;A String&quot;, # The modification time of the object metadata in RFC 3339 format. Set initially to object creation time and then updated whenever any metadata of the object changes. This includes changes made by a requester, such as modifying custom metadata, as well as changes made by Cloud Storage on behalf of a requester, such as changing the storage class based on an Object Lifecycle Configuration.
288 },
289 &quot;kind&quot;: &quot;storage#composeRequest&quot;, # The kind of item this is.
290 &quot;sourceObjects&quot;: [ # The list of source objects that will be concatenated into a single object.
291 {
292 &quot;generation&quot;: &quot;A String&quot;, # The generation of this object to use as the source.
293 &quot;name&quot;: &quot;A String&quot;, # The source object&#x27;s name. All source objects must reside in the same bucket.
294 &quot;objectPreconditions&quot;: { # Conditions that must be met for this operation to execute.
295 &quot;ifGenerationMatch&quot;: &quot;A String&quot;, # Only perform the composition if the generation of the source object that would be used matches this value. If this value and a generation are both specified, they must be the same value or the call will fail.
296 },
297 },
298 ],
299 }
300
301 destinationPredefinedAcl: string, Apply a predefined set of access controls to the destination object.
302 Allowed values
303 authenticatedRead - Object owner gets OWNER access, and allAuthenticatedUsers get READER access.
304 bucketOwnerFullControl - Object owner gets OWNER access, and project team owners get OWNER access.
305 bucketOwnerRead - Object owner gets OWNER access, and project team owners get READER access.
306 private - Object owner gets OWNER access.
307 projectPrivate - Object owner gets OWNER access, and project team members get access according to their roles.
308 publicRead - Object owner gets OWNER access, and allUsers get READER access.
309 dropContextGroups: string, Specifies which groups of Object Contexts from the source object(s) should be dropped from the destination object. (repeated)
310 ifGenerationMatch: string, Makes the operation conditional on whether the object&#x27;s current generation matches the given value. Setting to 0 makes the operation succeed only if there are no live versions of the object.
311 ifMetagenerationMatch: string, Makes the operation conditional on whether the object&#x27;s current metageneration matches the given value.
312 kmsKeyName: string, Resource name of the Cloud KMS key, of the form projects/my-project/locations/global/keyRings/my-kr/cryptoKeys/my-key, that will be used to encrypt the object. Overrides the object metadata&#x27;s kms_key_name value, if any.
313 userProject: string, The project to be billed for this request. Required for Requester Pays buckets.
314
315 Returns:
316 An object of the form:
317
318 { # An object.
319 &quot;acl&quot;: [ # Access controls on the object.
320 { # An access-control entry.
321 &quot;bucket&quot;: &quot;A String&quot;, # The name of the bucket.
322 &quot;domain&quot;: &quot;A String&quot;, # The domain associated with the entity, if any.
323 &quot;email&quot;: &quot;A String&quot;, # The email address associated with the entity, if any.
324 &quot;entity&quot;: &quot;A String&quot;, # The entity holding the permission, in one of the following forms:
325 # - user-userId
326 # - user-email
327 # - group-groupId
328 # - group-email
329 # - domain-domain
330 # - project-team-projectId
331 # - allUsers
332 # - allAuthenticatedUsers Examples:
333 # - The user [email protected] would be [email protected].
334 # - The group [email protected] would be [email protected].
335 # - To refer to all members of the Google Apps for Business domain example.com, the entity would be domain-example.com.
336 &quot;entityId&quot;: &quot;A String&quot;, # The ID for the entity, if any.
337 &quot;etag&quot;: &quot;A String&quot;, # HTTP 1.1 Entity tag for the access-control entry.
338 &quot;generation&quot;: &quot;A String&quot;, # The content generation of the object, if applied to an object.
339 &quot;id&quot;: &quot;A String&quot;, # The ID of the access-control entry.
340 &quot;kind&quot;: &quot;storage#objectAccessControl&quot;, # The kind of item this is. For object access control entries, this is always storage#objectAccessControl.
341 &quot;object&quot;: &quot;A String&quot;, # The name of the object, if applied to an object.
342 &quot;projectTeam&quot;: { # The project team associated with the entity, if any.
343 &quot;projectNumber&quot;: &quot;A String&quot;, # The project number.
344 &quot;team&quot;: &quot;A String&quot;, # The team.
345 },
346 &quot;role&quot;: &quot;A String&quot;, # The access permission for the entity.
347 &quot;selfLink&quot;: &quot;A String&quot;, # The link to this access-control entry.
348 },
349 ],
350 &quot;bucket&quot;: &quot;A String&quot;, # The name of the bucket containing this object.
351 &quot;cacheControl&quot;: &quot;A String&quot;, # Cache-Control directive for the object data. If omitted, and the object is accessible to all anonymous users, the default will be public, max-age=3600.
352 &quot;componentCount&quot;: 42, # Number of underlying components that make up this object. Components are accumulated by compose operations.
353 &quot;contentDisposition&quot;: &quot;A String&quot;, # Content-Disposition of the object data.
354 &quot;contentEncoding&quot;: &quot;A String&quot;, # Content-Encoding of the object data.
355 &quot;contentLanguage&quot;: &quot;A String&quot;, # Content-Language of the object data.
356 &quot;contentType&quot;: &quot;A String&quot;, # Content-Type of the object data. If an object is stored without a Content-Type, it is served as application/octet-stream.
357 &quot;contexts&quot;: { # User-defined or system-defined object contexts. Each object context is a key-payload pair, where the key provides the identification and the payload holds the associated value and additional metadata.
358 &quot;custom&quot;: { # User-defined object contexts.
359 &quot;a_key&quot;: { # The payload of a single user-defined object context. # A single user-defined object context.
360 &quot;createTime&quot;: &quot;A String&quot;, # The time at which the object context was created in RFC 3339 format.
361 &quot;updateTime&quot;: &quot;A String&quot;, # The time at which the object context was last updated in RFC 3339 format.
362 &quot;value&quot;: &quot;A String&quot;, # The value of the object context.
363 },
364 },
365 },
366 &quot;crc32c&quot;: &quot;A String&quot;, # CRC32c checksum, as described in RFC 4960, Appendix B; encoded using base64 in big-endian byte order. For more information about using the CRC32c checksum, see [Data Validation and Change Detection](https://cloud.google.com/storage/docs/data-validation).
367 &quot;customTime&quot;: &quot;A String&quot;, # A timestamp in RFC 3339 format specified by the user for an object.
368 &quot;customerEncryption&quot;: { # Metadata of customer-supplied encryption key, if the object is encrypted by such a key.
369 &quot;encryptionAlgorithm&quot;: &quot;A String&quot;, # The encryption algorithm.
370 &quot;keySha256&quot;: &quot;A String&quot;, # SHA256 hash value of the encryption key.
371 },
372 &quot;etag&quot;: &quot;A String&quot;, # HTTP 1.1 Entity tag for the object.
373 &quot;eventBasedHold&quot;: True or False, # Whether an object is under event-based hold. Event-based hold is a way to retain objects until an event occurs, which is signified by the hold&#x27;s release (i.e. this value is set to false). After being released (set to false), such objects will be subject to bucket-level retention (if any). One sample use case of this flag is for banks to hold loan documents for at least 3 years after loan is paid in full. Here, bucket-level retention is 3 years and the event is the loan being paid in full. In this example, these objects will be held intact for any number of years until the event has occurred (event-based hold on the object is released) and then 3 more years after that. That means retention duration of the objects begins from the moment event-based hold transitioned from true to false.
374 &quot;generation&quot;: &quot;A String&quot;, # The content generation of this object. Used for object versioning.
375 &quot;hardDeleteTime&quot;: &quot;A String&quot;, # This is the time (in the future) when the soft-deleted object will no longer be restorable. It is equal to the soft delete time plus the current soft delete retention duration of the bucket.
376 &quot;id&quot;: &quot;A String&quot;, # The ID of the object, including the bucket name, object name, and generation number.
377 &quot;kind&quot;: &quot;storage#object&quot;, # The kind of item this is. For objects, this is always storage#object.
378 &quot;kmsKeyName&quot;: &quot;A String&quot;, # Not currently supported. Specifying the parameter causes the request to fail with status code 400 - Bad Request.
379 &quot;md5Hash&quot;: &quot;A String&quot;, # MD5 hash of the data; encoded using base64. For more information about using the MD5 hash, see [Data Validation and Change Detection](https://cloud.google.com/storage/docs/data-validation).
380 &quot;mediaLink&quot;: &quot;A String&quot;, # Media download link.
381 &quot;metadata&quot;: { # User-provided metadata, in key/value pairs.
382 &quot;a_key&quot;: &quot;A String&quot;, # An individual metadata entry.
383 },
384 &quot;metageneration&quot;: &quot;A String&quot;, # The version of the metadata for this object at this generation. Used for preconditions and for detecting changes in metadata. A metageneration number is only meaningful in the context of a particular generation of a particular object.
385 &quot;name&quot;: &quot;A String&quot;, # The name of the object. Required if not specified by URL parameter.
386 &quot;owner&quot;: { # The owner of the object. This will always be the uploader of the object.
387 &quot;entity&quot;: &quot;A String&quot;, # The entity, in the form user-userId.
388 &quot;entityId&quot;: &quot;A String&quot;, # The ID for the entity.
389 },
390 &quot;restoreToken&quot;: &quot;A String&quot;, # Restore token used to differentiate deleted objects with the same name and generation. This field is only returned for deleted objects in hierarchical namespace buckets.
391 &quot;retention&quot;: { # A collection of object level retention parameters.
392 &quot;mode&quot;: &quot;A String&quot;, # The bucket&#x27;s object retention mode, can only be Unlocked or Locked.
393 &quot;retainUntilTime&quot;: &quot;A String&quot;, # A time in RFC 3339 format until which object retention protects this object.
394 },
395 &quot;retentionExpirationTime&quot;: &quot;A String&quot;, # A server-determined value that specifies the earliest time that the object&#x27;s retention period expires. This value is in RFC 3339 format. Note 1: This field is not provided for objects with an active event-based hold, since retention expiration is unknown until the hold is removed. Note 2: This value can be provided even when temporary hold is set (so that the user can reason about policy without having to first unset the temporary hold).
396 &quot;selfLink&quot;: &quot;A String&quot;, # The link to this object.
397 &quot;size&quot;: &quot;A String&quot;, # Content-Length of the data in bytes.
398 &quot;softDeleteTime&quot;: &quot;A String&quot;, # The time at which the object became soft-deleted in RFC 3339 format.
399 &quot;storageClass&quot;: &quot;A String&quot;, # Storage class of the object.
400 &quot;temporaryHold&quot;: True or False, # Whether an object is under temporary hold. While this flag is set to true, the object is protected against deletion and overwrites. A common use case of this flag is regulatory investigations where objects need to be retained while the investigation is ongoing. Note that unlike event-based hold, temporary hold does not impact retention expiration time of an object.
401 &quot;timeCreated&quot;: &quot;A String&quot;, # The creation time of the object in RFC 3339 format.
402 &quot;timeDeleted&quot;: &quot;A String&quot;, # The time at which the object became noncurrent in RFC 3339 format. Will be returned if and only if this version of the object has been deleted.
403 &quot;timeFinalized&quot;: &quot;A String&quot;, # The time when the object was finalized.
404 &quot;timeStorageClassUpdated&quot;: &quot;A String&quot;, # The time at which the object&#x27;s storage class was last changed. When the object is initially created, it will be set to timeCreated.
405 &quot;updated&quot;: &quot;A String&quot;, # The modification time of the object metadata in RFC 3339 format. Set initially to object creation time and then updated whenever any metadata of the object changes. This includes changes made by a requester, such as modifying custom metadata, as well as changes made by Cloud Storage on behalf of a requester, such as changing the storage class based on an Object Lifecycle Configuration.
406 }</pre>
407 </div>
408
409 <div class="method">
410 <code class="details" id="copy">copy(sourceBucket, sourceObject, destinationBucket, destinationObject, body=None, destinationKmsKeyName=None, destinationPredefinedAcl=None, ifGenerationMatch=None, ifGenerationNotMatch=None, ifMetagenerationMatch=None, ifMetagenerationNotMatch=None, ifSourceGenerationMatch=None, ifSourceGenerationNotMatch=None, ifSourceMetagenerationMatch=None, ifSourceMetagenerationNotMatch=None, projection=None, sourceGeneration=None, userProject=None)</code>
411 <pre>Copies a source object to a destination object. Optionally overrides metadata.
412
413 Args:
414 sourceBucket: string, Name of the bucket in which to find the source object. (required)
415 sourceObject: string, Name of the source object. For information about how to URL encode object names to be path safe, see [Encoding URI Path Parts](https://cloud.google.com/storage/docs/request-endpoints#encoding). (required)
416 destinationBucket: string, Name of the bucket in which to store the new object. Overrides the provided object metadata&#x27;s bucket value, if any.For information about how to URL encode object names to be path safe, see [Encoding URI Path Parts](https://cloud.google.com/storage/docs/request-endpoints#encoding). (required)
417 destinationObject: string, Name of the new object. Required when the object metadata is not otherwise provided. Overrides the object metadata&#x27;s name value, if any. (required)
418 body: object, The request body.
419 The object takes the form of:
420
421 { # An object.
422 &quot;acl&quot;: [ # Access controls on the object.
423 { # An access-control entry.
424 &quot;bucket&quot;: &quot;A String&quot;, # The name of the bucket.
425 &quot;domain&quot;: &quot;A String&quot;, # The domain associated with the entity, if any.
426 &quot;email&quot;: &quot;A String&quot;, # The email address associated with the entity, if any.
427 &quot;entity&quot;: &quot;A String&quot;, # The entity holding the permission, in one of the following forms:
428 # - user-userId
429 # - user-email
430 # - group-groupId
431 # - group-email
432 # - domain-domain
433 # - project-team-projectId
434 # - allUsers
435 # - allAuthenticatedUsers Examples:
436 # - The user [email protected] would be [email protected].
437 # - The group [email protected] would be [email protected].
438 # - To refer to all members of the Google Apps for Business domain example.com, the entity would be domain-example.com.
439 &quot;entityId&quot;: &quot;A String&quot;, # The ID for the entity, if any.
440 &quot;etag&quot;: &quot;A String&quot;, # HTTP 1.1 Entity tag for the access-control entry.
441 &quot;generation&quot;: &quot;A String&quot;, # The content generation of the object, if applied to an object.
442 &quot;id&quot;: &quot;A String&quot;, # The ID of the access-control entry.
443 &quot;kind&quot;: &quot;storage#objectAccessControl&quot;, # The kind of item this is. For object access control entries, this is always storage#objectAccessControl.
444 &quot;object&quot;: &quot;A String&quot;, # The name of the object, if applied to an object.
445 &quot;projectTeam&quot;: { # The project team associated with the entity, if any.
446 &quot;projectNumber&quot;: &quot;A String&quot;, # The project number.
447 &quot;team&quot;: &quot;A String&quot;, # The team.
448 },
449 &quot;role&quot;: &quot;A String&quot;, # The access permission for the entity.
450 &quot;selfLink&quot;: &quot;A String&quot;, # The link to this access-control entry.
451 },
452 ],
453 &quot;bucket&quot;: &quot;A String&quot;, # The name of the bucket containing this object.
454 &quot;cacheControl&quot;: &quot;A String&quot;, # Cache-Control directive for the object data. If omitted, and the object is accessible to all anonymous users, the default will be public, max-age=3600.
455 &quot;componentCount&quot;: 42, # Number of underlying components that make up this object. Components are accumulated by compose operations.
456 &quot;contentDisposition&quot;: &quot;A String&quot;, # Content-Disposition of the object data.
457 &quot;contentEncoding&quot;: &quot;A String&quot;, # Content-Encoding of the object data.
458 &quot;contentLanguage&quot;: &quot;A String&quot;, # Content-Language of the object data.
459 &quot;contentType&quot;: &quot;A String&quot;, # Content-Type of the object data. If an object is stored without a Content-Type, it is served as application/octet-stream.
460 &quot;contexts&quot;: { # User-defined or system-defined object contexts. Each object context is a key-payload pair, where the key provides the identification and the payload holds the associated value and additional metadata.
461 &quot;custom&quot;: { # User-defined object contexts.
462 &quot;a_key&quot;: { # The payload of a single user-defined object context. # A single user-defined object context.
463 &quot;createTime&quot;: &quot;A String&quot;, # The time at which the object context was created in RFC 3339 format.
464 &quot;updateTime&quot;: &quot;A String&quot;, # The time at which the object context was last updated in RFC 3339 format.
465 &quot;value&quot;: &quot;A String&quot;, # The value of the object context.
466 },
467 },
468 },
469 &quot;crc32c&quot;: &quot;A String&quot;, # CRC32c checksum, as described in RFC 4960, Appendix B; encoded using base64 in big-endian byte order. For more information about using the CRC32c checksum, see [Data Validation and Change Detection](https://cloud.google.com/storage/docs/data-validation).
470 &quot;customTime&quot;: &quot;A String&quot;, # A timestamp in RFC 3339 format specified by the user for an object.
471 &quot;customerEncryption&quot;: { # Metadata of customer-supplied encryption key, if the object is encrypted by such a key.
472 &quot;encryptionAlgorithm&quot;: &quot;A String&quot;, # The encryption algorithm.
473 &quot;keySha256&quot;: &quot;A String&quot;, # SHA256 hash value of the encryption key.
474 },
475 &quot;etag&quot;: &quot;A String&quot;, # HTTP 1.1 Entity tag for the object.
476 &quot;eventBasedHold&quot;: True or False, # Whether an object is under event-based hold. Event-based hold is a way to retain objects until an event occurs, which is signified by the hold&#x27;s release (i.e. this value is set to false). After being released (set to false), such objects will be subject to bucket-level retention (if any). One sample use case of this flag is for banks to hold loan documents for at least 3 years after loan is paid in full. Here, bucket-level retention is 3 years and the event is the loan being paid in full. In this example, these objects will be held intact for any number of years until the event has occurred (event-based hold on the object is released) and then 3 more years after that. That means retention duration of the objects begins from the moment event-based hold transitioned from true to false.
477 &quot;generation&quot;: &quot;A String&quot;, # The content generation of this object. Used for object versioning.
478 &quot;hardDeleteTime&quot;: &quot;A String&quot;, # This is the time (in the future) when the soft-deleted object will no longer be restorable. It is equal to the soft delete time plus the current soft delete retention duration of the bucket.
479 &quot;id&quot;: &quot;A String&quot;, # The ID of the object, including the bucket name, object name, and generation number.
480 &quot;kind&quot;: &quot;storage#object&quot;, # The kind of item this is. For objects, this is always storage#object.
481 &quot;kmsKeyName&quot;: &quot;A String&quot;, # Not currently supported. Specifying the parameter causes the request to fail with status code 400 - Bad Request.
482 &quot;md5Hash&quot;: &quot;A String&quot;, # MD5 hash of the data; encoded using base64. For more information about using the MD5 hash, see [Data Validation and Change Detection](https://cloud.google.com/storage/docs/data-validation).
483 &quot;mediaLink&quot;: &quot;A String&quot;, # Media download link.
484 &quot;metadata&quot;: { # User-provided metadata, in key/value pairs.
485 &quot;a_key&quot;: &quot;A String&quot;, # An individual metadata entry.
486 },
487 &quot;metageneration&quot;: &quot;A String&quot;, # The version of the metadata for this object at this generation. Used for preconditions and for detecting changes in metadata. A metageneration number is only meaningful in the context of a particular generation of a particular object.
488 &quot;name&quot;: &quot;A String&quot;, # The name of the object. Required if not specified by URL parameter.
489 &quot;owner&quot;: { # The owner of the object. This will always be the uploader of the object.
490 &quot;entity&quot;: &quot;A String&quot;, # The entity, in the form user-userId.
491 &quot;entityId&quot;: &quot;A String&quot;, # The ID for the entity.
492 },
493 &quot;restoreToken&quot;: &quot;A String&quot;, # Restore token used to differentiate deleted objects with the same name and generation. This field is only returned for deleted objects in hierarchical namespace buckets.
494 &quot;retention&quot;: { # A collection of object level retention parameters.
495 &quot;mode&quot;: &quot;A String&quot;, # The bucket&#x27;s object retention mode, can only be Unlocked or Locked.
496 &quot;retainUntilTime&quot;: &quot;A String&quot;, # A time in RFC 3339 format until which object retention protects this object.
497 },
498 &quot;retentionExpirationTime&quot;: &quot;A String&quot;, # A server-determined value that specifies the earliest time that the object&#x27;s retention period expires. This value is in RFC 3339 format. Note 1: This field is not provided for objects with an active event-based hold, since retention expiration is unknown until the hold is removed. Note 2: This value can be provided even when temporary hold is set (so that the user can reason about policy without having to first unset the temporary hold).
499 &quot;selfLink&quot;: &quot;A String&quot;, # The link to this object.
500 &quot;size&quot;: &quot;A String&quot;, # Content-Length of the data in bytes.
501 &quot;softDeleteTime&quot;: &quot;A String&quot;, # The time at which the object became soft-deleted in RFC 3339 format.
502 &quot;storageClass&quot;: &quot;A String&quot;, # Storage class of the object.
503 &quot;temporaryHold&quot;: True or False, # Whether an object is under temporary hold. While this flag is set to true, the object is protected against deletion and overwrites. A common use case of this flag is regulatory investigations where objects need to be retained while the investigation is ongoing. Note that unlike event-based hold, temporary hold does not impact retention expiration time of an object.
504 &quot;timeCreated&quot;: &quot;A String&quot;, # The creation time of the object in RFC 3339 format.
505 &quot;timeDeleted&quot;: &quot;A String&quot;, # The time at which the object became noncurrent in RFC 3339 format. Will be returned if and only if this version of the object has been deleted.
506 &quot;timeFinalized&quot;: &quot;A String&quot;, # The time when the object was finalized.
507 &quot;timeStorageClassUpdated&quot;: &quot;A String&quot;, # The time at which the object&#x27;s storage class was last changed. When the object is initially created, it will be set to timeCreated.
508 &quot;updated&quot;: &quot;A String&quot;, # The modification time of the object metadata in RFC 3339 format. Set initially to object creation time and then updated whenever any metadata of the object changes. This includes changes made by a requester, such as modifying custom metadata, as well as changes made by Cloud Storage on behalf of a requester, such as changing the storage class based on an Object Lifecycle Configuration.
509 }
510
511 destinationKmsKeyName: string, Resource name of the Cloud KMS key, of the form projects/my-project/locations/global/keyRings/my-kr/cryptoKeys/my-key, that will be used to encrypt the object. Overrides the object metadata&#x27;s kms_key_name value, if any.
512 destinationPredefinedAcl: string, Apply a predefined set of access controls to the destination object.
513 Allowed values
514 authenticatedRead - Object owner gets OWNER access, and allAuthenticatedUsers get READER access.
515 bucketOwnerFullControl - Object owner gets OWNER access, and project team owners get OWNER access.
516 bucketOwnerRead - Object owner gets OWNER access, and project team owners get READER access.
517 private - Object owner gets OWNER access.
518 projectPrivate - Object owner gets OWNER access, and project team members get access according to their roles.
519 publicRead - Object owner gets OWNER access, and allUsers get READER access.
520 ifGenerationMatch: string, Makes the operation conditional on whether the destination object&#x27;s current generation matches the given value. Setting to 0 makes the operation succeed only if there are no live versions of the object.
521 ifGenerationNotMatch: string, Makes the operation conditional on whether the destination object&#x27;s current generation does not match the given value. If no live object exists, the precondition fails. Setting to 0 makes the operation succeed only if there is a live version of the object.
522 ifMetagenerationMatch: string, Makes the operation conditional on whether the destination object&#x27;s current metageneration matches the given value.
523 ifMetagenerationNotMatch: string, Makes the operation conditional on whether the destination object&#x27;s current metageneration does not match the given value.
524 ifSourceGenerationMatch: string, Makes the operation conditional on whether the source object&#x27;s current generation matches the given value.
525 ifSourceGenerationNotMatch: string, Makes the operation conditional on whether the source object&#x27;s current generation does not match the given value.
526 ifSourceMetagenerationMatch: string, Makes the operation conditional on whether the source object&#x27;s current metageneration matches the given value.
527 ifSourceMetagenerationNotMatch: string, Makes the operation conditional on whether the source object&#x27;s current metageneration does not match the given value.
528 projection: string, Set of properties to return. Defaults to noAcl, unless the object resource specifies the acl property, when it defaults to full.
529 Allowed values
530 full - Include all properties.
531 noAcl - Omit the owner, acl property.
532 sourceGeneration: string, If present, selects a specific revision of the source object (as opposed to the latest version, the default).
533 userProject: string, The project to be billed for this request. Required for Requester Pays buckets.
534
535 Returns:
536 An object of the form:
537
538 { # An object.
539 &quot;acl&quot;: [ # Access controls on the object.
540 { # An access-control entry.
541 &quot;bucket&quot;: &quot;A String&quot;, # The name of the bucket.
542 &quot;domain&quot;: &quot;A String&quot;, # The domain associated with the entity, if any.
543 &quot;email&quot;: &quot;A String&quot;, # The email address associated with the entity, if any.
544 &quot;entity&quot;: &quot;A String&quot;, # The entity holding the permission, in one of the following forms:
545 # - user-userId
546 # - user-email
547 # - group-groupId
548 # - group-email
549 # - domain-domain
550 # - project-team-projectId
551 # - allUsers
552 # - allAuthenticatedUsers Examples:
553 # - The user [email protected] would be [email protected].
554 # - The group [email protected] would be [email protected].
555 # - To refer to all members of the Google Apps for Business domain example.com, the entity would be domain-example.com.
556 &quot;entityId&quot;: &quot;A String&quot;, # The ID for the entity, if any.
557 &quot;etag&quot;: &quot;A String&quot;, # HTTP 1.1 Entity tag for the access-control entry.
558 &quot;generation&quot;: &quot;A String&quot;, # The content generation of the object, if applied to an object.
559 &quot;id&quot;: &quot;A String&quot;, # The ID of the access-control entry.
560 &quot;kind&quot;: &quot;storage#objectAccessControl&quot;, # The kind of item this is. For object access control entries, this is always storage#objectAccessControl.
561 &quot;object&quot;: &quot;A String&quot;, # The name of the object, if applied to an object.
562 &quot;projectTeam&quot;: { # The project team associated with the entity, if any.
563 &quot;projectNumber&quot;: &quot;A String&quot;, # The project number.
564 &quot;team&quot;: &quot;A String&quot;, # The team.
565 },
566 &quot;role&quot;: &quot;A String&quot;, # The access permission for the entity.
567 &quot;selfLink&quot;: &quot;A String&quot;, # The link to this access-control entry.
568 },
569 ],
570 &quot;bucket&quot;: &quot;A String&quot;, # The name of the bucket containing this object.
571 &quot;cacheControl&quot;: &quot;A String&quot;, # Cache-Control directive for the object data. If omitted, and the object is accessible to all anonymous users, the default will be public, max-age=3600.
572 &quot;componentCount&quot;: 42, # Number of underlying components that make up this object. Components are accumulated by compose operations.
573 &quot;contentDisposition&quot;: &quot;A String&quot;, # Content-Disposition of the object data.
574 &quot;contentEncoding&quot;: &quot;A String&quot;, # Content-Encoding of the object data.
575 &quot;contentLanguage&quot;: &quot;A String&quot;, # Content-Language of the object data.
576 &quot;contentType&quot;: &quot;A String&quot;, # Content-Type of the object data. If an object is stored without a Content-Type, it is served as application/octet-stream.
577 &quot;contexts&quot;: { # User-defined or system-defined object contexts. Each object context is a key-payload pair, where the key provides the identification and the payload holds the associated value and additional metadata.
578 &quot;custom&quot;: { # User-defined object contexts.
579 &quot;a_key&quot;: { # The payload of a single user-defined object context. # A single user-defined object context.
580 &quot;createTime&quot;: &quot;A String&quot;, # The time at which the object context was created in RFC 3339 format.
581 &quot;updateTime&quot;: &quot;A String&quot;, # The time at which the object context was last updated in RFC 3339 format.
582 &quot;value&quot;: &quot;A String&quot;, # The value of the object context.
583 },
584 },
585 },
586 &quot;crc32c&quot;: &quot;A String&quot;, # CRC32c checksum, as described in RFC 4960, Appendix B; encoded using base64 in big-endian byte order. For more information about using the CRC32c checksum, see [Data Validation and Change Detection](https://cloud.google.com/storage/docs/data-validation).
587 &quot;customTime&quot;: &quot;A String&quot;, # A timestamp in RFC 3339 format specified by the user for an object.
588 &quot;customerEncryption&quot;: { # Metadata of customer-supplied encryption key, if the object is encrypted by such a key.
589 &quot;encryptionAlgorithm&quot;: &quot;A String&quot;, # The encryption algorithm.
590 &quot;keySha256&quot;: &quot;A String&quot;, # SHA256 hash value of the encryption key.
591 },
592 &quot;etag&quot;: &quot;A String&quot;, # HTTP 1.1 Entity tag for the object.
593 &quot;eventBasedHold&quot;: True or False, # Whether an object is under event-based hold. Event-based hold is a way to retain objects until an event occurs, which is signified by the hold&#x27;s release (i.e. this value is set to false). After being released (set to false), such objects will be subject to bucket-level retention (if any). One sample use case of this flag is for banks to hold loan documents for at least 3 years after loan is paid in full. Here, bucket-level retention is 3 years and the event is the loan being paid in full. In this example, these objects will be held intact for any number of years until the event has occurred (event-based hold on the object is released) and then 3 more years after that. That means retention duration of the objects begins from the moment event-based hold transitioned from true to false.
594 &quot;generation&quot;: &quot;A String&quot;, # The content generation of this object. Used for object versioning.
595 &quot;hardDeleteTime&quot;: &quot;A String&quot;, # This is the time (in the future) when the soft-deleted object will no longer be restorable. It is equal to the soft delete time plus the current soft delete retention duration of the bucket.
596 &quot;id&quot;: &quot;A String&quot;, # The ID of the object, including the bucket name, object name, and generation number.
597 &quot;kind&quot;: &quot;storage#object&quot;, # The kind of item this is. For objects, this is always storage#object.
598 &quot;kmsKeyName&quot;: &quot;A String&quot;, # Not currently supported. Specifying the parameter causes the request to fail with status code 400 - Bad Request.
599 &quot;md5Hash&quot;: &quot;A String&quot;, # MD5 hash of the data; encoded using base64. For more information about using the MD5 hash, see [Data Validation and Change Detection](https://cloud.google.com/storage/docs/data-validation).
600 &quot;mediaLink&quot;: &quot;A String&quot;, # Media download link.
601 &quot;metadata&quot;: { # User-provided metadata, in key/value pairs.
602 &quot;a_key&quot;: &quot;A String&quot;, # An individual metadata entry.
603 },
604 &quot;metageneration&quot;: &quot;A String&quot;, # The version of the metadata for this object at this generation. Used for preconditions and for detecting changes in metadata. A metageneration number is only meaningful in the context of a particular generation of a particular object.
605 &quot;name&quot;: &quot;A String&quot;, # The name of the object. Required if not specified by URL parameter.
606 &quot;owner&quot;: { # The owner of the object. This will always be the uploader of the object.
607 &quot;entity&quot;: &quot;A String&quot;, # The entity, in the form user-userId.
608 &quot;entityId&quot;: &quot;A String&quot;, # The ID for the entity.
609 },
610 &quot;restoreToken&quot;: &quot;A String&quot;, # Restore token used to differentiate deleted objects with the same name and generation. This field is only returned for deleted objects in hierarchical namespace buckets.
611 &quot;retention&quot;: { # A collection of object level retention parameters.
612 &quot;mode&quot;: &quot;A String&quot;, # The bucket&#x27;s object retention mode, can only be Unlocked or Locked.
613 &quot;retainUntilTime&quot;: &quot;A String&quot;, # A time in RFC 3339 format until which object retention protects this object.
614 },
615 &quot;retentionExpirationTime&quot;: &quot;A String&quot;, # A server-determined value that specifies the earliest time that the object&#x27;s retention period expires. This value is in RFC 3339 format. Note 1: This field is not provided for objects with an active event-based hold, since retention expiration is unknown until the hold is removed. Note 2: This value can be provided even when temporary hold is set (so that the user can reason about policy without having to first unset the temporary hold).
616 &quot;selfLink&quot;: &quot;A String&quot;, # The link to this object.
617 &quot;size&quot;: &quot;A String&quot;, # Content-Length of the data in bytes.
618 &quot;softDeleteTime&quot;: &quot;A String&quot;, # The time at which the object became soft-deleted in RFC 3339 format.
619 &quot;storageClass&quot;: &quot;A String&quot;, # Storage class of the object.
620 &quot;temporaryHold&quot;: True or False, # Whether an object is under temporary hold. While this flag is set to true, the object is protected against deletion and overwrites. A common use case of this flag is regulatory investigations where objects need to be retained while the investigation is ongoing. Note that unlike event-based hold, temporary hold does not impact retention expiration time of an object.
621 &quot;timeCreated&quot;: &quot;A String&quot;, # The creation time of the object in RFC 3339 format.
622 &quot;timeDeleted&quot;: &quot;A String&quot;, # The time at which the object became noncurrent in RFC 3339 format. Will be returned if and only if this version of the object has been deleted.
623 &quot;timeFinalized&quot;: &quot;A String&quot;, # The time when the object was finalized.
624 &quot;timeStorageClassUpdated&quot;: &quot;A String&quot;, # The time at which the object&#x27;s storage class was last changed. When the object is initially created, it will be set to timeCreated.
625 &quot;updated&quot;: &quot;A String&quot;, # The modification time of the object metadata in RFC 3339 format. Set initially to object creation time and then updated whenever any metadata of the object changes. This includes changes made by a requester, such as modifying custom metadata, as well as changes made by Cloud Storage on behalf of a requester, such as changing the storage class based on an Object Lifecycle Configuration.
626 }</pre>
627 </div>
628
629 <div class="method">
630 <code class="details" id="delete">delete(bucket, object, generation=None, ifGenerationMatch=None, ifGenerationNotMatch=None, ifMetagenerationMatch=None, ifMetagenerationNotMatch=None, userProject=None)</code>
631 <pre>Deletes an object and its metadata. Deletions are permanent if versioning is not enabled for the bucket, or if the generation parameter is used.
632
633 Args:
634 bucket: string, Name of the bucket in which the object resides. (required)
635 object: string, Name of the object. For information about how to URL encode object names to be path safe, see [Encoding URI Path Parts](https://cloud.google.com/storage/docs/request-endpoints#encoding). (required)
636 generation: string, If present, permanently deletes a specific revision of this object (as opposed to the latest version, the default).
637 ifGenerationMatch: string, Makes the operation conditional on whether the object&#x27;s current generation matches the given value. Setting to 0 makes the operation succeed only if there are no live versions of the object.
638 ifGenerationNotMatch: string, Makes the operation conditional on whether the object&#x27;s current generation does not match the given value. If no live object exists, the precondition fails. Setting to 0 makes the operation succeed only if there is a live version of the object.
639 ifMetagenerationMatch: string, Makes the operation conditional on whether the object&#x27;s current metageneration matches the given value.
640 ifMetagenerationNotMatch: string, Makes the operation conditional on whether the object&#x27;s current metageneration does not match the given value.
641 userProject: string, The project to be billed for this request. Required for Requester Pays buckets.
642 </pre>
643 </div>
644
645 <div class="method">
646 <code class="details" id="get">get(bucket, object, generation=None, ifGenerationMatch=None, ifGenerationNotMatch=None, ifMetagenerationMatch=None, ifMetagenerationNotMatch=None, projection=None, restoreToken=None, softDeleted=None, userProject=None)</code>
647 <pre>Retrieves an object or its metadata.
648
649 Args:
650 bucket: string, Name of the bucket in which the object resides. (required)
651 object: string, Name of the object. For information about how to URL encode object names to be path safe, see [Encoding URI Path Parts](https://cloud.google.com/storage/docs/request-endpoints#encoding). (required)
652 generation: string, If present, selects a specific revision of this object (as opposed to the latest version, the default).
653 ifGenerationMatch: string, Makes the operation conditional on whether the object&#x27;s current generation matches the given value. Setting to 0 makes the operation succeed only if there are no live versions of the object.
654 ifGenerationNotMatch: string, Makes the operation conditional on whether the object&#x27;s current generation does not match the given value. If no live object exists, the precondition fails. Setting to 0 makes the operation succeed only if there is a live version of the object.
655 ifMetagenerationMatch: string, Makes the operation conditional on whether the object&#x27;s current metageneration matches the given value.
656 ifMetagenerationNotMatch: string, Makes the operation conditional on whether the object&#x27;s current metageneration does not match the given value.
657 projection: string, Set of properties to return. Defaults to noAcl.
658 Allowed values
659 full - Include all properties.
660 noAcl - Omit the owner, acl property.
661 restoreToken: string, Restore token used to differentiate soft-deleted objects with the same name and generation. Only applicable for hierarchical namespace buckets and if softDeleted is set to true. This parameter is optional, and is only required in the rare case when there are multiple soft-deleted objects with the same name and generation.
662 softDeleted: boolean, If true, only soft-deleted object versions will be listed. The default is false. For more information, see [Soft Delete](https://cloud.google.com/storage/docs/soft-delete).
663 userProject: string, The project to be billed for this request. Required for Requester Pays buckets.
664
665 Returns:
666 An object of the form:
667
668 { # An object.
669 &quot;acl&quot;: [ # Access controls on the object.
670 { # An access-control entry.
671 &quot;bucket&quot;: &quot;A String&quot;, # The name of the bucket.
672 &quot;domain&quot;: &quot;A String&quot;, # The domain associated with the entity, if any.
673 &quot;email&quot;: &quot;A String&quot;, # The email address associated with the entity, if any.
674 &quot;entity&quot;: &quot;A String&quot;, # The entity holding the permission, in one of the following forms:
675 # - user-userId
676 # - user-email
677 # - group-groupId
678 # - group-email
679 # - domain-domain
680 # - project-team-projectId
681 # - allUsers
682 # - allAuthenticatedUsers Examples:
683 # - The user [email protected] would be [email protected].
684 # - The group [email protected] would be [email protected].
685 # - To refer to all members of the Google Apps for Business domain example.com, the entity would be domain-example.com.
686 &quot;entityId&quot;: &quot;A String&quot;, # The ID for the entity, if any.
687 &quot;etag&quot;: &quot;A String&quot;, # HTTP 1.1 Entity tag for the access-control entry.
688 &quot;generation&quot;: &quot;A String&quot;, # The content generation of the object, if applied to an object.
689 &quot;id&quot;: &quot;A String&quot;, # The ID of the access-control entry.
690 &quot;kind&quot;: &quot;storage#objectAccessControl&quot;, # The kind of item this is. For object access control entries, this is always storage#objectAccessControl.
691 &quot;object&quot;: &quot;A String&quot;, # The name of the object, if applied to an object.
692 &quot;projectTeam&quot;: { # The project team associated with the entity, if any.
693 &quot;projectNumber&quot;: &quot;A String&quot;, # The project number.
694 &quot;team&quot;: &quot;A String&quot;, # The team.
695 },
696 &quot;role&quot;: &quot;A String&quot;, # The access permission for the entity.
697 &quot;selfLink&quot;: &quot;A String&quot;, # The link to this access-control entry.
698 },
699 ],
700 &quot;bucket&quot;: &quot;A String&quot;, # The name of the bucket containing this object.
701 &quot;cacheControl&quot;: &quot;A String&quot;, # Cache-Control directive for the object data. If omitted, and the object is accessible to all anonymous users, the default will be public, max-age=3600.
702 &quot;componentCount&quot;: 42, # Number of underlying components that make up this object. Components are accumulated by compose operations.
703 &quot;contentDisposition&quot;: &quot;A String&quot;, # Content-Disposition of the object data.
704 &quot;contentEncoding&quot;: &quot;A String&quot;, # Content-Encoding of the object data.
705 &quot;contentLanguage&quot;: &quot;A String&quot;, # Content-Language of the object data.
706 &quot;contentType&quot;: &quot;A String&quot;, # Content-Type of the object data. If an object is stored without a Content-Type, it is served as application/octet-stream.
707 &quot;contexts&quot;: { # User-defined or system-defined object contexts. Each object context is a key-payload pair, where the key provides the identification and the payload holds the associated value and additional metadata.
708 &quot;custom&quot;: { # User-defined object contexts.
709 &quot;a_key&quot;: { # The payload of a single user-defined object context. # A single user-defined object context.
710 &quot;createTime&quot;: &quot;A String&quot;, # The time at which the object context was created in RFC 3339 format.
711 &quot;updateTime&quot;: &quot;A String&quot;, # The time at which the object context was last updated in RFC 3339 format.
712 &quot;value&quot;: &quot;A String&quot;, # The value of the object context.
713 },
714 },
715 },
716 &quot;crc32c&quot;: &quot;A String&quot;, # CRC32c checksum, as described in RFC 4960, Appendix B; encoded using base64 in big-endian byte order. For more information about using the CRC32c checksum, see [Data Validation and Change Detection](https://cloud.google.com/storage/docs/data-validation).
717 &quot;customTime&quot;: &quot;A String&quot;, # A timestamp in RFC 3339 format specified by the user for an object.
718 &quot;customerEncryption&quot;: { # Metadata of customer-supplied encryption key, if the object is encrypted by such a key.
719 &quot;encryptionAlgorithm&quot;: &quot;A String&quot;, # The encryption algorithm.
720 &quot;keySha256&quot;: &quot;A String&quot;, # SHA256 hash value of the encryption key.
721 },
722 &quot;etag&quot;: &quot;A String&quot;, # HTTP 1.1 Entity tag for the object.
723 &quot;eventBasedHold&quot;: True or False, # Whether an object is under event-based hold. Event-based hold is a way to retain objects until an event occurs, which is signified by the hold&#x27;s release (i.e. this value is set to false). After being released (set to false), such objects will be subject to bucket-level retention (if any). One sample use case of this flag is for banks to hold loan documents for at least 3 years after loan is paid in full. Here, bucket-level retention is 3 years and the event is the loan being paid in full. In this example, these objects will be held intact for any number of years until the event has occurred (event-based hold on the object is released) and then 3 more years after that. That means retention duration of the objects begins from the moment event-based hold transitioned from true to false.
724 &quot;generation&quot;: &quot;A String&quot;, # The content generation of this object. Used for object versioning.
725 &quot;hardDeleteTime&quot;: &quot;A String&quot;, # This is the time (in the future) when the soft-deleted object will no longer be restorable. It is equal to the soft delete time plus the current soft delete retention duration of the bucket.
726 &quot;id&quot;: &quot;A String&quot;, # The ID of the object, including the bucket name, object name, and generation number.
727 &quot;kind&quot;: &quot;storage#object&quot;, # The kind of item this is. For objects, this is always storage#object.
728 &quot;kmsKeyName&quot;: &quot;A String&quot;, # Not currently supported. Specifying the parameter causes the request to fail with status code 400 - Bad Request.
729 &quot;md5Hash&quot;: &quot;A String&quot;, # MD5 hash of the data; encoded using base64. For more information about using the MD5 hash, see [Data Validation and Change Detection](https://cloud.google.com/storage/docs/data-validation).
730 &quot;mediaLink&quot;: &quot;A String&quot;, # Media download link.
731 &quot;metadata&quot;: { # User-provided metadata, in key/value pairs.
732 &quot;a_key&quot;: &quot;A String&quot;, # An individual metadata entry.
733 },
734 &quot;metageneration&quot;: &quot;A String&quot;, # The version of the metadata for this object at this generation. Used for preconditions and for detecting changes in metadata. A metageneration number is only meaningful in the context of a particular generation of a particular object.
735 &quot;name&quot;: &quot;A String&quot;, # The name of the object. Required if not specified by URL parameter.
736 &quot;owner&quot;: { # The owner of the object. This will always be the uploader of the object.
737 &quot;entity&quot;: &quot;A String&quot;, # The entity, in the form user-userId.
738 &quot;entityId&quot;: &quot;A String&quot;, # The ID for the entity.
739 },
740 &quot;restoreToken&quot;: &quot;A String&quot;, # Restore token used to differentiate deleted objects with the same name and generation. This field is only returned for deleted objects in hierarchical namespace buckets.
741 &quot;retention&quot;: { # A collection of object level retention parameters.
742 &quot;mode&quot;: &quot;A String&quot;, # The bucket&#x27;s object retention mode, can only be Unlocked or Locked.
743 &quot;retainUntilTime&quot;: &quot;A String&quot;, # A time in RFC 3339 format until which object retention protects this object.
744 },
745 &quot;retentionExpirationTime&quot;: &quot;A String&quot;, # A server-determined value that specifies the earliest time that the object&#x27;s retention period expires. This value is in RFC 3339 format. Note 1: This field is not provided for objects with an active event-based hold, since retention expiration is unknown until the hold is removed. Note 2: This value can be provided even when temporary hold is set (so that the user can reason about policy without having to first unset the temporary hold).
746 &quot;selfLink&quot;: &quot;A String&quot;, # The link to this object.
747 &quot;size&quot;: &quot;A String&quot;, # Content-Length of the data in bytes.
748 &quot;softDeleteTime&quot;: &quot;A String&quot;, # The time at which the object became soft-deleted in RFC 3339 format.
749 &quot;storageClass&quot;: &quot;A String&quot;, # Storage class of the object.
750 &quot;temporaryHold&quot;: True or False, # Whether an object is under temporary hold. While this flag is set to true, the object is protected against deletion and overwrites. A common use case of this flag is regulatory investigations where objects need to be retained while the investigation is ongoing. Note that unlike event-based hold, temporary hold does not impact retention expiration time of an object.
751 &quot;timeCreated&quot;: &quot;A String&quot;, # The creation time of the object in RFC 3339 format.
752 &quot;timeDeleted&quot;: &quot;A String&quot;, # The time at which the object became noncurrent in RFC 3339 format. Will be returned if and only if this version of the object has been deleted.
753 &quot;timeFinalized&quot;: &quot;A String&quot;, # The time when the object was finalized.
754 &quot;timeStorageClassUpdated&quot;: &quot;A String&quot;, # The time at which the object&#x27;s storage class was last changed. When the object is initially created, it will be set to timeCreated.
755 &quot;updated&quot;: &quot;A String&quot;, # The modification time of the object metadata in RFC 3339 format. Set initially to object creation time and then updated whenever any metadata of the object changes. This includes changes made by a requester, such as modifying custom metadata, as well as changes made by Cloud Storage on behalf of a requester, such as changing the storage class based on an Object Lifecycle Configuration.
756 }</pre>
757 </div>
758
759 <div class="method">
760 <code class="details" id="getIamPolicy">getIamPolicy(bucket, object, generation=None, userProject=None)</code>
761 <pre>Returns an IAM policy for the specified object.
762
763 Args:
764 bucket: string, Name of the bucket in which the object resides. (required)
765 object: string, Name of the object. For information about how to URL encode object names to be path safe, see [Encoding URI Path Parts](https://cloud.google.com/storage/docs/request-endpoints#encoding). (required)
766 generation: string, If present, selects a specific revision of this object (as opposed to the latest version, the default).
767 userProject: string, The project to be billed for this request. Required for Requester Pays buckets.
768
769 Returns:
770 An object of the form:
771
772 { # A bucket/object/managedFolder IAM policy.
773 &quot;bindings&quot;: [ # An association between a role, which comes with a set of permissions, and members who may assume that role.
774 {
775 &quot;condition&quot;: { # Represents an expression text. Example: title: &quot;User account presence&quot; description: &quot;Determines whether the request has a user account&quot; expression: &quot;size(request.user) &gt; 0&quot; # The condition that is associated with this binding. NOTE: an unsatisfied condition will not allow user access via current binding. Different bindings, including their conditions, are examined independently.
776 &quot;description&quot;: &quot;A String&quot;, # An optional description of the expression. This is a longer text which describes the expression, e.g. when hovered over it in a UI.
777 &quot;expression&quot;: &quot;A String&quot;, # Textual representation of an expression in Common Expression Language syntax. The application context of the containing message determines which well-known feature set of CEL is supported.
778 &quot;location&quot;: &quot;A String&quot;, # An optional string indicating the location of the expression for error reporting, e.g. a file name and a position in the file.
779 &quot;title&quot;: &quot;A String&quot;, # An optional title for the expression, i.e. a short string describing its purpose. This can be used e.g. in UIs which allow to enter the expression.
780 },
781 &quot;members&quot;: [ # A collection of identifiers for members who may assume the provided role. Recognized identifiers are as follows:
782 # - allUsers - A special identifier that represents anyone on the internet; with or without a Google account.
783 # - allAuthenticatedUsers - A special identifier that represents anyone who is authenticated with a Google account or a service account.
784 # - user:emailid - An email address that represents a specific account. For example, user:[email protected] or user:[email protected].
785 # - serviceAccount:emailid - An email address that represents a service account. For example, serviceAccount:[email protected] .
786 # - group:emailid - An email address that represents a Google group. For example, group:[email protected].
787 # - domain:domain - A Google Apps domain name that represents all the users of that domain. For example, domain:google.com or domain:example.com.
788 # - projectOwner:projectid - Owners of the given project. For example, projectOwner:my-example-project
789 # - projectEditor:projectid - Editors of the given project. For example, projectEditor:my-example-project
790 # - projectViewer:projectid - Viewers of the given project. For example, projectViewer:my-example-project
791 &quot;A String&quot;,
792 ],
793 &quot;role&quot;: &quot;A String&quot;, # The role to which members belong. Two types of roles are supported: new IAM roles, which grant permissions that do not map directly to those provided by ACLs, and legacy IAM roles, which do map directly to ACL permissions. All roles are of the format roles/storage.specificRole.
794 # The new IAM roles are:
795 # - roles/storage.admin - Full control of Google Cloud Storage resources.
796 # - roles/storage.objectViewer - Read-Only access to Google Cloud Storage objects.
797 # - roles/storage.objectCreator - Access to create objects in Google Cloud Storage.
798 # - roles/storage.objectAdmin - Full control of Google Cloud Storage objects. The legacy IAM roles are:
799 # - roles/storage.legacyObjectReader - Read-only access to objects without listing. Equivalent to an ACL entry on an object with the READER role.
800 # - roles/storage.legacyObjectOwner - Read/write access to existing objects without listing. Equivalent to an ACL entry on an object with the OWNER role.
801 # - roles/storage.legacyBucketReader - Read access to buckets with object listing. Equivalent to an ACL entry on a bucket with the READER role.
802 # - roles/storage.legacyBucketWriter - Read access to buckets with object listing/creation/deletion. Equivalent to an ACL entry on a bucket with the WRITER role.
803 # - roles/storage.legacyBucketOwner - Read and write access to existing buckets with object listing/creation/deletion. Equivalent to an ACL entry on a bucket with the OWNER role.
804 },
805 ],
806 &quot;etag&quot;: &quot;A String&quot;, # HTTP 1.1 Entity tag for the policy.
807 &quot;kind&quot;: &quot;storage#policy&quot;, # The kind of item this is. For policies, this is always storage#policy. This field is ignored on input.
808 &quot;resourceId&quot;: &quot;A String&quot;, # The ID of the resource to which this policy belongs. Will be of the form projects/_/buckets/bucket for buckets, projects/_/buckets/bucket/objects/object for objects, and projects/_/buckets/bucket/managedFolders/managedFolder. A specific generation may be specified by appending #generationNumber to the end of the object name, e.g. projects/_/buckets/my-bucket/objects/data.txt#17. The current generation can be denoted with #0. This field is ignored on input.
809 &quot;version&quot;: 42, # The IAM policy format version.
810 }</pre>
811 </div>
812
813 <div class="method">
814 <code class="details" id="get_media">get_media(bucket, object, generation=None, ifGenerationMatch=None, ifGenerationNotMatch=None, ifMetagenerationMatch=None, ifMetagenerationNotMatch=None, projection=None, restoreToken=None, softDeleted=None, userProject=None)</code>
815 <pre>Retrieves an object or its metadata.
816
817 Args:
818 bucket: string, Name of the bucket in which the object resides. (required)
819 object: string, Name of the object. For information about how to URL encode object names to be path safe, see [Encoding URI Path Parts](https://cloud.google.com/storage/docs/request-endpoints#encoding). (required)
820 generation: string, If present, selects a specific revision of this object (as opposed to the latest version, the default).
821 ifGenerationMatch: string, Makes the operation conditional on whether the object&#x27;s current generation matches the given value. Setting to 0 makes the operation succeed only if there are no live versions of the object.
822 ifGenerationNotMatch: string, Makes the operation conditional on whether the object&#x27;s current generation does not match the given value. If no live object exists, the precondition fails. Setting to 0 makes the operation succeed only if there is a live version of the object.
823 ifMetagenerationMatch: string, Makes the operation conditional on whether the object&#x27;s current metageneration matches the given value.
824 ifMetagenerationNotMatch: string, Makes the operation conditional on whether the object&#x27;s current metageneration does not match the given value.
825 projection: string, Set of properties to return. Defaults to noAcl.
826 Allowed values
827 full - Include all properties.
828 noAcl - Omit the owner, acl property.
829 restoreToken: string, Restore token used to differentiate soft-deleted objects with the same name and generation. Only applicable for hierarchical namespace buckets and if softDeleted is set to true. This parameter is optional, and is only required in the rare case when there are multiple soft-deleted objects with the same name and generation.
830 softDeleted: boolean, If true, only soft-deleted object versions will be listed. The default is false. For more information, see [Soft Delete](https://cloud.google.com/storage/docs/soft-delete).
831 userProject: string, The project to be billed for this request. Required for Requester Pays buckets.
832
833 Returns:
834 The media object as a string.
835
836 </pre>
837 </div>
838
839 <div class="method">
840 <code class="details" id="insert">insert(bucket, body=None, contentEncoding=None, ifGenerationMatch=None, ifGenerationNotMatch=None, ifMetagenerationMatch=None, ifMetagenerationNotMatch=None, kmsKeyName=None, media_body=None, media_mime_type=None, name=None, predefinedAcl=None, projection=None, userProject=None)</code>
841 <pre>Stores a new object and metadata.
842
843 Args:
844 bucket: string, Name of the bucket in which to store the new object. Overrides the provided object metadata&#x27;s bucket value, if any. (required)
845 body: object, The request body.
846 The object takes the form of:
847
848 { # An object.
849 &quot;acl&quot;: [ # Access controls on the object.
850 { # An access-control entry.
851 &quot;bucket&quot;: &quot;A String&quot;, # The name of the bucket.
852 &quot;domain&quot;: &quot;A String&quot;, # The domain associated with the entity, if any.
853 &quot;email&quot;: &quot;A String&quot;, # The email address associated with the entity, if any.
854 &quot;entity&quot;: &quot;A String&quot;, # The entity holding the permission, in one of the following forms:
855 # - user-userId
856 # - user-email
857 # - group-groupId
858 # - group-email
859 # - domain-domain
860 # - project-team-projectId
861 # - allUsers
862 # - allAuthenticatedUsers Examples:
863 # - The user [email protected] would be [email protected].
864 # - The group [email protected] would be [email protected].
865 # - To refer to all members of the Google Apps for Business domain example.com, the entity would be domain-example.com.
866 &quot;entityId&quot;: &quot;A String&quot;, # The ID for the entity, if any.
867 &quot;etag&quot;: &quot;A String&quot;, # HTTP 1.1 Entity tag for the access-control entry.
868 &quot;generation&quot;: &quot;A String&quot;, # The content generation of the object, if applied to an object.
869 &quot;id&quot;: &quot;A String&quot;, # The ID of the access-control entry.
870 &quot;kind&quot;: &quot;storage#objectAccessControl&quot;, # The kind of item this is. For object access control entries, this is always storage#objectAccessControl.
871 &quot;object&quot;: &quot;A String&quot;, # The name of the object, if applied to an object.
872 &quot;projectTeam&quot;: { # The project team associated with the entity, if any.
873 &quot;projectNumber&quot;: &quot;A String&quot;, # The project number.
874 &quot;team&quot;: &quot;A String&quot;, # The team.
875 },
876 &quot;role&quot;: &quot;A String&quot;, # The access permission for the entity.
877 &quot;selfLink&quot;: &quot;A String&quot;, # The link to this access-control entry.
878 },
879 ],
880 &quot;bucket&quot;: &quot;A String&quot;, # The name of the bucket containing this object.
881 &quot;cacheControl&quot;: &quot;A String&quot;, # Cache-Control directive for the object data. If omitted, and the object is accessible to all anonymous users, the default will be public, max-age=3600.
882 &quot;componentCount&quot;: 42, # Number of underlying components that make up this object. Components are accumulated by compose operations.
883 &quot;contentDisposition&quot;: &quot;A String&quot;, # Content-Disposition of the object data.
884 &quot;contentEncoding&quot;: &quot;A String&quot;, # Content-Encoding of the object data.
885 &quot;contentLanguage&quot;: &quot;A String&quot;, # Content-Language of the object data.
886 &quot;contentType&quot;: &quot;A String&quot;, # Content-Type of the object data. If an object is stored without a Content-Type, it is served as application/octet-stream.
887 &quot;contexts&quot;: { # User-defined or system-defined object contexts. Each object context is a key-payload pair, where the key provides the identification and the payload holds the associated value and additional metadata.
888 &quot;custom&quot;: { # User-defined object contexts.
889 &quot;a_key&quot;: { # The payload of a single user-defined object context. # A single user-defined object context.
890 &quot;createTime&quot;: &quot;A String&quot;, # The time at which the object context was created in RFC 3339 format.
891 &quot;updateTime&quot;: &quot;A String&quot;, # The time at which the object context was last updated in RFC 3339 format.
892 &quot;value&quot;: &quot;A String&quot;, # The value of the object context.
893 },
894 },
895 },
896 &quot;crc32c&quot;: &quot;A String&quot;, # CRC32c checksum, as described in RFC 4960, Appendix B; encoded using base64 in big-endian byte order. For more information about using the CRC32c checksum, see [Data Validation and Change Detection](https://cloud.google.com/storage/docs/data-validation).
897 &quot;customTime&quot;: &quot;A String&quot;, # A timestamp in RFC 3339 format specified by the user for an object.
898 &quot;customerEncryption&quot;: { # Metadata of customer-supplied encryption key, if the object is encrypted by such a key.
899 &quot;encryptionAlgorithm&quot;: &quot;A String&quot;, # The encryption algorithm.
900 &quot;keySha256&quot;: &quot;A String&quot;, # SHA256 hash value of the encryption key.
901 },
902 &quot;etag&quot;: &quot;A String&quot;, # HTTP 1.1 Entity tag for the object.
903 &quot;eventBasedHold&quot;: True or False, # Whether an object is under event-based hold. Event-based hold is a way to retain objects until an event occurs, which is signified by the hold&#x27;s release (i.e. this value is set to false). After being released (set to false), such objects will be subject to bucket-level retention (if any). One sample use case of this flag is for banks to hold loan documents for at least 3 years after loan is paid in full. Here, bucket-level retention is 3 years and the event is the loan being paid in full. In this example, these objects will be held intact for any number of years until the event has occurred (event-based hold on the object is released) and then 3 more years after that. That means retention duration of the objects begins from the moment event-based hold transitioned from true to false.
904 &quot;generation&quot;: &quot;A String&quot;, # The content generation of this object. Used for object versioning.
905 &quot;hardDeleteTime&quot;: &quot;A String&quot;, # This is the time (in the future) when the soft-deleted object will no longer be restorable. It is equal to the soft delete time plus the current soft delete retention duration of the bucket.
906 &quot;id&quot;: &quot;A String&quot;, # The ID of the object, including the bucket name, object name, and generation number.
907 &quot;kind&quot;: &quot;storage#object&quot;, # The kind of item this is. For objects, this is always storage#object.
908 &quot;kmsKeyName&quot;: &quot;A String&quot;, # Not currently supported. Specifying the parameter causes the request to fail with status code 400 - Bad Request.
909 &quot;md5Hash&quot;: &quot;A String&quot;, # MD5 hash of the data; encoded using base64. For more information about using the MD5 hash, see [Data Validation and Change Detection](https://cloud.google.com/storage/docs/data-validation).
910 &quot;mediaLink&quot;: &quot;A String&quot;, # Media download link.
911 &quot;metadata&quot;: { # User-provided metadata, in key/value pairs.
912 &quot;a_key&quot;: &quot;A String&quot;, # An individual metadata entry.
913 },
914 &quot;metageneration&quot;: &quot;A String&quot;, # The version of the metadata for this object at this generation. Used for preconditions and for detecting changes in metadata. A metageneration number is only meaningful in the context of a particular generation of a particular object.
915 &quot;name&quot;: &quot;A String&quot;, # The name of the object. Required if not specified by URL parameter.
916 &quot;owner&quot;: { # The owner of the object. This will always be the uploader of the object.
917 &quot;entity&quot;: &quot;A String&quot;, # The entity, in the form user-userId.
918 &quot;entityId&quot;: &quot;A String&quot;, # The ID for the entity.
919 },
920 &quot;restoreToken&quot;: &quot;A String&quot;, # Restore token used to differentiate deleted objects with the same name and generation. This field is only returned for deleted objects in hierarchical namespace buckets.
921 &quot;retention&quot;: { # A collection of object level retention parameters.
922 &quot;mode&quot;: &quot;A String&quot;, # The bucket&#x27;s object retention mode, can only be Unlocked or Locked.
923 &quot;retainUntilTime&quot;: &quot;A String&quot;, # A time in RFC 3339 format until which object retention protects this object.
924 },
925 &quot;retentionExpirationTime&quot;: &quot;A String&quot;, # A server-determined value that specifies the earliest time that the object&#x27;s retention period expires. This value is in RFC 3339 format. Note 1: This field is not provided for objects with an active event-based hold, since retention expiration is unknown until the hold is removed. Note 2: This value can be provided even when temporary hold is set (so that the user can reason about policy without having to first unset the temporary hold).
926 &quot;selfLink&quot;: &quot;A String&quot;, # The link to this object.
927 &quot;size&quot;: &quot;A String&quot;, # Content-Length of the data in bytes.
928 &quot;softDeleteTime&quot;: &quot;A String&quot;, # The time at which the object became soft-deleted in RFC 3339 format.
929 &quot;storageClass&quot;: &quot;A String&quot;, # Storage class of the object.
930 &quot;temporaryHold&quot;: True or False, # Whether an object is under temporary hold. While this flag is set to true, the object is protected against deletion and overwrites. A common use case of this flag is regulatory investigations where objects need to be retained while the investigation is ongoing. Note that unlike event-based hold, temporary hold does not impact retention expiration time of an object.
931 &quot;timeCreated&quot;: &quot;A String&quot;, # The creation time of the object in RFC 3339 format.
932 &quot;timeDeleted&quot;: &quot;A String&quot;, # The time at which the object became noncurrent in RFC 3339 format. Will be returned if and only if this version of the object has been deleted.
933 &quot;timeFinalized&quot;: &quot;A String&quot;, # The time when the object was finalized.
934 &quot;timeStorageClassUpdated&quot;: &quot;A String&quot;, # The time at which the object&#x27;s storage class was last changed. When the object is initially created, it will be set to timeCreated.
935 &quot;updated&quot;: &quot;A String&quot;, # The modification time of the object metadata in RFC 3339 format. Set initially to object creation time and then updated whenever any metadata of the object changes. This includes changes made by a requester, such as modifying custom metadata, as well as changes made by Cloud Storage on behalf of a requester, such as changing the storage class based on an Object Lifecycle Configuration.
936 }
937
938 contentEncoding: string, If set, sets the contentEncoding property of the final object to this value. Setting this parameter is equivalent to setting the contentEncoding metadata property. This can be useful when uploading an object with uploadType=media to indicate the encoding of the content being uploaded.
939 ifGenerationMatch: string, Makes the operation conditional on whether the object&#x27;s current generation matches the given value. Setting to 0 makes the operation succeed only if there are no live versions of the object.
940 ifGenerationNotMatch: string, Makes the operation conditional on whether the object&#x27;s current generation does not match the given value. If no live object exists, the precondition fails. Setting to 0 makes the operation succeed only if there is a live version of the object.
941 ifMetagenerationMatch: string, Makes the operation conditional on whether the object&#x27;s current metageneration matches the given value.
942 ifMetagenerationNotMatch: string, Makes the operation conditional on whether the object&#x27;s current metageneration does not match the given value.
943 kmsKeyName: string, Resource name of the Cloud KMS key, of the form projects/my-project/locations/global/keyRings/my-kr/cryptoKeys/my-key, that will be used to encrypt the object. Overrides the object metadata&#x27;s kms_key_name value, if any.
944 media_body: string, The filename of the media request body, or an instance of a MediaUpload object.
945 media_mime_type: string, The MIME type of the media request body, or an instance of a MediaUpload object.
946 name: string, Name of the object. Required when the object metadata is not otherwise provided. Overrides the object metadata&#x27;s name value, if any. For information about how to URL encode object names to be path safe, see [Encoding URI Path Parts](https://cloud.google.com/storage/docs/request-endpoints#encoding).
947 predefinedAcl: string, Apply a predefined set of access controls to this object.
948 Allowed values
949 authenticatedRead - Object owner gets OWNER access, and allAuthenticatedUsers get READER access.
950 bucketOwnerFullControl - Object owner gets OWNER access, and project team owners get OWNER access.
951 bucketOwnerRead - Object owner gets OWNER access, and project team owners get READER access.
952 private - Object owner gets OWNER access.
953 projectPrivate - Object owner gets OWNER access, and project team members get access according to their roles.
954 publicRead - Object owner gets OWNER access, and allUsers get READER access.
955 projection: string, Set of properties to return. Defaults to noAcl, unless the object resource specifies the acl property, when it defaults to full.
956 Allowed values
957 full - Include all properties.
958 noAcl - Omit the owner, acl property.
959 userProject: string, The project to be billed for this request. Required for Requester Pays buckets.
960
961 Returns:
962 An object of the form:
963
964 { # An object.
965 &quot;acl&quot;: [ # Access controls on the object.
966 { # An access-control entry.
967 &quot;bucket&quot;: &quot;A String&quot;, # The name of the bucket.
968 &quot;domain&quot;: &quot;A String&quot;, # The domain associated with the entity, if any.
969 &quot;email&quot;: &quot;A String&quot;, # The email address associated with the entity, if any.
970 &quot;entity&quot;: &quot;A String&quot;, # The entity holding the permission, in one of the following forms:
971 # - user-userId
972 # - user-email
973 # - group-groupId
974 # - group-email
975 # - domain-domain
976 # - project-team-projectId
977 # - allUsers
978 # - allAuthenticatedUsers Examples:
979 # - The user [email protected] would be [email protected].
980 # - The group [email protected] would be [email protected].
981 # - To refer to all members of the Google Apps for Business domain example.com, the entity would be domain-example.com.
982 &quot;entityId&quot;: &quot;A String&quot;, # The ID for the entity, if any.
983 &quot;etag&quot;: &quot;A String&quot;, # HTTP 1.1 Entity tag for the access-control entry.
984 &quot;generation&quot;: &quot;A String&quot;, # The content generation of the object, if applied to an object.
985 &quot;id&quot;: &quot;A String&quot;, # The ID of the access-control entry.
986 &quot;kind&quot;: &quot;storage#objectAccessControl&quot;, # The kind of item this is. For object access control entries, this is always storage#objectAccessControl.
987 &quot;object&quot;: &quot;A String&quot;, # The name of the object, if applied to an object.
988 &quot;projectTeam&quot;: { # The project team associated with the entity, if any.
989 &quot;projectNumber&quot;: &quot;A String&quot;, # The project number.
990 &quot;team&quot;: &quot;A String&quot;, # The team.
991 },
992 &quot;role&quot;: &quot;A String&quot;, # The access permission for the entity.
993 &quot;selfLink&quot;: &quot;A String&quot;, # The link to this access-control entry.
994 },
995 ],
996 &quot;bucket&quot;: &quot;A String&quot;, # The name of the bucket containing this object.
997 &quot;cacheControl&quot;: &quot;A String&quot;, # Cache-Control directive for the object data. If omitted, and the object is accessible to all anonymous users, the default will be public, max-age=3600.
998 &quot;componentCount&quot;: 42, # Number of underlying components that make up this object. Components are accumulated by compose operations.
999 &quot;contentDisposition&quot;: &quot;A String&quot;, # Content-Disposition of the object data.
1000 &quot;contentEncoding&quot;: &quot;A String&quot;, # Content-Encoding of the object data.
1001 &quot;contentLanguage&quot;: &quot;A String&quot;, # Content-Language of the object data.
1002 &quot;contentType&quot;: &quot;A String&quot;, # Content-Type of the object data. If an object is stored without a Content-Type, it is served as application/octet-stream.
1003 &quot;contexts&quot;: { # User-defined or system-defined object contexts. Each object context is a key-payload pair, where the key provides the identification and the payload holds the associated value and additional metadata.
1004 &quot;custom&quot;: { # User-defined object contexts.
1005 &quot;a_key&quot;: { # The payload of a single user-defined object context. # A single user-defined object context.
1006 &quot;createTime&quot;: &quot;A String&quot;, # The time at which the object context was created in RFC 3339 format.
1007 &quot;updateTime&quot;: &quot;A String&quot;, # The time at which the object context was last updated in RFC 3339 format.
1008 &quot;value&quot;: &quot;A String&quot;, # The value of the object context.
1009 },
1010 },
1011 },
1012 &quot;crc32c&quot;: &quot;A String&quot;, # CRC32c checksum, as described in RFC 4960, Appendix B; encoded using base64 in big-endian byte order. For more information about using the CRC32c checksum, see [Data Validation and Change Detection](https://cloud.google.com/storage/docs/data-validation).
1013 &quot;customTime&quot;: &quot;A String&quot;, # A timestamp in RFC 3339 format specified by the user for an object.
1014 &quot;customerEncryption&quot;: { # Metadata of customer-supplied encryption key, if the object is encrypted by such a key.
1015 &quot;encryptionAlgorithm&quot;: &quot;A String&quot;, # The encryption algorithm.
1016 &quot;keySha256&quot;: &quot;A String&quot;, # SHA256 hash value of the encryption key.
1017 },
1018 &quot;etag&quot;: &quot;A String&quot;, # HTTP 1.1 Entity tag for the object.
1019 &quot;eventBasedHold&quot;: True or False, # Whether an object is under event-based hold. Event-based hold is a way to retain objects until an event occurs, which is signified by the hold&#x27;s release (i.e. this value is set to false). After being released (set to false), such objects will be subject to bucket-level retention (if any). One sample use case of this flag is for banks to hold loan documents for at least 3 years after loan is paid in full. Here, bucket-level retention is 3 years and the event is the loan being paid in full. In this example, these objects will be held intact for any number of years until the event has occurred (event-based hold on the object is released) and then 3 more years after that. That means retention duration of the objects begins from the moment event-based hold transitioned from true to false.
1020 &quot;generation&quot;: &quot;A String&quot;, # The content generation of this object. Used for object versioning.
1021 &quot;hardDeleteTime&quot;: &quot;A String&quot;, # This is the time (in the future) when the soft-deleted object will no longer be restorable. It is equal to the soft delete time plus the current soft delete retention duration of the bucket.
1022 &quot;id&quot;: &quot;A String&quot;, # The ID of the object, including the bucket name, object name, and generation number.
1023 &quot;kind&quot;: &quot;storage#object&quot;, # The kind of item this is. For objects, this is always storage#object.
1024 &quot;kmsKeyName&quot;: &quot;A String&quot;, # Not currently supported. Specifying the parameter causes the request to fail with status code 400 - Bad Request.
1025 &quot;md5Hash&quot;: &quot;A String&quot;, # MD5 hash of the data; encoded using base64. For more information about using the MD5 hash, see [Data Validation and Change Detection](https://cloud.google.com/storage/docs/data-validation).
1026 &quot;mediaLink&quot;: &quot;A String&quot;, # Media download link.
1027 &quot;metadata&quot;: { # User-provided metadata, in key/value pairs.
1028 &quot;a_key&quot;: &quot;A String&quot;, # An individual metadata entry.
1029 },
1030 &quot;metageneration&quot;: &quot;A String&quot;, # The version of the metadata for this object at this generation. Used for preconditions and for detecting changes in metadata. A metageneration number is only meaningful in the context of a particular generation of a particular object.
1031 &quot;name&quot;: &quot;A String&quot;, # The name of the object. Required if not specified by URL parameter.
1032 &quot;owner&quot;: { # The owner of the object. This will always be the uploader of the object.
1033 &quot;entity&quot;: &quot;A String&quot;, # The entity, in the form user-userId.
1034 &quot;entityId&quot;: &quot;A String&quot;, # The ID for the entity.
1035 },
1036 &quot;restoreToken&quot;: &quot;A String&quot;, # Restore token used to differentiate deleted objects with the same name and generation. This field is only returned for deleted objects in hierarchical namespace buckets.
1037 &quot;retention&quot;: { # A collection of object level retention parameters.
1038 &quot;mode&quot;: &quot;A String&quot;, # The bucket&#x27;s object retention mode, can only be Unlocked or Locked.
1039 &quot;retainUntilTime&quot;: &quot;A String&quot;, # A time in RFC 3339 format until which object retention protects this object.
1040 },
1041 &quot;retentionExpirationTime&quot;: &quot;A String&quot;, # A server-determined value that specifies the earliest time that the object&#x27;s retention period expires. This value is in RFC 3339 format. Note 1: This field is not provided for objects with an active event-based hold, since retention expiration is unknown until the hold is removed. Note 2: This value can be provided even when temporary hold is set (so that the user can reason about policy without having to first unset the temporary hold).
1042 &quot;selfLink&quot;: &quot;A String&quot;, # The link to this object.
1043 &quot;size&quot;: &quot;A String&quot;, # Content-Length of the data in bytes.
1044 &quot;softDeleteTime&quot;: &quot;A String&quot;, # The time at which the object became soft-deleted in RFC 3339 format.
1045 &quot;storageClass&quot;: &quot;A String&quot;, # Storage class of the object.
1046 &quot;temporaryHold&quot;: True or False, # Whether an object is under temporary hold. While this flag is set to true, the object is protected against deletion and overwrites. A common use case of this flag is regulatory investigations where objects need to be retained while the investigation is ongoing. Note that unlike event-based hold, temporary hold does not impact retention expiration time of an object.
1047 &quot;timeCreated&quot;: &quot;A String&quot;, # The creation time of the object in RFC 3339 format.
1048 &quot;timeDeleted&quot;: &quot;A String&quot;, # The time at which the object became noncurrent in RFC 3339 format. Will be returned if and only if this version of the object has been deleted.
1049 &quot;timeFinalized&quot;: &quot;A String&quot;, # The time when the object was finalized.
1050 &quot;timeStorageClassUpdated&quot;: &quot;A String&quot;, # The time at which the object&#x27;s storage class was last changed. When the object is initially created, it will be set to timeCreated.
1051 &quot;updated&quot;: &quot;A String&quot;, # The modification time of the object metadata in RFC 3339 format. Set initially to object creation time and then updated whenever any metadata of the object changes. This includes changes made by a requester, such as modifying custom metadata, as well as changes made by Cloud Storage on behalf of a requester, such as changing the storage class based on an Object Lifecycle Configuration.
1052 }</pre>
1053 </div>
1054
1055 <div class="method">
1056 <code class="details" id="list">list(bucket, delimiter=None, endOffset=None, filter=None, includeFoldersAsPrefixes=None, includeTrailingDelimiter=None, matchGlob=None, maxResults=None, pageToken=None, prefix=None, projection=None, softDeleted=None, startOffset=None, userProject=None, versions=None)</code>
1057 <pre>Retrieves a list of objects matching the criteria.
1058
1059 Args:
1060 bucket: string, Name of the bucket in which to look for objects. (required)
1061 delimiter: string, Returns results in a directory-like mode. items will contain only objects whose names, aside from the prefix, do not contain delimiter. Objects whose names, aside from the prefix, contain delimiter will have their name, truncated after the delimiter, returned in prefixes. Duplicate prefixes are omitted.
1062 endOffset: string, Filter results to objects whose names are lexicographically before endOffset. If startOffset is also set, the objects listed will have names between startOffset (inclusive) and endOffset (exclusive).
1063 filter: string, Filter the returned objects. Currently only supported for the contexts field. If delimiter is set, the returned prefixes are exempt from this filter.
1064 includeFoldersAsPrefixes: boolean, Only applicable if delimiter is set to &#x27;/&#x27;. If true, will also include folders and managed folders (besides objects) in the returned prefixes.
1065 includeTrailingDelimiter: boolean, If true, objects that end in exactly one instance of delimiter will have their metadata included in items in addition to prefixes.
1066 matchGlob: string, Filter results to objects and prefixes that match this glob pattern.
1067 maxResults: integer, Maximum number of items plus prefixes to return in a single page of responses. As duplicate prefixes are omitted, fewer total results may be returned than requested. The service will use this parameter or 1,000 items, whichever is smaller.
1068 pageToken: string, A previously-returned page token representing part of the larger set of results to view.
1069 prefix: string, Filter results to objects whose names begin with this prefix.
1070 projection: string, Set of properties to return. Defaults to noAcl.
1071 Allowed values
1072 full - Include all properties.
1073 noAcl - Omit the owner, acl property.
1074 softDeleted: boolean, If true, only soft-deleted object versions will be listed. The default is false. For more information, see [Soft Delete](https://cloud.google.com/storage/docs/soft-delete).
1075 startOffset: string, Filter results to objects whose names are lexicographically equal to or after startOffset. If endOffset is also set, the objects listed will have names between startOffset (inclusive) and endOffset (exclusive).
1076 userProject: string, The project to be billed for this request. Required for Requester Pays buckets.
1077 versions: boolean, If true, lists all versions of an object as distinct results. The default is false. For more information, see [Object Versioning](https://cloud.google.com/storage/docs/object-versioning).
1078
1079 Returns:
1080 An object of the form:
1081
1082 { # A list of objects.
1083 &quot;items&quot;: [ # The list of items.
1084 { # An object.
1085 &quot;acl&quot;: [ # Access controls on the object.
1086 { # An access-control entry.
1087 &quot;bucket&quot;: &quot;A String&quot;, # The name of the bucket.
1088 &quot;domain&quot;: &quot;A String&quot;, # The domain associated with the entity, if any.
1089 &quot;email&quot;: &quot;A String&quot;, # The email address associated with the entity, if any.
1090 &quot;entity&quot;: &quot;A String&quot;, # The entity holding the permission, in one of the following forms:
1091 # - user-userId
1092 # - user-email
1093 # - group-groupId
1094 # - group-email
1095 # - domain-domain
1096 # - project-team-projectId
1097 # - allUsers
1098 # - allAuthenticatedUsers Examples:
1099 # - The user [email protected] would be [email protected].
1100 # - The group [email protected] would be [email protected].
1101 # - To refer to all members of the Google Apps for Business domain example.com, the entity would be domain-example.com.
1102 &quot;entityId&quot;: &quot;A String&quot;, # The ID for the entity, if any.
1103 &quot;etag&quot;: &quot;A String&quot;, # HTTP 1.1 Entity tag for the access-control entry.
1104 &quot;generation&quot;: &quot;A String&quot;, # The content generation of the object, if applied to an object.
1105 &quot;id&quot;: &quot;A String&quot;, # The ID of the access-control entry.
1106 &quot;kind&quot;: &quot;storage#objectAccessControl&quot;, # The kind of item this is. For object access control entries, this is always storage#objectAccessControl.
1107 &quot;object&quot;: &quot;A String&quot;, # The name of the object, if applied to an object.
1108 &quot;projectTeam&quot;: { # The project team associated with the entity, if any.
1109 &quot;projectNumber&quot;: &quot;A String&quot;, # The project number.
1110 &quot;team&quot;: &quot;A String&quot;, # The team.
1111 },
1112 &quot;role&quot;: &quot;A String&quot;, # The access permission for the entity.
1113 &quot;selfLink&quot;: &quot;A String&quot;, # The link to this access-control entry.
1114 },
1115 ],
1116 &quot;bucket&quot;: &quot;A String&quot;, # The name of the bucket containing this object.
1117 &quot;cacheControl&quot;: &quot;A String&quot;, # Cache-Control directive for the object data. If omitted, and the object is accessible to all anonymous users, the default will be public, max-age=3600.
1118 &quot;componentCount&quot;: 42, # Number of underlying components that make up this object. Components are accumulated by compose operations.
1119 &quot;contentDisposition&quot;: &quot;A String&quot;, # Content-Disposition of the object data.
1120 &quot;contentEncoding&quot;: &quot;A String&quot;, # Content-Encoding of the object data.
1121 &quot;contentLanguage&quot;: &quot;A String&quot;, # Content-Language of the object data.
1122 &quot;contentType&quot;: &quot;A String&quot;, # Content-Type of the object data. If an object is stored without a Content-Type, it is served as application/octet-stream.
1123 &quot;contexts&quot;: { # User-defined or system-defined object contexts. Each object context is a key-payload pair, where the key provides the identification and the payload holds the associated value and additional metadata.
1124 &quot;custom&quot;: { # User-defined object contexts.
1125 &quot;a_key&quot;: { # The payload of a single user-defined object context. # A single user-defined object context.
1126 &quot;createTime&quot;: &quot;A String&quot;, # The time at which the object context was created in RFC 3339 format.
1127 &quot;updateTime&quot;: &quot;A String&quot;, # The time at which the object context was last updated in RFC 3339 format.
1128 &quot;value&quot;: &quot;A String&quot;, # The value of the object context.
1129 },
1130 },
1131 },
1132 &quot;crc32c&quot;: &quot;A String&quot;, # CRC32c checksum, as described in RFC 4960, Appendix B; encoded using base64 in big-endian byte order. For more information about using the CRC32c checksum, see [Data Validation and Change Detection](https://cloud.google.com/storage/docs/data-validation).
1133 &quot;customTime&quot;: &quot;A String&quot;, # A timestamp in RFC 3339 format specified by the user for an object.
1134 &quot;customerEncryption&quot;: { # Metadata of customer-supplied encryption key, if the object is encrypted by such a key.
1135 &quot;encryptionAlgorithm&quot;: &quot;A String&quot;, # The encryption algorithm.
1136 &quot;keySha256&quot;: &quot;A String&quot;, # SHA256 hash value of the encryption key.
1137 },
1138 &quot;etag&quot;: &quot;A String&quot;, # HTTP 1.1 Entity tag for the object.
1139 &quot;eventBasedHold&quot;: True or False, # Whether an object is under event-based hold. Event-based hold is a way to retain objects until an event occurs, which is signified by the hold&#x27;s release (i.e. this value is set to false). After being released (set to false), such objects will be subject to bucket-level retention (if any). One sample use case of this flag is for banks to hold loan documents for at least 3 years after loan is paid in full. Here, bucket-level retention is 3 years and the event is the loan being paid in full. In this example, these objects will be held intact for any number of years until the event has occurred (event-based hold on the object is released) and then 3 more years after that. That means retention duration of the objects begins from the moment event-based hold transitioned from true to false.
1140 &quot;generation&quot;: &quot;A String&quot;, # The content generation of this object. Used for object versioning.
1141 &quot;hardDeleteTime&quot;: &quot;A String&quot;, # This is the time (in the future) when the soft-deleted object will no longer be restorable. It is equal to the soft delete time plus the current soft delete retention duration of the bucket.
1142 &quot;id&quot;: &quot;A String&quot;, # The ID of the object, including the bucket name, object name, and generation number.
1143 &quot;kind&quot;: &quot;storage#object&quot;, # The kind of item this is. For objects, this is always storage#object.
1144 &quot;kmsKeyName&quot;: &quot;A String&quot;, # Not currently supported. Specifying the parameter causes the request to fail with status code 400 - Bad Request.
1145 &quot;md5Hash&quot;: &quot;A String&quot;, # MD5 hash of the data; encoded using base64. For more information about using the MD5 hash, see [Data Validation and Change Detection](https://cloud.google.com/storage/docs/data-validation).
1146 &quot;mediaLink&quot;: &quot;A String&quot;, # Media download link.
1147 &quot;metadata&quot;: { # User-provided metadata, in key/value pairs.
1148 &quot;a_key&quot;: &quot;A String&quot;, # An individual metadata entry.
1149 },
1150 &quot;metageneration&quot;: &quot;A String&quot;, # The version of the metadata for this object at this generation. Used for preconditions and for detecting changes in metadata. A metageneration number is only meaningful in the context of a particular generation of a particular object.
1151 &quot;name&quot;: &quot;A String&quot;, # The name of the object. Required if not specified by URL parameter.
1152 &quot;owner&quot;: { # The owner of the object. This will always be the uploader of the object.
1153 &quot;entity&quot;: &quot;A String&quot;, # The entity, in the form user-userId.
1154 &quot;entityId&quot;: &quot;A String&quot;, # The ID for the entity.
1155 },
1156 &quot;restoreToken&quot;: &quot;A String&quot;, # Restore token used to differentiate deleted objects with the same name and generation. This field is only returned for deleted objects in hierarchical namespace buckets.
1157 &quot;retention&quot;: { # A collection of object level retention parameters.
1158 &quot;mode&quot;: &quot;A String&quot;, # The bucket&#x27;s object retention mode, can only be Unlocked or Locked.
1159 &quot;retainUntilTime&quot;: &quot;A String&quot;, # A time in RFC 3339 format until which object retention protects this object.
1160 },
1161 &quot;retentionExpirationTime&quot;: &quot;A String&quot;, # A server-determined value that specifies the earliest time that the object&#x27;s retention period expires. This value is in RFC 3339 format. Note 1: This field is not provided for objects with an active event-based hold, since retention expiration is unknown until the hold is removed. Note 2: This value can be provided even when temporary hold is set (so that the user can reason about policy without having to first unset the temporary hold).
1162 &quot;selfLink&quot;: &quot;A String&quot;, # The link to this object.
1163 &quot;size&quot;: &quot;A String&quot;, # Content-Length of the data in bytes.
1164 &quot;softDeleteTime&quot;: &quot;A String&quot;, # The time at which the object became soft-deleted in RFC 3339 format.
1165 &quot;storageClass&quot;: &quot;A String&quot;, # Storage class of the object.
1166 &quot;temporaryHold&quot;: True or False, # Whether an object is under temporary hold. While this flag is set to true, the object is protected against deletion and overwrites. A common use case of this flag is regulatory investigations where objects need to be retained while the investigation is ongoing. Note that unlike event-based hold, temporary hold does not impact retention expiration time of an object.
1167 &quot;timeCreated&quot;: &quot;A String&quot;, # The creation time of the object in RFC 3339 format.
1168 &quot;timeDeleted&quot;: &quot;A String&quot;, # The time at which the object became noncurrent in RFC 3339 format. Will be returned if and only if this version of the object has been deleted.
1169 &quot;timeFinalized&quot;: &quot;A String&quot;, # The time when the object was finalized.
1170 &quot;timeStorageClassUpdated&quot;: &quot;A String&quot;, # The time at which the object&#x27;s storage class was last changed. When the object is initially created, it will be set to timeCreated.
1171 &quot;updated&quot;: &quot;A String&quot;, # The modification time of the object metadata in RFC 3339 format. Set initially to object creation time and then updated whenever any metadata of the object changes. This includes changes made by a requester, such as modifying custom metadata, as well as changes made by Cloud Storage on behalf of a requester, such as changing the storage class based on an Object Lifecycle Configuration.
1172 },
1173 ],
1174 &quot;kind&quot;: &quot;storage#objects&quot;, # The kind of item this is. For lists of objects, this is always storage#objects.
1175 &quot;nextPageToken&quot;: &quot;A String&quot;, # The continuation token, used to page through large result sets. Provide this value in a subsequent request to return the next page of results.
1176 &quot;prefixes&quot;: [ # The list of prefixes of objects matching-but-not-listed up to and including the requested delimiter.
1177 &quot;A String&quot;,
1178 ],
1179 }</pre>
1180 </div>
1181
1182 <div class="method">
1183 <code class="details" id="list_next">list_next()</code>
1184 <pre>Retrieves the next page of results.
1185
1186 Args:
1187 previous_request: The request for the previous page. (required)
1188 previous_response: The response from the request for the previous page. (required)
1189
1190 Returns:
1191 A request object that you can call &#x27;execute()&#x27; on to request the next
1192 page. Returns None if there are no more items in the collection.
1193 </pre>
1194 </div>
1195
1196 <div class="method">
1197 <code class="details" id="move">move(bucket, sourceObject, destinationObject, ifGenerationMatch=None, ifGenerationNotMatch=None, ifMetagenerationMatch=None, ifMetagenerationNotMatch=None, ifSourceGenerationMatch=None, ifSourceGenerationNotMatch=None, ifSourceMetagenerationMatch=None, ifSourceMetagenerationNotMatch=None, projection=None, userProject=None)</code>
1198 <pre>Moves the source object to the destination object in the same bucket.
1199
1200 Args:
1201 bucket: string, Name of the bucket in which the object resides. (required)
1202 sourceObject: string, Name of the source object. For information about how to URL encode object names to be path safe, see [Encoding URI Path Parts](https://cloud.google.com/storage/docs/request-endpoints#encoding). (required)
1203 destinationObject: string, Name of the destination object. For information about how to URL encode object names to be path safe, see [Encoding URI Path Parts](https://cloud.google.com/storage/docs/request-endpoints#encoding). (required)
1204 ifGenerationMatch: string, Makes the operation conditional on whether the destination object&#x27;s current generation matches the given value. Setting to 0 makes the operation succeed only if there are no live versions of the object. `ifGenerationMatch` and `ifGenerationNotMatch` conditions are mutually exclusive: it&#x27;s an error for both of them to be set in the request.
1205 ifGenerationNotMatch: string, Makes the operation conditional on whether the destination object&#x27;s current generation does not match the given value. If no live object exists, the precondition fails. Setting to 0 makes the operation succeed only if there is a live version of the object.`ifGenerationMatch` and `ifGenerationNotMatch` conditions are mutually exclusive: it&#x27;s an error for both of them to be set in the request.
1206 ifMetagenerationMatch: string, Makes the operation conditional on whether the destination object&#x27;s current metageneration matches the given value. `ifMetagenerationMatch` and `ifMetagenerationNotMatch` conditions are mutually exclusive: it&#x27;s an error for both of them to be set in the request.
1207 ifMetagenerationNotMatch: string, Makes the operation conditional on whether the destination object&#x27;s current metageneration does not match the given value. `ifMetagenerationMatch` and `ifMetagenerationNotMatch` conditions are mutually exclusive: it&#x27;s an error for both of them to be set in the request.
1208 ifSourceGenerationMatch: string, Makes the operation conditional on whether the source object&#x27;s current generation matches the given value. `ifSourceGenerationMatch` and `ifSourceGenerationNotMatch` conditions are mutually exclusive: it&#x27;s an error for both of them to be set in the request.
1209 ifSourceGenerationNotMatch: string, Makes the operation conditional on whether the source object&#x27;s current generation does not match the given value. `ifSourceGenerationMatch` and `ifSourceGenerationNotMatch` conditions are mutually exclusive: it&#x27;s an error for both of them to be set in the request.
1210 ifSourceMetagenerationMatch: string, Makes the operation conditional on whether the source object&#x27;s current metageneration matches the given value. `ifSourceMetagenerationMatch` and `ifSourceMetagenerationNotMatch` conditions are mutually exclusive: it&#x27;s an error for both of them to be set in the request.
1211 ifSourceMetagenerationNotMatch: string, Makes the operation conditional on whether the source object&#x27;s current metageneration does not match the given value. `ifSourceMetagenerationMatch` and `ifSourceMetagenerationNotMatch` conditions are mutually exclusive: it&#x27;s an error for both of them to be set in the request.
1212 projection: string, Set of properties to return. Defaults to noAcl.
1213 Allowed values
1214 full - Include all properties.
1215 noAcl - Omit the owner, acl property.
1216 userProject: string, The project to be billed for this request. Required for Requester Pays buckets.
1217
1218 Returns:
1219 An object of the form:
1220
1221 { # An object.
1222 &quot;acl&quot;: [ # Access controls on the object.
1223 { # An access-control entry.
1224 &quot;bucket&quot;: &quot;A String&quot;, # The name of the bucket.
1225 &quot;domain&quot;: &quot;A String&quot;, # The domain associated with the entity, if any.
1226 &quot;email&quot;: &quot;A String&quot;, # The email address associated with the entity, if any.
1227 &quot;entity&quot;: &quot;A String&quot;, # The entity holding the permission, in one of the following forms:
1228 # - user-userId
1229 # - user-email
1230 # - group-groupId
1231 # - group-email
1232 # - domain-domain
1233 # - project-team-projectId
1234 # - allUsers
1235 # - allAuthenticatedUsers Examples:
1236 # - The user [email protected] would be [email protected].
1237 # - The group [email protected] would be [email protected].
1238 # - To refer to all members of the Google Apps for Business domain example.com, the entity would be domain-example.com.
1239 &quot;entityId&quot;: &quot;A String&quot;, # The ID for the entity, if any.
1240 &quot;etag&quot;: &quot;A String&quot;, # HTTP 1.1 Entity tag for the access-control entry.
1241 &quot;generation&quot;: &quot;A String&quot;, # The content generation of the object, if applied to an object.
1242 &quot;id&quot;: &quot;A String&quot;, # The ID of the access-control entry.
1243 &quot;kind&quot;: &quot;storage#objectAccessControl&quot;, # The kind of item this is. For object access control entries, this is always storage#objectAccessControl.
1244 &quot;object&quot;: &quot;A String&quot;, # The name of the object, if applied to an object.
1245 &quot;projectTeam&quot;: { # The project team associated with the entity, if any.
1246 &quot;projectNumber&quot;: &quot;A String&quot;, # The project number.
1247 &quot;team&quot;: &quot;A String&quot;, # The team.
1248 },
1249 &quot;role&quot;: &quot;A String&quot;, # The access permission for the entity.
1250 &quot;selfLink&quot;: &quot;A String&quot;, # The link to this access-control entry.
1251 },
1252 ],
1253 &quot;bucket&quot;: &quot;A String&quot;, # The name of the bucket containing this object.
1254 &quot;cacheControl&quot;: &quot;A String&quot;, # Cache-Control directive for the object data. If omitted, and the object is accessible to all anonymous users, the default will be public, max-age=3600.
1255 &quot;componentCount&quot;: 42, # Number of underlying components that make up this object. Components are accumulated by compose operations.
1256 &quot;contentDisposition&quot;: &quot;A String&quot;, # Content-Disposition of the object data.
1257 &quot;contentEncoding&quot;: &quot;A String&quot;, # Content-Encoding of the object data.
1258 &quot;contentLanguage&quot;: &quot;A String&quot;, # Content-Language of the object data.
1259 &quot;contentType&quot;: &quot;A String&quot;, # Content-Type of the object data. If an object is stored without a Content-Type, it is served as application/octet-stream.
1260 &quot;contexts&quot;: { # User-defined or system-defined object contexts. Each object context is a key-payload pair, where the key provides the identification and the payload holds the associated value and additional metadata.
1261 &quot;custom&quot;: { # User-defined object contexts.
1262 &quot;a_key&quot;: { # The payload of a single user-defined object context. # A single user-defined object context.
1263 &quot;createTime&quot;: &quot;A String&quot;, # The time at which the object context was created in RFC 3339 format.
1264 &quot;updateTime&quot;: &quot;A String&quot;, # The time at which the object context was last updated in RFC 3339 format.
1265 &quot;value&quot;: &quot;A String&quot;, # The value of the object context.
1266 },
1267 },
1268 },
1269 &quot;crc32c&quot;: &quot;A String&quot;, # CRC32c checksum, as described in RFC 4960, Appendix B; encoded using base64 in big-endian byte order. For more information about using the CRC32c checksum, see [Data Validation and Change Detection](https://cloud.google.com/storage/docs/data-validation).
1270 &quot;customTime&quot;: &quot;A String&quot;, # A timestamp in RFC 3339 format specified by the user for an object.
1271 &quot;customerEncryption&quot;: { # Metadata of customer-supplied encryption key, if the object is encrypted by such a key.
1272 &quot;encryptionAlgorithm&quot;: &quot;A String&quot;, # The encryption algorithm.
1273 &quot;keySha256&quot;: &quot;A String&quot;, # SHA256 hash value of the encryption key.
1274 },
1275 &quot;etag&quot;: &quot;A String&quot;, # HTTP 1.1 Entity tag for the object.
1276 &quot;eventBasedHold&quot;: True or False, # Whether an object is under event-based hold. Event-based hold is a way to retain objects until an event occurs, which is signified by the hold&#x27;s release (i.e. this value is set to false). After being released (set to false), such objects will be subject to bucket-level retention (if any). One sample use case of this flag is for banks to hold loan documents for at least 3 years after loan is paid in full. Here, bucket-level retention is 3 years and the event is the loan being paid in full. In this example, these objects will be held intact for any number of years until the event has occurred (event-based hold on the object is released) and then 3 more years after that. That means retention duration of the objects begins from the moment event-based hold transitioned from true to false.
1277 &quot;generation&quot;: &quot;A String&quot;, # The content generation of this object. Used for object versioning.
1278 &quot;hardDeleteTime&quot;: &quot;A String&quot;, # This is the time (in the future) when the soft-deleted object will no longer be restorable. It is equal to the soft delete time plus the current soft delete retention duration of the bucket.
1279 &quot;id&quot;: &quot;A String&quot;, # The ID of the object, including the bucket name, object name, and generation number.
1280 &quot;kind&quot;: &quot;storage#object&quot;, # The kind of item this is. For objects, this is always storage#object.
1281 &quot;kmsKeyName&quot;: &quot;A String&quot;, # Not currently supported. Specifying the parameter causes the request to fail with status code 400 - Bad Request.
1282 &quot;md5Hash&quot;: &quot;A String&quot;, # MD5 hash of the data; encoded using base64. For more information about using the MD5 hash, see [Data Validation and Change Detection](https://cloud.google.com/storage/docs/data-validation).
1283 &quot;mediaLink&quot;: &quot;A String&quot;, # Media download link.
1284 &quot;metadata&quot;: { # User-provided metadata, in key/value pairs.
1285 &quot;a_key&quot;: &quot;A String&quot;, # An individual metadata entry.
1286 },
1287 &quot;metageneration&quot;: &quot;A String&quot;, # The version of the metadata for this object at this generation. Used for preconditions and for detecting changes in metadata. A metageneration number is only meaningful in the context of a particular generation of a particular object.
1288 &quot;name&quot;: &quot;A String&quot;, # The name of the object. Required if not specified by URL parameter.
1289 &quot;owner&quot;: { # The owner of the object. This will always be the uploader of the object.
1290 &quot;entity&quot;: &quot;A String&quot;, # The entity, in the form user-userId.
1291 &quot;entityId&quot;: &quot;A String&quot;, # The ID for the entity.
1292 },
1293 &quot;restoreToken&quot;: &quot;A String&quot;, # Restore token used to differentiate deleted objects with the same name and generation. This field is only returned for deleted objects in hierarchical namespace buckets.
1294 &quot;retention&quot;: { # A collection of object level retention parameters.
1295 &quot;mode&quot;: &quot;A String&quot;, # The bucket&#x27;s object retention mode, can only be Unlocked or Locked.
1296 &quot;retainUntilTime&quot;: &quot;A String&quot;, # A time in RFC 3339 format until which object retention protects this object.
1297 },
1298 &quot;retentionExpirationTime&quot;: &quot;A String&quot;, # A server-determined value that specifies the earliest time that the object&#x27;s retention period expires. This value is in RFC 3339 format. Note 1: This field is not provided for objects with an active event-based hold, since retention expiration is unknown until the hold is removed. Note 2: This value can be provided even when temporary hold is set (so that the user can reason about policy without having to first unset the temporary hold).
1299 &quot;selfLink&quot;: &quot;A String&quot;, # The link to this object.
1300 &quot;size&quot;: &quot;A String&quot;, # Content-Length of the data in bytes.
1301 &quot;softDeleteTime&quot;: &quot;A String&quot;, # The time at which the object became soft-deleted in RFC 3339 format.
1302 &quot;storageClass&quot;: &quot;A String&quot;, # Storage class of the object.
1303 &quot;temporaryHold&quot;: True or False, # Whether an object is under temporary hold. While this flag is set to true, the object is protected against deletion and overwrites. A common use case of this flag is regulatory investigations where objects need to be retained while the investigation is ongoing. Note that unlike event-based hold, temporary hold does not impact retention expiration time of an object.
1304 &quot;timeCreated&quot;: &quot;A String&quot;, # The creation time of the object in RFC 3339 format.
1305 &quot;timeDeleted&quot;: &quot;A String&quot;, # The time at which the object became noncurrent in RFC 3339 format. Will be returned if and only if this version of the object has been deleted.
1306 &quot;timeFinalized&quot;: &quot;A String&quot;, # The time when the object was finalized.
1307 &quot;timeStorageClassUpdated&quot;: &quot;A String&quot;, # The time at which the object&#x27;s storage class was last changed. When the object is initially created, it will be set to timeCreated.
1308 &quot;updated&quot;: &quot;A String&quot;, # The modification time of the object metadata in RFC 3339 format. Set initially to object creation time and then updated whenever any metadata of the object changes. This includes changes made by a requester, such as modifying custom metadata, as well as changes made by Cloud Storage on behalf of a requester, such as changing the storage class based on an Object Lifecycle Configuration.
1309 }</pre>
1310 </div>
1311
1312 <div class="method">
1313 <code class="details" id="patch">patch(bucket, object, body=None, generation=None, ifGenerationMatch=None, ifGenerationNotMatch=None, ifMetagenerationMatch=None, ifMetagenerationNotMatch=None, overrideUnlockedRetention=None, predefinedAcl=None, projection=None, userProject=None)</code>
1314 <pre>Patches an object&#x27;s metadata.
1315
1316 Args:
1317 bucket: string, Name of the bucket in which the object resides. (required)
1318 object: string, Name of the object. For information about how to URL encode object names to be path safe, see [Encoding URI Path Parts](https://cloud.google.com/storage/docs/request-endpoints#encoding). (required)
1319 body: object, The request body.
1320 The object takes the form of:
1321
1322 { # An object.
1323 &quot;acl&quot;: [ # Access controls on the object.
1324 { # An access-control entry.
1325 &quot;bucket&quot;: &quot;A String&quot;, # The name of the bucket.
1326 &quot;domain&quot;: &quot;A String&quot;, # The domain associated with the entity, if any.
1327 &quot;email&quot;: &quot;A String&quot;, # The email address associated with the entity, if any.
1328 &quot;entity&quot;: &quot;A String&quot;, # The entity holding the permission, in one of the following forms:
1329 # - user-userId
1330 # - user-email
1331 # - group-groupId
1332 # - group-email
1333 # - domain-domain
1334 # - project-team-projectId
1335 # - allUsers
1336 # - allAuthenticatedUsers Examples:
1337 # - The user [email protected] would be [email protected].
1338 # - The group [email protected] would be [email protected].
1339 # - To refer to all members of the Google Apps for Business domain example.com, the entity would be domain-example.com.
1340 &quot;entityId&quot;: &quot;A String&quot;, # The ID for the entity, if any.
1341 &quot;etag&quot;: &quot;A String&quot;, # HTTP 1.1 Entity tag for the access-control entry.
1342 &quot;generation&quot;: &quot;A String&quot;, # The content generation of the object, if applied to an object.
1343 &quot;id&quot;: &quot;A String&quot;, # The ID of the access-control entry.
1344 &quot;kind&quot;: &quot;storage#objectAccessControl&quot;, # The kind of item this is. For object access control entries, this is always storage#objectAccessControl.
1345 &quot;object&quot;: &quot;A String&quot;, # The name of the object, if applied to an object.
1346 &quot;projectTeam&quot;: { # The project team associated with the entity, if any.
1347 &quot;projectNumber&quot;: &quot;A String&quot;, # The project number.
1348 &quot;team&quot;: &quot;A String&quot;, # The team.
1349 },
1350 &quot;role&quot;: &quot;A String&quot;, # The access permission for the entity.
1351 &quot;selfLink&quot;: &quot;A String&quot;, # The link to this access-control entry.
1352 },
1353 ],
1354 &quot;bucket&quot;: &quot;A String&quot;, # The name of the bucket containing this object.
1355 &quot;cacheControl&quot;: &quot;A String&quot;, # Cache-Control directive for the object data. If omitted, and the object is accessible to all anonymous users, the default will be public, max-age=3600.
1356 &quot;componentCount&quot;: 42, # Number of underlying components that make up this object. Components are accumulated by compose operations.
1357 &quot;contentDisposition&quot;: &quot;A String&quot;, # Content-Disposition of the object data.
1358 &quot;contentEncoding&quot;: &quot;A String&quot;, # Content-Encoding of the object data.
1359 &quot;contentLanguage&quot;: &quot;A String&quot;, # Content-Language of the object data.
1360 &quot;contentType&quot;: &quot;A String&quot;, # Content-Type of the object data. If an object is stored without a Content-Type, it is served as application/octet-stream.
1361 &quot;contexts&quot;: { # User-defined or system-defined object contexts. Each object context is a key-payload pair, where the key provides the identification and the payload holds the associated value and additional metadata.
1362 &quot;custom&quot;: { # User-defined object contexts.
1363 &quot;a_key&quot;: { # The payload of a single user-defined object context. # A single user-defined object context.
1364 &quot;createTime&quot;: &quot;A String&quot;, # The time at which the object context was created in RFC 3339 format.
1365 &quot;updateTime&quot;: &quot;A String&quot;, # The time at which the object context was last updated in RFC 3339 format.
1366 &quot;value&quot;: &quot;A String&quot;, # The value of the object context.
1367 },
1368 },
1369 },
1370 &quot;crc32c&quot;: &quot;A String&quot;, # CRC32c checksum, as described in RFC 4960, Appendix B; encoded using base64 in big-endian byte order. For more information about using the CRC32c checksum, see [Data Validation and Change Detection](https://cloud.google.com/storage/docs/data-validation).
1371 &quot;customTime&quot;: &quot;A String&quot;, # A timestamp in RFC 3339 format specified by the user for an object.
1372 &quot;customerEncryption&quot;: { # Metadata of customer-supplied encryption key, if the object is encrypted by such a key.
1373 &quot;encryptionAlgorithm&quot;: &quot;A String&quot;, # The encryption algorithm.
1374 &quot;keySha256&quot;: &quot;A String&quot;, # SHA256 hash value of the encryption key.
1375 },
1376 &quot;etag&quot;: &quot;A String&quot;, # HTTP 1.1 Entity tag for the object.
1377 &quot;eventBasedHold&quot;: True or False, # Whether an object is under event-based hold. Event-based hold is a way to retain objects until an event occurs, which is signified by the hold&#x27;s release (i.e. this value is set to false). After being released (set to false), such objects will be subject to bucket-level retention (if any). One sample use case of this flag is for banks to hold loan documents for at least 3 years after loan is paid in full. Here, bucket-level retention is 3 years and the event is the loan being paid in full. In this example, these objects will be held intact for any number of years until the event has occurred (event-based hold on the object is released) and then 3 more years after that. That means retention duration of the objects begins from the moment event-based hold transitioned from true to false.
1378 &quot;generation&quot;: &quot;A String&quot;, # The content generation of this object. Used for object versioning.
1379 &quot;hardDeleteTime&quot;: &quot;A String&quot;, # This is the time (in the future) when the soft-deleted object will no longer be restorable. It is equal to the soft delete time plus the current soft delete retention duration of the bucket.
1380 &quot;id&quot;: &quot;A String&quot;, # The ID of the object, including the bucket name, object name, and generation number.
1381 &quot;kind&quot;: &quot;storage#object&quot;, # The kind of item this is. For objects, this is always storage#object.
1382 &quot;kmsKeyName&quot;: &quot;A String&quot;, # Not currently supported. Specifying the parameter causes the request to fail with status code 400 - Bad Request.
1383 &quot;md5Hash&quot;: &quot;A String&quot;, # MD5 hash of the data; encoded using base64. For more information about using the MD5 hash, see [Data Validation and Change Detection](https://cloud.google.com/storage/docs/data-validation).
1384 &quot;mediaLink&quot;: &quot;A String&quot;, # Media download link.
1385 &quot;metadata&quot;: { # User-provided metadata, in key/value pairs.
1386 &quot;a_key&quot;: &quot;A String&quot;, # An individual metadata entry.
1387 },
1388 &quot;metageneration&quot;: &quot;A String&quot;, # The version of the metadata for this object at this generation. Used for preconditions and for detecting changes in metadata. A metageneration number is only meaningful in the context of a particular generation of a particular object.
1389 &quot;name&quot;: &quot;A String&quot;, # The name of the object. Required if not specified by URL parameter.
1390 &quot;owner&quot;: { # The owner of the object. This will always be the uploader of the object.
1391 &quot;entity&quot;: &quot;A String&quot;, # The entity, in the form user-userId.
1392 &quot;entityId&quot;: &quot;A String&quot;, # The ID for the entity.
1393 },
1394 &quot;restoreToken&quot;: &quot;A String&quot;, # Restore token used to differentiate deleted objects with the same name and generation. This field is only returned for deleted objects in hierarchical namespace buckets.
1395 &quot;retention&quot;: { # A collection of object level retention parameters.
1396 &quot;mode&quot;: &quot;A String&quot;, # The bucket&#x27;s object retention mode, can only be Unlocked or Locked.
1397 &quot;retainUntilTime&quot;: &quot;A String&quot;, # A time in RFC 3339 format until which object retention protects this object.
1398 },
1399 &quot;retentionExpirationTime&quot;: &quot;A String&quot;, # A server-determined value that specifies the earliest time that the object&#x27;s retention period expires. This value is in RFC 3339 format. Note 1: This field is not provided for objects with an active event-based hold, since retention expiration is unknown until the hold is removed. Note 2: This value can be provided even when temporary hold is set (so that the user can reason about policy without having to first unset the temporary hold).
1400 &quot;selfLink&quot;: &quot;A String&quot;, # The link to this object.
1401 &quot;size&quot;: &quot;A String&quot;, # Content-Length of the data in bytes.
1402 &quot;softDeleteTime&quot;: &quot;A String&quot;, # The time at which the object became soft-deleted in RFC 3339 format.
1403 &quot;storageClass&quot;: &quot;A String&quot;, # Storage class of the object.
1404 &quot;temporaryHold&quot;: True or False, # Whether an object is under temporary hold. While this flag is set to true, the object is protected against deletion and overwrites. A common use case of this flag is regulatory investigations where objects need to be retained while the investigation is ongoing. Note that unlike event-based hold, temporary hold does not impact retention expiration time of an object.
1405 &quot;timeCreated&quot;: &quot;A String&quot;, # The creation time of the object in RFC 3339 format.
1406 &quot;timeDeleted&quot;: &quot;A String&quot;, # The time at which the object became noncurrent in RFC 3339 format. Will be returned if and only if this version of the object has been deleted.
1407 &quot;timeFinalized&quot;: &quot;A String&quot;, # The time when the object was finalized.
1408 &quot;timeStorageClassUpdated&quot;: &quot;A String&quot;, # The time at which the object&#x27;s storage class was last changed. When the object is initially created, it will be set to timeCreated.
1409 &quot;updated&quot;: &quot;A String&quot;, # The modification time of the object metadata in RFC 3339 format. Set initially to object creation time and then updated whenever any metadata of the object changes. This includes changes made by a requester, such as modifying custom metadata, as well as changes made by Cloud Storage on behalf of a requester, such as changing the storage class based on an Object Lifecycle Configuration.
1410 }
1411
1412 generation: string, If present, selects a specific revision of this object (as opposed to the latest version, the default).
1413 ifGenerationMatch: string, Makes the operation conditional on whether the object&#x27;s current generation matches the given value. Setting to 0 makes the operation succeed only if there are no live versions of the object.
1414 ifGenerationNotMatch: string, Makes the operation conditional on whether the object&#x27;s current generation does not match the given value. If no live object exists, the precondition fails. Setting to 0 makes the operation succeed only if there is a live version of the object.
1415 ifMetagenerationMatch: string, Makes the operation conditional on whether the object&#x27;s current metageneration matches the given value.
1416 ifMetagenerationNotMatch: string, Makes the operation conditional on whether the object&#x27;s current metageneration does not match the given value.
1417 overrideUnlockedRetention: boolean, Must be true to remove the retention configuration, reduce its unlocked retention period, or change its mode from unlocked to locked.
1418 predefinedAcl: string, Apply a predefined set of access controls to this object.
1419 Allowed values
1420 authenticatedRead - Object owner gets OWNER access, and allAuthenticatedUsers get READER access.
1421 bucketOwnerFullControl - Object owner gets OWNER access, and project team owners get OWNER access.
1422 bucketOwnerRead - Object owner gets OWNER access, and project team owners get READER access.
1423 private - Object owner gets OWNER access.
1424 projectPrivate - Object owner gets OWNER access, and project team members get access according to their roles.
1425 publicRead - Object owner gets OWNER access, and allUsers get READER access.
1426 projection: string, Set of properties to return. Defaults to full.
1427 Allowed values
1428 full - Include all properties.
1429 noAcl - Omit the owner, acl property.
1430 userProject: string, The project to be billed for this request, for Requester Pays buckets.
1431
1432 Returns:
1433 An object of the form:
1434
1435 { # An object.
1436 &quot;acl&quot;: [ # Access controls on the object.
1437 { # An access-control entry.
1438 &quot;bucket&quot;: &quot;A String&quot;, # The name of the bucket.
1439 &quot;domain&quot;: &quot;A String&quot;, # The domain associated with the entity, if any.
1440 &quot;email&quot;: &quot;A String&quot;, # The email address associated with the entity, if any.
1441 &quot;entity&quot;: &quot;A String&quot;, # The entity holding the permission, in one of the following forms:
1442 # - user-userId
1443 # - user-email
1444 # - group-groupId
1445 # - group-email
1446 # - domain-domain
1447 # - project-team-projectId
1448 # - allUsers
1449 # - allAuthenticatedUsers Examples:
1450 # - The user [email protected] would be [email protected].
1451 # - The group [email protected] would be [email protected].
1452 # - To refer to all members of the Google Apps for Business domain example.com, the entity would be domain-example.com.
1453 &quot;entityId&quot;: &quot;A String&quot;, # The ID for the entity, if any.
1454 &quot;etag&quot;: &quot;A String&quot;, # HTTP 1.1 Entity tag for the access-control entry.
1455 &quot;generation&quot;: &quot;A String&quot;, # The content generation of the object, if applied to an object.
1456 &quot;id&quot;: &quot;A String&quot;, # The ID of the access-control entry.
1457 &quot;kind&quot;: &quot;storage#objectAccessControl&quot;, # The kind of item this is. For object access control entries, this is always storage#objectAccessControl.
1458 &quot;object&quot;: &quot;A String&quot;, # The name of the object, if applied to an object.
1459 &quot;projectTeam&quot;: { # The project team associated with the entity, if any.
1460 &quot;projectNumber&quot;: &quot;A String&quot;, # The project number.
1461 &quot;team&quot;: &quot;A String&quot;, # The team.
1462 },
1463 &quot;role&quot;: &quot;A String&quot;, # The access permission for the entity.
1464 &quot;selfLink&quot;: &quot;A String&quot;, # The link to this access-control entry.
1465 },
1466 ],
1467 &quot;bucket&quot;: &quot;A String&quot;, # The name of the bucket containing this object.
1468 &quot;cacheControl&quot;: &quot;A String&quot;, # Cache-Control directive for the object data. If omitted, and the object is accessible to all anonymous users, the default will be public, max-age=3600.
1469 &quot;componentCount&quot;: 42, # Number of underlying components that make up this object. Components are accumulated by compose operations.
1470 &quot;contentDisposition&quot;: &quot;A String&quot;, # Content-Disposition of the object data.
1471 &quot;contentEncoding&quot;: &quot;A String&quot;, # Content-Encoding of the object data.
1472 &quot;contentLanguage&quot;: &quot;A String&quot;, # Content-Language of the object data.
1473 &quot;contentType&quot;: &quot;A String&quot;, # Content-Type of the object data. If an object is stored without a Content-Type, it is served as application/octet-stream.
1474 &quot;contexts&quot;: { # User-defined or system-defined object contexts. Each object context is a key-payload pair, where the key provides the identification and the payload holds the associated value and additional metadata.
1475 &quot;custom&quot;: { # User-defined object contexts.
1476 &quot;a_key&quot;: { # The payload of a single user-defined object context. # A single user-defined object context.
1477 &quot;createTime&quot;: &quot;A String&quot;, # The time at which the object context was created in RFC 3339 format.
1478 &quot;updateTime&quot;: &quot;A String&quot;, # The time at which the object context was last updated in RFC 3339 format.
1479 &quot;value&quot;: &quot;A String&quot;, # The value of the object context.
1480 },
1481 },
1482 },
1483 &quot;crc32c&quot;: &quot;A String&quot;, # CRC32c checksum, as described in RFC 4960, Appendix B; encoded using base64 in big-endian byte order. For more information about using the CRC32c checksum, see [Data Validation and Change Detection](https://cloud.google.com/storage/docs/data-validation).
1484 &quot;customTime&quot;: &quot;A String&quot;, # A timestamp in RFC 3339 format specified by the user for an object.
1485 &quot;customerEncryption&quot;: { # Metadata of customer-supplied encryption key, if the object is encrypted by such a key.
1486 &quot;encryptionAlgorithm&quot;: &quot;A String&quot;, # The encryption algorithm.
1487 &quot;keySha256&quot;: &quot;A String&quot;, # SHA256 hash value of the encryption key.
1488 },
1489 &quot;etag&quot;: &quot;A String&quot;, # HTTP 1.1 Entity tag for the object.
1490 &quot;eventBasedHold&quot;: True or False, # Whether an object is under event-based hold. Event-based hold is a way to retain objects until an event occurs, which is signified by the hold&#x27;s release (i.e. this value is set to false). After being released (set to false), such objects will be subject to bucket-level retention (if any). One sample use case of this flag is for banks to hold loan documents for at least 3 years after loan is paid in full. Here, bucket-level retention is 3 years and the event is the loan being paid in full. In this example, these objects will be held intact for any number of years until the event has occurred (event-based hold on the object is released) and then 3 more years after that. That means retention duration of the objects begins from the moment event-based hold transitioned from true to false.
1491 &quot;generation&quot;: &quot;A String&quot;, # The content generation of this object. Used for object versioning.
1492 &quot;hardDeleteTime&quot;: &quot;A String&quot;, # This is the time (in the future) when the soft-deleted object will no longer be restorable. It is equal to the soft delete time plus the current soft delete retention duration of the bucket.
1493 &quot;id&quot;: &quot;A String&quot;, # The ID of the object, including the bucket name, object name, and generation number.
1494 &quot;kind&quot;: &quot;storage#object&quot;, # The kind of item this is. For objects, this is always storage#object.
1495 &quot;kmsKeyName&quot;: &quot;A String&quot;, # Not currently supported. Specifying the parameter causes the request to fail with status code 400 - Bad Request.
1496 &quot;md5Hash&quot;: &quot;A String&quot;, # MD5 hash of the data; encoded using base64. For more information about using the MD5 hash, see [Data Validation and Change Detection](https://cloud.google.com/storage/docs/data-validation).
1497 &quot;mediaLink&quot;: &quot;A String&quot;, # Media download link.
1498 &quot;metadata&quot;: { # User-provided metadata, in key/value pairs.
1499 &quot;a_key&quot;: &quot;A String&quot;, # An individual metadata entry.
1500 },
1501 &quot;metageneration&quot;: &quot;A String&quot;, # The version of the metadata for this object at this generation. Used for preconditions and for detecting changes in metadata. A metageneration number is only meaningful in the context of a particular generation of a particular object.
1502 &quot;name&quot;: &quot;A String&quot;, # The name of the object. Required if not specified by URL parameter.
1503 &quot;owner&quot;: { # The owner of the object. This will always be the uploader of the object.
1504 &quot;entity&quot;: &quot;A String&quot;, # The entity, in the form user-userId.
1505 &quot;entityId&quot;: &quot;A String&quot;, # The ID for the entity.
1506 },
1507 &quot;restoreToken&quot;: &quot;A String&quot;, # Restore token used to differentiate deleted objects with the same name and generation. This field is only returned for deleted objects in hierarchical namespace buckets.
1508 &quot;retention&quot;: { # A collection of object level retention parameters.
1509 &quot;mode&quot;: &quot;A String&quot;, # The bucket&#x27;s object retention mode, can only be Unlocked or Locked.
1510 &quot;retainUntilTime&quot;: &quot;A String&quot;, # A time in RFC 3339 format until which object retention protects this object.
1511 },
1512 &quot;retentionExpirationTime&quot;: &quot;A String&quot;, # A server-determined value that specifies the earliest time that the object&#x27;s retention period expires. This value is in RFC 3339 format. Note 1: This field is not provided for objects with an active event-based hold, since retention expiration is unknown until the hold is removed. Note 2: This value can be provided even when temporary hold is set (so that the user can reason about policy without having to first unset the temporary hold).
1513 &quot;selfLink&quot;: &quot;A String&quot;, # The link to this object.
1514 &quot;size&quot;: &quot;A String&quot;, # Content-Length of the data in bytes.
1515 &quot;softDeleteTime&quot;: &quot;A String&quot;, # The time at which the object became soft-deleted in RFC 3339 format.
1516 &quot;storageClass&quot;: &quot;A String&quot;, # Storage class of the object.
1517 &quot;temporaryHold&quot;: True or False, # Whether an object is under temporary hold. While this flag is set to true, the object is protected against deletion and overwrites. A common use case of this flag is regulatory investigations where objects need to be retained while the investigation is ongoing. Note that unlike event-based hold, temporary hold does not impact retention expiration time of an object.
1518 &quot;timeCreated&quot;: &quot;A String&quot;, # The creation time of the object in RFC 3339 format.
1519 &quot;timeDeleted&quot;: &quot;A String&quot;, # The time at which the object became noncurrent in RFC 3339 format. Will be returned if and only if this version of the object has been deleted.
1520 &quot;timeFinalized&quot;: &quot;A String&quot;, # The time when the object was finalized.
1521 &quot;timeStorageClassUpdated&quot;: &quot;A String&quot;, # The time at which the object&#x27;s storage class was last changed. When the object is initially created, it will be set to timeCreated.
1522 &quot;updated&quot;: &quot;A String&quot;, # The modification time of the object metadata in RFC 3339 format. Set initially to object creation time and then updated whenever any metadata of the object changes. This includes changes made by a requester, such as modifying custom metadata, as well as changes made by Cloud Storage on behalf of a requester, such as changing the storage class based on an Object Lifecycle Configuration.
1523 }</pre>
1524 </div>
1525
1526 <div class="method">
1527 <code class="details" id="restore">restore(bucket, object, generation, copySourceAcl=None, ifGenerationMatch=None, ifGenerationNotMatch=None, ifMetagenerationMatch=None, ifMetagenerationNotMatch=None, projection=None, restoreToken=None, userProject=None)</code>
1528 <pre>Restores a soft-deleted object.
1529
1530 Args:
1531 bucket: string, Name of the bucket in which the object resides. (required)
1532 object: string, Name of the object. For information about how to URL encode object names to be path safe, see [Encoding URI Path Parts](https://cloud.google.com/storage/docs/request-endpoints#encoding). (required)
1533 generation: string, Selects a specific revision of this object. (required)
1534 copySourceAcl: boolean, If true, copies the source object&#x27;s ACL; otherwise, uses the bucket&#x27;s default object ACL. The default is false.
1535 ifGenerationMatch: string, Makes the operation conditional on whether the object&#x27;s one live generation matches the given value. Setting to 0 makes the operation succeed only if there are no live versions of the object.
1536 ifGenerationNotMatch: string, Makes the operation conditional on whether none of the object&#x27;s live generations match the given value. If no live object exists, the precondition fails. Setting to 0 makes the operation succeed only if there is a live version of the object.
1537 ifMetagenerationMatch: string, Makes the operation conditional on whether the object&#x27;s one live metageneration matches the given value.
1538 ifMetagenerationNotMatch: string, Makes the operation conditional on whether none of the object&#x27;s live metagenerations match the given value.
1539 projection: string, Set of properties to return. Defaults to full.
1540 Allowed values
1541 full - Include all properties.
1542 noAcl - Omit the owner, acl property.
1543 restoreToken: string, Restore token used to differentiate sof-deleted objects with the same name and generation. Only applicable for hierarchical namespace buckets. This parameter is optional, and is only required in the rare case when there are multiple soft-deleted objects with the same name and generation.
1544 userProject: string, The project to be billed for this request. Required for Requester Pays buckets.
1545
1546 Returns:
1547 An object of the form:
1548
1549 { # An object.
1550 &quot;acl&quot;: [ # Access controls on the object.
1551 { # An access-control entry.
1552 &quot;bucket&quot;: &quot;A String&quot;, # The name of the bucket.
1553 &quot;domain&quot;: &quot;A String&quot;, # The domain associated with the entity, if any.
1554 &quot;email&quot;: &quot;A String&quot;, # The email address associated with the entity, if any.
1555 &quot;entity&quot;: &quot;A String&quot;, # The entity holding the permission, in one of the following forms:
1556 # - user-userId
1557 # - user-email
1558 # - group-groupId
1559 # - group-email
1560 # - domain-domain
1561 # - project-team-projectId
1562 # - allUsers
1563 # - allAuthenticatedUsers Examples:
1564 # - The user [email protected] would be [email protected].
1565 # - The group [email protected] would be [email protected].
1566 # - To refer to all members of the Google Apps for Business domain example.com, the entity would be domain-example.com.
1567 &quot;entityId&quot;: &quot;A String&quot;, # The ID for the entity, if any.
1568 &quot;etag&quot;: &quot;A String&quot;, # HTTP 1.1 Entity tag for the access-control entry.
1569 &quot;generation&quot;: &quot;A String&quot;, # The content generation of the object, if applied to an object.
1570 &quot;id&quot;: &quot;A String&quot;, # The ID of the access-control entry.
1571 &quot;kind&quot;: &quot;storage#objectAccessControl&quot;, # The kind of item this is. For object access control entries, this is always storage#objectAccessControl.
1572 &quot;object&quot;: &quot;A String&quot;, # The name of the object, if applied to an object.
1573 &quot;projectTeam&quot;: { # The project team associated with the entity, if any.
1574 &quot;projectNumber&quot;: &quot;A String&quot;, # The project number.
1575 &quot;team&quot;: &quot;A String&quot;, # The team.
1576 },
1577 &quot;role&quot;: &quot;A String&quot;, # The access permission for the entity.
1578 &quot;selfLink&quot;: &quot;A String&quot;, # The link to this access-control entry.
1579 },
1580 ],
1581 &quot;bucket&quot;: &quot;A String&quot;, # The name of the bucket containing this object.
1582 &quot;cacheControl&quot;: &quot;A String&quot;, # Cache-Control directive for the object data. If omitted, and the object is accessible to all anonymous users, the default will be public, max-age=3600.
1583 &quot;componentCount&quot;: 42, # Number of underlying components that make up this object. Components are accumulated by compose operations.
1584 &quot;contentDisposition&quot;: &quot;A String&quot;, # Content-Disposition of the object data.
1585 &quot;contentEncoding&quot;: &quot;A String&quot;, # Content-Encoding of the object data.
1586 &quot;contentLanguage&quot;: &quot;A String&quot;, # Content-Language of the object data.
1587 &quot;contentType&quot;: &quot;A String&quot;, # Content-Type of the object data. If an object is stored without a Content-Type, it is served as application/octet-stream.
1588 &quot;contexts&quot;: { # User-defined or system-defined object contexts. Each object context is a key-payload pair, where the key provides the identification and the payload holds the associated value and additional metadata.
1589 &quot;custom&quot;: { # User-defined object contexts.
1590 &quot;a_key&quot;: { # The payload of a single user-defined object context. # A single user-defined object context.
1591 &quot;createTime&quot;: &quot;A String&quot;, # The time at which the object context was created in RFC 3339 format.
1592 &quot;updateTime&quot;: &quot;A String&quot;, # The time at which the object context was last updated in RFC 3339 format.
1593 &quot;value&quot;: &quot;A String&quot;, # The value of the object context.
1594 },
1595 },
1596 },
1597 &quot;crc32c&quot;: &quot;A String&quot;, # CRC32c checksum, as described in RFC 4960, Appendix B; encoded using base64 in big-endian byte order. For more information about using the CRC32c checksum, see [Data Validation and Change Detection](https://cloud.google.com/storage/docs/data-validation).
1598 &quot;customTime&quot;: &quot;A String&quot;, # A timestamp in RFC 3339 format specified by the user for an object.
1599 &quot;customerEncryption&quot;: { # Metadata of customer-supplied encryption key, if the object is encrypted by such a key.
1600 &quot;encryptionAlgorithm&quot;: &quot;A String&quot;, # The encryption algorithm.
1601 &quot;keySha256&quot;: &quot;A String&quot;, # SHA256 hash value of the encryption key.
1602 },
1603 &quot;etag&quot;: &quot;A String&quot;, # HTTP 1.1 Entity tag for the object.
1604 &quot;eventBasedHold&quot;: True or False, # Whether an object is under event-based hold. Event-based hold is a way to retain objects until an event occurs, which is signified by the hold&#x27;s release (i.e. this value is set to false). After being released (set to false), such objects will be subject to bucket-level retention (if any). One sample use case of this flag is for banks to hold loan documents for at least 3 years after loan is paid in full. Here, bucket-level retention is 3 years and the event is the loan being paid in full. In this example, these objects will be held intact for any number of years until the event has occurred (event-based hold on the object is released) and then 3 more years after that. That means retention duration of the objects begins from the moment event-based hold transitioned from true to false.
1605 &quot;generation&quot;: &quot;A String&quot;, # The content generation of this object. Used for object versioning.
1606 &quot;hardDeleteTime&quot;: &quot;A String&quot;, # This is the time (in the future) when the soft-deleted object will no longer be restorable. It is equal to the soft delete time plus the current soft delete retention duration of the bucket.
1607 &quot;id&quot;: &quot;A String&quot;, # The ID of the object, including the bucket name, object name, and generation number.
1608 &quot;kind&quot;: &quot;storage#object&quot;, # The kind of item this is. For objects, this is always storage#object.
1609 &quot;kmsKeyName&quot;: &quot;A String&quot;, # Not currently supported. Specifying the parameter causes the request to fail with status code 400 - Bad Request.
1610 &quot;md5Hash&quot;: &quot;A String&quot;, # MD5 hash of the data; encoded using base64. For more information about using the MD5 hash, see [Data Validation and Change Detection](https://cloud.google.com/storage/docs/data-validation).
1611 &quot;mediaLink&quot;: &quot;A String&quot;, # Media download link.
1612 &quot;metadata&quot;: { # User-provided metadata, in key/value pairs.
1613 &quot;a_key&quot;: &quot;A String&quot;, # An individual metadata entry.
1614 },
1615 &quot;metageneration&quot;: &quot;A String&quot;, # The version of the metadata for this object at this generation. Used for preconditions and for detecting changes in metadata. A metageneration number is only meaningful in the context of a particular generation of a particular object.
1616 &quot;name&quot;: &quot;A String&quot;, # The name of the object. Required if not specified by URL parameter.
1617 &quot;owner&quot;: { # The owner of the object. This will always be the uploader of the object.
1618 &quot;entity&quot;: &quot;A String&quot;, # The entity, in the form user-userId.
1619 &quot;entityId&quot;: &quot;A String&quot;, # The ID for the entity.
1620 },
1621 &quot;restoreToken&quot;: &quot;A String&quot;, # Restore token used to differentiate deleted objects with the same name and generation. This field is only returned for deleted objects in hierarchical namespace buckets.
1622 &quot;retention&quot;: { # A collection of object level retention parameters.
1623 &quot;mode&quot;: &quot;A String&quot;, # The bucket&#x27;s object retention mode, can only be Unlocked or Locked.
1624 &quot;retainUntilTime&quot;: &quot;A String&quot;, # A time in RFC 3339 format until which object retention protects this object.
1625 },
1626 &quot;retentionExpirationTime&quot;: &quot;A String&quot;, # A server-determined value that specifies the earliest time that the object&#x27;s retention period expires. This value is in RFC 3339 format. Note 1: This field is not provided for objects with an active event-based hold, since retention expiration is unknown until the hold is removed. Note 2: This value can be provided even when temporary hold is set (so that the user can reason about policy without having to first unset the temporary hold).
1627 &quot;selfLink&quot;: &quot;A String&quot;, # The link to this object.
1628 &quot;size&quot;: &quot;A String&quot;, # Content-Length of the data in bytes.
1629 &quot;softDeleteTime&quot;: &quot;A String&quot;, # The time at which the object became soft-deleted in RFC 3339 format.
1630 &quot;storageClass&quot;: &quot;A String&quot;, # Storage class of the object.
1631 &quot;temporaryHold&quot;: True or False, # Whether an object is under temporary hold. While this flag is set to true, the object is protected against deletion and overwrites. A common use case of this flag is regulatory investigations where objects need to be retained while the investigation is ongoing. Note that unlike event-based hold, temporary hold does not impact retention expiration time of an object.
1632 &quot;timeCreated&quot;: &quot;A String&quot;, # The creation time of the object in RFC 3339 format.
1633 &quot;timeDeleted&quot;: &quot;A String&quot;, # The time at which the object became noncurrent in RFC 3339 format. Will be returned if and only if this version of the object has been deleted.
1634 &quot;timeFinalized&quot;: &quot;A String&quot;, # The time when the object was finalized.
1635 &quot;timeStorageClassUpdated&quot;: &quot;A String&quot;, # The time at which the object&#x27;s storage class was last changed. When the object is initially created, it will be set to timeCreated.
1636 &quot;updated&quot;: &quot;A String&quot;, # The modification time of the object metadata in RFC 3339 format. Set initially to object creation time and then updated whenever any metadata of the object changes. This includes changes made by a requester, such as modifying custom metadata, as well as changes made by Cloud Storage on behalf of a requester, such as changing the storage class based on an Object Lifecycle Configuration.
1637 }</pre>
1638 </div>
1639
1640 <div class="method">
1641 <code class="details" id="rewrite">rewrite(sourceBucket, sourceObject, destinationBucket, destinationObject, body=None, destinationKmsKeyName=None, destinationPredefinedAcl=None, dropContextGroups=None, ifGenerationMatch=None, ifGenerationNotMatch=None, ifMetagenerationMatch=None, ifMetagenerationNotMatch=None, ifSourceGenerationMatch=None, ifSourceGenerationNotMatch=None, ifSourceMetagenerationMatch=None, ifSourceMetagenerationNotMatch=None, maxBytesRewrittenPerCall=None, projection=None, rewriteToken=None, sourceGeneration=None, userProject=None)</code>
1642 <pre>Rewrites a source object to a destination object. Optionally overrides metadata.
1643
1644 Args:
1645 sourceBucket: string, Name of the bucket in which to find the source object. (required)
1646 sourceObject: string, Name of the source object. For information about how to URL encode object names to be path safe, see [Encoding URI Path Parts](https://cloud.google.com/storage/docs/request-endpoints#encoding). (required)
1647 destinationBucket: string, Name of the bucket in which to store the new object. Overrides the provided object metadata&#x27;s bucket value, if any. (required)
1648 destinationObject: string, Name of the new object. Required when the object metadata is not otherwise provided. Overrides the object metadata&#x27;s name value, if any. For information about how to URL encode object names to be path safe, see [Encoding URI Path Parts](https://cloud.google.com/storage/docs/request-endpoints#encoding). (required)
1649 body: object, The request body.
1650 The object takes the form of:
1651
1652 { # An object.
1653 &quot;acl&quot;: [ # Access controls on the object.
1654 { # An access-control entry.
1655 &quot;bucket&quot;: &quot;A String&quot;, # The name of the bucket.
1656 &quot;domain&quot;: &quot;A String&quot;, # The domain associated with the entity, if any.
1657 &quot;email&quot;: &quot;A String&quot;, # The email address associated with the entity, if any.
1658 &quot;entity&quot;: &quot;A String&quot;, # The entity holding the permission, in one of the following forms:
1659 # - user-userId
1660 # - user-email
1661 # - group-groupId
1662 # - group-email
1663 # - domain-domain
1664 # - project-team-projectId
1665 # - allUsers
1666 # - allAuthenticatedUsers Examples:
1667 # - The user [email protected] would be [email protected].
1668 # - The group [email protected] would be [email protected].
1669 # - To refer to all members of the Google Apps for Business domain example.com, the entity would be domain-example.com.
1670 &quot;entityId&quot;: &quot;A String&quot;, # The ID for the entity, if any.
1671 &quot;etag&quot;: &quot;A String&quot;, # HTTP 1.1 Entity tag for the access-control entry.
1672 &quot;generation&quot;: &quot;A String&quot;, # The content generation of the object, if applied to an object.
1673 &quot;id&quot;: &quot;A String&quot;, # The ID of the access-control entry.
1674 &quot;kind&quot;: &quot;storage#objectAccessControl&quot;, # The kind of item this is. For object access control entries, this is always storage#objectAccessControl.
1675 &quot;object&quot;: &quot;A String&quot;, # The name of the object, if applied to an object.
1676 &quot;projectTeam&quot;: { # The project team associated with the entity, if any.
1677 &quot;projectNumber&quot;: &quot;A String&quot;, # The project number.
1678 &quot;team&quot;: &quot;A String&quot;, # The team.
1679 },
1680 &quot;role&quot;: &quot;A String&quot;, # The access permission for the entity.
1681 &quot;selfLink&quot;: &quot;A String&quot;, # The link to this access-control entry.
1682 },
1683 ],
1684 &quot;bucket&quot;: &quot;A String&quot;, # The name of the bucket containing this object.
1685 &quot;cacheControl&quot;: &quot;A String&quot;, # Cache-Control directive for the object data. If omitted, and the object is accessible to all anonymous users, the default will be public, max-age=3600.
1686 &quot;componentCount&quot;: 42, # Number of underlying components that make up this object. Components are accumulated by compose operations.
1687 &quot;contentDisposition&quot;: &quot;A String&quot;, # Content-Disposition of the object data.
1688 &quot;contentEncoding&quot;: &quot;A String&quot;, # Content-Encoding of the object data.
1689 &quot;contentLanguage&quot;: &quot;A String&quot;, # Content-Language of the object data.
1690 &quot;contentType&quot;: &quot;A String&quot;, # Content-Type of the object data. If an object is stored without a Content-Type, it is served as application/octet-stream.
1691 &quot;contexts&quot;: { # User-defined or system-defined object contexts. Each object context is a key-payload pair, where the key provides the identification and the payload holds the associated value and additional metadata.
1692 &quot;custom&quot;: { # User-defined object contexts.
1693 &quot;a_key&quot;: { # The payload of a single user-defined object context. # A single user-defined object context.
1694 &quot;createTime&quot;: &quot;A String&quot;, # The time at which the object context was created in RFC 3339 format.
1695 &quot;updateTime&quot;: &quot;A String&quot;, # The time at which the object context was last updated in RFC 3339 format.
1696 &quot;value&quot;: &quot;A String&quot;, # The value of the object context.
1697 },
1698 },
1699 },
1700 &quot;crc32c&quot;: &quot;A String&quot;, # CRC32c checksum, as described in RFC 4960, Appendix B; encoded using base64 in big-endian byte order. For more information about using the CRC32c checksum, see [Data Validation and Change Detection](https://cloud.google.com/storage/docs/data-validation).
1701 &quot;customTime&quot;: &quot;A String&quot;, # A timestamp in RFC 3339 format specified by the user for an object.
1702 &quot;customerEncryption&quot;: { # Metadata of customer-supplied encryption key, if the object is encrypted by such a key.
1703 &quot;encryptionAlgorithm&quot;: &quot;A String&quot;, # The encryption algorithm.
1704 &quot;keySha256&quot;: &quot;A String&quot;, # SHA256 hash value of the encryption key.
1705 },
1706 &quot;etag&quot;: &quot;A String&quot;, # HTTP 1.1 Entity tag for the object.
1707 &quot;eventBasedHold&quot;: True or False, # Whether an object is under event-based hold. Event-based hold is a way to retain objects until an event occurs, which is signified by the hold&#x27;s release (i.e. this value is set to false). After being released (set to false), such objects will be subject to bucket-level retention (if any). One sample use case of this flag is for banks to hold loan documents for at least 3 years after loan is paid in full. Here, bucket-level retention is 3 years and the event is the loan being paid in full. In this example, these objects will be held intact for any number of years until the event has occurred (event-based hold on the object is released) and then 3 more years after that. That means retention duration of the objects begins from the moment event-based hold transitioned from true to false.
1708 &quot;generation&quot;: &quot;A String&quot;, # The content generation of this object. Used for object versioning.
1709 &quot;hardDeleteTime&quot;: &quot;A String&quot;, # This is the time (in the future) when the soft-deleted object will no longer be restorable. It is equal to the soft delete time plus the current soft delete retention duration of the bucket.
1710 &quot;id&quot;: &quot;A String&quot;, # The ID of the object, including the bucket name, object name, and generation number.
1711 &quot;kind&quot;: &quot;storage#object&quot;, # The kind of item this is. For objects, this is always storage#object.
1712 &quot;kmsKeyName&quot;: &quot;A String&quot;, # Not currently supported. Specifying the parameter causes the request to fail with status code 400 - Bad Request.
1713 &quot;md5Hash&quot;: &quot;A String&quot;, # MD5 hash of the data; encoded using base64. For more information about using the MD5 hash, see [Data Validation and Change Detection](https://cloud.google.com/storage/docs/data-validation).
1714 &quot;mediaLink&quot;: &quot;A String&quot;, # Media download link.
1715 &quot;metadata&quot;: { # User-provided metadata, in key/value pairs.
1716 &quot;a_key&quot;: &quot;A String&quot;, # An individual metadata entry.
1717 },
1718 &quot;metageneration&quot;: &quot;A String&quot;, # The version of the metadata for this object at this generation. Used for preconditions and for detecting changes in metadata. A metageneration number is only meaningful in the context of a particular generation of a particular object.
1719 &quot;name&quot;: &quot;A String&quot;, # The name of the object. Required if not specified by URL parameter.
1720 &quot;owner&quot;: { # The owner of the object. This will always be the uploader of the object.
1721 &quot;entity&quot;: &quot;A String&quot;, # The entity, in the form user-userId.
1722 &quot;entityId&quot;: &quot;A String&quot;, # The ID for the entity.
1723 },
1724 &quot;restoreToken&quot;: &quot;A String&quot;, # Restore token used to differentiate deleted objects with the same name and generation. This field is only returned for deleted objects in hierarchical namespace buckets.
1725 &quot;retention&quot;: { # A collection of object level retention parameters.
1726 &quot;mode&quot;: &quot;A String&quot;, # The bucket&#x27;s object retention mode, can only be Unlocked or Locked.
1727 &quot;retainUntilTime&quot;: &quot;A String&quot;, # A time in RFC 3339 format until which object retention protects this object.
1728 },
1729 &quot;retentionExpirationTime&quot;: &quot;A String&quot;, # A server-determined value that specifies the earliest time that the object&#x27;s retention period expires. This value is in RFC 3339 format. Note 1: This field is not provided for objects with an active event-based hold, since retention expiration is unknown until the hold is removed. Note 2: This value can be provided even when temporary hold is set (so that the user can reason about policy without having to first unset the temporary hold).
1730 &quot;selfLink&quot;: &quot;A String&quot;, # The link to this object.
1731 &quot;size&quot;: &quot;A String&quot;, # Content-Length of the data in bytes.
1732 &quot;softDeleteTime&quot;: &quot;A String&quot;, # The time at which the object became soft-deleted in RFC 3339 format.
1733 &quot;storageClass&quot;: &quot;A String&quot;, # Storage class of the object.
1734 &quot;temporaryHold&quot;: True or False, # Whether an object is under temporary hold. While this flag is set to true, the object is protected against deletion and overwrites. A common use case of this flag is regulatory investigations where objects need to be retained while the investigation is ongoing. Note that unlike event-based hold, temporary hold does not impact retention expiration time of an object.
1735 &quot;timeCreated&quot;: &quot;A String&quot;, # The creation time of the object in RFC 3339 format.
1736 &quot;timeDeleted&quot;: &quot;A String&quot;, # The time at which the object became noncurrent in RFC 3339 format. Will be returned if and only if this version of the object has been deleted.
1737 &quot;timeFinalized&quot;: &quot;A String&quot;, # The time when the object was finalized.
1738 &quot;timeStorageClassUpdated&quot;: &quot;A String&quot;, # The time at which the object&#x27;s storage class was last changed. When the object is initially created, it will be set to timeCreated.
1739 &quot;updated&quot;: &quot;A String&quot;, # The modification time of the object metadata in RFC 3339 format. Set initially to object creation time and then updated whenever any metadata of the object changes. This includes changes made by a requester, such as modifying custom metadata, as well as changes made by Cloud Storage on behalf of a requester, such as changing the storage class based on an Object Lifecycle Configuration.
1740 }
1741
1742 destinationKmsKeyName: string, Resource name of the Cloud KMS key, of the form projects/my-project/locations/global/keyRings/my-kr/cryptoKeys/my-key, that will be used to encrypt the object. Overrides the object metadata&#x27;s kms_key_name value, if any.
1743 destinationPredefinedAcl: string, Apply a predefined set of access controls to the destination object.
1744 Allowed values
1745 authenticatedRead - Object owner gets OWNER access, and allAuthenticatedUsers get READER access.
1746 bucketOwnerFullControl - Object owner gets OWNER access, and project team owners get OWNER access.
1747 bucketOwnerRead - Object owner gets OWNER access, and project team owners get READER access.
1748 private - Object owner gets OWNER access.
1749 projectPrivate - Object owner gets OWNER access, and project team members get access according to their roles.
1750 publicRead - Object owner gets OWNER access, and allUsers get READER access.
1751 dropContextGroups: string, Specifies which groups of Object Contexts from the source object should be dropped from the destination object. (repeated)
1752 ifGenerationMatch: string, Makes the operation conditional on whether the object&#x27;s current generation matches the given value. Setting to 0 makes the operation succeed only if there are no live versions of the object.
1753 ifGenerationNotMatch: string, Makes the operation conditional on whether the object&#x27;s current generation does not match the given value. If no live object exists, the precondition fails. Setting to 0 makes the operation succeed only if there is a live version of the object.
1754 ifMetagenerationMatch: string, Makes the operation conditional on whether the destination object&#x27;s current metageneration matches the given value.
1755 ifMetagenerationNotMatch: string, Makes the operation conditional on whether the destination object&#x27;s current metageneration does not match the given value.
1756 ifSourceGenerationMatch: string, Makes the operation conditional on whether the source object&#x27;s current generation matches the given value.
1757 ifSourceGenerationNotMatch: string, Makes the operation conditional on whether the source object&#x27;s current generation does not match the given value.
1758 ifSourceMetagenerationMatch: string, Makes the operation conditional on whether the source object&#x27;s current metageneration matches the given value.
1759 ifSourceMetagenerationNotMatch: string, Makes the operation conditional on whether the source object&#x27;s current metageneration does not match the given value.
1760 maxBytesRewrittenPerCall: string, The maximum number of bytes that will be rewritten per rewrite request. Most callers shouldn&#x27;t need to specify this parameter - it is primarily in place to support testing. If specified the value must be an integral multiple of 1 MiB (1048576). Also, this only applies to requests where the source and destination span locations and/or storage classes. Finally, this value must not change across rewrite calls else you&#x27;ll get an error that the rewriteToken is invalid.
1761 projection: string, Set of properties to return. Defaults to noAcl, unless the object resource specifies the acl property, when it defaults to full.
1762 Allowed values
1763 full - Include all properties.
1764 noAcl - Omit the owner, acl property.
1765 rewriteToken: string, Include this field (from the previous rewrite response) on each rewrite request after the first one, until the rewrite response &#x27;done&#x27; flag is true. Calls that provide a rewriteToken can omit all other request fields, but if included those fields must match the values provided in the first rewrite request.
1766 sourceGeneration: string, If present, selects a specific revision of the source object (as opposed to the latest version, the default).
1767 userProject: string, The project to be billed for this request. Required for Requester Pays buckets.
1768
1769 Returns:
1770 An object of the form:
1771
1772 { # A rewrite response.
1773 &quot;done&quot;: True or False, # true if the copy is finished; otherwise, false if the copy is in progress. This property is always present in the response.
1774 &quot;kind&quot;: &quot;storage#rewriteResponse&quot;, # The kind of item this is.
1775 &quot;objectSize&quot;: &quot;A String&quot;, # The total size of the object being copied in bytes. This property is always present in the response.
1776 &quot;resource&quot;: { # An object. # A resource containing the metadata for the copied-to object. This property is present in the response only when copying completes.
1777 &quot;acl&quot;: [ # Access controls on the object.
1778 { # An access-control entry.
1779 &quot;bucket&quot;: &quot;A String&quot;, # The name of the bucket.
1780 &quot;domain&quot;: &quot;A String&quot;, # The domain associated with the entity, if any.
1781 &quot;email&quot;: &quot;A String&quot;, # The email address associated with the entity, if any.
1782 &quot;entity&quot;: &quot;A String&quot;, # The entity holding the permission, in one of the following forms:
1783 # - user-userId
1784 # - user-email
1785 # - group-groupId
1786 # - group-email
1787 # - domain-domain
1788 # - project-team-projectId
1789 # - allUsers
1790 # - allAuthenticatedUsers Examples:
1791 # - The user [email protected] would be [email protected].
1792 # - The group [email protected] would be [email protected].
1793 # - To refer to all members of the Google Apps for Business domain example.com, the entity would be domain-example.com.
1794 &quot;entityId&quot;: &quot;A String&quot;, # The ID for the entity, if any.
1795 &quot;etag&quot;: &quot;A String&quot;, # HTTP 1.1 Entity tag for the access-control entry.
1796 &quot;generation&quot;: &quot;A String&quot;, # The content generation of the object, if applied to an object.
1797 &quot;id&quot;: &quot;A String&quot;, # The ID of the access-control entry.
1798 &quot;kind&quot;: &quot;storage#objectAccessControl&quot;, # The kind of item this is. For object access control entries, this is always storage#objectAccessControl.
1799 &quot;object&quot;: &quot;A String&quot;, # The name of the object, if applied to an object.
1800 &quot;projectTeam&quot;: { # The project team associated with the entity, if any.
1801 &quot;projectNumber&quot;: &quot;A String&quot;, # The project number.
1802 &quot;team&quot;: &quot;A String&quot;, # The team.
1803 },
1804 &quot;role&quot;: &quot;A String&quot;, # The access permission for the entity.
1805 &quot;selfLink&quot;: &quot;A String&quot;, # The link to this access-control entry.
1806 },
1807 ],
1808 &quot;bucket&quot;: &quot;A String&quot;, # The name of the bucket containing this object.
1809 &quot;cacheControl&quot;: &quot;A String&quot;, # Cache-Control directive for the object data. If omitted, and the object is accessible to all anonymous users, the default will be public, max-age=3600.
1810 &quot;componentCount&quot;: 42, # Number of underlying components that make up this object. Components are accumulated by compose operations.
1811 &quot;contentDisposition&quot;: &quot;A String&quot;, # Content-Disposition of the object data.
1812 &quot;contentEncoding&quot;: &quot;A String&quot;, # Content-Encoding of the object data.
1813 &quot;contentLanguage&quot;: &quot;A String&quot;, # Content-Language of the object data.
1814 &quot;contentType&quot;: &quot;A String&quot;, # Content-Type of the object data. If an object is stored without a Content-Type, it is served as application/octet-stream.
1815 &quot;contexts&quot;: { # User-defined or system-defined object contexts. Each object context is a key-payload pair, where the key provides the identification and the payload holds the associated value and additional metadata.
1816 &quot;custom&quot;: { # User-defined object contexts.
1817 &quot;a_key&quot;: { # The payload of a single user-defined object context. # A single user-defined object context.
1818 &quot;createTime&quot;: &quot;A String&quot;, # The time at which the object context was created in RFC 3339 format.
1819 &quot;updateTime&quot;: &quot;A String&quot;, # The time at which the object context was last updated in RFC 3339 format.
1820 &quot;value&quot;: &quot;A String&quot;, # The value of the object context.
1821 },
1822 },
1823 },
1824 &quot;crc32c&quot;: &quot;A String&quot;, # CRC32c checksum, as described in RFC 4960, Appendix B; encoded using base64 in big-endian byte order. For more information about using the CRC32c checksum, see [Data Validation and Change Detection](https://cloud.google.com/storage/docs/data-validation).
1825 &quot;customTime&quot;: &quot;A String&quot;, # A timestamp in RFC 3339 format specified by the user for an object.
1826 &quot;customerEncryption&quot;: { # Metadata of customer-supplied encryption key, if the object is encrypted by such a key.
1827 &quot;encryptionAlgorithm&quot;: &quot;A String&quot;, # The encryption algorithm.
1828 &quot;keySha256&quot;: &quot;A String&quot;, # SHA256 hash value of the encryption key.
1829 },
1830 &quot;etag&quot;: &quot;A String&quot;, # HTTP 1.1 Entity tag for the object.
1831 &quot;eventBasedHold&quot;: True or False, # Whether an object is under event-based hold. Event-based hold is a way to retain objects until an event occurs, which is signified by the hold&#x27;s release (i.e. this value is set to false). After being released (set to false), such objects will be subject to bucket-level retention (if any). One sample use case of this flag is for banks to hold loan documents for at least 3 years after loan is paid in full. Here, bucket-level retention is 3 years and the event is the loan being paid in full. In this example, these objects will be held intact for any number of years until the event has occurred (event-based hold on the object is released) and then 3 more years after that. That means retention duration of the objects begins from the moment event-based hold transitioned from true to false.
1832 &quot;generation&quot;: &quot;A String&quot;, # The content generation of this object. Used for object versioning.
1833 &quot;hardDeleteTime&quot;: &quot;A String&quot;, # This is the time (in the future) when the soft-deleted object will no longer be restorable. It is equal to the soft delete time plus the current soft delete retention duration of the bucket.
1834 &quot;id&quot;: &quot;A String&quot;, # The ID of the object, including the bucket name, object name, and generation number.
1835 &quot;kind&quot;: &quot;storage#object&quot;, # The kind of item this is. For objects, this is always storage#object.
1836 &quot;kmsKeyName&quot;: &quot;A String&quot;, # Not currently supported. Specifying the parameter causes the request to fail with status code 400 - Bad Request.
1837 &quot;md5Hash&quot;: &quot;A String&quot;, # MD5 hash of the data; encoded using base64. For more information about using the MD5 hash, see [Data Validation and Change Detection](https://cloud.google.com/storage/docs/data-validation).
1838 &quot;mediaLink&quot;: &quot;A String&quot;, # Media download link.
1839 &quot;metadata&quot;: { # User-provided metadata, in key/value pairs.
1840 &quot;a_key&quot;: &quot;A String&quot;, # An individual metadata entry.
1841 },
1842 &quot;metageneration&quot;: &quot;A String&quot;, # The version of the metadata for this object at this generation. Used for preconditions and for detecting changes in metadata. A metageneration number is only meaningful in the context of a particular generation of a particular object.
1843 &quot;name&quot;: &quot;A String&quot;, # The name of the object. Required if not specified by URL parameter.
1844 &quot;owner&quot;: { # The owner of the object. This will always be the uploader of the object.
1845 &quot;entity&quot;: &quot;A String&quot;, # The entity, in the form user-userId.
1846 &quot;entityId&quot;: &quot;A String&quot;, # The ID for the entity.
1847 },
1848 &quot;restoreToken&quot;: &quot;A String&quot;, # Restore token used to differentiate deleted objects with the same name and generation. This field is only returned for deleted objects in hierarchical namespace buckets.
1849 &quot;retention&quot;: { # A collection of object level retention parameters.
1850 &quot;mode&quot;: &quot;A String&quot;, # The bucket&#x27;s object retention mode, can only be Unlocked or Locked.
1851 &quot;retainUntilTime&quot;: &quot;A String&quot;, # A time in RFC 3339 format until which object retention protects this object.
1852 },
1853 &quot;retentionExpirationTime&quot;: &quot;A String&quot;, # A server-determined value that specifies the earliest time that the object&#x27;s retention period expires. This value is in RFC 3339 format. Note 1: This field is not provided for objects with an active event-based hold, since retention expiration is unknown until the hold is removed. Note 2: This value can be provided even when temporary hold is set (so that the user can reason about policy without having to first unset the temporary hold).
1854 &quot;selfLink&quot;: &quot;A String&quot;, # The link to this object.
1855 &quot;size&quot;: &quot;A String&quot;, # Content-Length of the data in bytes.
1856 &quot;softDeleteTime&quot;: &quot;A String&quot;, # The time at which the object became soft-deleted in RFC 3339 format.
1857 &quot;storageClass&quot;: &quot;A String&quot;, # Storage class of the object.
1858 &quot;temporaryHold&quot;: True or False, # Whether an object is under temporary hold. While this flag is set to true, the object is protected against deletion and overwrites. A common use case of this flag is regulatory investigations where objects need to be retained while the investigation is ongoing. Note that unlike event-based hold, temporary hold does not impact retention expiration time of an object.
1859 &quot;timeCreated&quot;: &quot;A String&quot;, # The creation time of the object in RFC 3339 format.
1860 &quot;timeDeleted&quot;: &quot;A String&quot;, # The time at which the object became noncurrent in RFC 3339 format. Will be returned if and only if this version of the object has been deleted.
1861 &quot;timeFinalized&quot;: &quot;A String&quot;, # The time when the object was finalized.
1862 &quot;timeStorageClassUpdated&quot;: &quot;A String&quot;, # The time at which the object&#x27;s storage class was last changed. When the object is initially created, it will be set to timeCreated.
1863 &quot;updated&quot;: &quot;A String&quot;, # The modification time of the object metadata in RFC 3339 format. Set initially to object creation time and then updated whenever any metadata of the object changes. This includes changes made by a requester, such as modifying custom metadata, as well as changes made by Cloud Storage on behalf of a requester, such as changing the storage class based on an Object Lifecycle Configuration.
1864 },
1865 &quot;rewriteToken&quot;: &quot;A String&quot;, # A token to use in subsequent requests to continue copying data. This token is present in the response only when there is more data to copy.
1866 &quot;totalBytesRewritten&quot;: &quot;A String&quot;, # The total bytes written so far, which can be used to provide a waiting user with a progress indicator. This property is always present in the response.
1867 }</pre>
1868 </div>
1869
1870 <div class="method">
1871 <code class="details" id="setIamPolicy">setIamPolicy(bucket, object, body=None, generation=None, userProject=None)</code>
1872 <pre>Updates an IAM policy for the specified object.
1873
1874 Args:
1875 bucket: string, Name of the bucket in which the object resides. (required)
1876 object: string, Name of the object. For information about how to URL encode object names to be path safe, see [Encoding URI Path Parts](https://cloud.google.com/storage/docs/request-endpoints#encoding). (required)
1877 body: object, The request body.
1878 The object takes the form of:
1879
1880 { # A bucket/object/managedFolder IAM policy.
1881 &quot;bindings&quot;: [ # An association between a role, which comes with a set of permissions, and members who may assume that role.
1882 {
1883 &quot;condition&quot;: { # Represents an expression text. Example: title: &quot;User account presence&quot; description: &quot;Determines whether the request has a user account&quot; expression: &quot;size(request.user) &gt; 0&quot; # The condition that is associated with this binding. NOTE: an unsatisfied condition will not allow user access via current binding. Different bindings, including their conditions, are examined independently.
1884 &quot;description&quot;: &quot;A String&quot;, # An optional description of the expression. This is a longer text which describes the expression, e.g. when hovered over it in a UI.
1885 &quot;expression&quot;: &quot;A String&quot;, # Textual representation of an expression in Common Expression Language syntax. The application context of the containing message determines which well-known feature set of CEL is supported.
1886 &quot;location&quot;: &quot;A String&quot;, # An optional string indicating the location of the expression for error reporting, e.g. a file name and a position in the file.
1887 &quot;title&quot;: &quot;A String&quot;, # An optional title for the expression, i.e. a short string describing its purpose. This can be used e.g. in UIs which allow to enter the expression.
1888 },
1889 &quot;members&quot;: [ # A collection of identifiers for members who may assume the provided role. Recognized identifiers are as follows:
1890 # - allUsers - A special identifier that represents anyone on the internet; with or without a Google account.
1891 # - allAuthenticatedUsers - A special identifier that represents anyone who is authenticated with a Google account or a service account.
1892 # - user:emailid - An email address that represents a specific account. For example, user:[email protected] or user:[email protected].
1893 # - serviceAccount:emailid - An email address that represents a service account. For example, serviceAccount:[email protected] .
1894 # - group:emailid - An email address that represents a Google group. For example, group:[email protected].
1895 # - domain:domain - A Google Apps domain name that represents all the users of that domain. For example, domain:google.com or domain:example.com.
1896 # - projectOwner:projectid - Owners of the given project. For example, projectOwner:my-example-project
1897 # - projectEditor:projectid - Editors of the given project. For example, projectEditor:my-example-project
1898 # - projectViewer:projectid - Viewers of the given project. For example, projectViewer:my-example-project
1899 &quot;A String&quot;,
1900 ],
1901 &quot;role&quot;: &quot;A String&quot;, # The role to which members belong. Two types of roles are supported: new IAM roles, which grant permissions that do not map directly to those provided by ACLs, and legacy IAM roles, which do map directly to ACL permissions. All roles are of the format roles/storage.specificRole.
1902 # The new IAM roles are:
1903 # - roles/storage.admin - Full control of Google Cloud Storage resources.
1904 # - roles/storage.objectViewer - Read-Only access to Google Cloud Storage objects.
1905 # - roles/storage.objectCreator - Access to create objects in Google Cloud Storage.
1906 # - roles/storage.objectAdmin - Full control of Google Cloud Storage objects. The legacy IAM roles are:
1907 # - roles/storage.legacyObjectReader - Read-only access to objects without listing. Equivalent to an ACL entry on an object with the READER role.
1908 # - roles/storage.legacyObjectOwner - Read/write access to existing objects without listing. Equivalent to an ACL entry on an object with the OWNER role.
1909 # - roles/storage.legacyBucketReader - Read access to buckets with object listing. Equivalent to an ACL entry on a bucket with the READER role.
1910 # - roles/storage.legacyBucketWriter - Read access to buckets with object listing/creation/deletion. Equivalent to an ACL entry on a bucket with the WRITER role.
1911 # - roles/storage.legacyBucketOwner - Read and write access to existing buckets with object listing/creation/deletion. Equivalent to an ACL entry on a bucket with the OWNER role.
1912 },
1913 ],
1914 &quot;etag&quot;: &quot;A String&quot;, # HTTP 1.1 Entity tag for the policy.
1915 &quot;kind&quot;: &quot;storage#policy&quot;, # The kind of item this is. For policies, this is always storage#policy. This field is ignored on input.
1916 &quot;resourceId&quot;: &quot;A String&quot;, # The ID of the resource to which this policy belongs. Will be of the form projects/_/buckets/bucket for buckets, projects/_/buckets/bucket/objects/object for objects, and projects/_/buckets/bucket/managedFolders/managedFolder. A specific generation may be specified by appending #generationNumber to the end of the object name, e.g. projects/_/buckets/my-bucket/objects/data.txt#17. The current generation can be denoted with #0. This field is ignored on input.
1917 &quot;version&quot;: 42, # The IAM policy format version.
1918 }
1919
1920 generation: string, If present, selects a specific revision of this object (as opposed to the latest version, the default).
1921 userProject: string, The project to be billed for this request. Required for Requester Pays buckets.
1922
1923 Returns:
1924 An object of the form:
1925
1926 { # A bucket/object/managedFolder IAM policy.
1927 &quot;bindings&quot;: [ # An association between a role, which comes with a set of permissions, and members who may assume that role.
1928 {
1929 &quot;condition&quot;: { # Represents an expression text. Example: title: &quot;User account presence&quot; description: &quot;Determines whether the request has a user account&quot; expression: &quot;size(request.user) &gt; 0&quot; # The condition that is associated with this binding. NOTE: an unsatisfied condition will not allow user access via current binding. Different bindings, including their conditions, are examined independently.
1930 &quot;description&quot;: &quot;A String&quot;, # An optional description of the expression. This is a longer text which describes the expression, e.g. when hovered over it in a UI.
1931 &quot;expression&quot;: &quot;A String&quot;, # Textual representation of an expression in Common Expression Language syntax. The application context of the containing message determines which well-known feature set of CEL is supported.
1932 &quot;location&quot;: &quot;A String&quot;, # An optional string indicating the location of the expression for error reporting, e.g. a file name and a position in the file.
1933 &quot;title&quot;: &quot;A String&quot;, # An optional title for the expression, i.e. a short string describing its purpose. This can be used e.g. in UIs which allow to enter the expression.
1934 },
1935 &quot;members&quot;: [ # A collection of identifiers for members who may assume the provided role. Recognized identifiers are as follows:
1936 # - allUsers - A special identifier that represents anyone on the internet; with or without a Google account.
1937 # - allAuthenticatedUsers - A special identifier that represents anyone who is authenticated with a Google account or a service account.
1938 # - user:emailid - An email address that represents a specific account. For example, user:[email protected] or user:[email protected].
1939 # - serviceAccount:emailid - An email address that represents a service account. For example, serviceAccount:[email protected] .
1940 # - group:emailid - An email address that represents a Google group. For example, group:[email protected].
1941 # - domain:domain - A Google Apps domain name that represents all the users of that domain. For example, domain:google.com or domain:example.com.
1942 # - projectOwner:projectid - Owners of the given project. For example, projectOwner:my-example-project
1943 # - projectEditor:projectid - Editors of the given project. For example, projectEditor:my-example-project
1944 # - projectViewer:projectid - Viewers of the given project. For example, projectViewer:my-example-project
1945 &quot;A String&quot;,
1946 ],
1947 &quot;role&quot;: &quot;A String&quot;, # The role to which members belong. Two types of roles are supported: new IAM roles, which grant permissions that do not map directly to those provided by ACLs, and legacy IAM roles, which do map directly to ACL permissions. All roles are of the format roles/storage.specificRole.
1948 # The new IAM roles are:
1949 # - roles/storage.admin - Full control of Google Cloud Storage resources.
1950 # - roles/storage.objectViewer - Read-Only access to Google Cloud Storage objects.
1951 # - roles/storage.objectCreator - Access to create objects in Google Cloud Storage.
1952 # - roles/storage.objectAdmin - Full control of Google Cloud Storage objects. The legacy IAM roles are:
1953 # - roles/storage.legacyObjectReader - Read-only access to objects without listing. Equivalent to an ACL entry on an object with the READER role.
1954 # - roles/storage.legacyObjectOwner - Read/write access to existing objects without listing. Equivalent to an ACL entry on an object with the OWNER role.
1955 # - roles/storage.legacyBucketReader - Read access to buckets with object listing. Equivalent to an ACL entry on a bucket with the READER role.
1956 # - roles/storage.legacyBucketWriter - Read access to buckets with object listing/creation/deletion. Equivalent to an ACL entry on a bucket with the WRITER role.
1957 # - roles/storage.legacyBucketOwner - Read and write access to existing buckets with object listing/creation/deletion. Equivalent to an ACL entry on a bucket with the OWNER role.
1958 },
1959 ],
1960 &quot;etag&quot;: &quot;A String&quot;, # HTTP 1.1 Entity tag for the policy.
1961 &quot;kind&quot;: &quot;storage#policy&quot;, # The kind of item this is. For policies, this is always storage#policy. This field is ignored on input.
1962 &quot;resourceId&quot;: &quot;A String&quot;, # The ID of the resource to which this policy belongs. Will be of the form projects/_/buckets/bucket for buckets, projects/_/buckets/bucket/objects/object for objects, and projects/_/buckets/bucket/managedFolders/managedFolder. A specific generation may be specified by appending #generationNumber to the end of the object name, e.g. projects/_/buckets/my-bucket/objects/data.txt#17. The current generation can be denoted with #0. This field is ignored on input.
1963 &quot;version&quot;: 42, # The IAM policy format version.
1964 }</pre>
1965 </div>
1966
1967 <div class="method">
1968 <code class="details" id="testIamPermissions">testIamPermissions(bucket, object, permissions, generation=None, userProject=None)</code>
1969 <pre>Tests a set of permissions on the given object to see which, if any, are held by the caller.
1970
1971 Args:
1972 bucket: string, Name of the bucket in which the object resides. (required)
1973 object: string, Name of the object. For information about how to URL encode object names to be path safe, see [Encoding URI Path Parts](https://cloud.google.com/storage/docs/request-endpoints#encoding). (required)
1974 permissions: string, Permissions to test. (required) (repeated)
1975 generation: string, If present, selects a specific revision of this object (as opposed to the latest version, the default).
1976 userProject: string, The project to be billed for this request. Required for Requester Pays buckets.
1977
1978 Returns:
1979 An object of the form:
1980
1981 { # A storage.(buckets|objects|managedFolders).testIamPermissions response.
1982 &quot;kind&quot;: &quot;storage#testIamPermissionsResponse&quot;, # The kind of item this is.
1983 &quot;permissions&quot;: [ # The permissions held by the caller. Permissions are always of the format storage.resource.capability, where resource is one of buckets, objects, or managedFolders. The supported permissions are as follows:
1984 # - storage.buckets.delete - Delete bucket.
1985 # - storage.buckets.get - Read bucket metadata.
1986 # - storage.buckets.getIamPolicy - Read bucket IAM policy.
1987 # - storage.buckets.create - Create bucket.
1988 # - storage.buckets.list - List buckets.
1989 # - storage.buckets.setIamPolicy - Update bucket IAM policy.
1990 # - storage.buckets.update - Update bucket metadata.
1991 # - storage.objects.delete - Delete object.
1992 # - storage.objects.get - Read object data and metadata.
1993 # - storage.objects.getIamPolicy - Read object IAM policy.
1994 # - storage.objects.create - Create object.
1995 # - storage.objects.list - List objects.
1996 # - storage.objects.setIamPolicy - Update object IAM policy.
1997 # - storage.objects.update - Update object metadata.
1998 # - storage.managedFolders.delete - Delete managed folder.
1999 # - storage.managedFolders.get - Read managed folder metadata.
2000 # - storage.managedFolders.getIamPolicy - Read managed folder IAM policy.
2001 # - storage.managedFolders.create - Create managed folder.
2002 # - storage.managedFolders.list - List managed folders.
2003 # - storage.managedFolders.setIamPolicy - Update managed folder IAM policy.
2004 &quot;A String&quot;,
2005 ],
2006 }</pre>
2007 </div>
2008
2009 <div class="method">
2010 <code class="details" id="update">update(bucket, object, body=None, generation=None, ifGenerationMatch=None, ifGenerationNotMatch=None, ifMetagenerationMatch=None, ifMetagenerationNotMatch=None, overrideUnlockedRetention=None, predefinedAcl=None, projection=None, userProject=None)</code>
2011 <pre>Updates an object&#x27;s metadata.
2012
2013 Args:
2014 bucket: string, Name of the bucket in which the object resides. (required)
2015 object: string, Name of the object. For information about how to URL encode object names to be path safe, see [Encoding URI Path Parts](https://cloud.google.com/storage/docs/request-endpoints#encoding). (required)
2016 body: object, The request body.
2017 The object takes the form of:
2018
2019 { # An object.
2020 &quot;acl&quot;: [ # Access controls on the object.
2021 { # An access-control entry.
2022 &quot;bucket&quot;: &quot;A String&quot;, # The name of the bucket.
2023 &quot;domain&quot;: &quot;A String&quot;, # The domain associated with the entity, if any.
2024 &quot;email&quot;: &quot;A String&quot;, # The email address associated with the entity, if any.
2025 &quot;entity&quot;: &quot;A String&quot;, # The entity holding the permission, in one of the following forms:
2026 # - user-userId
2027 # - user-email
2028 # - group-groupId
2029 # - group-email
2030 # - domain-domain
2031 # - project-team-projectId
2032 # - allUsers
2033 # - allAuthenticatedUsers Examples:
2034 # - The user [email protected] would be [email protected].
2035 # - The group [email protected] would be [email protected].
2036 # - To refer to all members of the Google Apps for Business domain example.com, the entity would be domain-example.com.
2037 &quot;entityId&quot;: &quot;A String&quot;, # The ID for the entity, if any.
2038 &quot;etag&quot;: &quot;A String&quot;, # HTTP 1.1 Entity tag for the access-control entry.
2039 &quot;generation&quot;: &quot;A String&quot;, # The content generation of the object, if applied to an object.
2040 &quot;id&quot;: &quot;A String&quot;, # The ID of the access-control entry.
2041 &quot;kind&quot;: &quot;storage#objectAccessControl&quot;, # The kind of item this is. For object access control entries, this is always storage#objectAccessControl.
2042 &quot;object&quot;: &quot;A String&quot;, # The name of the object, if applied to an object.
2043 &quot;projectTeam&quot;: { # The project team associated with the entity, if any.
2044 &quot;projectNumber&quot;: &quot;A String&quot;, # The project number.
2045 &quot;team&quot;: &quot;A String&quot;, # The team.
2046 },
2047 &quot;role&quot;: &quot;A String&quot;, # The access permission for the entity.
2048 &quot;selfLink&quot;: &quot;A String&quot;, # The link to this access-control entry.
2049 },
2050 ],
2051 &quot;bucket&quot;: &quot;A String&quot;, # The name of the bucket containing this object.
2052 &quot;cacheControl&quot;: &quot;A String&quot;, # Cache-Control directive for the object data. If omitted, and the object is accessible to all anonymous users, the default will be public, max-age=3600.
2053 &quot;componentCount&quot;: 42, # Number of underlying components that make up this object. Components are accumulated by compose operations.
2054 &quot;contentDisposition&quot;: &quot;A String&quot;, # Content-Disposition of the object data.
2055 &quot;contentEncoding&quot;: &quot;A String&quot;, # Content-Encoding of the object data.
2056 &quot;contentLanguage&quot;: &quot;A String&quot;, # Content-Language of the object data.
2057 &quot;contentType&quot;: &quot;A String&quot;, # Content-Type of the object data. If an object is stored without a Content-Type, it is served as application/octet-stream.
2058 &quot;contexts&quot;: { # User-defined or system-defined object contexts. Each object context is a key-payload pair, where the key provides the identification and the payload holds the associated value and additional metadata.
2059 &quot;custom&quot;: { # User-defined object contexts.
2060 &quot;a_key&quot;: { # The payload of a single user-defined object context. # A single user-defined object context.
2061 &quot;createTime&quot;: &quot;A String&quot;, # The time at which the object context was created in RFC 3339 format.
2062 &quot;updateTime&quot;: &quot;A String&quot;, # The time at which the object context was last updated in RFC 3339 format.
2063 &quot;value&quot;: &quot;A String&quot;, # The value of the object context.
2064 },
2065 },
2066 },
2067 &quot;crc32c&quot;: &quot;A String&quot;, # CRC32c checksum, as described in RFC 4960, Appendix B; encoded using base64 in big-endian byte order. For more information about using the CRC32c checksum, see [Data Validation and Change Detection](https://cloud.google.com/storage/docs/data-validation).
2068 &quot;customTime&quot;: &quot;A String&quot;, # A timestamp in RFC 3339 format specified by the user for an object.
2069 &quot;customerEncryption&quot;: { # Metadata of customer-supplied encryption key, if the object is encrypted by such a key.
2070 &quot;encryptionAlgorithm&quot;: &quot;A String&quot;, # The encryption algorithm.
2071 &quot;keySha256&quot;: &quot;A String&quot;, # SHA256 hash value of the encryption key.
2072 },
2073 &quot;etag&quot;: &quot;A String&quot;, # HTTP 1.1 Entity tag for the object.
2074 &quot;eventBasedHold&quot;: True or False, # Whether an object is under event-based hold. Event-based hold is a way to retain objects until an event occurs, which is signified by the hold&#x27;s release (i.e. this value is set to false). After being released (set to false), such objects will be subject to bucket-level retention (if any). One sample use case of this flag is for banks to hold loan documents for at least 3 years after loan is paid in full. Here, bucket-level retention is 3 years and the event is the loan being paid in full. In this example, these objects will be held intact for any number of years until the event has occurred (event-based hold on the object is released) and then 3 more years after that. That means retention duration of the objects begins from the moment event-based hold transitioned from true to false.
2075 &quot;generation&quot;: &quot;A String&quot;, # The content generation of this object. Used for object versioning.
2076 &quot;hardDeleteTime&quot;: &quot;A String&quot;, # This is the time (in the future) when the soft-deleted object will no longer be restorable. It is equal to the soft delete time plus the current soft delete retention duration of the bucket.
2077 &quot;id&quot;: &quot;A String&quot;, # The ID of the object, including the bucket name, object name, and generation number.
2078 &quot;kind&quot;: &quot;storage#object&quot;, # The kind of item this is. For objects, this is always storage#object.
2079 &quot;kmsKeyName&quot;: &quot;A String&quot;, # Not currently supported. Specifying the parameter causes the request to fail with status code 400 - Bad Request.
2080 &quot;md5Hash&quot;: &quot;A String&quot;, # MD5 hash of the data; encoded using base64. For more information about using the MD5 hash, see [Data Validation and Change Detection](https://cloud.google.com/storage/docs/data-validation).
2081 &quot;mediaLink&quot;: &quot;A String&quot;, # Media download link.
2082 &quot;metadata&quot;: { # User-provided metadata, in key/value pairs.
2083 &quot;a_key&quot;: &quot;A String&quot;, # An individual metadata entry.
2084 },
2085 &quot;metageneration&quot;: &quot;A String&quot;, # The version of the metadata for this object at this generation. Used for preconditions and for detecting changes in metadata. A metageneration number is only meaningful in the context of a particular generation of a particular object.
2086 &quot;name&quot;: &quot;A String&quot;, # The name of the object. Required if not specified by URL parameter.
2087 &quot;owner&quot;: { # The owner of the object. This will always be the uploader of the object.
2088 &quot;entity&quot;: &quot;A String&quot;, # The entity, in the form user-userId.
2089 &quot;entityId&quot;: &quot;A String&quot;, # The ID for the entity.
2090 },
2091 &quot;restoreToken&quot;: &quot;A String&quot;, # Restore token used to differentiate deleted objects with the same name and generation. This field is only returned for deleted objects in hierarchical namespace buckets.
2092 &quot;retention&quot;: { # A collection of object level retention parameters.
2093 &quot;mode&quot;: &quot;A String&quot;, # The bucket&#x27;s object retention mode, can only be Unlocked or Locked.
2094 &quot;retainUntilTime&quot;: &quot;A String&quot;, # A time in RFC 3339 format until which object retention protects this object.
2095 },
2096 &quot;retentionExpirationTime&quot;: &quot;A String&quot;, # A server-determined value that specifies the earliest time that the object&#x27;s retention period expires. This value is in RFC 3339 format. Note 1: This field is not provided for objects with an active event-based hold, since retention expiration is unknown until the hold is removed. Note 2: This value can be provided even when temporary hold is set (so that the user can reason about policy without having to first unset the temporary hold).
2097 &quot;selfLink&quot;: &quot;A String&quot;, # The link to this object.
2098 &quot;size&quot;: &quot;A String&quot;, # Content-Length of the data in bytes.
2099 &quot;softDeleteTime&quot;: &quot;A String&quot;, # The time at which the object became soft-deleted in RFC 3339 format.
2100 &quot;storageClass&quot;: &quot;A String&quot;, # Storage class of the object.
2101 &quot;temporaryHold&quot;: True or False, # Whether an object is under temporary hold. While this flag is set to true, the object is protected against deletion and overwrites. A common use case of this flag is regulatory investigations where objects need to be retained while the investigation is ongoing. Note that unlike event-based hold, temporary hold does not impact retention expiration time of an object.
2102 &quot;timeCreated&quot;: &quot;A String&quot;, # The creation time of the object in RFC 3339 format.
2103 &quot;timeDeleted&quot;: &quot;A String&quot;, # The time at which the object became noncurrent in RFC 3339 format. Will be returned if and only if this version of the object has been deleted.
2104 &quot;timeFinalized&quot;: &quot;A String&quot;, # The time when the object was finalized.
2105 &quot;timeStorageClassUpdated&quot;: &quot;A String&quot;, # The time at which the object&#x27;s storage class was last changed. When the object is initially created, it will be set to timeCreated.
2106 &quot;updated&quot;: &quot;A String&quot;, # The modification time of the object metadata in RFC 3339 format. Set initially to object creation time and then updated whenever any metadata of the object changes. This includes changes made by a requester, such as modifying custom metadata, as well as changes made by Cloud Storage on behalf of a requester, such as changing the storage class based on an Object Lifecycle Configuration.
2107 }
2108
2109 generation: string, If present, selects a specific revision of this object (as opposed to the latest version, the default).
2110 ifGenerationMatch: string, Makes the operation conditional on whether the object&#x27;s current generation matches the given value. Setting to 0 makes the operation succeed only if there are no live versions of the object.
2111 ifGenerationNotMatch: string, Makes the operation conditional on whether the object&#x27;s current generation does not match the given value. If no live object exists, the precondition fails. Setting to 0 makes the operation succeed only if there is a live version of the object.
2112 ifMetagenerationMatch: string, Makes the operation conditional on whether the object&#x27;s current metageneration matches the given value.
2113 ifMetagenerationNotMatch: string, Makes the operation conditional on whether the object&#x27;s current metageneration does not match the given value.
2114 overrideUnlockedRetention: boolean, Must be true to remove the retention configuration, reduce its unlocked retention period, or change its mode from unlocked to locked.
2115 predefinedAcl: string, Apply a predefined set of access controls to this object.
2116 Allowed values
2117 authenticatedRead - Object owner gets OWNER access, and allAuthenticatedUsers get READER access.
2118 bucketOwnerFullControl - Object owner gets OWNER access, and project team owners get OWNER access.
2119 bucketOwnerRead - Object owner gets OWNER access, and project team owners get READER access.
2120 private - Object owner gets OWNER access.
2121 projectPrivate - Object owner gets OWNER access, and project team members get access according to their roles.
2122 publicRead - Object owner gets OWNER access, and allUsers get READER access.
2123 projection: string, Set of properties to return. Defaults to full.
2124 Allowed values
2125 full - Include all properties.
2126 noAcl - Omit the owner, acl property.
2127 userProject: string, The project to be billed for this request. Required for Requester Pays buckets.
2128
2129 Returns:
2130 An object of the form:
2131
2132 { # An object.
2133 &quot;acl&quot;: [ # Access controls on the object.
2134 { # An access-control entry.
2135 &quot;bucket&quot;: &quot;A String&quot;, # The name of the bucket.
2136 &quot;domain&quot;: &quot;A String&quot;, # The domain associated with the entity, if any.
2137 &quot;email&quot;: &quot;A String&quot;, # The email address associated with the entity, if any.
2138 &quot;entity&quot;: &quot;A String&quot;, # The entity holding the permission, in one of the following forms:
2139 # - user-userId
2140 # - user-email
2141 # - group-groupId
2142 # - group-email
2143 # - domain-domain
2144 # - project-team-projectId
2145 # - allUsers
2146 # - allAuthenticatedUsers Examples:
2147 # - The user [email protected] would be [email protected].
2148 # - The group [email protected] would be [email protected].
2149 # - To refer to all members of the Google Apps for Business domain example.com, the entity would be domain-example.com.
2150 &quot;entityId&quot;: &quot;A String&quot;, # The ID for the entity, if any.
2151 &quot;etag&quot;: &quot;A String&quot;, # HTTP 1.1 Entity tag for the access-control entry.
2152 &quot;generation&quot;: &quot;A String&quot;, # The content generation of the object, if applied to an object.
2153 &quot;id&quot;: &quot;A String&quot;, # The ID of the access-control entry.
2154 &quot;kind&quot;: &quot;storage#objectAccessControl&quot;, # The kind of item this is. For object access control entries, this is always storage#objectAccessControl.
2155 &quot;object&quot;: &quot;A String&quot;, # The name of the object, if applied to an object.
2156 &quot;projectTeam&quot;: { # The project team associated with the entity, if any.
2157 &quot;projectNumber&quot;: &quot;A String&quot;, # The project number.
2158 &quot;team&quot;: &quot;A String&quot;, # The team.
2159 },
2160 &quot;role&quot;: &quot;A String&quot;, # The access permission for the entity.
2161 &quot;selfLink&quot;: &quot;A String&quot;, # The link to this access-control entry.
2162 },
2163 ],
2164 &quot;bucket&quot;: &quot;A String&quot;, # The name of the bucket containing this object.
2165 &quot;cacheControl&quot;: &quot;A String&quot;, # Cache-Control directive for the object data. If omitted, and the object is accessible to all anonymous users, the default will be public, max-age=3600.
2166 &quot;componentCount&quot;: 42, # Number of underlying components that make up this object. Components are accumulated by compose operations.
2167 &quot;contentDisposition&quot;: &quot;A String&quot;, # Content-Disposition of the object data.
2168 &quot;contentEncoding&quot;: &quot;A String&quot;, # Content-Encoding of the object data.
2169 &quot;contentLanguage&quot;: &quot;A String&quot;, # Content-Language of the object data.
2170 &quot;contentType&quot;: &quot;A String&quot;, # Content-Type of the object data. If an object is stored without a Content-Type, it is served as application/octet-stream.
2171 &quot;contexts&quot;: { # User-defined or system-defined object contexts. Each object context is a key-payload pair, where the key provides the identification and the payload holds the associated value and additional metadata.
2172 &quot;custom&quot;: { # User-defined object contexts.
2173 &quot;a_key&quot;: { # The payload of a single user-defined object context. # A single user-defined object context.
2174 &quot;createTime&quot;: &quot;A String&quot;, # The time at which the object context was created in RFC 3339 format.
2175 &quot;updateTime&quot;: &quot;A String&quot;, # The time at which the object context was last updated in RFC 3339 format.
2176 &quot;value&quot;: &quot;A String&quot;, # The value of the object context.
2177 },
2178 },
2179 },
2180 &quot;crc32c&quot;: &quot;A String&quot;, # CRC32c checksum, as described in RFC 4960, Appendix B; encoded using base64 in big-endian byte order. For more information about using the CRC32c checksum, see [Data Validation and Change Detection](https://cloud.google.com/storage/docs/data-validation).
2181 &quot;customTime&quot;: &quot;A String&quot;, # A timestamp in RFC 3339 format specified by the user for an object.
2182 &quot;customerEncryption&quot;: { # Metadata of customer-supplied encryption key, if the object is encrypted by such a key.
2183 &quot;encryptionAlgorithm&quot;: &quot;A String&quot;, # The encryption algorithm.
2184 &quot;keySha256&quot;: &quot;A String&quot;, # SHA256 hash value of the encryption key.
2185 },
2186 &quot;etag&quot;: &quot;A String&quot;, # HTTP 1.1 Entity tag for the object.
2187 &quot;eventBasedHold&quot;: True or False, # Whether an object is under event-based hold. Event-based hold is a way to retain objects until an event occurs, which is signified by the hold&#x27;s release (i.e. this value is set to false). After being released (set to false), such objects will be subject to bucket-level retention (if any). One sample use case of this flag is for banks to hold loan documents for at least 3 years after loan is paid in full. Here, bucket-level retention is 3 years and the event is the loan being paid in full. In this example, these objects will be held intact for any number of years until the event has occurred (event-based hold on the object is released) and then 3 more years after that. That means retention duration of the objects begins from the moment event-based hold transitioned from true to false.
2188 &quot;generation&quot;: &quot;A String&quot;, # The content generation of this object. Used for object versioning.
2189 &quot;hardDeleteTime&quot;: &quot;A String&quot;, # This is the time (in the future) when the soft-deleted object will no longer be restorable. It is equal to the soft delete time plus the current soft delete retention duration of the bucket.
2190 &quot;id&quot;: &quot;A String&quot;, # The ID of the object, including the bucket name, object name, and generation number.
2191 &quot;kind&quot;: &quot;storage#object&quot;, # The kind of item this is. For objects, this is always storage#object.
2192 &quot;kmsKeyName&quot;: &quot;A String&quot;, # Not currently supported. Specifying the parameter causes the request to fail with status code 400 - Bad Request.
2193 &quot;md5Hash&quot;: &quot;A String&quot;, # MD5 hash of the data; encoded using base64. For more information about using the MD5 hash, see [Data Validation and Change Detection](https://cloud.google.com/storage/docs/data-validation).
2194 &quot;mediaLink&quot;: &quot;A String&quot;, # Media download link.
2195 &quot;metadata&quot;: { # User-provided metadata, in key/value pairs.
2196 &quot;a_key&quot;: &quot;A String&quot;, # An individual metadata entry.
2197 },
2198 &quot;metageneration&quot;: &quot;A String&quot;, # The version of the metadata for this object at this generation. Used for preconditions and for detecting changes in metadata. A metageneration number is only meaningful in the context of a particular generation of a particular object.
2199 &quot;name&quot;: &quot;A String&quot;, # The name of the object. Required if not specified by URL parameter.
2200 &quot;owner&quot;: { # The owner of the object. This will always be the uploader of the object.
2201 &quot;entity&quot;: &quot;A String&quot;, # The entity, in the form user-userId.
2202 &quot;entityId&quot;: &quot;A String&quot;, # The ID for the entity.
2203 },
2204 &quot;restoreToken&quot;: &quot;A String&quot;, # Restore token used to differentiate deleted objects with the same name and generation. This field is only returned for deleted objects in hierarchical namespace buckets.
2205 &quot;retention&quot;: { # A collection of object level retention parameters.
2206 &quot;mode&quot;: &quot;A String&quot;, # The bucket&#x27;s object retention mode, can only be Unlocked or Locked.
2207 &quot;retainUntilTime&quot;: &quot;A String&quot;, # A time in RFC 3339 format until which object retention protects this object.
2208 },
2209 &quot;retentionExpirationTime&quot;: &quot;A String&quot;, # A server-determined value that specifies the earliest time that the object&#x27;s retention period expires. This value is in RFC 3339 format. Note 1: This field is not provided for objects with an active event-based hold, since retention expiration is unknown until the hold is removed. Note 2: This value can be provided even when temporary hold is set (so that the user can reason about policy without having to first unset the temporary hold).
2210 &quot;selfLink&quot;: &quot;A String&quot;, # The link to this object.
2211 &quot;size&quot;: &quot;A String&quot;, # Content-Length of the data in bytes.
2212 &quot;softDeleteTime&quot;: &quot;A String&quot;, # The time at which the object became soft-deleted in RFC 3339 format.
2213 &quot;storageClass&quot;: &quot;A String&quot;, # Storage class of the object.
2214 &quot;temporaryHold&quot;: True or False, # Whether an object is under temporary hold. While this flag is set to true, the object is protected against deletion and overwrites. A common use case of this flag is regulatory investigations where objects need to be retained while the investigation is ongoing. Note that unlike event-based hold, temporary hold does not impact retention expiration time of an object.
2215 &quot;timeCreated&quot;: &quot;A String&quot;, # The creation time of the object in RFC 3339 format.
2216 &quot;timeDeleted&quot;: &quot;A String&quot;, # The time at which the object became noncurrent in RFC 3339 format. Will be returned if and only if this version of the object has been deleted.
2217 &quot;timeFinalized&quot;: &quot;A String&quot;, # The time when the object was finalized.
2218 &quot;timeStorageClassUpdated&quot;: &quot;A String&quot;, # The time at which the object&#x27;s storage class was last changed. When the object is initially created, it will be set to timeCreated.
2219 &quot;updated&quot;: &quot;A String&quot;, # The modification time of the object metadata in RFC 3339 format. Set initially to object creation time and then updated whenever any metadata of the object changes. This includes changes made by a requester, such as modifying custom metadata, as well as changes made by Cloud Storage on behalf of a requester, such as changing the storage class based on an Object Lifecycle Configuration.
2220 }</pre>
2221 </div>
2222
2223 <div class="method">
2224 <code class="details" id="watchAll">watchAll(bucket, body=None, delimiter=None, endOffset=None, includeTrailingDelimiter=None, maxResults=None, pageToken=None, prefix=None, projection=None, startOffset=None, userProject=None, versions=None)</code>
2225 <pre>Watch for changes on all objects in a bucket.
2226
2227 Args:
2228 bucket: string, Name of the bucket in which to look for objects. (required)
2229 body: object, The request body.
2230 The object takes the form of:
2231
2232 { # An notification channel used to watch for resource changes.
2233 &quot;address&quot;: &quot;A String&quot;, # The address where notifications are delivered for this channel.
2234 &quot;expiration&quot;: &quot;A String&quot;, # Date and time of notification channel expiration, expressed as a Unix timestamp, in milliseconds. Optional.
2235 &quot;id&quot;: &quot;A String&quot;, # A UUID or similar unique string that identifies this channel.
2236 &quot;kind&quot;: &quot;api#channel&quot;, # Identifies this as a notification channel used to watch for changes to a resource, which is &quot;api#channel&quot;.
2237 &quot;params&quot;: { # Additional parameters controlling delivery channel behavior. Optional.
2238 &quot;a_key&quot;: &quot;A String&quot;, # Declares a new parameter by name.
2239 },
2240 &quot;payload&quot;: True or False, # A Boolean value to indicate whether payload is wanted. Optional.
2241 &quot;resourceId&quot;: &quot;A String&quot;, # An opaque ID that identifies the resource being watched on this channel. Stable across different API versions.
2242 &quot;resourceUri&quot;: &quot;A String&quot;, # A version-specific identifier for the watched resource.
2243 &quot;token&quot;: &quot;A String&quot;, # An arbitrary string delivered to the target address with each notification delivered over this channel. Optional.
2244 &quot;type&quot;: &quot;A String&quot;, # The type of delivery mechanism used for this channel.
2245 }
2246
2247 delimiter: string, Returns results in a directory-like mode. items will contain only objects whose names, aside from the prefix, do not contain delimiter. Objects whose names, aside from the prefix, contain delimiter will have their name, truncated after the delimiter, returned in prefixes. Duplicate prefixes are omitted.
2248 endOffset: string, Filter results to objects whose names are lexicographically before endOffset. If startOffset is also set, the objects listed will have names between startOffset (inclusive) and endOffset (exclusive).
2249 includeTrailingDelimiter: boolean, If true, objects that end in exactly one instance of delimiter will have their metadata included in items in addition to prefixes.
2250 maxResults: integer, Maximum number of items plus prefixes to return in a single page of responses. As duplicate prefixes are omitted, fewer total results may be returned than requested. The service will use this parameter or 1,000 items, whichever is smaller.
2251 pageToken: string, A previously-returned page token representing part of the larger set of results to view.
2252 prefix: string, Filter results to objects whose names begin with this prefix.
2253 projection: string, Set of properties to return. Defaults to noAcl.
2254 Allowed values
2255 full - Include all properties.
2256 noAcl - Omit the owner, acl property.
2257 startOffset: string, Filter results to objects whose names are lexicographically equal to or after startOffset. If endOffset is also set, the objects listed will have names between startOffset (inclusive) and endOffset (exclusive).
2258 userProject: string, The project to be billed for this request. Required for Requester Pays buckets.
2259 versions: boolean, If true, lists all versions of an object as distinct results. The default is false. For more information, see [Object Versioning](https://cloud.google.com/storage/docs/object-versioning).
2260
2261 Returns:
2262 An object of the form:
2263
2264 { # An notification channel used to watch for resource changes.
2265 &quot;address&quot;: &quot;A String&quot;, # The address where notifications are delivered for this channel.
2266 &quot;expiration&quot;: &quot;A String&quot;, # Date and time of notification channel expiration, expressed as a Unix timestamp, in milliseconds. Optional.
2267 &quot;id&quot;: &quot;A String&quot;, # A UUID or similar unique string that identifies this channel.
2268 &quot;kind&quot;: &quot;api#channel&quot;, # Identifies this as a notification channel used to watch for changes to a resource, which is &quot;api#channel&quot;.
2269 &quot;params&quot;: { # Additional parameters controlling delivery channel behavior. Optional.
2270 &quot;a_key&quot;: &quot;A String&quot;, # Declares a new parameter by name.
2271 },
2272 &quot;payload&quot;: True or False, # A Boolean value to indicate whether payload is wanted. Optional.
2273 &quot;resourceId&quot;: &quot;A String&quot;, # An opaque ID that identifies the resource being watched on this channel. Stable across different API versions.
2274 &quot;resourceUri&quot;: &quot;A String&quot;, # A version-specific identifier for the watched resource.
2275 &quot;token&quot;: &quot;A String&quot;, # An arbitrary string delivered to the target address with each notification delivered over this channel. Optional.
2276 &quot;type&quot;: &quot;A String&quot;, # The type of delivery mechanism used for this channel.
2277 }</pre>
2278 </div>
2279
2280 </body></html>