Reservation Station API

<back to all web services

GetFacilityStatus

Requires Authentication
<?php namespace dtos;

use DateTime;
use Exception;
use DateInterval;
use JsonSerializable;
use ServiceStack\{IReturn,IReturnVoid,IGet,IPost,IPut,IDelete,IPatch,IMeta,IHasSessionId,IHasBearerToken,IHasVersion};
use ServiceStack\{ICrud,ICreateDb,IUpdateDb,IPatchDb,IDeleteDb,ISaveDb,AuditBase,QueryDb,QueryDb2,QueryData,QueryData2,QueryResponse};
use ServiceStack\{ResponseStatus,ResponseError,EmptyResponse,IdResponse,ArrayList,KeyValuePair2,StringResponse,StringsResponse,Tuple2,Tuple3,ByteArray};
use ServiceStack\{JsonConverters,Returns,TypeContext};


class ApiServiceRequest implements IServiceRequest, IHasApiKey, IHasDeviceInfo, JsonSerializable
{
    public function __construct(
        /** @description The API Key required for authentication */
        // @ApiMember(DataType="string", Description="The API Key required for authentication", IsRequired=true)
        /** @var string */
        public string $apiKey='',

        /** @description Latitude of the user making this request */
        // @ApiMember(DataType="double", Description="Latitude of the user making this request")
        /** @var float */
        public float $latitude=0.0,

        /** @description Longitude of the user making this request */
        // @ApiMember(DataType="double", Description="Longitude of the user making this request")
        /** @var float */
        public float $longitude=0.0
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['apiKey'])) $this->apiKey = $o['apiKey'];
        if (isset($o['latitude'])) $this->latitude = $o['latitude'];
        if (isset($o['longitude'])) $this->longitude = $o['longitude'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->apiKey)) $o['apiKey'] = $this->apiKey;
        if (isset($this->latitude)) $o['latitude'] = $this->latitude;
        if (isset($this->longitude)) $o['longitude'] = $this->longitude;
        return empty($o) ? new class(){} : $o;
    }
}

class ApiServiceResponse implements IServiceResponse, JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $description=null,
        /** @var string|null */
        public ?string $heading=null,
        /** @var bool|null */
        public ?bool $wasSuccessful=null,
        /** @var Object|null */
        public ?Object $modelState=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['description'])) $this->description = $o['description'];
        if (isset($o['heading'])) $this->heading = $o['heading'];
        if (isset($o['wasSuccessful'])) $this->wasSuccessful = $o['wasSuccessful'];
        if (isset($o['modelState'])) $this->modelState = JsonConverters::from('Object', $o['modelState']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->description)) $o['description'] = $this->description;
        if (isset($this->heading)) $o['heading'] = $this->heading;
        if (isset($this->wasSuccessful)) $o['wasSuccessful'] = $this->wasSuccessful;
        if (isset($this->modelState)) $o['modelState'] = JsonConverters::to('Object', $this->modelState);
        return empty($o) ? new class(){} : $o;
    }
}

class FacilityStatusData implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $facilityName=null,
        /** @var string|null */
        public ?string $themeColor=null,
        /** @var string|null */
        public ?string $venueLogoUrl=null,
        /** @var bool|null */
        public ?bool $inProgress=null,
        /** @var string|null */
        public ?string $currentReservationName=null,
        /** @var string|null */
        public ?string $currentReservationStart=null,
        /** @var string|null */
        public ?string $currentReservationEnd=null,
        /** @var int */
        public int $currentReservationId=0,
        /** @var bool|null */
        public ?bool $hasNextReservation=null,
        /** @var string|null */
        public ?string $nextReservationName=null,
        /** @var string|null */
        public ?string $nextReservationStart=null,
        /** @var string|null */
        public ?string $nextReservationEnd=null,
        /** @var int */
        public int $nextReservationId=0,
        /** @var bool|null */
        public ?bool $freeUntilNextBooking=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['facilityName'])) $this->facilityName = $o['facilityName'];
        if (isset($o['themeColor'])) $this->themeColor = $o['themeColor'];
        if (isset($o['venueLogoUrl'])) $this->venueLogoUrl = $o['venueLogoUrl'];
        if (isset($o['inProgress'])) $this->inProgress = $o['inProgress'];
        if (isset($o['currentReservationName'])) $this->currentReservationName = $o['currentReservationName'];
        if (isset($o['currentReservationStart'])) $this->currentReservationStart = $o['currentReservationStart'];
        if (isset($o['currentReservationEnd'])) $this->currentReservationEnd = $o['currentReservationEnd'];
        if (isset($o['currentReservationId'])) $this->currentReservationId = $o['currentReservationId'];
        if (isset($o['hasNextReservation'])) $this->hasNextReservation = $o['hasNextReservation'];
        if (isset($o['nextReservationName'])) $this->nextReservationName = $o['nextReservationName'];
        if (isset($o['nextReservationStart'])) $this->nextReservationStart = $o['nextReservationStart'];
        if (isset($o['nextReservationEnd'])) $this->nextReservationEnd = $o['nextReservationEnd'];
        if (isset($o['nextReservationId'])) $this->nextReservationId = $o['nextReservationId'];
        if (isset($o['freeUntilNextBooking'])) $this->freeUntilNextBooking = $o['freeUntilNextBooking'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->facilityName)) $o['facilityName'] = $this->facilityName;
        if (isset($this->themeColor)) $o['themeColor'] = $this->themeColor;
        if (isset($this->venueLogoUrl)) $o['venueLogoUrl'] = $this->venueLogoUrl;
        if (isset($this->inProgress)) $o['inProgress'] = $this->inProgress;
        if (isset($this->currentReservationName)) $o['currentReservationName'] = $this->currentReservationName;
        if (isset($this->currentReservationStart)) $o['currentReservationStart'] = $this->currentReservationStart;
        if (isset($this->currentReservationEnd)) $o['currentReservationEnd'] = $this->currentReservationEnd;
        if (isset($this->currentReservationId)) $o['currentReservationId'] = $this->currentReservationId;
        if (isset($this->hasNextReservation)) $o['hasNextReservation'] = $this->hasNextReservation;
        if (isset($this->nextReservationName)) $o['nextReservationName'] = $this->nextReservationName;
        if (isset($this->nextReservationStart)) $o['nextReservationStart'] = $this->nextReservationStart;
        if (isset($this->nextReservationEnd)) $o['nextReservationEnd'] = $this->nextReservationEnd;
        if (isset($this->nextReservationId)) $o['nextReservationId'] = $this->nextReservationId;
        if (isset($this->freeUntilNextBooking)) $o['freeUntilNextBooking'] = $this->freeUntilNextBooking;
        return empty($o) ? new class(){} : $o;
    }
}

class RatesItem implements JsonSerializable
{
    public function __construct(
        /** @var float */
        public float $rate=0.0,
        /** @var int */
        public int $minutes=0
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['rate'])) $this->rate = $o['rate'];
        if (isset($o['minutes'])) $this->minutes = $o['minutes'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->rate)) $o['rate'] = $this->rate;
        if (isset($this->minutes)) $o['minutes'] = $this->minutes;
        return empty($o) ? new class(){} : $o;
    }
}

class FacilityData implements JsonSerializable
{
    public function __construct(
        /** @var int */
        public int $facilityId=0,
        /** @var string|null */
        public ?string $facilityGuid=null,
        /** @var string|null */
        public ?string $name=null,
        /** @var string|null */
        public ?string $description=null,
        /** @var string|null */
        public ?string $nextAvailable=null,
        /** @var bool|null */
        public ?bool $hasNextAvailable=null,
        /** @var array<RatesItem>|null */
        public ?array $rates=null,
        /** @var string|null */
        public ?string $themeColor=null,
        /** @var string|null */
        public ?string $bookingNotes=null,
        /** @var int */
        public int $leadTime=0,
        /** @var int */
        public int $venueId=0,
        /** @var bool|null */
        public ?bool $allowExtraRequirements=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['facilityId'])) $this->facilityId = $o['facilityId'];
        if (isset($o['facilityGuid'])) $this->facilityGuid = $o['facilityGuid'];
        if (isset($o['name'])) $this->name = $o['name'];
        if (isset($o['description'])) $this->description = $o['description'];
        if (isset($o['nextAvailable'])) $this->nextAvailable = $o['nextAvailable'];
        if (isset($o['hasNextAvailable'])) $this->hasNextAvailable = $o['hasNextAvailable'];
        if (isset($o['rates'])) $this->rates = JsonConverters::fromArray('RatesItem', $o['rates']);
        if (isset($o['themeColor'])) $this->themeColor = $o['themeColor'];
        if (isset($o['bookingNotes'])) $this->bookingNotes = $o['bookingNotes'];
        if (isset($o['leadTime'])) $this->leadTime = $o['leadTime'];
        if (isset($o['venueId'])) $this->venueId = $o['venueId'];
        if (isset($o['allowExtraRequirements'])) $this->allowExtraRequirements = $o['allowExtraRequirements'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->facilityId)) $o['facilityId'] = $this->facilityId;
        if (isset($this->facilityGuid)) $o['facilityGuid'] = $this->facilityGuid;
        if (isset($this->name)) $o['name'] = $this->name;
        if (isset($this->description)) $o['description'] = $this->description;
        if (isset($this->nextAvailable)) $o['nextAvailable'] = $this->nextAvailable;
        if (isset($this->hasNextAvailable)) $o['hasNextAvailable'] = $this->hasNextAvailable;
        if (isset($this->rates)) $o['rates'] = JsonConverters::toArray('RatesItem', $this->rates);
        if (isset($this->themeColor)) $o['themeColor'] = $this->themeColor;
        if (isset($this->bookingNotes)) $o['bookingNotes'] = $this->bookingNotes;
        if (isset($this->leadTime)) $o['leadTime'] = $this->leadTime;
        if (isset($this->venueId)) $o['venueId'] = $this->venueId;
        if (isset($this->allowExtraRequirements)) $o['allowExtraRequirements'] = $this->allowExtraRequirements;
        return empty($o) ? new class(){} : $o;
    }
}

class GetFacilityStatusResponse extends ApiServiceResponse implements JsonSerializable
{
    /**
     * @param string|null $description
     * @param string|null $heading
     * @param bool|null $wasSuccessful
     * @param Object|null $modelState
     */
    public function __construct(
        ?string $description=null,
        ?string $heading=null,
        ?bool $wasSuccessful=null,
        ?Object $modelState=null,
        /** @var FacilityStatusData|null */
        public ?FacilityStatusData $facilityStatus=null,
        /** @var FacilityData|null */
        public ?FacilityData $facilityData=null
    ) {
        parent::__construct($description,$heading,$wasSuccessful,$modelState);
    }

    /** @throws Exception */
    public function fromMap($o): void {
        parent::fromMap($o);
        if (isset($o['facilityStatus'])) $this->facilityStatus = JsonConverters::from('FacilityStatusData', $o['facilityStatus']);
        if (isset($o['facilityData'])) $this->facilityData = JsonConverters::from('FacilityData', $o['facilityData']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = parent::jsonSerialize();
        if (isset($this->facilityStatus)) $o['facilityStatus'] = JsonConverters::to('FacilityStatusData', $this->facilityStatus);
        if (isset($this->facilityData)) $o['facilityData'] = JsonConverters::to('FacilityData', $this->facilityData);
        return empty($o) ? new class(){} : $o;
    }
}

class GetFacilityStatus extends ApiServiceRequest implements JsonSerializable
{
    /**
     * @param string $apiKey
     * @param float $latitude
     * @param float $longitude
     */
    public function __construct(
        string $apiKey='',
        float $latitude=0.0,
        float $longitude=0.0,
        /** @var string|null */
        public ?string $facilityGuid=null
    ) {
        parent::__construct($apiKey,$latitude,$longitude);
    }

    /** @throws Exception */
    public function fromMap($o): void {
        parent::fromMap($o);
        if (isset($o['facilityGuid'])) $this->facilityGuid = $o['facilityGuid'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = parent::jsonSerialize();
        if (isset($this->facilityGuid)) $o['facilityGuid'] = $this->facilityGuid;
        return empty($o) ? new class(){} : $o;
    }
}

PHP GetFacilityStatus DTOs

To override the Content-type in your clients, use the HTTP Accept Header, append the .json suffix or ?format=json

To embed the response in a jsonp callback, append ?callback=myCallback

HTTP + JSON

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

POST /json/reply/GetFacilityStatus HTTP/1.1 
Host: reservation.api.dev.86degrees.com 
Accept: application/json
Content-Type: application/json
Content-Length: length

{"facilityGuid":"String","apiKey":"String","latitude":0,"longitude":0}
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length

{"description":"String","heading":"String","wasSuccessful":false,"modelState":{}}