1<html><body> 2<style> 3 4body, 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 15body { 16 font-size: 13px; 17 padding: 1em; 18} 19 20h1 { 21 font-size: 26px; 22 margin-bottom: 1em; 23} 24 25h2 { 26 font-size: 24px; 27 margin-bottom: 1em; 28} 29 30h3 { 31 font-size: 20px; 32 margin-bottom: 1em; 33 margin-top: 1em; 34} 35 36pre, code { 37 line-height: 1.5; 38 font-family: Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Lucida Console', monospace; 39} 40 41pre { 42 margin-top: 0.5em; 43} 44 45h1, h2, h3, p { 46 font-family: Arial, sans serif; 47} 48 49h1, 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="#close">close()</a></code></p> 79<p class="firstline">Close httplib2 connections.</p> 80<p class="toc_element"> 81 <code><a href="#compose">compose(destinationBucket, destinationObject, body=None, destinationPredefinedAcl=None, ifGenerationMatch=None, ifMetagenerationMatch=None, kmsKeyName=None, provisionalUserProject=None, userProject=None)</a></code></p> 82<p class="firstline">Concatenates a list of existing objects into a new object in the same bucket.</p> 83<p class="toc_element"> 84 <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, provisionalUserProject=None, sourceGeneration=None, userProject=None)</a></code></p> 85<p class="firstline">Copies a source object to a destination object. Optionally overrides metadata.</p> 86<p class="toc_element"> 87 <code><a href="#delete">delete(bucket, object, generation=None, ifGenerationMatch=None, ifGenerationNotMatch=None, ifMetagenerationMatch=None, ifMetagenerationNotMatch=None, provisionalUserProject=None, userProject=None)</a></code></p> 88<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> 89<p class="toc_element"> 90 <code><a href="#get">get(bucket, object, generation=None, ifGenerationMatch=None, ifGenerationNotMatch=None, ifMetagenerationMatch=None, ifMetagenerationNotMatch=None, projection=None, provisionalUserProject=None, userProject=None)</a></code></p> 91<p class="firstline">Retrieves an object or its metadata.</p> 92<p class="toc_element"> 93 <code><a href="#getIamPolicy">getIamPolicy(bucket, object, generation=None, provisionalUserProject=None, userProject=None)</a></code></p> 94<p class="firstline">Returns an IAM policy for the specified object.</p> 95<p class="toc_element"> 96 <code><a href="#get_media">get_media(bucket, object, generation=None, ifGenerationMatch=None, ifGenerationNotMatch=None, ifMetagenerationMatch=None, ifMetagenerationNotMatch=None, projection=None, provisionalUserProject=None, userProject=None)</a></code></p> 97<p class="firstline">Retrieves an object or its metadata.</p> 98<p class="toc_element"> 99 <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, provisionalUserProject=None, userProject=None)</a></code></p> 100<p class="firstline">Stores a new object and metadata.</p> 101<p class="toc_element"> 102 <code><a href="#list">list(bucket, delimiter=None, endOffset=None, includeTrailingDelimiter=None, maxResults=None, pageToken=None, prefix=None, projection=None, provisionalUserProject=None, startOffset=None, userProject=None, versions=None)</a></code></p> 103<p class="firstline">Retrieves a list of objects matching the criteria.</p> 104<p class="toc_element"> 105 <code><a href="#list_next">list_next(previous_request, previous_response)</a></code></p> 106<p class="firstline">Retrieves the next page of results.</p> 107<p class="toc_element"> 108 <code><a href="#patch">patch(bucket, object, body=None, generation=None, ifGenerationMatch=None, ifGenerationNotMatch=None, ifMetagenerationMatch=None, ifMetagenerationNotMatch=None, predefinedAcl=None, projection=None, provisionalUserProject=None, userProject=None)</a></code></p> 109<p class="firstline">Patches an object's metadata.</p> 110<p class="toc_element"> 111 <code><a href="#rewrite">rewrite(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, maxBytesRewrittenPerCall=None, projection=None, provisionalUserProject=None, rewriteToken=None, sourceGeneration=None, userProject=None)</a></code></p> 112<p class="firstline">Rewrites a source object to a destination object. Optionally overrides metadata.</p> 113<p class="toc_element"> 114 <code><a href="#setIamPolicy">setIamPolicy(bucket, object, body=None, generation=None, provisionalUserProject=None, userProject=None)</a></code></p> 115<p class="firstline">Updates an IAM policy for the specified object.</p> 116<p class="toc_element"> 117 <code><a href="#testIamPermissions">testIamPermissions(bucket, object, permissions, generation=None, provisionalUserProject=None, userProject=None)</a></code></p> 118<p class="firstline">Tests a set of permissions on the given object to see which, if any, are held by the caller.</p> 119<p class="toc_element"> 120 <code><a href="#update">update(bucket, object, body=None, generation=None, ifGenerationMatch=None, ifGenerationNotMatch=None, ifMetagenerationMatch=None, ifMetagenerationNotMatch=None, predefinedAcl=None, projection=None, provisionalUserProject=None, userProject=None)</a></code></p> 121<p class="firstline">Updates an object's metadata.</p> 122<p class="toc_element"> 123 <code><a href="#watchAll">watchAll(bucket, body=None, delimiter=None, endOffset=None, includeTrailingDelimiter=None, maxResults=None, pageToken=None, prefix=None, projection=None, provisionalUserProject=None, startOffset=None, userProject=None, versions=None)</a></code></p> 124<p class="firstline">Watch for changes on all objects in a bucket.</p> 125<h3>Method Details</h3> 126<div class="method"> 127 <code class="details" id="close">close()</code> 128 <pre>Close httplib2 connections.</pre> 129</div> 130 131<div class="method"> 132 <code class="details" id="compose">compose(destinationBucket, destinationObject, body=None, destinationPredefinedAcl=None, ifGenerationMatch=None, ifMetagenerationMatch=None, kmsKeyName=None, provisionalUserProject=None, userProject=None)</code> 133 <pre>Concatenates a list of existing objects into a new object in the same bucket. 134 135Args: 136 destinationBucket: string, Name of the bucket containing the source objects. The destination object is stored in this bucket. (required) 137 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. (required) 138 body: object, The request body. 139 The object takes the form of: 140 141{ # A Compose request. 142 "destination": { # An object. # Properties of the resulting object. 143 "acl": [ # Access controls on the object. 144 { # An access-control entry. 145 "bucket": "A String", # The name of the bucket. 146 "domain": "A String", # The domain associated with the entity, if any. 147 "email": "A String", # The email address associated with the entity, if any. 148 "entity": "A String", # The entity holding the permission, in one of the following forms: 149 # - user-userId 150 # - user-email 151 # - group-groupId 152 # - group-email 153 # - domain-domain 154 # - project-team-projectId 155 # - allUsers 156 # - allAuthenticatedUsers Examples: 157 # - The user [email protected] would be [email protected]. 158 # - The group [email protected] would be [email protected]. 159 # - To refer to all members of the Google Apps for Business domain example.com, the entity would be domain-example.com. 160 "entityId": "A String", # The ID for the entity, if any. 161 "etag": "A String", # HTTP 1.1 Entity tag for the access-control entry. 162 "generation": "A String", # The content generation of the object, if applied to an object. 163 "id": "A String", # The ID of the access-control entry. 164 "kind": "storage#objectAccessControl", # The kind of item this is. For object access control entries, this is always storage#objectAccessControl. 165 "object": "A String", # The name of the object, if applied to an object. 166 "projectTeam": { # The project team associated with the entity, if any. 167 "projectNumber": "A String", # The project number. 168 "team": "A String", # The team. 169 }, 170 "role": "A String", # The access permission for the entity. 171 "selfLink": "A String", # The link to this access-control entry. 172 }, 173 ], 174 "bucket": "A String", # The name of the bucket containing this object. 175 "cacheControl": "A String", # 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. 176 "componentCount": 42, # Number of underlying components that make up this object. Components are accumulated by compose operations. 177 "contentDisposition": "A String", # Content-Disposition of the object data. 178 "contentEncoding": "A String", # Content-Encoding of the object data. 179 "contentLanguage": "A String", # Content-Language of the object data. 180 "contentType": "A String", # Content-Type of the object data. If an object is stored without a Content-Type, it is served as application/octet-stream. 181 "crc32c": "A String", # 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 Hashes and ETags: Best Practices. 182 "customTime": "A String", # A timestamp in RFC 3339 format specified by the user for an object. 183 "customerEncryption": { # Metadata of customer-supplied encryption key, if the object is encrypted by such a key. 184 "encryptionAlgorithm": "A String", # The encryption algorithm. 185 "keySha256": "A String", # SHA256 hash value of the encryption key. 186 }, 187 "etag": "A String", # HTTP 1.1 Entity tag for the object. 188 "eventBasedHold": 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'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. 189 "generation": "A String", # The content generation of this object. Used for object versioning. 190 "id": "A String", # The ID of the object, including the bucket name, object name, and generation number. 191 "kind": "storage#object", # The kind of item this is. For objects, this is always storage#object. 192 "kmsKeyName": "A String", # Not currently supported. Specifying the parameter causes the request to fail with status code 400 - Bad Request. 193 "md5Hash": "A String", # MD5 hash of the data; encoded using base64. For more information about using the MD5 hash, see Hashes and ETags: Best Practices. 194 "mediaLink": "A String", # Media download link. 195 "metadata": { # User-provided metadata, in key/value pairs. 196 "a_key": "A String", # An individual metadata entry. 197 }, 198 "metageneration": "A String", # 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. 199 "name": "A String", # The name of the object. Required if not specified by URL parameter. 200 "owner": { # The owner of the object. This will always be the uploader of the object. 201 "entity": "A String", # The entity, in the form user-userId. 202 "entityId": "A String", # The ID for the entity. 203 }, 204 "retentionExpirationTime": "A String", # A server-determined value that specifies the earliest time that the object'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). 205 "selfLink": "A String", # The link to this object. 206 "size": "A String", # Content-Length of the data in bytes. 207 "storageClass": "A String", # Storage class of the object. 208 "temporaryHold": 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. 209 "timeCreated": "A String", # The creation time of the object in RFC 3339 format. 210 "timeDeleted": "A String", # The deletion time of the object in RFC 3339 format. Will be returned if and only if this version of the object has been deleted. 211 "timeStorageClassUpdated": "A String", # The time at which the object's storage class was last changed. When the object is initially created, it will be set to timeCreated. 212 "updated": "A String", # The modification time of the object metadata in RFC 3339 format. 213 }, 214 "kind": "storage#composeRequest", # The kind of item this is. 215 "sourceObjects": [ # The list of source objects that will be concatenated into a single object. 216 { 217 "generation": "A String", # The generation of this object to use as the source. 218 "name": "A String", # The source object's name. All source objects must reside in the same bucket. 219 "objectPreconditions": { # Conditions that must be met for this operation to execute. 220 "ifGenerationMatch": "A String", # 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. 221 }, 222 }, 223 ], 224} 225 226 destinationPredefinedAcl: string, Apply a predefined set of access controls to the destination object. 227 Allowed values 228 authenticatedRead - Object owner gets OWNER access, and allAuthenticatedUsers get READER access. 229 bucketOwnerFullControl - Object owner gets OWNER access, and project team owners get OWNER access. 230 bucketOwnerRead - Object owner gets OWNER access, and project team owners get READER access. 231 private - Object owner gets OWNER access. 232 projectPrivate - Object owner gets OWNER access, and project team members get access according to their roles. 233 publicRead - Object owner gets OWNER access, and allUsers get READER access. 234 ifGenerationMatch: string, Makes the operation conditional on whether the object's current generation matches the given value. Setting to 0 makes the operation succeed only if there are no live versions of the object. 235 ifMetagenerationMatch: string, Makes the operation conditional on whether the object's current metageneration matches the given value. 236 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's kms_key_name value, if any. 237 provisionalUserProject: string, The project to be billed for this request if the target bucket is requester-pays bucket. 238 userProject: string, The project to be billed for this request. Required for Requester Pays buckets. 239 240Returns: 241 An object of the form: 242 243 { # An object. 244 "acl": [ # Access controls on the object. 245 { # An access-control entry. 246 "bucket": "A String", # The name of the bucket. 247 "domain": "A String", # The domain associated with the entity, if any. 248 "email": "A String", # The email address associated with the entity, if any. 249 "entity": "A String", # The entity holding the permission, in one of the following forms: 250 # - user-userId 251 # - user-email 252 # - group-groupId 253 # - group-email 254 # - domain-domain 255 # - project-team-projectId 256 # - allUsers 257 # - allAuthenticatedUsers Examples: 258 # - The user [email protected] would be [email protected]. 259 # - The group [email protected] would be [email protected]. 260 # - To refer to all members of the Google Apps for Business domain example.com, the entity would be domain-example.com. 261 "entityId": "A String", # The ID for the entity, if any. 262 "etag": "A String", # HTTP 1.1 Entity tag for the access-control entry. 263 "generation": "A String", # The content generation of the object, if applied to an object. 264 "id": "A String", # The ID of the access-control entry. 265 "kind": "storage#objectAccessControl", # The kind of item this is. For object access control entries, this is always storage#objectAccessControl. 266 "object": "A String", # The name of the object, if applied to an object. 267 "projectTeam": { # The project team associated with the entity, if any. 268 "projectNumber": "A String", # The project number. 269 "team": "A String", # The team. 270 }, 271 "role": "A String", # The access permission for the entity. 272 "selfLink": "A String", # The link to this access-control entry. 273 }, 274 ], 275 "bucket": "A String", # The name of the bucket containing this object. 276 "cacheControl": "A String", # 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. 277 "componentCount": 42, # Number of underlying components that make up this object. Components are accumulated by compose operations. 278 "contentDisposition": "A String", # Content-Disposition of the object data. 279 "contentEncoding": "A String", # Content-Encoding of the object data. 280 "contentLanguage": "A String", # Content-Language of the object data. 281 "contentType": "A String", # Content-Type of the object data. If an object is stored without a Content-Type, it is served as application/octet-stream. 282 "crc32c": "A String", # 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 Hashes and ETags: Best Practices. 283 "customTime": "A String", # A timestamp in RFC 3339 format specified by the user for an object. 284 "customerEncryption": { # Metadata of customer-supplied encryption key, if the object is encrypted by such a key. 285 "encryptionAlgorithm": "A String", # The encryption algorithm. 286 "keySha256": "A String", # SHA256 hash value of the encryption key. 287 }, 288 "etag": "A String", # HTTP 1.1 Entity tag for the object. 289 "eventBasedHold": 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'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. 290 "generation": "A String", # The content generation of this object. Used for object versioning. 291 "id": "A String", # The ID of the object, including the bucket name, object name, and generation number. 292 "kind": "storage#object", # The kind of item this is. For objects, this is always storage#object. 293 "kmsKeyName": "A String", # Not currently supported. Specifying the parameter causes the request to fail with status code 400 - Bad Request. 294 "md5Hash": "A String", # MD5 hash of the data; encoded using base64. For more information about using the MD5 hash, see Hashes and ETags: Best Practices. 295 "mediaLink": "A String", # Media download link. 296 "metadata": { # User-provided metadata, in key/value pairs. 297 "a_key": "A String", # An individual metadata entry. 298 }, 299 "metageneration": "A String", # 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. 300 "name": "A String", # The name of the object. Required if not specified by URL parameter. 301 "owner": { # The owner of the object. This will always be the uploader of the object. 302 "entity": "A String", # The entity, in the form user-userId. 303 "entityId": "A String", # The ID for the entity. 304 }, 305 "retentionExpirationTime": "A String", # A server-determined value that specifies the earliest time that the object'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). 306 "selfLink": "A String", # The link to this object. 307 "size": "A String", # Content-Length of the data in bytes. 308 "storageClass": "A String", # Storage class of the object. 309 "temporaryHold": 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. 310 "timeCreated": "A String", # The creation time of the object in RFC 3339 format. 311 "timeDeleted": "A String", # The deletion time of the object in RFC 3339 format. Will be returned if and only if this version of the object has been deleted. 312 "timeStorageClassUpdated": "A String", # The time at which the object's storage class was last changed. When the object is initially created, it will be set to timeCreated. 313 "updated": "A String", # The modification time of the object metadata in RFC 3339 format. 314}</pre> 315</div> 316 317<div class="method"> 318 <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, provisionalUserProject=None, sourceGeneration=None, userProject=None)</code> 319 <pre>Copies a source object to a destination object. Optionally overrides metadata. 320 321Args: 322 sourceBucket: string, Name of the bucket in which to find the source object. (required) 323 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. (required) 324 destinationBucket: string, Name of the bucket in which to store the new object. Overrides the provided object metadata's bucket value, if any.For information about how to URL encode object names to be path safe, see Encoding URI Path Parts. (required) 325 destinationObject: string, Name of the new object. Required when the object metadata is not otherwise provided. Overrides the object metadata's name value, if any. (required) 326 body: object, The request body. 327 The object takes the form of: 328 329{ # An object. 330 "acl": [ # Access controls on the object. 331 { # An access-control entry. 332 "bucket": "A String", # The name of the bucket. 333 "domain": "A String", # The domain associated with the entity, if any. 334 "email": "A String", # The email address associated with the entity, if any. 335 "entity": "A String", # The entity holding the permission, in one of the following forms: 336 # - user-userId 337 # - user-email 338 # - group-groupId 339 # - group-email 340 # - domain-domain 341 # - project-team-projectId 342 # - allUsers 343 # - allAuthenticatedUsers Examples: 344 # - The user [email protected] would be [email protected]. 345 # - The group [email protected] would be [email protected]. 346 # - To refer to all members of the Google Apps for Business domain example.com, the entity would be domain-example.com. 347 "entityId": "A String", # The ID for the entity, if any. 348 "etag": "A String", # HTTP 1.1 Entity tag for the access-control entry. 349 "generation": "A String", # The content generation of the object, if applied to an object. 350 "id": "A String", # The ID of the access-control entry. 351 "kind": "storage#objectAccessControl", # The kind of item this is. For object access control entries, this is always storage#objectAccessControl. 352 "object": "A String", # The name of the object, if applied to an object. 353 "projectTeam": { # The project team associated with the entity, if any. 354 "projectNumber": "A String", # The project number. 355 "team": "A String", # The team. 356 }, 357 "role": "A String", # The access permission for the entity. 358 "selfLink": "A String", # The link to this access-control entry. 359 }, 360 ], 361 "bucket": "A String", # The name of the bucket containing this object. 362 "cacheControl": "A String", # 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. 363 "componentCount": 42, # Number of underlying components that make up this object. Components are accumulated by compose operations. 364 "contentDisposition": "A String", # Content-Disposition of the object data. 365 "contentEncoding": "A String", # Content-Encoding of the object data. 366 "contentLanguage": "A String", # Content-Language of the object data. 367 "contentType": "A String", # Content-Type of the object data. If an object is stored without a Content-Type, it is served as application/octet-stream. 368 "crc32c": "A String", # 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 Hashes and ETags: Best Practices. 369 "customTime": "A String", # A timestamp in RFC 3339 format specified by the user for an object. 370 "customerEncryption": { # Metadata of customer-supplied encryption key, if the object is encrypted by such a key. 371 "encryptionAlgorithm": "A String", # The encryption algorithm. 372 "keySha256": "A String", # SHA256 hash value of the encryption key. 373 }, 374 "etag": "A String", # HTTP 1.1 Entity tag for the object. 375 "eventBasedHold": 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'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. 376 "generation": "A String", # The content generation of this object. Used for object versioning. 377 "id": "A String", # The ID of the object, including the bucket name, object name, and generation number. 378 "kind": "storage#object", # The kind of item this is. For objects, this is always storage#object. 379 "kmsKeyName": "A String", # Not currently supported. Specifying the parameter causes the request to fail with status code 400 - Bad Request. 380 "md5Hash": "A String", # MD5 hash of the data; encoded using base64. For more information about using the MD5 hash, see Hashes and ETags: Best Practices. 381 "mediaLink": "A String", # Media download link. 382 "metadata": { # User-provided metadata, in key/value pairs. 383 "a_key": "A String", # An individual metadata entry. 384 }, 385 "metageneration": "A String", # 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. 386 "name": "A String", # The name of the object. Required if not specified by URL parameter. 387 "owner": { # The owner of the object. This will always be the uploader of the object. 388 "entity": "A String", # The entity, in the form user-userId. 389 "entityId": "A String", # The ID for the entity. 390 }, 391 "retentionExpirationTime": "A String", # A server-determined value that specifies the earliest time that the object'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). 392 "selfLink": "A String", # The link to this object. 393 "size": "A String", # Content-Length of the data in bytes. 394 "storageClass": "A String", # Storage class of the object. 395 "temporaryHold": 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. 396 "timeCreated": "A String", # The creation time of the object in RFC 3339 format. 397 "timeDeleted": "A String", # The deletion time of the object in RFC 3339 format. Will be returned if and only if this version of the object has been deleted. 398 "timeStorageClassUpdated": "A String", # The time at which the object's storage class was last changed. When the object is initially created, it will be set to timeCreated. 399 "updated": "A String", # The modification time of the object metadata in RFC 3339 format. 400} 401 402 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's kms_key_name value, if any. 403 destinationPredefinedAcl: string, Apply a predefined set of access controls to the destination object. 404 Allowed values 405 authenticatedRead - Object owner gets OWNER access, and allAuthenticatedUsers get READER access. 406 bucketOwnerFullControl - Object owner gets OWNER access, and project team owners get OWNER access. 407 bucketOwnerRead - Object owner gets OWNER access, and project team owners get READER access. 408 private - Object owner gets OWNER access. 409 projectPrivate - Object owner gets OWNER access, and project team members get access according to their roles. 410 publicRead - Object owner gets OWNER access, and allUsers get READER access. 411 ifGenerationMatch: string, Makes the operation conditional on whether the destination object's current generation matches the given value. Setting to 0 makes the operation succeed only if there are no live versions of the object. 412 ifGenerationNotMatch: string, Makes the operation conditional on whether the destination object'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. 413 ifMetagenerationMatch: string, Makes the operation conditional on whether the destination object's current metageneration matches the given value. 414 ifMetagenerationNotMatch: string, Makes the operation conditional on whether the destination object's current metageneration does not match the given value. 415 ifSourceGenerationMatch: string, Makes the operation conditional on whether the source object's current generation matches the given value. 416 ifSourceGenerationNotMatch: string, Makes the operation conditional on whether the source object's current generation does not match the given value. 417 ifSourceMetagenerationMatch: string, Makes the operation conditional on whether the source object's current metageneration matches the given value. 418 ifSourceMetagenerationNotMatch: string, Makes the operation conditional on whether the source object's current metageneration does not match the given value. 419 projection: string, Set of properties to return. Defaults to noAcl, unless the object resource specifies the acl property, when it defaults to full. 420 Allowed values 421 full - Include all properties. 422 noAcl - Omit the owner, acl property. 423 provisionalUserProject: string, The project to be billed for this request if the target bucket is requester-pays bucket. 424 sourceGeneration: string, If present, selects a specific revision of the source object (as opposed to the latest version, the default). 425 userProject: string, The project to be billed for this request. Required for Requester Pays buckets. 426 427Returns: 428 An object of the form: 429 430 { # An object. 431 "acl": [ # Access controls on the object. 432 { # An access-control entry. 433 "bucket": "A String", # The name of the bucket. 434 "domain": "A String", # The domain associated with the entity, if any. 435 "email": "A String", # The email address associated with the entity, if any. 436 "entity": "A String", # The entity holding the permission, in one of the following forms: 437 # - user-userId 438 # - user-email 439 # - group-groupId 440 # - group-email 441 # - domain-domain 442 # - project-team-projectId 443 # - allUsers 444 # - allAuthenticatedUsers Examples: 445 # - The user [email protected] would be [email protected]. 446 # - The group [email protected] would be [email protected]. 447 # - To refer to all members of the Google Apps for Business domain example.com, the entity would be domain-example.com. 448 "entityId": "A String", # The ID for the entity, if any. 449 "etag": "A String", # HTTP 1.1 Entity tag for the access-control entry. 450 "generation": "A String", # The content generation of the object, if applied to an object. 451 "id": "A String", # The ID of the access-control entry. 452 "kind": "storage#objectAccessControl", # The kind of item this is. For object access control entries, this is always storage#objectAccessControl. 453 "object": "A String", # The name of the object, if applied to an object. 454 "projectTeam": { # The project team associated with the entity, if any. 455 "projectNumber": "A String", # The project number. 456 "team": "A String", # The team. 457 }, 458 "role": "A String", # The access permission for the entity. 459 "selfLink": "A String", # The link to this access-control entry. 460 }, 461 ], 462 "bucket": "A String", # The name of the bucket containing this object. 463 "cacheControl": "A String", # 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. 464 "componentCount": 42, # Number of underlying components that make up this object. Components are accumulated by compose operations. 465 "contentDisposition": "A String", # Content-Disposition of the object data. 466 "contentEncoding": "A String", # Content-Encoding of the object data. 467 "contentLanguage": "A String", # Content-Language of the object data. 468 "contentType": "A String", # Content-Type of the object data. If an object is stored without a Content-Type, it is served as application/octet-stream. 469 "crc32c": "A String", # 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 Hashes and ETags: Best Practices. 470 "customTime": "A String", # A timestamp in RFC 3339 format specified by the user for an object. 471 "customerEncryption": { # Metadata of customer-supplied encryption key, if the object is encrypted by such a key. 472 "encryptionAlgorithm": "A String", # The encryption algorithm. 473 "keySha256": "A String", # SHA256 hash value of the encryption key. 474 }, 475 "etag": "A String", # HTTP 1.1 Entity tag for the object. 476 "eventBasedHold": 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'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 "generation": "A String", # The content generation of this object. Used for object versioning. 478 "id": "A String", # The ID of the object, including the bucket name, object name, and generation number. 479 "kind": "storage#object", # The kind of item this is. For objects, this is always storage#object. 480 "kmsKeyName": "A String", # Not currently supported. Specifying the parameter causes the request to fail with status code 400 - Bad Request. 481 "md5Hash": "A String", # MD5 hash of the data; encoded using base64. For more information about using the MD5 hash, see Hashes and ETags: Best Practices. 482 "mediaLink": "A String", # Media download link. 483 "metadata": { # User-provided metadata, in key/value pairs. 484 "a_key": "A String", # An individual metadata entry. 485 }, 486 "metageneration": "A String", # 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. 487 "name": "A String", # The name of the object. Required if not specified by URL parameter. 488 "owner": { # The owner of the object. This will always be the uploader of the object. 489 "entity": "A String", # The entity, in the form user-userId. 490 "entityId": "A String", # The ID for the entity. 491 }, 492 "retentionExpirationTime": "A String", # A server-determined value that specifies the earliest time that the object'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). 493 "selfLink": "A String", # The link to this object. 494 "size": "A String", # Content-Length of the data in bytes. 495 "storageClass": "A String", # Storage class of the object. 496 "temporaryHold": 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. 497 "timeCreated": "A String", # The creation time of the object in RFC 3339 format. 498 "timeDeleted": "A String", # The deletion time of the object in RFC 3339 format. Will be returned if and only if this version of the object has been deleted. 499 "timeStorageClassUpdated": "A String", # The time at which the object's storage class was last changed. When the object is initially created, it will be set to timeCreated. 500 "updated": "A String", # The modification time of the object metadata in RFC 3339 format. 501}</pre> 502</div> 503 504<div class="method"> 505 <code class="details" id="delete">delete(bucket, object, generation=None, ifGenerationMatch=None, ifGenerationNotMatch=None, ifMetagenerationMatch=None, ifMetagenerationNotMatch=None, provisionalUserProject=None, userProject=None)</code> 506 <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. 507 508Args: 509 bucket: string, Name of the bucket in which the object resides. (required) 510 object: string, Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts. (required) 511 generation: string, If present, permanently deletes a specific revision of this object (as opposed to the latest version, the default). 512 ifGenerationMatch: string, Makes the operation conditional on whether the object's current generation matches the given value. Setting to 0 makes the operation succeed only if there are no live versions of the object. 513 ifGenerationNotMatch: string, Makes the operation conditional on whether the object'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. 514 ifMetagenerationMatch: string, Makes the operation conditional on whether the object's current metageneration matches the given value. 515 ifMetagenerationNotMatch: string, Makes the operation conditional on whether the object's current metageneration does not match the given value. 516 provisionalUserProject: string, The project to be billed for this request if the target bucket is requester-pays bucket. 517 userProject: string, The project to be billed for this request. Required for Requester Pays buckets. 518</pre> 519</div> 520 521<div class="method"> 522 <code class="details" id="get">get(bucket, object, generation=None, ifGenerationMatch=None, ifGenerationNotMatch=None, ifMetagenerationMatch=None, ifMetagenerationNotMatch=None, projection=None, provisionalUserProject=None, userProject=None)</code> 523 <pre>Retrieves an object or its metadata. 524 525Args: 526 bucket: string, Name of the bucket in which the object resides. (required) 527 object: string, Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts. (required) 528 generation: string, If present, selects a specific revision of this object (as opposed to the latest version, the default). 529 ifGenerationMatch: string, Makes the operation conditional on whether the object's current generation matches the given value. Setting to 0 makes the operation succeed only if there are no live versions of the object. 530 ifGenerationNotMatch: string, Makes the operation conditional on whether the object'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. 531 ifMetagenerationMatch: string, Makes the operation conditional on whether the object's current metageneration matches the given value. 532 ifMetagenerationNotMatch: string, Makes the operation conditional on whether the object's current metageneration does not match the given value. 533 projection: string, Set of properties to return. Defaults to noAcl. 534 Allowed values 535 full - Include all properties. 536 noAcl - Omit the owner, acl property. 537 provisionalUserProject: string, The project to be billed for this request if the target bucket is requester-pays bucket. 538 userProject: string, The project to be billed for this request. Required for Requester Pays buckets. 539 540Returns: 541 An object of the form: 542 543 { # An object. 544 "acl": [ # Access controls on the object. 545 { # An access-control entry. 546 "bucket": "A String", # The name of the bucket. 547 "domain": "A String", # The domain associated with the entity, if any. 548 "email": "A String", # The email address associated with the entity, if any. 549 "entity": "A String", # The entity holding the permission, in one of the following forms: 550 # - user-userId 551 # - user-email 552 # - group-groupId 553 # - group-email 554 # - domain-domain 555 # - project-team-projectId 556 # - allUsers 557 # - allAuthenticatedUsers Examples: 558 # - The user [email protected] would be [email protected]. 559 # - The group [email protected] would be [email protected]. 560 # - To refer to all members of the Google Apps for Business domain example.com, the entity would be domain-example.com. 561 "entityId": "A String", # The ID for the entity, if any. 562 "etag": "A String", # HTTP 1.1 Entity tag for the access-control entry. 563 "generation": "A String", # The content generation of the object, if applied to an object. 564 "id": "A String", # The ID of the access-control entry. 565 "kind": "storage#objectAccessControl", # The kind of item this is. For object access control entries, this is always storage#objectAccessControl. 566 "object": "A String", # The name of the object, if applied to an object. 567 "projectTeam": { # The project team associated with the entity, if any. 568 "projectNumber": "A String", # The project number. 569 "team": "A String", # The team. 570 }, 571 "role": "A String", # The access permission for the entity. 572 "selfLink": "A String", # The link to this access-control entry. 573 }, 574 ], 575 "bucket": "A String", # The name of the bucket containing this object. 576 "cacheControl": "A String", # 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. 577 "componentCount": 42, # Number of underlying components that make up this object. Components are accumulated by compose operations. 578 "contentDisposition": "A String", # Content-Disposition of the object data. 579 "contentEncoding": "A String", # Content-Encoding of the object data. 580 "contentLanguage": "A String", # Content-Language of the object data. 581 "contentType": "A String", # Content-Type of the object data. If an object is stored without a Content-Type, it is served as application/octet-stream. 582 "crc32c": "A String", # 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 Hashes and ETags: Best Practices. 583 "customTime": "A String", # A timestamp in RFC 3339 format specified by the user for an object. 584 "customerEncryption": { # Metadata of customer-supplied encryption key, if the object is encrypted by such a key. 585 "encryptionAlgorithm": "A String", # The encryption algorithm. 586 "keySha256": "A String", # SHA256 hash value of the encryption key. 587 }, 588 "etag": "A String", # HTTP 1.1 Entity tag for the object. 589 "eventBasedHold": 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'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. 590 "generation": "A String", # The content generation of this object. Used for object versioning. 591 "id": "A String", # The ID of the object, including the bucket name, object name, and generation number. 592 "kind": "storage#object", # The kind of item this is. For objects, this is always storage#object. 593 "kmsKeyName": "A String", # Not currently supported. Specifying the parameter causes the request to fail with status code 400 - Bad Request. 594 "md5Hash": "A String", # MD5 hash of the data; encoded using base64. For more information about using the MD5 hash, see Hashes and ETags: Best Practices. 595 "mediaLink": "A String", # Media download link. 596 "metadata": { # User-provided metadata, in key/value pairs. 597 "a_key": "A String", # An individual metadata entry. 598 }, 599 "metageneration": "A String", # 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. 600 "name": "A String", # The name of the object. Required if not specified by URL parameter. 601 "owner": { # The owner of the object. This will always be the uploader of the object. 602 "entity": "A String", # The entity, in the form user-userId. 603 "entityId": "A String", # The ID for the entity. 604 }, 605 "retentionExpirationTime": "A String", # A server-determined value that specifies the earliest time that the object'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). 606 "selfLink": "A String", # The link to this object. 607 "size": "A String", # Content-Length of the data in bytes. 608 "storageClass": "A String", # Storage class of the object. 609 "temporaryHold": 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. 610 "timeCreated": "A String", # The creation time of the object in RFC 3339 format. 611 "timeDeleted": "A String", # The deletion time of the object in RFC 3339 format. Will be returned if and only if this version of the object has been deleted. 612 "timeStorageClassUpdated": "A String", # The time at which the object's storage class was last changed. When the object is initially created, it will be set to timeCreated. 613 "updated": "A String", # The modification time of the object metadata in RFC 3339 format. 614}</pre> 615</div> 616 617<div class="method"> 618 <code class="details" id="getIamPolicy">getIamPolicy(bucket, object, generation=None, provisionalUserProject=None, userProject=None)</code> 619 <pre>Returns an IAM policy for the specified object. 620 621Args: 622 bucket: string, Name of the bucket in which the object resides. (required) 623 object: string, Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts. (required) 624 generation: string, If present, selects a specific revision of this object (as opposed to the latest version, the default). 625 provisionalUserProject: string, The project to be billed for this request if the target bucket is requester-pays bucket. 626 userProject: string, The project to be billed for this request. Required for Requester Pays buckets. 627 628Returns: 629 An object of the form: 630 631 { # A bucket/object IAM policy. 632 "bindings": [ # An association between a role, which comes with a set of permissions, and members who may assume that role. 633 { 634 "condition": { # Represents an expression text. Example: title: "User account presence" description: "Determines whether the request has a user account" expression: "size(request.user) > 0" # 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. 635 "description": "A String", # An optional description of the expression. This is a longer text which describes the expression, e.g. when hovered over it in a UI. 636 "expression": "A String", # 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. 637 "location": "A String", # An optional string indicating the location of the expression for error reporting, e.g. a file name and a position in the file. 638 "title": "A String", # 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. 639 }, 640 "members": [ # A collection of identifiers for members who may assume the provided role. Recognized identifiers are as follows: 641 # - allUsers — A special identifier that represents anyone on the internet; with or without a Google account. 642 # - allAuthenticatedUsers — A special identifier that represents anyone who is authenticated with a Google account or a service account. 643 # - user:emailid — An email address that represents a specific account. For example, user:[email protected] or user:[email protected]. 644 # - serviceAccount:emailid — An email address that represents a service account. For example, serviceAccount:[email protected] . 645 # - group:emailid — An email address that represents a Google group. For example, group:[email protected]. 646 # - domain:domain — A Google Apps domain name that represents all the users of that domain. For example, domain:google.com or domain:example.com. 647 # - projectOwner:projectid — Owners of the given project. For example, projectOwner:my-example-project 648 # - projectEditor:projectid — Editors of the given project. For example, projectEditor:my-example-project 649 # - projectViewer:projectid — Viewers of the given project. For example, projectViewer:my-example-project 650 "A String", 651 ], 652 "role": "A String", # 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. 653 # The new IAM roles are: 654 # - roles/storage.admin — Full control of Google Cloud Storage resources. 655 # - roles/storage.objectViewer — Read-Only access to Google Cloud Storage objects. 656 # - roles/storage.objectCreator — Access to create objects in Google Cloud Storage. 657 # - roles/storage.objectAdmin — Full control of Google Cloud Storage objects. The legacy IAM roles are: 658 # - roles/storage.legacyObjectReader — Read-only access to objects without listing. Equivalent to an ACL entry on an object with the READER role. 659 # - roles/storage.legacyObjectOwner — Read/write access to existing objects without listing. Equivalent to an ACL entry on an object with the OWNER role. 660 # - roles/storage.legacyBucketReader — Read access to buckets with object listing. Equivalent to an ACL entry on a bucket with the READER role. 661 # - roles/storage.legacyBucketWriter — Read access to buckets with object listing/creation/deletion. Equivalent to an ACL entry on a bucket with the WRITER role. 662 # - 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. 663 }, 664 ], 665 "etag": "A String", # HTTP 1.1 Entity tag for the policy. 666 "kind": "storage#policy", # The kind of item this is. For policies, this is always storage#policy. This field is ignored on input. 667 "resourceId": "A String", # The ID of the resource to which this policy belongs. Will be of the form projects/_/buckets/bucket for buckets, and projects/_/buckets/bucket/objects/object for objects. 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. 668 "version": 42, # The IAM policy format version. 669}</pre> 670</div> 671 672<div class="method"> 673 <code class="details" id="get_media">get_media(bucket, object, generation=None, ifGenerationMatch=None, ifGenerationNotMatch=None, ifMetagenerationMatch=None, ifMetagenerationNotMatch=None, projection=None, provisionalUserProject=None, userProject=None)</code> 674 <pre>Retrieves an object or its metadata. 675 676Args: 677 bucket: string, Name of the bucket in which the object resides. (required) 678 object: string, Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts. (required) 679 generation: string, If present, selects a specific revision of this object (as opposed to the latest version, the default). 680 ifGenerationMatch: string, Makes the operation conditional on whether the object's current generation matches the given value. Setting to 0 makes the operation succeed only if there are no live versions of the object. 681 ifGenerationNotMatch: string, Makes the operation conditional on whether the object'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. 682 ifMetagenerationMatch: string, Makes the operation conditional on whether the object's current metageneration matches the given value. 683 ifMetagenerationNotMatch: string, Makes the operation conditional on whether the object's current metageneration does not match the given value. 684 projection: string, Set of properties to return. Defaults to noAcl. 685 Allowed values 686 full - Include all properties. 687 noAcl - Omit the owner, acl property. 688 provisionalUserProject: string, The project to be billed for this request if the target bucket is requester-pays bucket. 689 userProject: string, The project to be billed for this request. Required for Requester Pays buckets. 690 691Returns: 692 The media object as a string. 693 694 </pre> 695</div> 696 697<div class="method"> 698 <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, provisionalUserProject=None, userProject=None)</code> 699 <pre>Stores a new object and metadata. 700 701Args: 702 bucket: string, Name of the bucket in which to store the new object. Overrides the provided object metadata's bucket value, if any. (required) 703 body: object, The request body. 704 The object takes the form of: 705 706{ # An object. 707 "acl": [ # Access controls on the object. 708 { # An access-control entry. 709 "bucket": "A String", # The name of the bucket. 710 "domain": "A String", # The domain associated with the entity, if any. 711 "email": "A String", # The email address associated with the entity, if any. 712 "entity": "A String", # The entity holding the permission, in one of the following forms: 713 # - user-userId 714 # - user-email 715 # - group-groupId 716 # - group-email 717 # - domain-domain 718 # - project-team-projectId 719 # - allUsers 720 # - allAuthenticatedUsers Examples: 721 # - The user [email protected] would be [email protected]. 722 # - The group [email protected] would be [email protected]. 723 # - To refer to all members of the Google Apps for Business domain example.com, the entity would be domain-example.com. 724 "entityId": "A String", # The ID for the entity, if any. 725 "etag": "A String", # HTTP 1.1 Entity tag for the access-control entry. 726 "generation": "A String", # The content generation of the object, if applied to an object. 727 "id": "A String", # The ID of the access-control entry. 728 "kind": "storage#objectAccessControl", # The kind of item this is. For object access control entries, this is always storage#objectAccessControl. 729 "object": "A String", # The name of the object, if applied to an object. 730 "projectTeam": { # The project team associated with the entity, if any. 731 "projectNumber": "A String", # The project number. 732 "team": "A String", # The team. 733 }, 734 "role": "A String", # The access permission for the entity. 735 "selfLink": "A String", # The link to this access-control entry. 736 }, 737 ], 738 "bucket": "A String", # The name of the bucket containing this object. 739 "cacheControl": "A String", # 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. 740 "componentCount": 42, # Number of underlying components that make up this object. Components are accumulated by compose operations. 741 "contentDisposition": "A String", # Content-Disposition of the object data. 742 "contentEncoding": "A String", # Content-Encoding of the object data. 743 "contentLanguage": "A String", # Content-Language of the object data. 744 "contentType": "A String", # Content-Type of the object data. If an object is stored without a Content-Type, it is served as application/octet-stream. 745 "crc32c": "A String", # 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 Hashes and ETags: Best Practices. 746 "customTime": "A String", # A timestamp in RFC 3339 format specified by the user for an object. 747 "customerEncryption": { # Metadata of customer-supplied encryption key, if the object is encrypted by such a key. 748 "encryptionAlgorithm": "A String", # The encryption algorithm. 749 "keySha256": "A String", # SHA256 hash value of the encryption key. 750 }, 751 "etag": "A String", # HTTP 1.1 Entity tag for the object. 752 "eventBasedHold": 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'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. 753 "generation": "A String", # The content generation of this object. Used for object versioning. 754 "id": "A String", # The ID of the object, including the bucket name, object name, and generation number. 755 "kind": "storage#object", # The kind of item this is. For objects, this is always storage#object. 756 "kmsKeyName": "A String", # Not currently supported. Specifying the parameter causes the request to fail with status code 400 - Bad Request. 757 "md5Hash": "A String", # MD5 hash of the data; encoded using base64. For more information about using the MD5 hash, see Hashes and ETags: Best Practices. 758 "mediaLink": "A String", # Media download link. 759 "metadata": { # User-provided metadata, in key/value pairs. 760 "a_key": "A String", # An individual metadata entry. 761 }, 762 "metageneration": "A String", # 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. 763 "name": "A String", # The name of the object. Required if not specified by URL parameter. 764 "owner": { # The owner of the object. This will always be the uploader of the object. 765 "entity": "A String", # The entity, in the form user-userId. 766 "entityId": "A String", # The ID for the entity. 767 }, 768 "retentionExpirationTime": "A String", # A server-determined value that specifies the earliest time that the object'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). 769 "selfLink": "A String", # The link to this object. 770 "size": "A String", # Content-Length of the data in bytes. 771 "storageClass": "A String", # Storage class of the object. 772 "temporaryHold": 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. 773 "timeCreated": "A String", # The creation time of the object in RFC 3339 format. 774 "timeDeleted": "A String", # The deletion time of the object in RFC 3339 format. Will be returned if and only if this version of the object has been deleted. 775 "timeStorageClassUpdated": "A String", # The time at which the object's storage class was last changed. When the object is initially created, it will be set to timeCreated. 776 "updated": "A String", # The modification time of the object metadata in RFC 3339 format. 777} 778 779 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. 780 ifGenerationMatch: string, Makes the operation conditional on whether the object's current generation matches the given value. Setting to 0 makes the operation succeed only if there are no live versions of the object. 781 ifGenerationNotMatch: string, Makes the operation conditional on whether the object'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. 782 ifMetagenerationMatch: string, Makes the operation conditional on whether the object's current metageneration matches the given value. 783 ifMetagenerationNotMatch: string, Makes the operation conditional on whether the object's current metageneration does not match the given value. 784 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's kms_key_name value, if any. 785 media_body: string, The filename of the media request body, or an instance of a MediaUpload object. 786 media_mime_type: string, The MIME type of the media request body, or an instance of a MediaUpload object. 787 name: string, Name of the object. Required when the object metadata is not otherwise provided. Overrides the object metadata's name value, if any. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts. 788 predefinedAcl: string, Apply a predefined set of access controls to this object. 789 Allowed values 790 authenticatedRead - Object owner gets OWNER access, and allAuthenticatedUsers get READER access. 791 bucketOwnerFullControl - Object owner gets OWNER access, and project team owners get OWNER access. 792 bucketOwnerRead - Object owner gets OWNER access, and project team owners get READER access. 793 private - Object owner gets OWNER access. 794 projectPrivate - Object owner gets OWNER access, and project team members get access according to their roles. 795 publicRead - Object owner gets OWNER access, and allUsers get READER access. 796 projection: string, Set of properties to return. Defaults to noAcl, unless the object resource specifies the acl property, when it defaults to full. 797 Allowed values 798 full - Include all properties. 799 noAcl - Omit the owner, acl property. 800 provisionalUserProject: string, The project to be billed for this request if the target bucket is requester-pays bucket. 801 userProject: string, The project to be billed for this request. Required for Requester Pays buckets. 802 803Returns: 804 An object of the form: 805 806 { # An object. 807 "acl": [ # Access controls on the object. 808 { # An access-control entry. 809 "bucket": "A String", # The name of the bucket. 810 "domain": "A String", # The domain associated with the entity, if any. 811 "email": "A String", # The email address associated with the entity, if any. 812 "entity": "A String", # The entity holding the permission, in one of the following forms: 813 # - user-userId 814 # - user-email 815 # - group-groupId 816 # - group-email 817 # - domain-domain 818 # - project-team-projectId 819 # - allUsers 820 # - allAuthenticatedUsers Examples: 821 # - The user [email protected] would be [email protected]. 822 # - The group [email protected] would be [email protected]. 823 # - To refer to all members of the Google Apps for Business domain example.com, the entity would be domain-example.com. 824 "entityId": "A String", # The ID for the entity, if any. 825 "etag": "A String", # HTTP 1.1 Entity tag for the access-control entry. 826 "generation": "A String", # The content generation of the object, if applied to an object. 827 "id": "A String", # The ID of the access-control entry. 828 "kind": "storage#objectAccessControl", # The kind of item this is. For object access control entries, this is always storage#objectAccessControl. 829 "object": "A String", # The name of the object, if applied to an object. 830 "projectTeam": { # The project team associated with the entity, if any. 831 "projectNumber": "A String", # The project number. 832 "team": "A String", # The team. 833 }, 834 "role": "A String", # The access permission for the entity. 835 "selfLink": "A String", # The link to this access-control entry. 836 }, 837 ], 838 "bucket": "A String", # The name of the bucket containing this object. 839 "cacheControl": "A String", # 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. 840 "componentCount": 42, # Number of underlying components that make up this object. Components are accumulated by compose operations. 841 "contentDisposition": "A String", # Content-Disposition of the object data. 842 "contentEncoding": "A String", # Content-Encoding of the object data. 843 "contentLanguage": "A String", # Content-Language of the object data. 844 "contentType": "A String", # Content-Type of the object data. If an object is stored without a Content-Type, it is served as application/octet-stream. 845 "crc32c": "A String", # 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 Hashes and ETags: Best Practices. 846 "customTime": "A String", # A timestamp in RFC 3339 format specified by the user for an object. 847 "customerEncryption": { # Metadata of customer-supplied encryption key, if the object is encrypted by such a key. 848 "encryptionAlgorithm": "A String", # The encryption algorithm. 849 "keySha256": "A String", # SHA256 hash value of the encryption key. 850 }, 851 "etag": "A String", # HTTP 1.1 Entity tag for the object. 852 "eventBasedHold": 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'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. 853 "generation": "A String", # The content generation of this object. Used for object versioning. 854 "id": "A String", # The ID of the object, including the bucket name, object name, and generation number. 855 "kind": "storage#object", # The kind of item this is. For objects, this is always storage#object. 856 "kmsKeyName": "A String", # Not currently supported. Specifying the parameter causes the request to fail with status code 400 - Bad Request. 857 "md5Hash": "A String", # MD5 hash of the data; encoded using base64. For more information about using the MD5 hash, see Hashes and ETags: Best Practices. 858 "mediaLink": "A String", # Media download link. 859 "metadata": { # User-provided metadata, in key/value pairs. 860 "a_key": "A String", # An individual metadata entry. 861 }, 862 "metageneration": "A String", # 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. 863 "name": "A String", # The name of the object. Required if not specified by URL parameter. 864 "owner": { # The owner of the object. This will always be the uploader of the object. 865 "entity": "A String", # The entity, in the form user-userId. 866 "entityId": "A String", # The ID for the entity. 867 }, 868 "retentionExpirationTime": "A String", # A server-determined value that specifies the earliest time that the object'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). 869 "selfLink": "A String", # The link to this object. 870 "size": "A String", # Content-Length of the data in bytes. 871 "storageClass": "A String", # Storage class of the object. 872 "temporaryHold": 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. 873 "timeCreated": "A String", # The creation time of the object in RFC 3339 format. 874 "timeDeleted": "A String", # The deletion time of the object in RFC 3339 format. Will be returned if and only if this version of the object has been deleted. 875 "timeStorageClassUpdated": "A String", # The time at which the object's storage class was last changed. When the object is initially created, it will be set to timeCreated. 876 "updated": "A String", # The modification time of the object metadata in RFC 3339 format. 877}</pre> 878</div> 879 880<div class="method"> 881 <code class="details" id="list">list(bucket, delimiter=None, endOffset=None, includeTrailingDelimiter=None, maxResults=None, pageToken=None, prefix=None, projection=None, provisionalUserProject=None, startOffset=None, userProject=None, versions=None)</code> 882 <pre>Retrieves a list of objects matching the criteria. 883 884Args: 885 bucket: string, Name of the bucket in which to look for objects. (required) 886 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. 887 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). 888 includeTrailingDelimiter: boolean, If true, objects that end in exactly one instance of delimiter will have their metadata included in items in addition to prefixes. 889 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. 890 pageToken: string, A previously-returned page token representing part of the larger set of results to view. 891 prefix: string, Filter results to objects whose names begin with this prefix. 892 projection: string, Set of properties to return. Defaults to noAcl. 893 Allowed values 894 full - Include all properties. 895 noAcl - Omit the owner, acl property. 896 provisionalUserProject: string, The project to be billed for this request if the target bucket is requester-pays bucket. 897 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). 898 userProject: string, The project to be billed for this request. Required for Requester Pays buckets. 899 versions: boolean, If true, lists all versions of an object as distinct results. The default is false. For more information, see Object Versioning. 900 901Returns: 902 An object of the form: 903 904 { # A list of objects. 905 "items": [ # The list of items. 906 { # An object. 907 "acl": [ # Access controls on the object. 908 { # An access-control entry. 909 "bucket": "A String", # The name of the bucket. 910 "domain": "A String", # The domain associated with the entity, if any. 911 "email": "A String", # The email address associated with the entity, if any. 912 "entity": "A String", # The entity holding the permission, in one of the following forms: 913 # - user-userId 914 # - user-email 915 # - group-groupId 916 # - group-email 917 # - domain-domain 918 # - project-team-projectId 919 # - allUsers 920 # - allAuthenticatedUsers Examples: 921 # - The user [email protected] would be [email protected]. 922 # - The group [email protected] would be [email protected]. 923 # - To refer to all members of the Google Apps for Business domain example.com, the entity would be domain-example.com. 924 "entityId": "A String", # The ID for the entity, if any. 925 "etag": "A String", # HTTP 1.1 Entity tag for the access-control entry. 926 "generation": "A String", # The content generation of the object, if applied to an object. 927 "id": "A String", # The ID of the access-control entry. 928 "kind": "storage#objectAccessControl", # The kind of item this is. For object access control entries, this is always storage#objectAccessControl. 929 "object": "A String", # The name of the object, if applied to an object. 930 "projectTeam": { # The project team associated with the entity, if any. 931 "projectNumber": "A String", # The project number. 932 "team": "A String", # The team. 933 }, 934 "role": "A String", # The access permission for the entity. 935 "selfLink": "A String", # The link to this access-control entry. 936 }, 937 ], 938 "bucket": "A String", # The name of the bucket containing this object. 939 "cacheControl": "A String", # 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. 940 "componentCount": 42, # Number of underlying components that make up this object. Components are accumulated by compose operations. 941 "contentDisposition": "A String", # Content-Disposition of the object data. 942 "contentEncoding": "A String", # Content-Encoding of the object data. 943 "contentLanguage": "A String", # Content-Language of the object data. 944 "contentType": "A String", # Content-Type of the object data. If an object is stored without a Content-Type, it is served as application/octet-stream. 945 "crc32c": "A String", # 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 Hashes and ETags: Best Practices. 946 "customTime": "A String", # A timestamp in RFC 3339 format specified by the user for an object. 947 "customerEncryption": { # Metadata of customer-supplied encryption key, if the object is encrypted by such a key. 948 "encryptionAlgorithm": "A String", # The encryption algorithm. 949 "keySha256": "A String", # SHA256 hash value of the encryption key. 950 }, 951 "etag": "A String", # HTTP 1.1 Entity tag for the object. 952 "eventBasedHold": 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'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. 953 "generation": "A String", # The content generation of this object. Used for object versioning. 954 "id": "A String", # The ID of the object, including the bucket name, object name, and generation number. 955 "kind": "storage#object", # The kind of item this is. For objects, this is always storage#object. 956 "kmsKeyName": "A String", # Not currently supported. Specifying the parameter causes the request to fail with status code 400 - Bad Request. 957 "md5Hash": "A String", # MD5 hash of the data; encoded using base64. For more information about using the MD5 hash, see Hashes and ETags: Best Practices. 958 "mediaLink": "A String", # Media download link. 959 "metadata": { # User-provided metadata, in key/value pairs. 960 "a_key": "A String", # An individual metadata entry. 961 }, 962 "metageneration": "A String", # 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. 963 "name": "A String", # The name of the object. Required if not specified by URL parameter. 964 "owner": { # The owner of the object. This will always be the uploader of the object. 965 "entity": "A String", # The entity, in the form user-userId. 966 "entityId": "A String", # The ID for the entity. 967 }, 968 "retentionExpirationTime": "A String", # A server-determined value that specifies the earliest time that the object'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). 969 "selfLink": "A String", # The link to this object. 970 "size": "A String", # Content-Length of the data in bytes. 971 "storageClass": "A String", # Storage class of the object. 972 "temporaryHold": 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. 973 "timeCreated": "A String", # The creation time of the object in RFC 3339 format. 974 "timeDeleted": "A String", # The deletion time of the object in RFC 3339 format. Will be returned if and only if this version of the object has been deleted. 975 "timeStorageClassUpdated": "A String", # The time at which the object's storage class was last changed. When the object is initially created, it will be set to timeCreated. 976 "updated": "A String", # The modification time of the object metadata in RFC 3339 format. 977 }, 978 ], 979 "kind": "storage#objects", # The kind of item this is. For lists of objects, this is always storage#objects. 980 "nextPageToken": "A String", # The continuation token, used to page through large result sets. Provide this value in a subsequent request to return the next page of results. 981 "prefixes": [ # The list of prefixes of objects matching-but-not-listed up to and including the requested delimiter. 982 "A String", 983 ], 984}</pre> 985</div> 986 987<div class="method"> 988 <code class="details" id="list_next">list_next(previous_request, previous_response)</code> 989 <pre>Retrieves the next page of results. 990 991Args: 992 previous_request: The request for the previous page. (required) 993 previous_response: The response from the request for the previous page. (required) 994 995Returns: 996 A request object that you can call 'execute()' on to request the next 997 page. Returns None if there are no more items in the collection. 998 </pre> 999</div> 1000 1001<div class="method"> 1002 <code class="details" id="patch">patch(bucket, object, body=None, generation=None, ifGenerationMatch=None, ifGenerationNotMatch=None, ifMetagenerationMatch=None, ifMetagenerationNotMatch=None, predefinedAcl=None, projection=None, provisionalUserProject=None, userProject=None)</code> 1003 <pre>Patches an object's metadata. 1004 1005Args: 1006 bucket: string, Name of the bucket in which the object resides. (required) 1007 object: string, Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts. (required) 1008 body: object, The request body. 1009 The object takes the form of: 1010 1011{ # An object. 1012 "acl": [ # Access controls on the object. 1013 { # An access-control entry. 1014 "bucket": "A String", # The name of the bucket. 1015 "domain": "A String", # The domain associated with the entity, if any. 1016 "email": "A String", # The email address associated with the entity, if any. 1017 "entity": "A String", # The entity holding the permission, in one of the following forms: 1018 # - user-userId 1019 # - user-email 1020 # - group-groupId 1021 # - group-email 1022 # - domain-domain 1023 # - project-team-projectId 1024 # - allUsers 1025 # - allAuthenticatedUsers Examples: 1026 # - The user [email protected] would be [email protected]. 1027 # - The group [email protected] would be [email protected]. 1028 # - To refer to all members of the Google Apps for Business domain example.com, the entity would be domain-example.com. 1029 "entityId": "A String", # The ID for the entity, if any. 1030 "etag": "A String", # HTTP 1.1 Entity tag for the access-control entry. 1031 "generation": "A String", # The content generation of the object, if applied to an object. 1032 "id": "A String", # The ID of the access-control entry. 1033 "kind": "storage#objectAccessControl", # The kind of item this is. For object access control entries, this is always storage#objectAccessControl. 1034 "object": "A String", # The name of the object, if applied to an object. 1035 "projectTeam": { # The project team associated with the entity, if any. 1036 "projectNumber": "A String", # The project number. 1037 "team": "A String", # The team. 1038 }, 1039 "role": "A String", # The access permission for the entity. 1040 "selfLink": "A String", # The link to this access-control entry. 1041 }, 1042 ], 1043 "bucket": "A String", # The name of the bucket containing this object. 1044 "cacheControl": "A String", # 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. 1045 "componentCount": 42, # Number of underlying components that make up this object. Components are accumulated by compose operations. 1046 "contentDisposition": "A String", # Content-Disposition of the object data. 1047 "contentEncoding": "A String", # Content-Encoding of the object data. 1048 "contentLanguage": "A String", # Content-Language of the object data. 1049 "contentType": "A String", # Content-Type of the object data. If an object is stored without a Content-Type, it is served as application/octet-stream. 1050 "crc32c": "A String", # 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 Hashes and ETags: Best Practices. 1051 "customTime": "A String", # A timestamp in RFC 3339 format specified by the user for an object. 1052 "customerEncryption": { # Metadata of customer-supplied encryption key, if the object is encrypted by such a key. 1053 "encryptionAlgorithm": "A String", # The encryption algorithm. 1054 "keySha256": "A String", # SHA256 hash value of the encryption key. 1055 }, 1056 "etag": "A String", # HTTP 1.1 Entity tag for the object. 1057 "eventBasedHold": 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'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. 1058 "generation": "A String", # The content generation of this object. Used for object versioning. 1059 "id": "A String", # The ID of the object, including the bucket name, object name, and generation number. 1060 "kind": "storage#object", # The kind of item this is. For objects, this is always storage#object. 1061 "kmsKeyName": "A String", # Not currently supported. Specifying the parameter causes the request to fail with status code 400 - Bad Request. 1062 "md5Hash": "A String", # MD5 hash of the data; encoded using base64. For more information about using the MD5 hash, see Hashes and ETags: Best Practices. 1063 "mediaLink": "A String", # Media download link. 1064 "metadata": { # User-provided metadata, in key/value pairs. 1065 "a_key": "A String", # An individual metadata entry. 1066 }, 1067 "metageneration": "A String", # 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. 1068 "name": "A String", # The name of the object. Required if not specified by URL parameter. 1069 "owner": { # The owner of the object. This will always be the uploader of the object. 1070 "entity": "A String", # The entity, in the form user-userId. 1071 "entityId": "A String", # The ID for the entity. 1072 }, 1073 "retentionExpirationTime": "A String", # A server-determined value that specifies the earliest time that the object'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). 1074 "selfLink": "A String", # The link to this object. 1075 "size": "A String", # Content-Length of the data in bytes. 1076 "storageClass": "A String", # Storage class of the object. 1077 "temporaryHold": 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. 1078 "timeCreated": "A String", # The creation time of the object in RFC 3339 format. 1079 "timeDeleted": "A String", # The deletion time of the object in RFC 3339 format. Will be returned if and only if this version of the object has been deleted. 1080 "timeStorageClassUpdated": "A String", # The time at which the object's storage class was last changed. When the object is initially created, it will be set to timeCreated. 1081 "updated": "A String", # The modification time of the object metadata in RFC 3339 format. 1082} 1083 1084 generation: string, If present, selects a specific revision of this object (as opposed to the latest version, the default). 1085 ifGenerationMatch: string, Makes the operation conditional on whether the object's current generation matches the given value. Setting to 0 makes the operation succeed only if there are no live versions of the object. 1086 ifGenerationNotMatch: string, Makes the operation conditional on whether the object'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. 1087 ifMetagenerationMatch: string, Makes the operation conditional on whether the object's current metageneration matches the given value. 1088 ifMetagenerationNotMatch: string, Makes the operation conditional on whether the object's current metageneration does not match the given value. 1089 predefinedAcl: string, Apply a predefined set of access controls to this object. 1090 Allowed values 1091 authenticatedRead - Object owner gets OWNER access, and allAuthenticatedUsers get READER access. 1092 bucketOwnerFullControl - Object owner gets OWNER access, and project team owners get OWNER access. 1093 bucketOwnerRead - Object owner gets OWNER access, and project team owners get READER access. 1094 private - Object owner gets OWNER access. 1095 projectPrivate - Object owner gets OWNER access, and project team members get access according to their roles. 1096 publicRead - Object owner gets OWNER access, and allUsers get READER access. 1097 projection: string, Set of properties to return. Defaults to full. 1098 Allowed values 1099 full - Include all properties. 1100 noAcl - Omit the owner, acl property. 1101 provisionalUserProject: string, The project to be billed for this request if the target bucket is requester-pays bucket. 1102 userProject: string, The project to be billed for this request, for Requester Pays buckets. 1103 1104Returns: 1105 An object of the form: 1106 1107 { # An object. 1108 "acl": [ # Access controls on the object. 1109 { # An access-control entry. 1110 "bucket": "A String", # The name of the bucket. 1111 "domain": "A String", # The domain associated with the entity, if any. 1112 "email": "A String", # The email address associated with the entity, if any. 1113 "entity": "A String", # The entity holding the permission, in one of the following forms: 1114 # - user-userId 1115 # - user-email 1116 # - group-groupId 1117 # - group-email 1118 # - domain-domain 1119 # - project-team-projectId 1120 # - allUsers 1121 # - allAuthenticatedUsers Examples: 1122 # - The user [email protected] would be [email protected]. 1123 # - The group [email protected] would be [email protected]. 1124 # - To refer to all members of the Google Apps for Business domain example.com, the entity would be domain-example.com. 1125 "entityId": "A String", # The ID for the entity, if any. 1126 "etag": "A String", # HTTP 1.1 Entity tag for the access-control entry. 1127 "generation": "A String", # The content generation of the object, if applied to an object. 1128 "id": "A String", # The ID of the access-control entry. 1129 "kind": "storage#objectAccessControl", # The kind of item this is. For object access control entries, this is always storage#objectAccessControl. 1130 "object": "A String", # The name of the object, if applied to an object. 1131 "projectTeam": { # The project team associated with the entity, if any. 1132 "projectNumber": "A String", # The project number. 1133 "team": "A String", # The team. 1134 }, 1135 "role": "A String", # The access permission for the entity. 1136 "selfLink": "A String", # The link to this access-control entry. 1137 }, 1138 ], 1139 "bucket": "A String", # The name of the bucket containing this object. 1140 "cacheControl": "A String", # 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. 1141 "componentCount": 42, # Number of underlying components that make up this object. Components are accumulated by compose operations. 1142 "contentDisposition": "A String", # Content-Disposition of the object data. 1143 "contentEncoding": "A String", # Content-Encoding of the object data. 1144 "contentLanguage": "A String", # Content-Language of the object data. 1145 "contentType": "A String", # Content-Type of the object data. If an object is stored without a Content-Type, it is served as application/octet-stream. 1146 "crc32c": "A String", # 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 Hashes and ETags: Best Practices. 1147 "customTime": "A String", # A timestamp in RFC 3339 format specified by the user for an object. 1148 "customerEncryption": { # Metadata of customer-supplied encryption key, if the object is encrypted by such a key. 1149 "encryptionAlgorithm": "A String", # The encryption algorithm. 1150 "keySha256": "A String", # SHA256 hash value of the encryption key. 1151 }, 1152 "etag": "A String", # HTTP 1.1 Entity tag for the object. 1153 "eventBasedHold": 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'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. 1154 "generation": "A String", # The content generation of this object. Used for object versioning. 1155 "id": "A String", # The ID of the object, including the bucket name, object name, and generation number. 1156 "kind": "storage#object", # The kind of item this is. For objects, this is always storage#object. 1157 "kmsKeyName": "A String", # Not currently supported. Specifying the parameter causes the request to fail with status code 400 - Bad Request. 1158 "md5Hash": "A String", # MD5 hash of the data; encoded using base64. For more information about using the MD5 hash, see Hashes and ETags: Best Practices. 1159 "mediaLink": "A String", # Media download link. 1160 "metadata": { # User-provided metadata, in key/value pairs. 1161 "a_key": "A String", # An individual metadata entry. 1162 }, 1163 "metageneration": "A String", # 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. 1164 "name": "A String", # The name of the object. Required if not specified by URL parameter. 1165 "owner": { # The owner of the object. This will always be the uploader of the object. 1166 "entity": "A String", # The entity, in the form user-userId. 1167 "entityId": "A String", # The ID for the entity. 1168 }, 1169 "retentionExpirationTime": "A String", # A server-determined value that specifies the earliest time that the object'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). 1170 "selfLink": "A String", # The link to this object. 1171 "size": "A String", # Content-Length of the data in bytes. 1172 "storageClass": "A String", # Storage class of the object. 1173 "temporaryHold": 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. 1174 "timeCreated": "A String", # The creation time of the object in RFC 3339 format. 1175 "timeDeleted": "A String", # The deletion time of the object in RFC 3339 format. Will be returned if and only if this version of the object has been deleted. 1176 "timeStorageClassUpdated": "A String", # The time at which the object's storage class was last changed. When the object is initially created, it will be set to timeCreated. 1177 "updated": "A String", # The modification time of the object metadata in RFC 3339 format. 1178}</pre> 1179</div> 1180 1181<div class="method"> 1182 <code class="details" id="rewrite">rewrite(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, maxBytesRewrittenPerCall=None, projection=None, provisionalUserProject=None, rewriteToken=None, sourceGeneration=None, userProject=None)</code> 1183 <pre>Rewrites a source object to a destination object. Optionally overrides metadata. 1184 1185Args: 1186 sourceBucket: string, Name of the bucket in which to find the source object. (required) 1187 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. (required) 1188 destinationBucket: string, Name of the bucket in which to store the new object. Overrides the provided object metadata's bucket value, if any. (required) 1189 destinationObject: string, Name of the new object. Required when the object metadata is not otherwise provided. Overrides the object metadata's name value, if any. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts. (required) 1190 body: object, The request body. 1191 The object takes the form of: 1192 1193{ # An object. 1194 "acl": [ # Access controls on the object. 1195 { # An access-control entry. 1196 "bucket": "A String", # The name of the bucket. 1197 "domain": "A String", # The domain associated with the entity, if any. 1198 "email": "A String", # The email address associated with the entity, if any. 1199 "entity": "A String", # The entity holding the permission, in one of the following forms: 1200 # - user-userId 1201 # - user-email 1202 # - group-groupId 1203 # - group-email 1204 # - domain-domain 1205 # - project-team-projectId 1206 # - allUsers 1207 # - allAuthenticatedUsers Examples: 1208 # - The user [email protected] would be [email protected]. 1209 # - The group [email protected] would be [email protected]. 1210 # - To refer to all members of the Google Apps for Business domain example.com, the entity would be domain-example.com. 1211 "entityId": "A String", # The ID for the entity, if any. 1212 "etag": "A String", # HTTP 1.1 Entity tag for the access-control entry. 1213 "generation": "A String", # The content generation of the object, if applied to an object. 1214 "id": "A String", # The ID of the access-control entry. 1215 "kind": "storage#objectAccessControl", # The kind of item this is. For object access control entries, this is always storage#objectAccessControl. 1216 "object": "A String", # The name of the object, if applied to an object. 1217 "projectTeam": { # The project team associated with the entity, if any. 1218 "projectNumber": "A String", # The project number. 1219 "team": "A String", # The team. 1220 }, 1221 "role": "A String", # The access permission for the entity. 1222 "selfLink": "A String", # The link to this access-control entry. 1223 }, 1224 ], 1225 "bucket": "A String", # The name of the bucket containing this object. 1226 "cacheControl": "A String", # 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. 1227 "componentCount": 42, # Number of underlying components that make up this object. Components are accumulated by compose operations. 1228 "contentDisposition": "A String", # Content-Disposition of the object data. 1229 "contentEncoding": "A String", # Content-Encoding of the object data. 1230 "contentLanguage": "A String", # Content-Language of the object data. 1231 "contentType": "A String", # Content-Type of the object data. If an object is stored without a Content-Type, it is served as application/octet-stream. 1232 "crc32c": "A String", # 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 Hashes and ETags: Best Practices. 1233 "customTime": "A String", # A timestamp in RFC 3339 format specified by the user for an object. 1234 "customerEncryption": { # Metadata of customer-supplied encryption key, if the object is encrypted by such a key. 1235 "encryptionAlgorithm": "A String", # The encryption algorithm. 1236 "keySha256": "A String", # SHA256 hash value of the encryption key. 1237 }, 1238 "etag": "A String", # HTTP 1.1 Entity tag for the object. 1239 "eventBasedHold": 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'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. 1240 "generation": "A String", # The content generation of this object. Used for object versioning. 1241 "id": "A String", # The ID of the object, including the bucket name, object name, and generation number. 1242 "kind": "storage#object", # The kind of item this is. For objects, this is always storage#object. 1243 "kmsKeyName": "A String", # Not currently supported. Specifying the parameter causes the request to fail with status code 400 - Bad Request. 1244 "md5Hash": "A String", # MD5 hash of the data; encoded using base64. For more information about using the MD5 hash, see Hashes and ETags: Best Practices. 1245 "mediaLink": "A String", # Media download link. 1246 "metadata": { # User-provided metadata, in key/value pairs. 1247 "a_key": "A String", # An individual metadata entry. 1248 }, 1249 "metageneration": "A String", # 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. 1250 "name": "A String", # The name of the object. Required if not specified by URL parameter. 1251 "owner": { # The owner of the object. This will always be the uploader of the object. 1252 "entity": "A String", # The entity, in the form user-userId. 1253 "entityId": "A String", # The ID for the entity. 1254 }, 1255 "retentionExpirationTime": "A String", # A server-determined value that specifies the earliest time that the object'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). 1256 "selfLink": "A String", # The link to this object. 1257 "size": "A String", # Content-Length of the data in bytes. 1258 "storageClass": "A String", # Storage class of the object. 1259 "temporaryHold": 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. 1260 "timeCreated": "A String", # The creation time of the object in RFC 3339 format. 1261 "timeDeleted": "A String", # The deletion time of the object in RFC 3339 format. Will be returned if and only if this version of the object has been deleted. 1262 "timeStorageClassUpdated": "A String", # The time at which the object's storage class was last changed. When the object is initially created, it will be set to timeCreated. 1263 "updated": "A String", # The modification time of the object metadata in RFC 3339 format. 1264} 1265 1266 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's kms_key_name value, if any. 1267 destinationPredefinedAcl: string, Apply a predefined set of access controls to the destination object. 1268 Allowed values 1269 authenticatedRead - Object owner gets OWNER access, and allAuthenticatedUsers get READER access. 1270 bucketOwnerFullControl - Object owner gets OWNER access, and project team owners get OWNER access. 1271 bucketOwnerRead - Object owner gets OWNER access, and project team owners get READER access. 1272 private - Object owner gets OWNER access. 1273 projectPrivate - Object owner gets OWNER access, and project team members get access according to their roles. 1274 publicRead - Object owner gets OWNER access, and allUsers get READER access. 1275 ifGenerationMatch: string, Makes the operation conditional on whether the object's current generation matches the given value. Setting to 0 makes the operation succeed only if there are no live versions of the object. 1276 ifGenerationNotMatch: string, Makes the operation conditional on whether the object'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. 1277 ifMetagenerationMatch: string, Makes the operation conditional on whether the destination object's current metageneration matches the given value. 1278 ifMetagenerationNotMatch: string, Makes the operation conditional on whether the destination object's current metageneration does not match the given value. 1279 ifSourceGenerationMatch: string, Makes the operation conditional on whether the source object's current generation matches the given value. 1280 ifSourceGenerationNotMatch: string, Makes the operation conditional on whether the source object's current generation does not match the given value. 1281 ifSourceMetagenerationMatch: string, Makes the operation conditional on whether the source object's current metageneration matches the given value. 1282 ifSourceMetagenerationNotMatch: string, Makes the operation conditional on whether the source object's current metageneration does not match the given value. 1283 maxBytesRewrittenPerCall: string, The maximum number of bytes that will be rewritten per rewrite request. Most callers shouldn'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'll get an error that the rewriteToken is invalid. 1284 projection: string, Set of properties to return. Defaults to noAcl, unless the object resource specifies the acl property, when it defaults to full. 1285 Allowed values 1286 full - Include all properties. 1287 noAcl - Omit the owner, acl property. 1288 provisionalUserProject: string, The project to be billed for this request if the target bucket is requester-pays bucket. 1289 rewriteToken: string, Include this field (from the previous rewrite response) on each rewrite request after the first one, until the rewrite response 'done' 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. 1290 sourceGeneration: string, If present, selects a specific revision of the source object (as opposed to the latest version, the default). 1291 userProject: string, The project to be billed for this request. Required for Requester Pays buckets. 1292 1293Returns: 1294 An object of the form: 1295 1296 { # A rewrite response. 1297 "done": 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. 1298 "kind": "storage#rewriteResponse", # The kind of item this is. 1299 "objectSize": "A String", # The total size of the object being copied in bytes. This property is always present in the response. 1300 "resource": { # An object. # A resource containing the metadata for the copied-to object. This property is present in the response only when copying completes. 1301 "acl": [ # Access controls on the object. 1302 { # An access-control entry. 1303 "bucket": "A String", # The name of the bucket. 1304 "domain": "A String", # The domain associated with the entity, if any. 1305 "email": "A String", # The email address associated with the entity, if any. 1306 "entity": "A String", # The entity holding the permission, in one of the following forms: 1307 # - user-userId 1308 # - user-email 1309 # - group-groupId 1310 # - group-email 1311 # - domain-domain 1312 # - project-team-projectId 1313 # - allUsers 1314 # - allAuthenticatedUsers Examples: 1315 # - The user [email protected] would be [email protected]. 1316 # - The group [email protected] would be [email protected]. 1317 # - To refer to all members of the Google Apps for Business domain example.com, the entity would be domain-example.com. 1318 "entityId": "A String", # The ID for the entity, if any. 1319 "etag": "A String", # HTTP 1.1 Entity tag for the access-control entry. 1320 "generation": "A String", # The content generation of the object, if applied to an object. 1321 "id": "A String", # The ID of the access-control entry. 1322 "kind": "storage#objectAccessControl", # The kind of item this is. For object access control entries, this is always storage#objectAccessControl. 1323 "object": "A String", # The name of the object, if applied to an object. 1324 "projectTeam": { # The project team associated with the entity, if any. 1325 "projectNumber": "A String", # The project number. 1326 "team": "A String", # The team. 1327 }, 1328 "role": "A String", # The access permission for the entity. 1329 "selfLink": "A String", # The link to this access-control entry. 1330 }, 1331 ], 1332 "bucket": "A String", # The name of the bucket containing this object. 1333 "cacheControl": "A String", # 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. 1334 "componentCount": 42, # Number of underlying components that make up this object. Components are accumulated by compose operations. 1335 "contentDisposition": "A String", # Content-Disposition of the object data. 1336 "contentEncoding": "A String", # Content-Encoding of the object data. 1337 "contentLanguage": "A String", # Content-Language of the object data. 1338 "contentType": "A String", # Content-Type of the object data. If an object is stored without a Content-Type, it is served as application/octet-stream. 1339 "crc32c": "A String", # 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 Hashes and ETags: Best Practices. 1340 "customTime": "A String", # A timestamp in RFC 3339 format specified by the user for an object. 1341 "customerEncryption": { # Metadata of customer-supplied encryption key, if the object is encrypted by such a key. 1342 "encryptionAlgorithm": "A String", # The encryption algorithm. 1343 "keySha256": "A String", # SHA256 hash value of the encryption key. 1344 }, 1345 "etag": "A String", # HTTP 1.1 Entity tag for the object. 1346 "eventBasedHold": 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'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. 1347 "generation": "A String", # The content generation of this object. Used for object versioning. 1348 "id": "A String", # The ID of the object, including the bucket name, object name, and generation number. 1349 "kind": "storage#object", # The kind of item this is. For objects, this is always storage#object. 1350 "kmsKeyName": "A String", # Not currently supported. Specifying the parameter causes the request to fail with status code 400 - Bad Request. 1351 "md5Hash": "A String", # MD5 hash of the data; encoded using base64. For more information about using the MD5 hash, see Hashes and ETags: Best Practices. 1352 "mediaLink": "A String", # Media download link. 1353 "metadata": { # User-provided metadata, in key/value pairs. 1354 "a_key": "A String", # An individual metadata entry. 1355 }, 1356 "metageneration": "A String", # 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. 1357 "name": "A String", # The name of the object. Required if not specified by URL parameter. 1358 "owner": { # The owner of the object. This will always be the uploader of the object. 1359 "entity": "A String", # The entity, in the form user-userId. 1360 "entityId": "A String", # The ID for the entity. 1361 }, 1362 "retentionExpirationTime": "A String", # A server-determined value that specifies the earliest time that the object'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). 1363 "selfLink": "A String", # The link to this object. 1364 "size": "A String", # Content-Length of the data in bytes. 1365 "storageClass": "A String", # Storage class of the object. 1366 "temporaryHold": 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. 1367 "timeCreated": "A String", # The creation time of the object in RFC 3339 format. 1368 "timeDeleted": "A String", # The deletion time of the object in RFC 3339 format. Will be returned if and only if this version of the object has been deleted. 1369 "timeStorageClassUpdated": "A String", # The time at which the object's storage class was last changed. When the object is initially created, it will be set to timeCreated. 1370 "updated": "A String", # The modification time of the object metadata in RFC 3339 format. 1371 }, 1372 "rewriteToken": "A String", # 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. 1373 "totalBytesRewritten": "A String", # 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. 1374}</pre> 1375</div> 1376 1377<div class="method"> 1378 <code class="details" id="setIamPolicy">setIamPolicy(bucket, object, body=None, generation=None, provisionalUserProject=None, userProject=None)</code> 1379 <pre>Updates an IAM policy for the specified object. 1380 1381Args: 1382 bucket: string, Name of the bucket in which the object resides. (required) 1383 object: string, Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts. (required) 1384 body: object, The request body. 1385 The object takes the form of: 1386 1387{ # A bucket/object IAM policy. 1388 "bindings": [ # An association between a role, which comes with a set of permissions, and members who may assume that role. 1389 { 1390 "condition": { # Represents an expression text. Example: title: "User account presence" description: "Determines whether the request has a user account" expression: "size(request.user) > 0" # 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. 1391 "description": "A String", # An optional description of the expression. This is a longer text which describes the expression, e.g. when hovered over it in a UI. 1392 "expression": "A String", # 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. 1393 "location": "A String", # An optional string indicating the location of the expression for error reporting, e.g. a file name and a position in the file. 1394 "title": "A String", # 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. 1395 }, 1396 "members": [ # A collection of identifiers for members who may assume the provided role. Recognized identifiers are as follows: 1397 # - allUsers — A special identifier that represents anyone on the internet; with or without a Google account. 1398 # - allAuthenticatedUsers — A special identifier that represents anyone who is authenticated with a Google account or a service account. 1399 # - user:emailid — An email address that represents a specific account. For example, user:[email protected] or user:[email protected]. 1400 # - serviceAccount:emailid — An email address that represents a service account. For example, serviceAccount:[email protected] . 1401 # - group:emailid — An email address that represents a Google group. For example, group:[email protected]. 1402 # - domain:domain — A Google Apps domain name that represents all the users of that domain. For example, domain:google.com or domain:example.com. 1403 # - projectOwner:projectid — Owners of the given project. For example, projectOwner:my-example-project 1404 # - projectEditor:projectid — Editors of the given project. For example, projectEditor:my-example-project 1405 # - projectViewer:projectid — Viewers of the given project. For example, projectViewer:my-example-project 1406 "A String", 1407 ], 1408 "role": "A String", # 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. 1409 # The new IAM roles are: 1410 # - roles/storage.admin — Full control of Google Cloud Storage resources. 1411 # - roles/storage.objectViewer — Read-Only access to Google Cloud Storage objects. 1412 # - roles/storage.objectCreator — Access to create objects in Google Cloud Storage. 1413 # - roles/storage.objectAdmin — Full control of Google Cloud Storage objects. The legacy IAM roles are: 1414 # - roles/storage.legacyObjectReader — Read-only access to objects without listing. Equivalent to an ACL entry on an object with the READER role. 1415 # - roles/storage.legacyObjectOwner — Read/write access to existing objects without listing. Equivalent to an ACL entry on an object with the OWNER role. 1416 # - roles/storage.legacyBucketReader — Read access to buckets with object listing. Equivalent to an ACL entry on a bucket with the READER role. 1417 # - roles/storage.legacyBucketWriter — Read access to buckets with object listing/creation/deletion. Equivalent to an ACL entry on a bucket with the WRITER role. 1418 # - 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. 1419 }, 1420 ], 1421 "etag": "A String", # HTTP 1.1 Entity tag for the policy. 1422 "kind": "storage#policy", # The kind of item this is. For policies, this is always storage#policy. This field is ignored on input. 1423 "resourceId": "A String", # The ID of the resource to which this policy belongs. Will be of the form projects/_/buckets/bucket for buckets, and projects/_/buckets/bucket/objects/object for objects. 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. 1424 "version": 42, # The IAM policy format version. 1425} 1426 1427 generation: string, If present, selects a specific revision of this object (as opposed to the latest version, the default). 1428 provisionalUserProject: string, The project to be billed for this request if the target bucket is requester-pays bucket. 1429 userProject: string, The project to be billed for this request. Required for Requester Pays buckets. 1430 1431Returns: 1432 An object of the form: 1433 1434 { # A bucket/object IAM policy. 1435 "bindings": [ # An association between a role, which comes with a set of permissions, and members who may assume that role. 1436 { 1437 "condition": { # Represents an expression text. Example: title: "User account presence" description: "Determines whether the request has a user account" expression: "size(request.user) > 0" # 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. 1438 "description": "A String", # An optional description of the expression. This is a longer text which describes the expression, e.g. when hovered over it in a UI. 1439 "expression": "A String", # 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. 1440 "location": "A String", # An optional string indicating the location of the expression for error reporting, e.g. a file name and a position in the file. 1441 "title": "A String", # 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. 1442 }, 1443 "members": [ # A collection of identifiers for members who may assume the provided role. Recognized identifiers are as follows: 1444 # - allUsers — A special identifier that represents anyone on the internet; with or without a Google account. 1445 # - allAuthenticatedUsers — A special identifier that represents anyone who is authenticated with a Google account or a service account. 1446 # - user:emailid — An email address that represents a specific account. For example, user:[email protected] or user:[email protected]. 1447 # - serviceAccount:emailid — An email address that represents a service account. For example, serviceAccount:[email protected] . 1448 # - group:emailid — An email address that represents a Google group. For example, group:[email protected]. 1449 # - domain:domain — A Google Apps domain name that represents all the users of that domain. For example, domain:google.com or domain:example.com. 1450 # - projectOwner:projectid — Owners of the given project. For example, projectOwner:my-example-project 1451 # - projectEditor:projectid — Editors of the given project. For example, projectEditor:my-example-project 1452 # - projectViewer:projectid — Viewers of the given project. For example, projectViewer:my-example-project 1453 "A String", 1454 ], 1455 "role": "A String", # 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. 1456 # The new IAM roles are: 1457 # - roles/storage.admin — Full control of Google Cloud Storage resources. 1458 # - roles/storage.objectViewer — Read-Only access to Google Cloud Storage objects. 1459 # - roles/storage.objectCreator — Access to create objects in Google Cloud Storage. 1460 # - roles/storage.objectAdmin — Full control of Google Cloud Storage objects. The legacy IAM roles are: 1461 # - roles/storage.legacyObjectReader — Read-only access to objects without listing. Equivalent to an ACL entry on an object with the READER role. 1462 # - roles/storage.legacyObjectOwner — Read/write access to existing objects without listing. Equivalent to an ACL entry on an object with the OWNER role. 1463 # - roles/storage.legacyBucketReader — Read access to buckets with object listing. Equivalent to an ACL entry on a bucket with the READER role. 1464 # - roles/storage.legacyBucketWriter — Read access to buckets with object listing/creation/deletion. Equivalent to an ACL entry on a bucket with the WRITER role. 1465 # - 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. 1466 }, 1467 ], 1468 "etag": "A String", # HTTP 1.1 Entity tag for the policy. 1469 "kind": "storage#policy", # The kind of item this is. For policies, this is always storage#policy. This field is ignored on input. 1470 "resourceId": "A String", # The ID of the resource to which this policy belongs. Will be of the form projects/_/buckets/bucket for buckets, and projects/_/buckets/bucket/objects/object for objects. 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. 1471 "version": 42, # The IAM policy format version. 1472}</pre> 1473</div> 1474 1475<div class="method"> 1476 <code class="details" id="testIamPermissions">testIamPermissions(bucket, object, permissions, generation=None, provisionalUserProject=None, userProject=None)</code> 1477 <pre>Tests a set of permissions on the given object to see which, if any, are held by the caller. 1478 1479Args: 1480 bucket: string, Name of the bucket in which the object resides. (required) 1481 object: string, Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts. (required) 1482 permissions: string, Permissions to test. (required) (repeated) 1483 generation: string, If present, selects a specific revision of this object (as opposed to the latest version, the default). 1484 provisionalUserProject: string, The project to be billed for this request if the target bucket is requester-pays bucket. 1485 userProject: string, The project to be billed for this request. Required for Requester Pays buckets. 1486 1487Returns: 1488 An object of the form: 1489 1490 { # A storage.(buckets|objects).testIamPermissions response. 1491 "kind": "storage#testIamPermissionsResponse", # The kind of item this is. 1492 "permissions": [ # The permissions held by the caller. Permissions are always of the format storage.resource.capability, where resource is one of buckets or objects. The supported permissions are as follows: 1493 # - storage.buckets.delete — Delete bucket. 1494 # - storage.buckets.get — Read bucket metadata. 1495 # - storage.buckets.getIamPolicy — Read bucket IAM policy. 1496 # - storage.buckets.create — Create bucket. 1497 # - storage.buckets.list — List buckets. 1498 # - storage.buckets.setIamPolicy — Update bucket IAM policy. 1499 # - storage.buckets.update — Update bucket metadata. 1500 # - storage.objects.delete — Delete object. 1501 # - storage.objects.get — Read object data and metadata. 1502 # - storage.objects.getIamPolicy — Read object IAM policy. 1503 # - storage.objects.create — Create object. 1504 # - storage.objects.list — List objects. 1505 # - storage.objects.setIamPolicy — Update object IAM policy. 1506 # - storage.objects.update — Update object metadata. 1507 "A String", 1508 ], 1509}</pre> 1510</div> 1511 1512<div class="method"> 1513 <code class="details" id="update">update(bucket, object, body=None, generation=None, ifGenerationMatch=None, ifGenerationNotMatch=None, ifMetagenerationMatch=None, ifMetagenerationNotMatch=None, predefinedAcl=None, projection=None, provisionalUserProject=None, userProject=None)</code> 1514 <pre>Updates an object's metadata. 1515 1516Args: 1517 bucket: string, Name of the bucket in which the object resides. (required) 1518 object: string, Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts. (required) 1519 body: object, The request body. 1520 The object takes the form of: 1521 1522{ # An object. 1523 "acl": [ # Access controls on the object. 1524 { # An access-control entry. 1525 "bucket": "A String", # The name of the bucket. 1526 "domain": "A String", # The domain associated with the entity, if any. 1527 "email": "A String", # The email address associated with the entity, if any. 1528 "entity": "A String", # The entity holding the permission, in one of the following forms: 1529 # - user-userId 1530 # - user-email 1531 # - group-groupId 1532 # - group-email 1533 # - domain-domain 1534 # - project-team-projectId 1535 # - allUsers 1536 # - allAuthenticatedUsers Examples: 1537 # - The user [email protected] would be [email protected]. 1538 # - The group [email protected] would be [email protected]. 1539 # - To refer to all members of the Google Apps for Business domain example.com, the entity would be domain-example.com. 1540 "entityId": "A String", # The ID for the entity, if any. 1541 "etag": "A String", # HTTP 1.1 Entity tag for the access-control entry. 1542 "generation": "A String", # The content generation of the object, if applied to an object. 1543 "id": "A String", # The ID of the access-control entry. 1544 "kind": "storage#objectAccessControl", # The kind of item this is. For object access control entries, this is always storage#objectAccessControl. 1545 "object": "A String", # The name of the object, if applied to an object. 1546 "projectTeam": { # The project team associated with the entity, if any. 1547 "projectNumber": "A String", # The project number. 1548 "team": "A String", # The team. 1549 }, 1550 "role": "A String", # The access permission for the entity. 1551 "selfLink": "A String", # The link to this access-control entry. 1552 }, 1553 ], 1554 "bucket": "A String", # The name of the bucket containing this object. 1555 "cacheControl": "A String", # 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. 1556 "componentCount": 42, # Number of underlying components that make up this object. Components are accumulated by compose operations. 1557 "contentDisposition": "A String", # Content-Disposition of the object data. 1558 "contentEncoding": "A String", # Content-Encoding of the object data. 1559 "contentLanguage": "A String", # Content-Language of the object data. 1560 "contentType": "A String", # Content-Type of the object data. If an object is stored without a Content-Type, it is served as application/octet-stream. 1561 "crc32c": "A String", # 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 Hashes and ETags: Best Practices. 1562 "customTime": "A String", # A timestamp in RFC 3339 format specified by the user for an object. 1563 "customerEncryption": { # Metadata of customer-supplied encryption key, if the object is encrypted by such a key. 1564 "encryptionAlgorithm": "A String", # The encryption algorithm. 1565 "keySha256": "A String", # SHA256 hash value of the encryption key. 1566 }, 1567 "etag": "A String", # HTTP 1.1 Entity tag for the object. 1568 "eventBasedHold": 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'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. 1569 "generation": "A String", # The content generation of this object. Used for object versioning. 1570 "id": "A String", # The ID of the object, including the bucket name, object name, and generation number. 1571 "kind": "storage#object", # The kind of item this is. For objects, this is always storage#object. 1572 "kmsKeyName": "A String", # Not currently supported. Specifying the parameter causes the request to fail with status code 400 - Bad Request. 1573 "md5Hash": "A String", # MD5 hash of the data; encoded using base64. For more information about using the MD5 hash, see Hashes and ETags: Best Practices. 1574 "mediaLink": "A String", # Media download link. 1575 "metadata": { # User-provided metadata, in key/value pairs. 1576 "a_key": "A String", # An individual metadata entry. 1577 }, 1578 "metageneration": "A String", # 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. 1579 "name": "A String", # The name of the object. Required if not specified by URL parameter. 1580 "owner": { # The owner of the object. This will always be the uploader of the object. 1581 "entity": "A String", # The entity, in the form user-userId. 1582 "entityId": "A String", # The ID for the entity. 1583 }, 1584 "retentionExpirationTime": "A String", # A server-determined value that specifies the earliest time that the object'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). 1585 "selfLink": "A String", # The link to this object. 1586 "size": "A String", # Content-Length of the data in bytes. 1587 "storageClass": "A String", # Storage class of the object. 1588 "temporaryHold": 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. 1589 "timeCreated": "A String", # The creation time of the object in RFC 3339 format. 1590 "timeDeleted": "A String", # The deletion time of the object in RFC 3339 format. Will be returned if and only if this version of the object has been deleted. 1591 "timeStorageClassUpdated": "A String", # The time at which the object's storage class was last changed. When the object is initially created, it will be set to timeCreated. 1592 "updated": "A String", # The modification time of the object metadata in RFC 3339 format. 1593} 1594 1595 generation: string, If present, selects a specific revision of this object (as opposed to the latest version, the default). 1596 ifGenerationMatch: string, Makes the operation conditional on whether the object's current generation matches the given value. Setting to 0 makes the operation succeed only if there are no live versions of the object. 1597 ifGenerationNotMatch: string, Makes the operation conditional on whether the object'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. 1598 ifMetagenerationMatch: string, Makes the operation conditional on whether the object's current metageneration matches the given value. 1599 ifMetagenerationNotMatch: string, Makes the operation conditional on whether the object's current metageneration does not match the given value. 1600 predefinedAcl: string, Apply a predefined set of access controls to this object. 1601 Allowed values 1602 authenticatedRead - Object owner gets OWNER access, and allAuthenticatedUsers get READER access. 1603 bucketOwnerFullControl - Object owner gets OWNER access, and project team owners get OWNER access. 1604 bucketOwnerRead - Object owner gets OWNER access, and project team owners get READER access. 1605 private - Object owner gets OWNER access. 1606 projectPrivate - Object owner gets OWNER access, and project team members get access according to their roles. 1607 publicRead - Object owner gets OWNER access, and allUsers get READER access. 1608 projection: string, Set of properties to return. Defaults to full. 1609 Allowed values 1610 full - Include all properties. 1611 noAcl - Omit the owner, acl property. 1612 provisionalUserProject: string, The project to be billed for this request if the target bucket is requester-pays bucket. 1613 userProject: string, The project to be billed for this request. Required for Requester Pays buckets. 1614 1615Returns: 1616 An object of the form: 1617 1618 { # An object. 1619 "acl": [ # Access controls on the object. 1620 { # An access-control entry. 1621 "bucket": "A String", # The name of the bucket. 1622 "domain": "A String", # The domain associated with the entity, if any. 1623 "email": "A String", # The email address associated with the entity, if any. 1624 "entity": "A String", # The entity holding the permission, in one of the following forms: 1625 # - user-userId 1626 # - user-email 1627 # - group-groupId 1628 # - group-email 1629 # - domain-domain 1630 # - project-team-projectId 1631 # - allUsers 1632 # - allAuthenticatedUsers Examples: 1633 # - The user [email protected] would be [email protected]. 1634 # - The group [email protected] would be [email protected]. 1635 # - To refer to all members of the Google Apps for Business domain example.com, the entity would be domain-example.com. 1636 "entityId": "A String", # The ID for the entity, if any. 1637 "etag": "A String", # HTTP 1.1 Entity tag for the access-control entry. 1638 "generation": "A String", # The content generation of the object, if applied to an object. 1639 "id": "A String", # The ID of the access-control entry. 1640 "kind": "storage#objectAccessControl", # The kind of item this is. For object access control entries, this is always storage#objectAccessControl. 1641 "object": "A String", # The name of the object, if applied to an object. 1642 "projectTeam": { # The project team associated with the entity, if any. 1643 "projectNumber": "A String", # The project number. 1644 "team": "A String", # The team. 1645 }, 1646 "role": "A String", # The access permission for the entity. 1647 "selfLink": "A String", # The link to this access-control entry. 1648 }, 1649 ], 1650 "bucket": "A String", # The name of the bucket containing this object. 1651 "cacheControl": "A String", # 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. 1652 "componentCount": 42, # Number of underlying components that make up this object. Components are accumulated by compose operations. 1653 "contentDisposition": "A String", # Content-Disposition of the object data. 1654 "contentEncoding": "A String", # Content-Encoding of the object data. 1655 "contentLanguage": "A String", # Content-Language of the object data. 1656 "contentType": "A String", # Content-Type of the object data. If an object is stored without a Content-Type, it is served as application/octet-stream. 1657 "crc32c": "A String", # 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 Hashes and ETags: Best Practices. 1658 "customTime": "A String", # A timestamp in RFC 3339 format specified by the user for an object. 1659 "customerEncryption": { # Metadata of customer-supplied encryption key, if the object is encrypted by such a key. 1660 "encryptionAlgorithm": "A String", # The encryption algorithm. 1661 "keySha256": "A String", # SHA256 hash value of the encryption key. 1662 }, 1663 "etag": "A String", # HTTP 1.1 Entity tag for the object. 1664 "eventBasedHold": 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'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. 1665 "generation": "A String", # The content generation of this object. Used for object versioning. 1666 "id": "A String", # The ID of the object, including the bucket name, object name, and generation number. 1667 "kind": "storage#object", # The kind of item this is. For objects, this is always storage#object. 1668 "kmsKeyName": "A String", # Not currently supported. Specifying the parameter causes the request to fail with status code 400 - Bad Request. 1669 "md5Hash": "A String", # MD5 hash of the data; encoded using base64. For more information about using the MD5 hash, see Hashes and ETags: Best Practices. 1670 "mediaLink": "A String", # Media download link. 1671 "metadata": { # User-provided metadata, in key/value pairs. 1672 "a_key": "A String", # An individual metadata entry. 1673 }, 1674 "metageneration": "A String", # 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. 1675 "name": "A String", # The name of the object. Required if not specified by URL parameter. 1676 "owner": { # The owner of the object. This will always be the uploader of the object. 1677 "entity": "A String", # The entity, in the form user-userId. 1678 "entityId": "A String", # The ID for the entity. 1679 }, 1680 "retentionExpirationTime": "A String", # A server-determined value that specifies the earliest time that the object'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). 1681 "selfLink": "A String", # The link to this object. 1682 "size": "A String", # Content-Length of the data in bytes. 1683 "storageClass": "A String", # Storage class of the object. 1684 "temporaryHold": 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. 1685 "timeCreated": "A String", # The creation time of the object in RFC 3339 format. 1686 "timeDeleted": "A String", # The deletion time of the object in RFC 3339 format. Will be returned if and only if this version of the object has been deleted. 1687 "timeStorageClassUpdated": "A String", # The time at which the object's storage class was last changed. When the object is initially created, it will be set to timeCreated. 1688 "updated": "A String", # The modification time of the object metadata in RFC 3339 format. 1689}</pre> 1690</div> 1691 1692<div class="method"> 1693 <code class="details" id="watchAll">watchAll(bucket, body=None, delimiter=None, endOffset=None, includeTrailingDelimiter=None, maxResults=None, pageToken=None, prefix=None, projection=None, provisionalUserProject=None, startOffset=None, userProject=None, versions=None)</code> 1694 <pre>Watch for changes on all objects in a bucket. 1695 1696Args: 1697 bucket: string, Name of the bucket in which to look for objects. (required) 1698 body: object, The request body. 1699 The object takes the form of: 1700 1701{ # An notification channel used to watch for resource changes. 1702 "address": "A String", # The address where notifications are delivered for this channel. 1703 "expiration": "A String", # Date and time of notification channel expiration, expressed as a Unix timestamp, in milliseconds. Optional. 1704 "id": "A String", # A UUID or similar unique string that identifies this channel. 1705 "kind": "api#channel", # Identifies this as a notification channel used to watch for changes to a resource, which is "api#channel". 1706 "params": { # Additional parameters controlling delivery channel behavior. Optional. 1707 "a_key": "A String", # Declares a new parameter by name. 1708 }, 1709 "payload": True or False, # A Boolean value to indicate whether payload is wanted. Optional. 1710 "resourceId": "A String", # An opaque ID that identifies the resource being watched on this channel. Stable across different API versions. 1711 "resourceUri": "A String", # A version-specific identifier for the watched resource. 1712 "token": "A String", # An arbitrary string delivered to the target address with each notification delivered over this channel. Optional. 1713 "type": "A String", # The type of delivery mechanism used for this channel. 1714} 1715 1716 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. 1717 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). 1718 includeTrailingDelimiter: boolean, If true, objects that end in exactly one instance of delimiter will have their metadata included in items in addition to prefixes. 1719 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. 1720 pageToken: string, A previously-returned page token representing part of the larger set of results to view. 1721 prefix: string, Filter results to objects whose names begin with this prefix. 1722 projection: string, Set of properties to return. Defaults to noAcl. 1723 Allowed values 1724 full - Include all properties. 1725 noAcl - Omit the owner, acl property. 1726 provisionalUserProject: string, The project to be billed for this request if the target bucket is requester-pays bucket. 1727 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). 1728 userProject: string, The project to be billed for this request. Required for Requester Pays buckets. 1729 versions: boolean, If true, lists all versions of an object as distinct results. The default is false. For more information, see Object Versioning. 1730 1731Returns: 1732 An object of the form: 1733 1734 { # An notification channel used to watch for resource changes. 1735 "address": "A String", # The address where notifications are delivered for this channel. 1736 "expiration": "A String", # Date and time of notification channel expiration, expressed as a Unix timestamp, in milliseconds. Optional. 1737 "id": "A String", # A UUID or similar unique string that identifies this channel. 1738 "kind": "api#channel", # Identifies this as a notification channel used to watch for changes to a resource, which is "api#channel". 1739 "params": { # Additional parameters controlling delivery channel behavior. Optional. 1740 "a_key": "A String", # Declares a new parameter by name. 1741 }, 1742 "payload": True or False, # A Boolean value to indicate whether payload is wanted. Optional. 1743 "resourceId": "A String", # An opaque ID that identifies the resource being watched on this channel. Stable across different API versions. 1744 "resourceUri": "A String", # A version-specific identifier for the watched resource. 1745 "token": "A String", # An arbitrary string delivered to the target address with each notification delivered over this channel. Optional. 1746 "type": "A String", # The type of delivery mechanism used for this channel. 1747}</pre> 1748</div> 1749 1750</body></html>