Container
class Container extends OperatorResource implements Creatable, Deletable, Retrievable, Listable, HasMetadata
Traits
Constants
METADATA_PREFIX |
|
Properties
$objectCount | int | |
$bytesUsed | int | |
$name | string | |
$metadata | array |
Methods
All models which represent an API resource should be able to be populated from a {see ResponseInterface} object.
Retrieves a collection of object resources in the form of a generator.
Retrieve details of the current resource from the remote API.
Create a new resource according to the configuration set in the options.
Permanently delete this resource.
Merges a set of new values with those which already exist (on the remote API) for a resource. For example, if the resource has this metadata already set:
Replaces all of the existing metadata items for a resource with a new set of values. Any metadata items which are not provided in the call are removed from the resource. For example, if the resource has this metadata already set:
Retrieves the metadata for the resource in the form of an associative array or hash. Each key represents the metadata item's name, and each value represents the metadata item's remote value.
Retrieves an Object and populates its name
and containerName
properties according to the name provided and
the name of this container. A HTTP call will not be executed by default - you need to call
{see Object::retrieve} or {see Object::download} on the returned Object object to do that.
Identifies whether an object exists in this container.
Creates a single object according to the values provided.
Creates a Dynamic Large Object by chunking a file into smaller segments and uploading them into a holding container. When this completes, a manifest file is uploaded which references the prefix of the segments, allowing concatenation when a request is executed against the manifest.
Details
populateFromResponse(ResponseInterface $response)
All models which represent an API resource should be able to be populated from a {see ResponseInterface} object.
listObjects(array $options = array(), callable $mapFn = null)
Retrieves a collection of object resources in the form of a generator.
mergeMetadata(array $metadata)
Merges a set of new values with those which already exist (on the remote API) for a resource. For example, if the resource has this metadata already set:
Foo: val1 Bar: val2
and mergeMetadata(['Foo' => 'val3', 'Baz' => 'val4']); is called, then the resource will have the following metadata:
Foo: val3 Bar: val2 Baz: val4
You will notice that any metadata items which are not specified in the call are preserved.
resetMetadata(array $metadata)
Replaces all of the existing metadata items for a resource with a new set of values. Any metadata items which are not provided in the call are removed from the resource. For example, if the resource has this metadata already set:
Foo: val1 Bar: val2
and resetMetadata(['Foo' => 'val3', 'Baz' => 'val4']); is called, then the resource will have the following metadata:
Foo: val3 Baz: val4
getMetadata()
Retrieves the metadata for the resource in the form of an associative array or hash. Each key represents the metadata item's name, and each value represents the metadata item's remote value.
getObject(string $name)
Retrieves an Object and populates its name
and containerName
properties according to the name provided and
the name of this container. A HTTP call will not be executed by default - you need to call
{see Object::retrieve} or {see Object::download} on the returned Object object to do that.
createLargeObject(array $data)
Creates a Dynamic Large Object by chunking a file into smaller segments and uploading them into a holding container. When this completes, a manifest file is uploaded which references the prefix of the segments, allowing concatenation when a request is executed against the manifest.