Constants

API_SERVICE

API_SERVICE

The API service used in this class.

CLASSIFICATION_ENDPOINT

CLASSIFICATION_ENDPOINT

SERVICE_GROUP_ENDPOINT

SERVICE_GROUP_ENDPOINT

SERVICE_DISPLAY_ENDPOINT

SERVICE_DISPLAY_ENDPOINT

SERVICE_AVAILABILITY_ENDPOINT

SERVICE_AVAILABILITY_ENDPOINT

SERVICE_ADD_ENDPOINT

SERVICE_ADD_ENDPOINT

SERVICE_REMOVE_ENDPOINT

SERVICE_REMOVE_ENDPOINT

Properties

$sessionId

$sessionId : string

Type

string

$shouldValidateSessionIds

$shouldValidateSessionIds : boolean

Type

boolean — This should only be used for testing.

Methods

__construct()

__construct(\AdventureRes\AdventureResApp  $app, \AdventureRes\HttpClients\AdventureResHttpClientInterface|null  $client = null, boolean  $shouldValidateSessionIds = true) 

AbstractAdventureResService constructor.

Parameters

\AdventureRes\AdventureResApp $app

The configuration app.

\AdventureRes\HttpClients\AdventureResHttpClientInterface|null $client

Optionally pass in a pre-configured HttpClient.

boolean $shouldValidateSessionIds

This should only be used for testing.

getSessionId()

getSessionId() : string

Gets the session ID to be used in requests. Uses the AdventureResSession class to validate and/or generate a session ID.

Returns

string

setSessionId()

setSessionId(string  $sessionId) 

Sets the session ID.

Parameters

string $sessionId

__call()

__call(  $command,   $arguments) 

Parameters

$command
$arguments

getClassifications()

getClassifications() : array

Gets service classifications from the API.

Throws

\AdventureRes\Exceptions\AdventureResResponseException

Returns

array —

[AdventureRes\Models\Output\ClassificationModel]

getServiceGroups()

getServiceGroups() : array

Gets service groups from the API. Nearly identical to `getClassifications`.

Throws

\AdventureRes\Exceptions\AdventureResResponseException

Returns

array —

[AdventureRes\Models\Output\ClassificationModel]

getServiceAvailability()

getServiceAvailability(\AdventureRes\Models\Input\ServiceAvailabilityInputModel  $inputModel) : array

Gets all availability options for a service by provided date.

Parameters

\AdventureRes\Models\Input\ServiceAvailabilityInputModel $inputModel

Throws

\AdventureRes\Exceptions\AdventureResSDKException

Returns

array —

[AdventureRes\Models\Output\ServiceModel]

removeServiceFromReservation()

removeServiceFromReservation(\AdventureRes\Models\Input\ServiceRemoveInputModel  $inputModel) : mixed

Removes a service from a reservation. If the result of the call leaves the reservation with zero services, the reservation id in the session is set back to 0.

Parameters

\AdventureRes\Models\Input\ServiceRemoveInputModel $inputModel

Throws

\AdventureRes\Exceptions\AdventureResSDKException

Returns

mixed

makeApiCall()

makeApiCall(  $method,   $endpoint,   $params) : \AdventureRes\Http\AdventureResResponse

Generates an AdventureResRequest and sends it via the client.

Parameters

$method
$endpoint
$params

Throws

\AdventureRes\Exceptions\AdventureResResponseException

Returns

\AdventureRes\Http\AdventureResResponse