\GuzzleHttp\Command\GuzzleDescription

Represents a Guzzle service description

Summary

Methods
Properties
Constants
__construct()
getBaseUri()
getOperations()
hasOperation()
getOperation()
getModel()
getModels()
hasModel()
getApiVersion()
getName()
getDescription()
format()
getData()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
$operations
$models
$name
$apiVersion
$description
$extraData
$baseUri
$formatter
N/A

Properties

$operations

$operations : array

Type

array — Array of {@see \GuzzleHttp\Command\Guzzle\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

$baseUri

$baseUri : \GuzzleHttp\Psr7\Uri

Type

Uri — baseUri/basePath

$formatter

$formatter : \GuzzleHttp\Command\Guzzle\SchemaFormatter

Type

SchemaFormatter

Methods

__construct()

__construct(array  $config, array  $options = []) : mixed

Parameters

array $config

Service description data

array $options

Custom options to apply to the description

  • formatter: Can provide a custom SchemaFormatter class

Throws

\InvalidArgumentException

Returns

mixed —

getBaseUri()

getBaseUri() : \GuzzleHttp\Psr7\Uri

Get the basePath/baseUri of the description

Returns

\GuzzleHttp\Psr7\Uri —

getOperations()

getOperations() : \GuzzleHttp\Command\Guzzle\Operation[]

Get the API operations of the service

Returns

\GuzzleHttp\Command\Guzzle\Operation[] —

Returns an array of {@see \GuzzleHttp\Command\Guzzle\Operation} objects

hasOperation()

hasOperation(string  $name) : bool

Check if the service has an operation by name

Parameters

string $name

Name of the operation to check

Returns

bool —

getOperation()

getOperation(string  $name) : \GuzzleHttp\Command\Guzzle\Operation

Get an API operation by name

Parameters

string $name

Name of the command

Throws

\InvalidArgumentException

if the operation is not found

Returns

\GuzzleHttp\Command\Guzzle\Operation —

getModel()

getModel(string  $id) : \GuzzleHttp\Command\Guzzle\Parameter

Get a shared definition structure.

Parameters

string $id

ID/name of the model to retrieve

Throws

\InvalidArgumentException

if the model is not found

Returns

\GuzzleHttp\Command\Guzzle\Parameter —

getModels()

getModels() : array

Get all models of the service description.

Returns

array —

hasModel()

hasModel(string  $id) : bool

Check if the service description has a model by name.

Parameters

string $id

Name/ID of the model to check

Returns

bool —

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 —

format()

format(string  $format, mixed  $input) : mixed

Format a parameter using named formats.

Parameters

string $format

Format to convert it to

mixed $input

Input string

Returns

mixed —

getData()

getData(string  $key = null) : null|mixed

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

Parameters

string $key

Data key to retrieve or null to retrieve all extra

Returns

null|mixed —