Class Guzzle\Service\Description\Operation

InheritanceGuzzle\Service\Description\Operation
ImplementsGuzzle\Service\Description\OperationInterface

Data object holding the information of an API command

Protected Properties

Hide inherited properties

PropertyTypeDescriptionDefined By
$additionalParameters Guzzle\Service\Description\Parameter Additional parameters schema Guzzle\Service\Description\Operation
$class string Class of the command object Guzzle\Service\Description\Operation
$data array Extra operation information Guzzle\Service\Description\Operation
$deprecated bool Whether or not the command is deprecated Guzzle\Service\Description\Operation
$description Guzzle\Service\Description\ServiceDescriptionInterface Guzzle\Service\Description\Operation
$documentationUrl string Reference URL providing more information about the operation Guzzle\Service\Description\Operation
$errorResponses array Array of errors that could occur when running the command Guzzle\Service\Description\Operation
$httpMethod string HTTP method Guzzle\Service\Description\Operation
$name string Name of the command Guzzle\Service\Description\Operation
$notes string A longer text field to explain the behavior of the operation. Guzzle\Service\Description\Operation
$parameters array Parameters Guzzle\Service\Description\Operation
$properties array Hashmap of properties that can be specified. Guzzle\Service\Description\Operation
$responseClass string This is what is returned from the method Guzzle\Service\Description\Operation
$responseNotes string Information about the response returned by the operation Guzzle\Service\Description\Operation
$responseType string Type information about the response Guzzle\Service\Description\Operation
$summary string This is a short summary of what the operation does Guzzle\Service\Description\Operation
$uri string HTTP URI of the command Guzzle\Service\Description\Operation

Public Methods

Hide inherited methods

MethodDescriptionDefined By
__construct() 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. Guzzle\Service\Description\Operation
addErrorResponse() Add an error to the command Guzzle\Service\Description\Operation
addParam() Add a parameter to the command Guzzle\Service\Description\Operation
getAdditionalParameters() Get the additionalParameters of the operation Guzzle\Service\Description\Operation
getClass() Guzzle\Service\Description\Operation
getData() Guzzle\Service\Description\Operation
getDeprecated() Guzzle\Service\Description\Operation
getDocumentationUrl() Guzzle\Service\Description\Operation
getErrorResponses() Guzzle\Service\Description\Operation
getHttpMethod() Guzzle\Service\Description\Operation
getName() Guzzle\Service\Description\Operation
getNotes() Guzzle\Service\Description\Operation
getParam() Guzzle\Service\Description\Operation
getParamNames() Guzzle\Service\Description\Operation
getParams() Guzzle\Service\Description\Operation
getResponseClass() Guzzle\Service\Description\Operation
getResponseNotes() Guzzle\Service\Description\Operation
getResponseType() Guzzle\Service\Description\Operation
getServiceDescription() Guzzle\Service\Description\Operation
getSummary() Guzzle\Service\Description\Operation
getUri() Guzzle\Service\Description\Operation
hasParam() Guzzle\Service\Description\Operation
removeParam() Remove a parameter from the command Guzzle\Service\Description\Operation
setAdditionalParameters() Set the additionalParameters of the operation Guzzle\Service\Description\Operation
setClass() Set the concrete class of the command Guzzle\Service\Description\Operation
setData() Set a particular data point on the operation Guzzle\Service\Description\Operation
setDeprecated() Set whether or not the command is deprecated Guzzle\Service\Description\Operation
setDocumentationUrl() Set the URL pointing to additional documentation on the command Guzzle\Service\Description\Operation
setErrorResponses() Set all of the error responses of the operation Guzzle\Service\Description\Operation
setHttpMethod() Set the HTTP method of the command Guzzle\Service\Description\Operation
setName() Set the name of the command Guzzle\Service\Description\Operation
setNotes() Set a longer text field to explain the behavior of the operation. Guzzle\Service\Description\Operation
setResponseClass() 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). Guzzle\Service\Description\Operation
setResponseNotes() Set notes about the response of the operation Guzzle\Service\Description\Operation
setResponseType() Set qualifying information about the responseClass. One of 'primitive', 'class', 'model', or 'documentation' Guzzle\Service\Description\Operation
setServiceDescription() Guzzle\Service\Description\Operation
setSummary() Set a short summary of what the operation does Guzzle\Service\Description\Operation
setUri() Set the URI template of the command Guzzle\Service\Description\Operation
toArray() Guzzle\Service\Description\Operation

Protected Methods

Hide inherited methods

MethodDescriptionDefined By
inferResponseType() Infer the response type from the responseClass value Guzzle\Service\Description\Operation

Constants

Hide inherited constants

ConstantValueDescriptionDefined By
DEFAULT_COMMAND_CLASS 'Guzzle\\Service\\Command\\OperationCommand' Guzzle\Service\Description\Operation

Property Details

$additionalParameters protected property

Additional parameters schema

$class protected property

Class of the command object

protected string $class null
$data protected property

Extra operation information

protected array $data null
$deprecated protected property

Whether or not the command is deprecated

protected bool $deprecated null
$description protected property
$documentationUrl protected property

Reference URL providing more information about the operation

protected string $documentationUrl null
$errorResponses protected property

Array of errors that could occur when running the command

protected array $errorResponses null
$httpMethod protected property

HTTP method

protected string $httpMethod null
$name protected property

Name of the command

protected string $name null
$notes protected property

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

protected string $notes null
$parameters protected property

Parameters

protected array $parameters = []
$properties protected static property

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

protected static array $properties = ['name' => true'httpMethod' => true'uri' => true'class' => true'responseClass' => true'responseType' => true'responseNotes' => true'notes' => true'summary' => true'documentationUrl' => true'deprecated' => true'data' => true'parameters' => true'additionalParameters' => true'errorResponses' => true]
$responseClass protected property

This is what is returned from the method

protected string $responseClass null
$responseNotes protected property

Information about the response returned by the operation

protected string $responseNotes null
$responseType protected property

Type information about the response

protected string $responseType null
$summary protected property

This is a short summary of what the operation does

protected string $summary null
$uri protected property

HTTP URI of the command

protected string $uri null

Method Details

__construct() public method

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
    
public void __construct ( array $config = [], Guzzle\Service\Description\ServiceDescriptionInterface $description null )
$config array

Array of configuration data

$description Guzzle\Service\Description\ServiceDescriptionInterface

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

addErrorResponse() public method

Add an error to the command

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

HTTP response code

$reason string

HTTP response reason phrase or information about the error

$class string

Exception class associated with the error

addParam() public method

Add a parameter to the command

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

Parameter to add

getAdditionalParameters() public method

Get the additionalParameters of the operation

public Guzzle\Service\Description\Parameter|null getAdditionalParameters ( )
getClass() public method

public void getClass ( )
getData() public method

public void getData ( $name )
$name
getDeprecated() public method

public void getDeprecated ( )
getDocumentationUrl() public method

public void getDocumentationUrl ( )
getErrorResponses() public method

public void getErrorResponses ( )
getHttpMethod() public method

public void getHttpMethod ( )
getName() public method

public void getName ( )
getNotes() public method

public void getNotes ( )
getParam() public method

public void getParam ( $param )
$param
getParamNames() public method

public void getParamNames ( )
getParams() public method

public void getParams ( )
getResponseClass() public method

public void getResponseClass ( )
getResponseNotes() public method

public void getResponseNotes ( )
getResponseType() public method

public void getResponseType ( )
getServiceDescription() public method

public void getServiceDescription ( )
getSummary() public method

public void getSummary ( )
getUri() public method

public void getUri ( )
hasParam() public method

public void hasParam ( $name )
$name
inferResponseType() protected method

Infer the response type from the responseClass value

protected void inferResponseType ( )
removeParam() public method

Remove a parameter from the command

public self removeParam ( $name )
$name string

Name of the parameter to remove

setAdditionalParameters() public method

Set the additionalParameters of the operation

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

Parameter to set

setClass() public method

Set the concrete class of the command

public self setClass ( $className )
$className string

Concrete class name

setData() public method

Set a particular data point on the operation

public self setData ( $name, $value )
$name string

Name of the data value

$value mixed

Value to set

setDeprecated() public method

Set whether or not the command is deprecated

public self setDeprecated ( $isDeprecated )
$isDeprecated bool

Set to true to mark as deprecated

setDocumentationUrl() public method

Set the URL pointing to additional documentation on the command

public self setDocumentationUrl ( $docUrl )
$docUrl string

Documentation URL

setErrorResponses() public method

Set all of the error responses of the operation

public self setErrorResponses ( array $errorResponses )
$errorResponses array

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

setHttpMethod() public method

Set the HTTP method of the command

public self setHttpMethod ( $httpMethod )
$httpMethod string

Method to set

setName() public method

Set the name of the command

public self setName ( $name )
$name string

Name of the command

setNotes() public method

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

public self setNotes ( $notes )
$notes string

Notes on the operation

setResponseClass() public method

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).

public self setResponseClass ( $responseClass )
$responseClass string

Type of response

setResponseNotes() public method

Set notes about the response of the operation

public self setResponseNotes ( $notes )
$notes string

Response notes

setResponseType() public method

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

public self setResponseType ( $responseType )
$responseType string

Response type information

throws Guzzle\Common\Exception\InvalidArgumentException
setServiceDescription() public method

public void setServiceDescription ( Guzzle\Service\Description\ServiceDescriptionInterface $description )
$description
setSummary() public method

Set a short summary of what the operation does

public self setSummary ( $summary )
$summary string

Short summary of the operation

setUri() public method

Set the URI template of the command

public self setUri ( $uri )
$uri string

URI template to set

toArray() public method

public void toArray ( )