ServiceDescription
in package
implements
ServiceDescriptionInterface, ToArrayInterface
A ServiceDescription stores service information based on a service document
Table of Contents
Interfaces
- ServiceDescriptionInterface
- A ServiceDescription stores service information based on a service document
- ToArrayInterface
- An object that can be represented as an array
Properties
- $apiVersion : string
- $baseUrl : string
- $description : string
- $descriptionLoader : ServiceDescriptionLoader
- $extraData : array<string|int, mixed>
- $models : array<string|int, mixed>
- $name : string
- $operations : array<string|int, mixed>
Methods
- __construct() : mixed
- __serialize() : mixed
- to fix php 8.1 compatibility
- __unserialize() : mixed
- to fix php 8.1 compatibility
- addModel() : self
- Add a model to the service description
- addOperation() : self
- Add a operation to the service description
- factory() : self
- {@inheritdoc}
- getApiVersion() : string
- Get the API version of the service
- getBaseUrl() : string
- Get the basePath/baseUrl of the description
- getData() : null|mixed
- Get arbitrary data from the service description that is not part of the Guzzle spec
- getDescription() : string
- Get a summary of the purpose of the API
- getModel() : Parameter|null
- Get a specific model from the description
- getModels() : array<string|int, mixed>
- Get all service description models
- getName() : string
- Get the name of the API
- getOperation() : OperationInterface|null
- Get an API operation by name
- getOperations() : array<string|int, mixed>
- Get the API operations of the service
- hasModel() : bool
- Check if the description has a specific model by name
- hasOperation() : bool
- Check if the service has an operation by name
- serialize() : mixed
- setBaseUrl() : self
- Set the baseUrl of the description
- setData() : self
- Set arbitrary data on the service description
- toArray() : array<string|int, mixed>
- Get the array representation of an object
- unserialize() : mixed
- fromArray() : mixed
- Initialize the state from an array
Properties
$apiVersion
protected
string
$apiVersion
API version
$baseUrl
protected
string
$baseUrl
baseUrl/basePath
$description
protected
string
$description
Summary of the API
$descriptionLoader
protected
static ServiceDescriptionLoader
$descriptionLoader
Factory used in factory method
$extraData
protected
array<string|int, mixed>
$extraData
= array()
Any extra API data
$models
protected
array<string|int, mixed>
$models
= array()
Array of API models
$name
protected
string
$name
Name of the API
$operations
protected
array<string|int, mixed>
$operations
= array()
Array of OperationInterface objects
Methods
__construct()
public
__construct([array<string|int, mixed> $config = array() ]) : mixed
Parameters
- $config : array<string|int, mixed> = array()
-
Array of configuration data
__serialize()
to fix php 8.1 compatibility
public
__serialize() : mixed
__unserialize()
to fix php 8.1 compatibility
public
__unserialize(mixed $json) : mixed
Parameters
- $json : mixed
addModel()
Add a model to the service description
public
addModel(Parameter $model) : self
Parameters
- $model : Parameter
-
Model to add
Return values
selfaddOperation()
Add a operation to the service description
public
addOperation(OperationInterface $operation) : self
Parameters
- $operation : OperationInterface
-
Operation to add
Return values
selffactory()
{@inheritdoc}
public
static factory(string|array<string|int, mixed> $config[, array<string|int, mixed> $options = array() ]) : self
Parameters
- $config : string|array<string|int, mixed>
-
File to build or array of operation information
- $options : array<string|int, mixed> = array()
-
Service description factory options
Return values
selfgetApiVersion()
Get the API version of the service
public
getApiVersion() : string
Return values
stringgetBaseUrl()
Get the basePath/baseUrl of the description
public
getBaseUrl() : string
Return values
stringgetData()
Get arbitrary data from the service description that is not part of the Guzzle spec
public
getData(mixed $key) : null|mixed
Parameters
- $key : mixed
-
Data key to retrieve
Return values
null|mixedgetDescription()
Get a summary of the purpose of the API
public
getDescription() : string
Return values
stringgetModel()
Get a specific model from the description
public
getModel(mixed $id) : Parameter|null
Parameters
- $id : mixed
-
ID of the model
Return values
Parameter|nullgetModels()
Get all service description models
public
getModels() : array<string|int, mixed>
Return values
array<string|int, mixed>getName()
Get the name of the API
public
getName() : string
Return values
stringgetOperation()
Get an API operation by name
public
getOperation(mixed $name) : OperationInterface|null
Parameters
- $name : mixed
-
Name of the command
Return values
OperationInterface|nullgetOperations()
Get the API operations of the service
public
getOperations() : array<string|int, mixed>
Return values
array<string|int, mixed> —Returns an array of OperationInterface objects
hasModel()
Check if the description has a specific model by name
public
hasModel(mixed $id) : bool
Parameters
- $id : mixed
-
ID of the model
Return values
boolhasOperation()
Check if the service has an operation by name
public
hasOperation(mixed $name) : bool
Parameters
- $name : mixed
-
Name of the operation to check
Return values
boolserialize()
public
serialize() : mixed
setBaseUrl()
Set the baseUrl of the description
public
setBaseUrl(string $baseUrl) : self
Parameters
- $baseUrl : string
-
Base URL of each operation
Return values
selfsetData()
Set arbitrary data on the service description
public
setData(mixed $key, mixed $value) : self
Parameters
- $key : mixed
-
Data key to set
- $value : mixed
-
Value to set
Return values
selftoArray()
Get the array representation of an object
public
toArray() : array<string|int, mixed>
Return values
array<string|int, mixed>unserialize()
public
unserialize(mixed $json) : mixed
Parameters
- $json : mixed
fromArray()
Initialize the state from an array
protected
fromArray(array<string|int, mixed> $config) : mixed
Parameters
- $config : array<string|int, mixed>
-
Configuration data