Documentation

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

$extraData

protected array<string|int, mixed> $extraData = array()

Any extra API data

$models

protected array<string|int, mixed> $models = array()

Array of API models

Methods

__construct()

public __construct([array<string|int, mixed> $config = array() ]) : mixed
Parameters
$config : array<string|int, mixed> = array()

Array of configuration data

__unserialize()

to fix php 8.1 compatibility

public __unserialize(mixed $json) : mixed
Parameters
$json : mixed

factory()

{@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
self

getApiVersion()

Get the API version of the service

public getApiVersion() : string
Return values
string

getBaseUrl()

Get the basePath/baseUrl of the description

public getBaseUrl() : string
Return values
string

getData()

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|mixed

getDescription()

Get a summary of the purpose of the API

public getDescription() : string
Return values
string

getModels()

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
string

getOperations()

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
bool

hasOperation()

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
bool

setBaseUrl()

Set the baseUrl of the description

public setBaseUrl(string $baseUrl) : self
Parameters
$baseUrl : string

Base URL of each operation

Return values
self

setData()

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
self

toArray()

Get the array representation of an object

public toArray() : array<string|int, mixed>
Return values
array<string|int, mixed>

fromArray()

Initialize the state from an array

protected fromArray(array<string|int, mixed> $config) : mixed
Parameters
$config : array<string|int, mixed>

Configuration data

Tags
throws
InvalidArgumentException

        
On this page

Search results