\Guzzle\Service\DescriptionServiceDescription

A ServiceDescription stores service information based on a service document

Summary

Methods
Properties
Constants
factory()
__construct()
serialize()
unserialize()
toArray()
getBaseUrl()
setBaseUrl()
getOperations()
hasOperation()
getOperation()
addOperation()
getModel()
getModels()
hasModel()
addModel()
getApiVersion()
getName()
getDescription()
getData()
setData()
No public properties found
No constants found
fromArray()
$operations
$models
$name
$apiVersion
$description
$extraData
$descriptionLoader
$baseUrl
N/A
No private methods found
No private properties found
N/A

Properties

$operations

$operations : array

Type

array — Array of {@see OperationInterface} objects

$models

$models : array

Type

array — Array of API models

$name

$name : string

Type

string — Name of the API

$apiVersion

$apiVersion : string

Type

string — API version

$description

$description : string

Type

string — Summary of the API

$extraData

$extraData : array

Type

array — Any extra API data

$baseUrl

$baseUrl : string

Type

string — baseUrl/basePath

Methods

factory()

factory(string|array  $config, array  $options = array()) : self

{@inheritdoc}

Parameters

string|array $config

File to build or array of operation information

array $options

Service description factory options

Returns

self

__construct()

__construct(array  $config = array()) 

Parameters

array $config

Array of configuration data

serialize()

serialize() 

unserialize()

unserialize(  $json) 

Parameters

$json

toArray()

toArray() : array

Get the array representation of an object

Returns

array

getBaseUrl()

getBaseUrl() : string

Get the basePath/baseUrl of the description

Returns

string

setBaseUrl()

setBaseUrl(string  $baseUrl) : self

Set the baseUrl of the description

Parameters

string $baseUrl

Base URL of each operation

Returns

self

getOperations()

getOperations() : array

Get the API operations of the service

Returns

array —

Returns an array of {@see OperationInterface} objects

hasOperation()

hasOperation(string  $name) : boolean

Check if the service has an operation by name

Parameters

string $name

Name of the operation to check

Returns

boolean

getOperation()

getOperation(string  $name) : \Guzzle\Service\Description\OperationInterface|null

Get an API operation by name

Parameters

string $name

Name of the command

Returns

\Guzzle\Service\Description\OperationInterface|null

addOperation()

addOperation(\Guzzle\Service\Description\OperationInterface  $operation) : self

Add a operation to the service description

Parameters

\Guzzle\Service\Description\OperationInterface $operation

Operation to add

Returns

self

getModel()

getModel(string  $id) : \Guzzle\Service\Description\Parameter|null

Get a specific model from the description

Parameters

string $id

ID of the model

Returns

\Guzzle\Service\Description\Parameter|null

getModels()

getModels() : array

Get all service description models

Returns

array

hasModel()

hasModel(string  $id) : boolean

Check if the description has a specific model by name

Parameters

string $id

ID of the model

Returns

boolean

addModel()

addModel(\Guzzle\Service\Description\Parameter  $model) : self

Add a model to the service description

Parameters

\Guzzle\Service\Description\Parameter $model

Model to add

Returns

self

getApiVersion()

getApiVersion() : string

Get the API version of the service

Returns

string

getName()

getName() : string

Get the name of the API

Returns

string

getDescription()

getDescription() : string

Get a summary of the purpose of the API

Returns

string

getData()

getData(string  $key) : null|mixed

Get arbitrary data from the service description that is not part of the Guzzle spec

Parameters

string $key

Data key to retrieve

Returns

null|mixed

setData()

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

Set arbitrary data on the service description

Parameters

string $key

Data key to set

mixed $value

Value to set

Returns

self

fromArray()

fromArray(array  $config) 

Initialize the state from an array

Parameters

array $config

Configuration data

Throws

\Guzzle\Common\Exception\InvalidArgumentException