\EventsForceRequest

Class Request To be built up during every request

Summary

Methods
Properties
Constants
__construct()
setParameters()
setOptions()
setEndpoint()
setMethod()
setQuery()
setJson()
send()
$allowedMethods
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
$client
$endpoint
$options
$method
N/A

Properties

$allowedMethods

$allowedMethods : array

Store the allowed methods for the Request

Type

array

$client

$client : \GuzzleHttp\Client

The Guzzle client for handling our actual requests

Type

\GuzzleHttp\Client

$endpoint

$endpoint : string

Endpoint for the request

Type

string

$options

$options : array

Options for the request

Type

array

$method

$method : string

Request method

Type

string

Methods

__construct()

__construct(\GuzzleHttp\Client  $client, array  $properties = array()) 

Request constructor.

Parameters

\GuzzleHttp\Client $client
array $properties

setParameters()

setParameters(array  $properties = array()) : $this

Method that takes an array of properties and assigns them to their relevant object properties

Parameters

array $properties

Returns

$this

setOptions()

setOptions(array  $options = array()) : $this

Method for setting request options

Parameters

array $options

Throws

\EventsForce\Exceptions\InvalidArgumentException

Returns

$this

setEndpoint()

setEndpoint(string  $endpoint = '') : $this

Method to set request endpoint

Parameters

string $endpoint

Throws

\EventsForce\Exceptions\InvalidArgumentException

Returns

$this

setMethod()

setMethod(string  $method = '') : $this

Method for setting the request method

Parameters

string $method

Throws

\EventsForce\Exceptions\Exception
\EventsForce\Exceptions\InvalidArgumentException

Returns

$this

setQuery()

setQuery(array  $query = array()) : $this

Method to set query

Parameters

array $query

Throws

\EventsForce\Exceptions\InvalidArgumentException

Returns

$this

setJson()

setJson(array  $data = array()) : $this

Method for setting the json options param to be sent with the request

Parameters

array $data

Throws

\EventsForce\Exceptions\InvalidArgumentException

Returns

$this

send()

send() : \Psr\Http\Message\StreamInterface

Method to handle sending a request

Throws

\EventsForce\Exceptions\EmptyResponseException
\EventsForce\Exceptions\ResourceNotFound

Returns

\Psr\Http\Message\StreamInterface