Constants

DEFAULT_COMMAND_CLASS

DEFAULT_COMMAND_CLASS = 'Guzzle\\Service\\Command\\OperationCommand' : string

Properties

$properties

$properties : array

Type

array — Hashmap of properties that can be specified. Represented as a hash to speed up constructor.

$parameters

$parameters : array

Type

array — Parameters

$name

$name : string

Type

string — Name of the command

$httpMethod

$httpMethod : string

Type

string — HTTP method

$summary

$summary : string

Type

string — This is a short summary of what the operation does

$notes

$notes : string

Type

string — A longer text field to explain the behavior of the operation.

$documentationUrl

$documentationUrl : string

Type

string — Reference URL providing more information about the operation

$uri

$uri : string

Type

string — HTTP URI of the command

$class

$class : string

Type

string — Class of the command object

$responseClass

$responseClass : string

Type

string — This is what is returned from the method

$responseType

$responseType : string

Type

string — Type information about the response

$responseNotes

$responseNotes : string

Type

string — Information about the response returned by the operation

$deprecated

$deprecated : boolean

Type

boolean — Whether or not the command is deprecated

$errorResponses

$errorResponses : array

Type

array — Array of errors that could occur when running the command

$data

$data : array

Type

array — Extra operation information

Methods

__construct()

__construct(array  $config = array(), \Guzzle\Service\Description\ServiceDescriptionInterface  $description = null) 

Builds an Operation object using an array of configuration data: - name: (string) Name of the command - httpMethod: (string) HTTP method of the operation - uri: (string) URI template that can create a relative or absolute URL - class: (string) Concrete class that implements this command - parameters: (array) Associative array of parameters for the command. {@see Parameter} for information.

  • summary: (string) This is a short summary of what the operation does
  • notes: (string) A longer text field to explain the behavior of the operation.
  • documentationUrl: (string) Reference URL providing more information about the operation
  • responseClass: (string) This is what is returned from the method. Can be a primitive, PSR-0 compliant class name, or model.
  • responseNotes: (string) Information about the response returned by the operation
  • responseType: (string) One of 'primitive', 'class', 'model', or 'documentation'. If not specified, this value will be automatically inferred based on whether or not there is a model matching the name, if a matching PSR-0 compliant class name is found, or set to 'primitive' by default.
  • deprecated: (bool) Set to true if this is a deprecated command
  • errorResponses: (array) Errors that could occur when executing the command. Array of hashes, each with a 'code' (the HTTP response code), 'reason' (response reason phrase or description of the error), and 'class' (a custom exception class that would be thrown if the error is encountered).
  • data: (array) Any extra data that might be used to help build or serialize the operation
  • additionalParameters: (null|array) Parameter schema to use when an option is passed to the operation that is not in the schema

Parameters

array $config

Array of configuration data

\Guzzle\Service\Description\ServiceDescriptionInterface $description

Service description used to resolve models if $ref tags are found

toArray()

toArray() 

setServiceDescription()

setServiceDescription(\Guzzle\Service\Description\ServiceDescriptionInterface  $description) : self

Set the service description that the operation belongs to

Parameters

\Guzzle\Service\Description\ServiceDescriptionInterface $description

Service description

Returns

self

getParams()

getParams() : array

Get the params of the operation

Returns

array

getParamNames()

getParamNames() : array

Returns an array of parameter names

Returns

array

hasParam()

hasParam(string  $name) : boolean

Check if the operation has a specific parameter by name

Parameters

string $name

Name of the param

Returns

boolean

getParam()

getParam(string  $param) : \Guzzle\Service\Description\Parameter|null

Get a single parameter of the operation

Parameters

string $param

Parameter to retrieve by name

Returns

\Guzzle\Service\Description\Parameter|null

addParam()

addParam(\Guzzle\Service\Description\Parameter  $param) : self

Add a parameter to the command

Parameters

\Guzzle\Service\Description\Parameter $param

Parameter to add

Returns

self

removeParam()

removeParam(string  $name) : self

Remove a parameter from the command

Parameters

string $name

Name of the parameter to remove

Returns

self

getHttpMethod()

getHttpMethod() : string|null

Get the HTTP method of the operation

Returns

string|null

setHttpMethod()

setHttpMethod(string  $httpMethod) : self

Set the HTTP method of the command

Parameters

string $httpMethod

Method to set

Returns

self

getClass()

getClass() : string

Get the concrete operation class that implements this operation

Returns

string

setClass()

setClass(string  $className) : self

Set the concrete class of the command

Parameters

string $className

Concrete class name

Returns

self

getName()

getName() : string|null

Get the name of the operation

Returns

string|null

setName()

setName(string  $name) : self

Set the name of the command

Parameters

string $name

Name of the command

Returns

self

getSummary()

getSummary() : string|null

Get a short summary of what the operation does

Returns

string|null

setSummary()

setSummary(string  $summary) : self

Set a short summary of what the operation does

Parameters

string $summary

Short summary of the operation

Returns

self

getNotes()

getNotes() : string|null

Get a longer text field to explain the behavior of the operation

Returns

string|null

setNotes()

setNotes(string  $notes) : self

Set a longer text field to explain the behavior of the operation.

Parameters

string $notes

Notes on the operation

Returns

self

getDocumentationUrl()

getDocumentationUrl() : string|null

Get the documentation URL of the operation

Returns

string|null

setDocumentationUrl()

setDocumentationUrl(string  $docUrl) : self

Set the URL pointing to additional documentation on the command

Parameters

string $docUrl

Documentation URL

Returns

self

getResponseClass()

getResponseClass() : string|null

Get what is returned from the method. Can be a primitive, class name, or model. For example, the responseClass could be 'array', which would inherently use a responseType of 'primitive'. Using a class name would set a responseType of 'class'. Specifying a model by ID will use a responseType of 'model'.

Returns

string|null

setResponseClass()

setResponseClass(string  $responseClass) : self

Set what is returned from the method. Can be a primitive, class name, or model. For example: 'array', 'Guzzle\\Foo\\Baz', or 'MyModelName' (to reference a model by ID).

Parameters

string $responseClass

Type of response

Returns

self

getResponseType()

getResponseType() : string

Get information about how the response is unmarshalled: One of 'primitive', 'class', 'model', or 'documentation'

Returns

string

setResponseType()

setResponseType(string  $responseType) : self

Set qualifying information about the responseClass. One of 'primitive', 'class', 'model', or 'documentation'

Parameters

string $responseType

Response type information

Throws

\Guzzle\Common\Exception\InvalidArgumentException

Returns

self

getResponseNotes()

getResponseNotes() : string|null

Get notes about the response of the operation

Returns

string|null

setResponseNotes()

setResponseNotes(string  $notes) : self

Set notes about the response of the operation

Parameters

string $notes

Response notes

Returns

self

getDeprecated()

getDeprecated() : boolean

Get whether or not the operation is deprecated

Returns

boolean

setDeprecated()

setDeprecated(boolean  $isDeprecated) : self

Set whether or not the command is deprecated

Parameters

boolean $isDeprecated

Set to true to mark as deprecated

Returns

self

getUri()

getUri() : string

Get the URI that will be merged into the generated request

Returns

string

setUri()

setUri(string  $uri) : self

Set the URI template of the command

Parameters

string $uri

URI template to set

Returns

self

getErrorResponses()

getErrorResponses() : array

Get the errors that could be encountered when executing the operation

Returns

array

addErrorResponse()

addErrorResponse(string  $code, string  $reason, string  $class) : self

Add an error to the command

Parameters

string $code

HTTP response code

string $reason

HTTP response reason phrase or information about the error

string $class

Exception class associated with the error

Returns

self

setErrorResponses()

setErrorResponses(array  $errorResponses) : self

Set all of the error responses of the operation

Parameters

array $errorResponses

Hash of error name to a hash containing a code, reason, class

Returns

self

getData()

getData(string  $name) : mixed|null

Get extra data from the operation

Parameters

string $name

Name of the data point to retrieve

Returns

mixed|null

setData()

setData(string  $name, mixed  $value) : self

Set a particular data point on the operation

Parameters

string $name

Name of the data value

mixed $value

Value to set

Returns

self

getAdditionalParameters()

getAdditionalParameters() : \Guzzle\Service\Description\Parameter|null

Get the additionalParameters of the operation

Returns

\Guzzle\Service\Description\Parameter|null

setAdditionalParameters()

setAdditionalParameters(\Guzzle\Service\Description\Parameter|null  $parameter) : self

Set the additionalParameters of the operation

Parameters

\Guzzle\Service\Description\Parameter|null $parameter

Parameter to set

Returns

self

inferResponseType()

inferResponseType() 

Infer the response type from the responseClass value