class APIClientFactory

The APIClientFactory can be used to create a preconfigured Guzzle HTTP API client based on the configuration data available for an API on CloudObjects.

Methods

__construct(ObjectRetriever $objectRetriever, IRI $namespaceCoid = null)

No description

Client
getClientWithCOID(IRI $apiCoid, bool $specificClient = false)

Get an API client for the WebAPI with the specified COID.

Details

at line 131
__construct(ObjectRetriever $objectRetriever, IRI $namespaceCoid = null)

Parameters

ObjectRetriever $objectRetriever An initialized and authenticated object retriever.
IRI $namespaceCoid The namespace of the API client. Used to retrieve credentials. If this parameter is not provided, the namespace provided with the "auth_ns" configuration option from the object retriever is used.

at line 153
Client getClientWithCOID(IRI $apiCoid, bool $specificClient = false)

Get an API client for the WebAPI with the specified COID.

Parameters

IRI $apiCoid WebAPI COID
bool $specificClient If TRUE, returns a specific client class based on the API type. If FALSE, always returns a Guzzle client. Defaults to FALSE.

Return Value

Client