HEADERS_OPTION
HEADERS_OPTION = 'command.headers'
Adds functionality to Qcloud Cos commands: - Adds the PutObject URL to a response - Allows creating a Pre-signed URL from any command
$requestSerializer : \Guzzle\Service\Command\RequestSerializerInterface
$responseParser : \Guzzle\Service\Command\ResponseParserInterface
$client : \Guzzle\Service\ClientInterface
$request : \Guzzle\Http\Message\RequestInterface
$operation : \Guzzle\Service\Description\OperationInterface
$validator : \Guzzle\Service\Description\ValidatorInterface
setResponseParser(\Guzzle\Service\Command\ResponseParserInterface $parser) : self
Set the response parser used with the command
\Guzzle\Service\Command\ResponseParserInterface | $parser | Response parser |
setRequestSerializer(\Guzzle\Service\Command\RequestSerializerInterface $serializer) : self
Set the request serializer used with the command
\Guzzle\Service\Command\RequestSerializerInterface | $serializer | Request serializer |
getRequestSerializer() : \Guzzle\Service\Command\RequestSerializerInterface
Get the request serializer used with the command
getResponseParser() : \Guzzle\Service\Command\ResponseParserInterface
Get the response parser used for the operation
getOperation() : \Guzzle\Service\Description\OperationInterface
Get the API command information about the command
getClient() : \Guzzle\Service\ClientInterface|null
Get the client object that will execute the command
setClient(\Guzzle\Service\ClientInterface $client) : self
Set the client object that will execute the command
\Guzzle\Service\ClientInterface | $client | The client object that will execute the command |
getRequest() : \Guzzle\Http\Message\RequestInterface
Get the request object associated with the command
getResponse() : \Guzzle\Http\Message\Response
Get the response object associated with the command
getResult() : \Guzzle\Http\Message\Response
Get the result of the command
By default, commands return a Response object unless overridden in a subclass
prepare() : \Guzzle\Http\Message\RequestInterface
Prepare the command for executing and create a request object.
Returns the generated request
setValidator(\Guzzle\Service\Description\ValidatorInterface $validator) : self
Set the validator used to validate and prepare command parameters and nested JSON schemas. If no validator is set, then the command will validate using the default {@see SchemaValidator}.
\Guzzle\Service\Description\ValidatorInterface | $validator | Validator used to prepare and validate properties against a JSON schema |
getRequestHeaders() : \Guzzle\Common\Collection
Get the object that manages the request headers that will be set on any outbound requests from the command
fromConfig(array $config = array(), array $defaults = array(), array $required = array()) : self
Create a new collection from an array, validate the keys, and add default values where missing
array | $config | Configuration values to apply. |
array | $defaults | Default parameters |
array | $required | Required parameter names |
if a parameter is missing
clear() : \Guzzle\Common\Collection
Removes all key value pairs
set(string $key, mixed $value) : \Guzzle\Common\Collection
Set a key value pair
string | $key | Key to set |
mixed | $value | Value to set |
Returns a reference to the object
add(string $key, mixed $value) : \Guzzle\Common\Collection
Add a value to a key. If a key of the same name has already been added, the key value will be converted into an array and the new value will be pushed to the end of the array.
string | $key | Key to add |
mixed | $value | Value to add to the key |
Returns a reference to the object.
remove(string $key) : \Guzzle\Common\Collection
Remove a specific key value pair
string | $key | A key to remove |
replace(array $data) : \Guzzle\Common\Collection
Replace the data of the object with the value of an array
array | $data | Associative array of data |
Returns a reference to the object
merge(\Guzzle\Common\Collection|array $data) : \Guzzle\Common\Collection
Add and merge in a Collection or array of key value pair data.
\Guzzle\Common\Collection|array | $data | Associative array of key value pair data |
Returns a reference to the object.
map(\Closure $closure, array $context = array(), boolean $static = true) : \Guzzle\Common\Collection
Returns a Collection containing all the elements of the collection after applying the callback function to each one. The Closure should accept three parameters: (string) $key, (string) $value, (array) $context and return a modified value
\Closure | $closure | Closure to apply |
array | $context | Context to pass to the closure |
boolean | $static | Set to TRUE to use the same class as the return rather than returning a Collection |
filter(\Closure $closure, boolean $static = true) : \Guzzle\Common\Collection
Iterates over each key value pair in the collection passing them to the Closure. If the Closure function returns true, the current value from input is returned into the result Collection. The Closure must accept three parameters: (string) $key, (string) $value and return Boolean TRUE or FALSE for each value.
\Closure | $closure | Closure evaluation function |
boolean | $static | Set to TRUE to use the same class as the return rather than returning a Collection |
setPath(string $path, mixed $value) : self
Set a value into a nested array key. Keys will be created as needed to set the value.
string | $path | Path to set |
mixed | $value | Value to set at the key |
when trying to setPath using a nested path that travels through a scalar value
getPath(string $path, string $separator = '/', mixed $data = null) : mixed|null
Gets a value from the collection using an array path (e.g. foo/baz/bar would retrieve bar from two nested arrays) Allows for wildcard searches which recursively combine matches up to the level at which the wildcard occurs. This can be useful for accepting any key of a sub-array and combining matching keys from each diverging path.
string | $path | Path to traverse and retrieve a value from |
string | $separator | Character used to add depth to the search |
mixed | $data | Optional data to descend into (used when wildcards are encountered) |
createPresignedUrl(integer|string $expires) : string
Create a pre-signed URL for the operation
integer|string | $expires | The Unix timestamp to expire at or a string that can be evaluated by strtotime |
None found |
None found |
None found |
process()
Create the result of the command after the request has been completed.
Override this method in subclasses to customize this behavior
None found |
None found |
createOperation() : \Guzzle\Service\Description\OperationInterface
Hook used to create an operation for concrete commands that are not associated with a service description
None found |
validate()
Validate and prepare the command based on the schema and rules defined by the command's Operation object
when validation errors occur
None found |
getValidator() : \Guzzle\Service\Description\ValidatorInterface
Get the validator used to prepare and validate properties. If no validator has been set on the command, then the default {@see SchemaValidator} will be used.
None found |