Methods |
public
|
__construct(
ConfigInterface $config,
RequestFactoryInterface $requestFactory,
StreamFactoryInterface $streamFactory,
ClientInterface $client,
)
Setups API with config and dependencies
Setups API with config and dependencies
|
#
|
public
|
prepareRequest(string $node, string $request, array $params = []): RequestInterface
Generates Request object for given node, API endpoint (request) and params
Generates Request object for given node, API endpoint (request) and params
Parameters
$node |
Yate node name like 'ucn', 'hss', 'smsc', 'dra', e.t.c.
|
$request |
Yate API 'request' string
|
$params |
Array of params to pass
|
|
#
|
public
static
|
parseResult(ResponseInterface $response): ApiResponse
Parse PSR-7 Response object from Yate API
Parse PSR-7 Response object from Yate API
Chcks for any problems with answer and throws proper exceptions.
If the answer is a good one, retun it as ApiResponse instance
Parameters
$response |
Response from API as PSR-7 object
|
Returns
Successfull response as ApiResponse object
Throws
|
#
|
public
|
call(string $node, string $request, array $params = []): ApiResponse
Performs API call
Parameters
$node |
Yate node name like 'ucn', 'hss', 'smsc', 'dra', e.t.c.
|
$request |
Yate API 'request' string
|
$params |
Array of params to pass
|
Returns
Successfull response as ApiResponse object
Throws
|
#
|