VultrClientHandler
Table of Contents
Constants
-
JSON
= 1
-
QUERY
= 0
Properties
-
$auth
: VultrAuth
-
$client
: ClientInterface
-
$request_fact
: RequestFactoryInterface
-
$response_fact
: ResponseFactoryInterface
-
$stream_fact
: StreamFactoryInterface
Methods
-
__construct()
: mixed
-
delete()
: ResponseInterface
-
get()
: ResponseInterface
-
patch()
: ResponseInterface
-
post()
: ResponseInterface
-
put()
: ResponseInterface
-
setClient()
: void
-
setRequestFactory()
: void
-
setResponseFactory()
: void
-
setStreamFactory()
: void
-
applyOptions()
: RequestInterface
-
bodySummary()
: string|null
-
formalizeErrorMessage()
: string
-
generateRequest()
: RequestInterface
-
request()
: ResponseInterface
JSON
private
mixed
JSON
= 1
QUERY
private
mixed
QUERY
= 0
$auth
private
VultrAuth
$auth
$client
private
ClientInterface
$client
$request_fact
private
RequestFactoryInterface
$request_fact
$response_fact
private
ResponseFactoryInterface
$response_fact
$stream_fact
private
StreamFactoryInterface
$stream_fact
__construct()
public
__construct(VultrAuth $auth, ClientInterface $http, RequestFactoryInterface $request, ResponseFactoryInterface $response, StreamFactoryInterface $stream) : mixed
Parameters
-
$auth
: VultrAuth
-
-
$http
: ClientInterface
-
-
$request
: RequestFactoryInterface
-
-
$response
: ResponseFactoryInterface
-
-
$stream
: StreamFactoryInterface
-
delete()
public
delete( $uri[, $params = [] ]) : ResponseInterface
Parameters
-
$uri
:
-
- string - anything after api.vultr.com/v2/
-
$params
:
= []
-
- array|null - query parameters that will be added to the uri query stirng.
-
throws
-
VultrClientException
Return values
ResponseInterface
get()
public
get( $uri[, $params = null ]) : ResponseInterface
Parameters
-
$uri
:
-
- string - anything after api.vultr.com/v2/
-
$params
:
= null
-
- array|null - query parameters that will be added to the uri query stirng.
-
throws
-
VultrClientException
Return values
ResponseInterface
patch()
public
patch( $uri[, $params = [] ]) : ResponseInterface
Parameters
-
$uri
:
-
- string - anything after api.vultr.com/v2/
-
$params
:
= []
-
- array - form data that will be encoded to a json
-
throws
-
VultrClientException
Return values
ResponseInterface
post()
public
post( $uri[, $params = [] ]) : ResponseInterface
Parameters
-
$uri
:
-
- string - anything after api.vultr.com/v2/
-
$params
:
= []
-
- array - form data that will be encoded to a json
-
throws
-
VultrClientException
Return values
ResponseInterface
put()
public
put( $uri[, $params = [] ]) : ResponseInterface
Parameters
-
$uri
:
-
- string - anything after api.vultr.com/v2/
-
$params
:
= []
-
- array - form data that will be encoded to a json
-
throws
-
VultrClientException
Return values
ResponseInterface
setClient()
public
setClient(ClientInterface $http) : void
Parameters
-
$http
: ClientInterface
-
setRequestFactory()
public
setRequestFactory(RequestFactoryInterface $request) : void
Parameters
-
$request
: RequestFactoryInterface
-
setResponseFactory()
public
setResponseFactory(ResponseFactoryInterface $response) : void
Parameters
-
$response
: ResponseFactoryInterface
-
setStreamFactory()
public
setStreamFactory(StreamFactoryInterface $stream) : void
Parameters
-
$stream
: StreamFactoryInterface
-
applyOptions()
private
applyOptions(RequestInterface $request, array<string|int, mixed> &$options) : RequestInterface
Parameters
-
$request
: RequestInterface
-
-
$options
: array<string|int, mixed>
-
Return values
RequestInterface
bodySummary()
private
bodySummary(MessageInterface $message[, int $truncateAt = 120 ]) : string|null
Parameters
-
$message
: MessageInterface
-
-
$truncateAt
: int
= 120
-
Return values
string|null
private
formalizeErrorMessage(ResponseInterface $response, RequestInterface $request) : string
Parameters
-
$response
: ResponseInterface
-
-
$request
: RequestInterface
-
generateRequest()
private
generateRequest(string $method, string $uri[, array<string|int, mixed> $options = [] ]) : RequestInterface
Parameters
-
$method
: string
-
-
$uri
: string
-
-
$options
: array<string|int, mixed>
= []
-
Return values
RequestInterface
request()
private
request(RequestInterface $request) : ResponseInterface
Parameters
-
$request
: RequestInterface
-
Return values
ResponseInterface