Property | Type | Description | |
---|---|---|---|
$connection | Represents a connection to Cloud Storage. |
Method | Description | |
---|---|---|
__construct ( Google\Cloud\Storage\Connection\ConnectionInterface $connection, string $name, string $bucket, string $generation = null, array $info = null, string $encryptionKey = null, string $encryptionKeySHA256 = null ) | ||
acl ( ) : |
Configure ACL for this object. | |
copy ( |
Copy the object to a destination bucket. | |
delete ( array $options = [] ) : void | Delete the object. | |
downloadAsStream ( array $options = [] ) : Psr\Http\Message\StreamInterface | Download an object as a stream. | |
downloadAsString ( array $options = [] ) : string | Download an object as a string. | |
downloadToFile ( string $path, array $options = [] ) : Psr\Http\Message\StreamInterface | Download an object to a specified location. | |
exists ( ) : boolean | Check whether or not the object exists. | |
identity ( ) : string | Retrieves the object's identity. | |
info ( array $options = [] ) : array | Retrieves the object's details. If no object data is cached a network request will be made to retrieve it. | |
name ( ) : string | Retrieves the object's name. | |
reload ( array $options = [] ) : array | Triggers a network request to reload the object's details. | |
rename ( string $name, array $options = [] ) : |
Renames the object. | |
rewrite ( |
Rewrite the object to a destination bucket. | |
update ( array $metadata, array $options = [] ) : array | Update the object. Upon receiving a result the local object's data will be updated. |
Method | Description | |
---|---|---|
formatDestinationRequest ( string | |
Formats a destination based request, such as copy or rewrite. |
public __construct ( Google\Cloud\Storage\Connection\ConnectionInterface $connection, string $name, string $bucket, string $generation = null, array $info = null, string $encryptionKey = null, string $encryptionKeySHA256 = null ) | ||
$connection | Google\Cloud\Storage\Connection\ConnectionInterface | Represents a connection to Cloud Storage. |
$name | string | The object's name. |
$bucket | string | The name of the bucket the object is contained in. |
$generation | string | [optional] The generation of the object. |
$info | array | [optional] The object's metadata. |
$encryptionKey | string | [optional] An AES-256 customer-supplied encryption key. |
$encryptionKeySHA256 | string | [optional] The SHA256 hash of the customer-supplied encryption key. |
public copy ( |
||
$destination | The destination bucket. | |
$options | array | [optional] { Configuration options. @type string $name The name of the destination object. **Defaults to** the name of the source object. @type string $predefinedAcl Access controls to apply to the destination object. Acceptable values include `authenticatedRead`, `bucketOwnerFullControl`, `bucketOwnerRead`, `private`, `projectPrivate`, and `publicRead`. @type string $encryptionKey A base64 encoded AES-256 customer-supplied encryption key. It will be neccesary to provide this when a key was used during the object's creation. @type string $encryptionKeySHA256 Base64 encoded SHA256 hash of the customer-supplied encryption key. This value will be calculated from the `encryptionKey` on your behalf if not provided, but for best performance it is recommended to pass in a cached version of the already calculated SHA. @type string $ifGenerationMatch Makes the operation conditional on whether the destination object's current generation matches the given value. @type string $ifGenerationNotMatch Makes the operation conditional on whether the destination object's current generation does not match the given value. @type string $ifMetagenerationMatch Makes the operation conditional on whether the destination object's current metageneration matches the given value. @type string $ifMetagenerationNotMatch Makes the operation conditional on whether the destination object's current metageneration does not match the given value. @type string $ifSourceGenerationMatch Makes the operation conditional on whether the source object's current generation matches the given value. @type string $ifSourceGenerationNotMatch Makes the operation conditional on whether the source object's current generation does not match the given value. @type string $ifSourceMetagenerationMatch Makes the operation conditional on whether the source object's current metageneration matches the given value. @type string $ifSourceMetagenerationNotMatch Makes the operation conditional on whether the source object's current metageneration does not match the given value. } |
return |
public delete ( array $options = [] ) : void | ||
$options | array | [optional] { Configuration options. @type string $ifGenerationMatch Makes the operation conditional on whether the object's current generation matches the given value. @type string $ifGenerationNotMatch Makes the operation conditional on whether the object's current generation does not match the given value. @type string $ifMetagenerationMatch Makes the operation conditional on whether the object's current metageneration matches the given value. @type string $ifMetagenerationNotMatch Makes the operation conditional on whether the object's current metageneration does not match the given value. } |
return | void |
public downloadAsStream ( array $options = [] ) : Psr\Http\Message\StreamInterface | ||
$options | array | [optional] { Configuration Options. @type string $encryptionKey An AES-256 customer-supplied encryption key. It will be neccesary to provide this when a key was used during the object's creation. If provided one must also include an `encryptionKeySHA256`. @type string $encryptionKeySHA256 The SHA256 hash of the customer-supplied encryption key. It will be neccesary to provide this when a key was used during the object's creation. If provided one must also include an `encryptionKey`. } |
return | Psr\Http\Message\StreamInterface |
public downloadAsString ( array $options = [] ) : string | ||
$options | array | [optional] { Configuration Options. @type string $encryptionKey An AES-256 customer-supplied encryption key. It will be neccesary to provide this when a key was used during the object's creation. If provided one must also include an `encryptionKeySHA256`. @type string $encryptionKeySHA256 The SHA256 hash of the customer-supplied encryption key. It will be neccesary to provide this when a key was used during the object's creation. If provided one must also include an `encryptionKey`. } |
return | string |
public downloadToFile ( string $path, array $options = [] ) : Psr\Http\Message\StreamInterface | ||
$path | string | Path to download the file to. |
$options | array | [optional] { Configuration Options. @type string $encryptionKey An AES-256 customer-supplied encryption key. It will be neccesary to provide this when a key was used during the object's creation. If provided one must also include an `encryptionKeySHA256`. @type string $encryptionKeySHA256 The SHA256 hash of the customer-supplied encryption key. It will be neccesary to provide this when a key was used during the object's creation. If provided one must also include an `encryptionKey`. } |
return | Psr\Http\Message\StreamInterface |
public info ( array $options = [] ) : array | ||
$options | array | [optional] { Configuration options. @type string $encryptionKey An AES-256 customer-supplied encryption key. It will be neccesary to provide this when a key was used during the object's creation in order to retrieve the MD5 hash and CRC32C checksum. If provided one must also include an `encryptionKeySHA256`. @type string $encryptionKeySHA256 The SHA256 hash of the customer-supplied encryption key. It will be neccesary to provide this when a key was used during the object's creation in order to retrieve the MD5 hash and CRC32C checksum. If provided one must also include an `encryptionKey`. @type string $ifGenerationMatch Makes the operation conditional on whether the object's current generation matches the given value. @type string $ifGenerationNotMatch Makes the operation conditional on whether the object's current generation does not match the given value. @type string $ifMetagenerationMatch Makes the operation conditional on whether the object's current metageneration matches the given value. @type string $ifMetagenerationNotMatch Makes the operation conditional on whether the object's current metageneration does not match the given value. @type string $projection Determines which properties to return. May be either 'full' or 'noAcl'. } |
return | array |
public reload ( array $options = [] ) : array | ||
$options | array | [optional] { Configuration options. @type string $encryptionKey A base64 encoded AES-256 customer-supplied encryption key. It will be neccesary to provide this when a key was used during the object's creation. @type string $encryptionKeySHA256 Base64 encoded SHA256 hash of the customer-supplied encryption key. This value will be calculated from the `encryptionKey` on your behalf if not provided, but for best performance it is recommended to pass in a cached version of the already calculated SHA. @type string $ifGenerationMatch Makes the operation conditional on whether the object's current generation matches the given value. @type string $ifGenerationNotMatch Makes the operation conditional on whether the object's current generation does not match the given value. @type string $ifMetagenerationMatch Makes the operation conditional on whether the object's current metageneration matches the given value. @type string $ifMetagenerationNotMatch Makes the operation conditional on whether the object's current metageneration does not match the given value. @type string $projection Determines which properties to return. May be either 'full' or 'noAcl'. } |
return | array |
public rename ( string $name, array $options = [] ) : |
||
$name | string | The new name. |
$options | array | [optional] { Configuration options. @type string $predefinedAcl Access controls to apply to the destination object. Acceptable values include `authenticatedRead`, `bucketOwnerFullControl`, `bucketOwnerRead`, `private`, `projectPrivate`, and `publicRead`. @type string $encryptionKey A base64 encoded AES-256 customer-supplied encryption key. It will be neccesary to provide this when a key was used during the object's creation. @type string $encryptionKeySHA256 Base64 encoded SHA256 hash of the customer-supplied encryption key. This value will be calculated from the `encryptionKey` on your behalf if not provided, but for best performance it is recommended to pass in a cached version of the already calculated SHA. @type string $ifGenerationMatch Makes the operation conditional on whether the destination object's current generation matches the given value. @type string $ifGenerationNotMatch Makes the operation conditional on whether the destination object's current generation does not match the given value. @type string $ifMetagenerationMatch Makes the operation conditional on whether the destination object's current metageneration matches the given value. @type string $ifMetagenerationNotMatch Makes the operation conditional on whether the destination object's current metageneration does not match the given value. @type string $ifSourceGenerationMatch Makes the operation conditional on whether the source object's current generation matches the given value. @type string $ifSourceGenerationNotMatch Makes the operation conditional on whether the source object's current generation does not match the given value. @type string $ifSourceMetagenerationMatch Makes the operation conditional on whether the source object's current metageneration matches the given value. @type string $ifSourceMetagenerationNotMatch Makes the operation conditional on whether the source object's current metageneration does not match the given value. } |
return | The renamed object. |
public rewrite ( |
||
$destination | The destination bucket. | |
$options | array | [optional] { Configuration options. @type string $name The name of the destination object. **Defaults to** the name of the source object. @type string $predefinedAcl Access controls to apply to the destination object. Acceptable values include `authenticatedRead`, `bucketOwnerFullControl`, `bucketOwnerRead`, `private`, `projectPrivate`, and `publicRead`. @type string $maxBytesRewrittenPerCall 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. @type string $encryptionKey A base64 encoded AES-256 customer-supplied encryption key. It will be neccesary to provide this when a key was used during the object's creation. @type string $encryptionKeySHA256 Base64 encoded SHA256 hash of the customer-supplied encryption key. This value will be calculated from the `encryptionKey` on your behalf if not provided, but for best performance it is recommended to pass in a cached version of the already calculated SHA. @type string $destinationEncryptionKey A base64 encoded AES-256 customer-supplied encryption key that will be used to encrypt the rewritten object. @type string $destinationEncryptionKeySHA256 Base64 encoded SHA256 hash of the customer-supplied destination encryption key. This value will be calculated from the `destinationEncryptionKey` on your behalf if not provided, but for best performance it is recommended to pass in a cached version of the already calculated SHA. @type string $ifGenerationMatch Makes the operation conditional on whether the destination object's current generation matches the given value. @type string $ifGenerationNotMatch Makes the operation conditional on whether the destination object's current generation does not match the given value. @type string $ifMetagenerationMatch Makes the operation conditional on whether the destination object's current metageneration matches the given value. @type string $ifMetagenerationNotMatch Makes the operation conditional on whether the destination object's current metageneration does not match the given value. @type string $ifSourceGenerationMatch Makes the operation conditional on whether the source object's current generation matches the given value. @type string $ifSourceGenerationNotMatch Makes the operation conditional on whether the source object's current generation does not match the given value. @type string $ifSourceMetagenerationMatch Makes the operation conditional on whether the source object's current metageneration matches the given value. @type string $ifSourceMetagenerationNotMatch Makes the operation conditional on whether the source object's current metageneration does not match the given value. } |
return |
public update ( array $metadata, array $options = [] ) : array | ||
$metadata | array | The available options for metadata are outlined at the [JSON API docs](https://cloud.google.com/storage/docs/json_api/v1/objects#resource) |
$options | array | [optional] { Configuration options. @type string $ifGenerationMatch Makes the operation conditional on whether the object's current generation matches the given value. @type string $ifGenerationNotMatch Makes the operation conditional on whether the object's current generation does not match the given value. @type string $ifMetagenerationMatch Makes the operation conditional on whether the object's current metageneration matches the given value. @type string $ifMetagenerationNotMatch Makes the operation conditional on whether the object's current metageneration does not match the given value. @type string $predefinedAcl Apply a predefined set of access controls to this object. @type string $projection Determines which properties to return. May be either 'full' or 'noAcl'. @type string $fields Selector which will cause the response to only return the specified fields. } |
return | array |