| GET,OPTIONS | /v1/dispatch/public/pickup/{SchedulerUrl} |
|---|
<?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 DispatchZoneView implements JsonSerializable
{
public function __construct(
/** @var string|null */
public ?string $Zone=null,
/** @var float */
public float $Base=0.0,
/** @var float */
public float $PerBag=0.0,
/** @var float */
public float $PremiumUpliftPct=0.0,
/** @var int */
public int $Drivers=0,
/** @var int */
public int $IdleDrivers=0
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['Zone'])) $this->Zone = $o['Zone'];
if (isset($o['Base'])) $this->Base = $o['Base'];
if (isset($o['PerBag'])) $this->PerBag = $o['PerBag'];
if (isset($o['PremiumUpliftPct'])) $this->PremiumUpliftPct = $o['PremiumUpliftPct'];
if (isset($o['Drivers'])) $this->Drivers = $o['Drivers'];
if (isset($o['IdleDrivers'])) $this->IdleDrivers = $o['IdleDrivers'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->Zone)) $o['Zone'] = $this->Zone;
if (isset($this->Base)) $o['Base'] = $this->Base;
if (isset($this->PerBag)) $o['PerBag'] = $this->PerBag;
if (isset($this->PremiumUpliftPct)) $o['PremiumUpliftPct'] = $this->PremiumUpliftPct;
if (isset($this->Drivers)) $o['Drivers'] = $this->Drivers;
if (isset($this->IdleDrivers)) $o['IdleDrivers'] = $this->IdleDrivers;
return empty($o) ? new class(){} : $o;
}
}
class DispatchNeedView implements JsonSerializable
{
public function __construct(
/** @var string|null */
public ?string $Id=null,
/** @var string|null */
public ?string $Label=null,
/** @var string|null */
public ?string $Sub=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['Id'])) $this->Id = $o['Id'];
if (isset($o['Label'])) $this->Label = $o['Label'];
if (isset($o['Sub'])) $this->Sub = $o['Sub'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->Id)) $o['Id'] = $this->Id;
if (isset($this->Label)) $o['Label'] = $this->Label;
if (isset($this->Sub)) $o['Sub'] = $this->Sub;
return empty($o) ? new class(){} : $o;
}
}
class DispatchPickupPageResponse implements JsonSerializable
{
public function __construct(
/** @var string|null */
public ?string $CompanyName=null,
/** @var array<DispatchZoneView>|null */
public ?array $Zones=null,
/** @var array<DispatchNeedView>|null */
public ?array $Needs=null,
/** @var bool|null */
public ?bool $CardEnabled=null,
/** @var string|null */
public ?string $PublishableKey=null,
/** @var ResponseStatus|null */
public ?ResponseStatus $ResponseStatus=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['CompanyName'])) $this->CompanyName = $o['CompanyName'];
if (isset($o['Zones'])) $this->Zones = JsonConverters::fromArray('DispatchZoneView', $o['Zones']);
if (isset($o['Needs'])) $this->Needs = JsonConverters::fromArray('DispatchNeedView', $o['Needs']);
if (isset($o['CardEnabled'])) $this->CardEnabled = $o['CardEnabled'];
if (isset($o['PublishableKey'])) $this->PublishableKey = $o['PublishableKey'];
if (isset($o['ResponseStatus'])) $this->ResponseStatus = JsonConverters::from('ResponseStatus', $o['ResponseStatus']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->CompanyName)) $o['CompanyName'] = $this->CompanyName;
if (isset($this->Zones)) $o['Zones'] = JsonConverters::toArray('DispatchZoneView', $this->Zones);
if (isset($this->Needs)) $o['Needs'] = JsonConverters::toArray('DispatchNeedView', $this->Needs);
if (isset($this->CardEnabled)) $o['CardEnabled'] = $this->CardEnabled;
if (isset($this->PublishableKey)) $o['PublishableKey'] = $this->PublishableKey;
if (isset($this->ResponseStatus)) $o['ResponseStatus'] = JsonConverters::to('ResponseStatus', $this->ResponseStatus);
return empty($o) ? new class(){} : $o;
}
}
class DispatchPickupPageRequest implements JsonSerializable
{
public function __construct(
/** @var string|null */
public ?string $SchedulerUrl=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['SchedulerUrl'])) $this->SchedulerUrl = $o['SchedulerUrl'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->SchedulerUrl)) $o['SchedulerUrl'] = $this->SchedulerUrl;
return empty($o) ? new class(){} : $o;
}
}
PHP DispatchPickupPageRequest DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .xml suffix or ?format=xml
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
GET /v1/dispatch/public/pickup/{SchedulerUrl} HTTP/1.1
Host: api.dev.dynamics.trendsic.com
Accept: application/xml
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length
<DispatchPickupPageResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/CRM.AgencyPlatform.API.Internal">
<CardEnabled>false</CardEnabled>
<CompanyName>String</CompanyName>
<Needs>
<DispatchNeedView>
<Id>String</Id>
<Label>String</Label>
<Sub>String</Sub>
</DispatchNeedView>
</Needs>
<PublishableKey>String</PublishableKey>
<ResponseStatus xmlns:d2p1="http://schemas.servicestack.net/types">
<d2p1:ErrorCode>String</d2p1:ErrorCode>
<d2p1:Message>String</d2p1:Message>
<d2p1:StackTrace>String</d2p1:StackTrace>
<d2p1:Errors>
<d2p1:ResponseError>
<d2p1:ErrorCode>String</d2p1:ErrorCode>
<d2p1:FieldName>String</d2p1:FieldName>
<d2p1:Message>String</d2p1:Message>
<d2p1:Meta xmlns:d5p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d5p1:KeyValueOfstringstring>
<d5p1:Key>String</d5p1:Key>
<d5p1:Value>String</d5p1:Value>
</d5p1:KeyValueOfstringstring>
</d2p1:Meta>
</d2p1:ResponseError>
</d2p1:Errors>
<d2p1:Meta xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d3p1:KeyValueOfstringstring>
<d3p1:Key>String</d3p1:Key>
<d3p1:Value>String</d3p1:Value>
</d3p1:KeyValueOfstringstring>
</d2p1:Meta>
</ResponseStatus>
<Zones>
<DispatchZoneView>
<Base>0</Base>
<Drivers>0</Drivers>
<IdleDrivers>0</IdleDrivers>
<PerBag>0</PerBag>
<PremiumUpliftPct>0</PremiumUpliftPct>
<Zone>String</Zone>
</DispatchZoneView>
</Zones>
</DispatchPickupPageResponse>