| GET, POST | /pickmeup/history | Get the user's recent history of bookings. |
|---|
<?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 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 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 PickMeUpBookingItem implements JsonSerializable
{
public function __construct(
/** @description Date and Time of the pickup in ISO 8601 format. */
// @ApiMember(Description="Date and Time of the pickup in ISO 8601 format.")
/** @var string|null */
public ?string $BookingTime=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 Date and Time the booking request was made in ISO 8601 format. */
// @ApiMember(Description="Date and Time the booking request was made in ISO 8601 format.")
/** @var string|null */
public ?string $DateCreated=null,
/** @description Status of the booking as returned by the service provider. */
// @ApiMember(Description="Status of the booking as returned by the service provider.")
/** @var string|null */
public ?string $Status=null,
/** @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 number of people to be picked up. */
// @ApiMember(Description="The number of people to be picked up.", IsRequired=true)
/** @var string */
public string $PassengerCount='',
/** @description The location details of where the clients are to be picked up. */
// @ApiMember(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(Description="The location details of where the clients are to be dropped off.", IsRequired=true)
/** @var BookingLocation|null */
public ?BookingLocation $DropoffLocation=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['BookingTime'])) $this->BookingTime = $o['BookingTime'];
if (isset($o['ReferenceNumber'])) $this->ReferenceNumber = $o['ReferenceNumber'];
if (isset($o['DateCreated'])) $this->DateCreated = $o['DateCreated'];
if (isset($o['Status'])) $this->Status = $o['Status'];
if (isset($o['ContactName'])) $this->ContactName = $o['ContactName'];
if (isset($o['ContactNumber'])) $this->ContactNumber = $o['ContactNumber'];
if (isset($o['PassengerCount'])) $this->PassengerCount = $o['PassengerCount'];
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 = [];
if (isset($this->BookingTime)) $o['BookingTime'] = $this->BookingTime;
if (isset($this->ReferenceNumber)) $o['ReferenceNumber'] = $this->ReferenceNumber;
if (isset($this->DateCreated)) $o['DateCreated'] = $this->DateCreated;
if (isset($this->Status)) $o['Status'] = $this->Status;
if (isset($this->ContactName)) $o['ContactName'] = $this->ContactName;
if (isset($this->ContactNumber)) $o['ContactNumber'] = $this->ContactNumber;
if (isset($this->PassengerCount)) $o['PassengerCount'] = $this->PassengerCount;
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 PickMeUpHistoryResponse 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 List of booking history items for the Pick Me Up service. */
// @ApiMember(Description="List of booking history items for the Pick Me Up service.")
/** @var array<PickMeUpBookingItem>|null */
public ?array $PickMeUpHistory=null,
/** @description List of booking history items for the Take Me Home service. */
// @ApiMember(Description="List of booking history items for the Take Me Home service.")
/** @var array<PickMeUpBookingItem>|null */
public ?array $TakeMeHomeHistory=null
) {
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['PickMeUpHistory'])) $this->PickMeUpHistory = JsonConverters::fromArray('PickMeUpBookingItem', $o['PickMeUpHistory']);
if (isset($o['TakeMeHomeHistory'])) $this->TakeMeHomeHistory = JsonConverters::fromArray('PickMeUpBookingItem', $o['TakeMeHomeHistory']);
}
/** @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->PickMeUpHistory)) $o['PickMeUpHistory'] = JsonConverters::toArray('PickMeUpBookingItem', $this->PickMeUpHistory);
if (isset($this->TakeMeHomeHistory)) $o['TakeMeHomeHistory'] = JsonConverters::toArray('PickMeUpBookingItem', $this->TakeMeHomeHistory);
return empty($o) ? new class(){} : $o;
}
}
class PickMeUpHistoryRequest extends ApiServiceRequest implements JsonSerializable
{
/**
* @param string $ApiKey
*/
public function __construct(
string $ApiKey='',
/** @description ID Number of the user's history to retrieve. */
// @ApiMember(Description="ID Number of the user's history to retrieve.", IsRequired=true)
/** @var string */
public string $IdNumber=''
) {
parent::__construct($ApiKey);
}
/** @throws Exception */
public function fromMap($o): void {
parent::fromMap($o);
if (isset($o['IdNumber'])) $this->IdNumber = $o['IdNumber'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = parent::jsonSerialize();
if (isset($this->IdNumber)) $o['IdNumber'] = $this->IdNumber;
return empty($o) ? new class(){} : $o;
}
}
PHP PickMeUpHistoryRequest DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .csv suffix or ?format=csv
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /pickmeup/history HTTP/1.1
Host: galaxymobile.api.client.prod.86degrees.com
Accept: text/csv
Content-Type: text/csv
Content-Length: length
{"IdNumber":"String","ApiKey":"String"}
HTTP/1.1 200 OK
Content-Type: text/csv
Content-Length: length
{"ProductAvailable":false,"UserHasAccess":false,"PickMeUpHistory":[{}],"TakeMeHomeHistory":[{}],"Description":"String","Heading":"String","WasSuccessful":false,"ModelState":{}}