GalaxyMobile Client API

<back to all web services

TakeMeHomeRequest

The following routes are available for this service:
POST/pickmeup/takemehomeRequest a booking for the Take Me Home service.
<?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, 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=''
    ) {
    }

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

class BookingLocation implements JsonSerializable
{
    public function __construct(
        /** @description Latitude of the pickup/drop-off location. */
        // @ApiMember(Description="Latitude of the pickup/drop-off location.", IsRequired=true)
        /** @var float */
        public float $Latitude=0.0,

        /** @description Longitude of the pickup/drop-off location. */
        // @ApiMember(Description="Longitude of the pickup/drop-off location.", IsRequired=true)
        /** @var float */
        public float $Longitude=0.0,

        /** @description Address of the pickup/drop-off location. */
        // @ApiMember(Description="Address of the pickup/drop-off location.", IsRequired=true)
        /** @var string */
        public string $Address=''
    ) {
    }

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

class PickMeUpActivationRequest extends ApiServiceRequest implements JsonSerializable
{
    /**
     * @param string $ApiKey
     */
    public function __construct(
        string $ApiKey='',
        /** @description ID Number of the user making this request. */
        // @ApiMember(Description="ID Number of the user making this request.", IsRequired=true)
        /** @var string */
        public string $IdNumber='',

        /** @description The number of people to be picked up. */
        // @ApiMember(Description="The number of people to be picked up.", IsRequired=true)
        /** @var int */
        public int $PassengerCount=0,

        /** @description Date and Time of the pickup in ISO 8601 format. */
        // @ApiMember(Description="Date and Time of the pickup in ISO 8601 format.", IsRequired=true)
        /** @var string */
        public string $BookingDate='',

        /** @description Name of contact person at pickup. */
        // @ApiMember(Description="Name of contact person at pickup.", IsRequired=true)
        /** @var string */
        public string $ContactName='',

        /** @description Contact number of contact person at pickup. */
        // @ApiMember(Description="Contact number of contact person at pickup.", IsRequired=true)
        /** @var string */
        public string $ContactNumber='',

        /** @description The location details of where the clients are to be picked up. */
        // @ApiMember(DataType="BookingLocation", Description="The location details of where the clients are to be picked up.", IsRequired=true)
        /** @var BookingLocation|null */
        public ?BookingLocation $PickupLocation=null,

        /** @description The location details of where the clients are to be dropped off. */
        // @ApiMember(DataType="BookingLocation", Description="The location details of where the clients are to be dropped off.", IsRequired=true)
        /** @var BookingLocation|null */
        public ?BookingLocation $DropoffLocation=null
    ) {
        parent::__construct($ApiKey);
    }

    /** @throws Exception */
    public function fromMap($o): void {
        parent::fromMap($o);
        if (isset($o['IdNumber'])) $this->IdNumber = $o['IdNumber'];
        if (isset($o['PassengerCount'])) $this->PassengerCount = $o['PassengerCount'];
        if (isset($o['BookingDate'])) $this->BookingDate = $o['BookingDate'];
        if (isset($o['ContactName'])) $this->ContactName = $o['ContactName'];
        if (isset($o['ContactNumber'])) $this->ContactNumber = $o['ContactNumber'];
        if (isset($o['PickupLocation'])) $this->PickupLocation = JsonConverters::from('BookingLocation', $o['PickupLocation']);
        if (isset($o['DropoffLocation'])) $this->DropoffLocation = JsonConverters::from('BookingLocation', $o['DropoffLocation']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = parent::jsonSerialize();
        if (isset($this->IdNumber)) $o['IdNumber'] = $this->IdNumber;
        if (isset($this->PassengerCount)) $o['PassengerCount'] = $this->PassengerCount;
        if (isset($this->BookingDate)) $o['BookingDate'] = $this->BookingDate;
        if (isset($this->ContactName)) $o['ContactName'] = $this->ContactName;
        if (isset($this->ContactNumber)) $o['ContactNumber'] = $this->ContactNumber;
        if (isset($this->PickupLocation)) $o['PickupLocation'] = JsonConverters::to('BookingLocation', $this->PickupLocation);
        if (isset($this->DropoffLocation)) $o['DropoffLocation'] = JsonConverters::to('BookingLocation', $this->DropoffLocation);
        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 PickMeUpResponse 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,
        /** @description Is the requested product set up and enabled on Galaxy. */
        // @ApiMember(Description="Is the requested product set up and enabled on Galaxy.")
        /** @var bool|null */
        public ?bool $ProductAvailable=null,

        /** @description Does the user have access to this product, based on their Galaxy profile. */
        // @ApiMember(Description="Does the user have access to this product, based on their Galaxy profile.")
        /** @var bool|null */
        public ?bool $UserHasAccess=null,

        /** @description This indicates that the pickup location is outside of the service area of the service provider. */
        // @ApiMember(Description="This indicates that the pickup location is outside of the service area of the service provider.")
        /** @var bool|null */
        public ?bool $PickupOutOfBounds=null,

        /** @description This indicates that the dropoff location is outside of the service area of the service provider. */
        // @ApiMember(Description="This indicates that the dropoff location is outside of the service area of the service provider.")
        /** @var bool|null */
        public ?bool $DropoffOutOfBounds=null,

        /** @description This indicates that the pickup time is not far enough in the future. The time needs to be at least 60 minutes in the future, or 90 minutes during peak times. See the documentation for more details. */
        // @ApiMember(Description="This indicates that the pickup time is not far enough in the future. The time needs to be at least 60 minutes in the future, or 90 minutes during peak times. See the documentation for more details.")
        /** @var bool|null */
        public ?bool $PickupTooSoon=null,

        /** @description The booking reference number returned by the service provider. To be shown to the client. */
        // @ApiMember(Description="The booking reference number returned by the service provider. To be shown to the client.")
        /** @var string|null */
        public ?string $ReferenceNumber=null,

        /** @description Error message from service provider. */
        // @ApiMember(Description="Error message from service provider.")
        /** @var string|null */
        public ?string $ErrorMessage=null,

        /** @description Error code from service provider. */
        // @ApiMember(Description="Error code from service provider.")
        /** @var int */
        public int $ErrorCode=0
    ) {
        parent::__construct($Description,$Heading,$WasSuccessful,$ModelState);
    }

    /** @throws Exception */
    public function fromMap($o): void {
        parent::fromMap($o);
        if (isset($o['ProductAvailable'])) $this->ProductAvailable = $o['ProductAvailable'];
        if (isset($o['UserHasAccess'])) $this->UserHasAccess = $o['UserHasAccess'];
        if (isset($o['PickupOutOfBounds'])) $this->PickupOutOfBounds = $o['PickupOutOfBounds'];
        if (isset($o['DropoffOutOfBounds'])) $this->DropoffOutOfBounds = $o['DropoffOutOfBounds'];
        if (isset($o['PickupTooSoon'])) $this->PickupTooSoon = $o['PickupTooSoon'];
        if (isset($o['ReferenceNumber'])) $this->ReferenceNumber = $o['ReferenceNumber'];
        if (isset($o['ErrorMessage'])) $this->ErrorMessage = $o['ErrorMessage'];
        if (isset($o['ErrorCode'])) $this->ErrorCode = $o['ErrorCode'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = parent::jsonSerialize();
        if (isset($this->ProductAvailable)) $o['ProductAvailable'] = $this->ProductAvailable;
        if (isset($this->UserHasAccess)) $o['UserHasAccess'] = $this->UserHasAccess;
        if (isset($this->PickupOutOfBounds)) $o['PickupOutOfBounds'] = $this->PickupOutOfBounds;
        if (isset($this->DropoffOutOfBounds)) $o['DropoffOutOfBounds'] = $this->DropoffOutOfBounds;
        if (isset($this->PickupTooSoon)) $o['PickupTooSoon'] = $this->PickupTooSoon;
        if (isset($this->ReferenceNumber)) $o['ReferenceNumber'] = $this->ReferenceNumber;
        if (isset($this->ErrorMessage)) $o['ErrorMessage'] = $this->ErrorMessage;
        if (isset($this->ErrorCode)) $o['ErrorCode'] = $this->ErrorCode;
        return empty($o) ? new class(){} : $o;
    }
}

class TakeMeHomeRequest extends PickMeUpActivationRequest implements JsonSerializable
{
    /**
     * @param string $ApiKey
     * @param string $IdNumber
     * @param int $PassengerCount
     * @param string $BookingDate
     * @param string $ContactName
     * @param string $ContactNumber
     * @param BookingLocation|null $PickupLocation
     * @param BookingLocation|null $DropoffLocation
     */
    public function __construct(
        string $ApiKey='',
        string $IdNumber='',
        int $PassengerCount=0,
        string $BookingDate='',
        string $ContactName='',
        string $ContactNumber='',
        ?BookingLocation $PickupLocation=null,
        ?BookingLocation $DropoffLocation=null
    ) {
        parent::__construct($ApiKey,$IdNumber,$PassengerCount,$BookingDate,$ContactName,$ContactNumber,$PickupLocation,$DropoffLocation);
    }

    /** @throws Exception */
    public function fromMap($o): void {
        parent::fromMap($o);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = parent::jsonSerialize();
        return empty($o) ? new class(){} : $o;
    }
}

PHP TakeMeHomeRequest 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 /pickmeup/takemehome HTTP/1.1 
Host: galaxymobile.api.client.prod.86degrees.com 
Accept: application/json
Content-Type: application/json
Content-Length: length

{"IdNumber":"String","PassengerCount":0,"BookingDate":"String","ContactName":"String","ContactNumber":"String","PickupLocation":{"Latitude":0,"Longitude":0,"Address":"String"},"DropoffLocation":{"Latitude":0,"Longitude":0,"Address":"String"},"ApiKey":"String"}
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length

{"ProductAvailable":false,"UserHasAccess":false,"PickupOutOfBounds":false,"DropoffOutOfBounds":false,"PickupTooSoon":false,"ReferenceNumber":"String","ErrorMessage":"String","ErrorCode":0,"Description":"String","Heading":"String","WasSuccessful":false,"ModelState":{}}