Trendsic Platform Service

<back to all web services

CourierTrackCancelRequest

The following routes are available for this service:
POST,OPTIONS/v1/dispatch/track/{Token}/cancel
<?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 CourierTrackActRequest implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $Token=null,
        /** @var string|null */
        public ?string $ActToken=null
    ) {
    }

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

class DispatchTrackStepView implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $Name=null,
        /** @var DateTime|null */
        public ?DateTime $At=null,
        /** @var bool|null */
        public ?bool $Done=null,
        /** @var bool|null */
        public ?bool $Current=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['Name'])) $this->Name = $o['Name'];
        if (isset($o['At'])) $this->At = JsonConverters::from('DateTime', $o['At']);
        if (isset($o['Done'])) $this->Done = $o['Done'];
        if (isset($o['Current'])) $this->Current = $o['Current'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->Name)) $o['Name'] = $this->Name;
        if (isset($this->At)) $o['At'] = JsonConverters::to('DateTime', $this->At);
        if (isset($this->Done)) $o['Done'] = $this->Done;
        if (isset($this->Current)) $o['Current'] = $this->Current;
        return empty($o) ? new class(){} : $o;
    }
}

class CourierTrackBusiness implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $Name=null,
        /** @var string|null */
        public ?string $Phone=null
    ) {
    }

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

class CourierTrackDriver implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $FirstName=null,
        /** @var string|null */
        public ?string $Initial=null,
        /** @var string|null */
        public ?string $Vehicle=null,
        /** @var string|null */
        public ?string $Plate=null,
        /** @var int|null */
        public ?int $EtaMin=null,
        /** @var int|null */
        public ?int $EtaPct=null
    ) {
    }

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

class CourierTrackProof implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $Kind=null,
        /** @var string|null */
        public ?string $PhotoUrl=null,
        /** @var string|null */
        public ?string $AtText=null,
        /** @var bool|null */
        public ?bool $GpsOk=null,
        /** @var int */
        public int $Units=0,
        /** @var string|null */
        public ?string $DamageNote=null,
        /** @var string|null */
        public ?string $DeliveredTo=null,
        /** @var int */
        public int $WaitedMin=0,
        /** @var int */
        public int $Attempts=0,
        /** @var string|null */
        public ?string $ContactedText=null,
        /** @var bool|null */
        public ?bool $EachTagged=null,
        /** @var bool|null */
        public ?bool $EachScanned=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['Kind'])) $this->Kind = $o['Kind'];
        if (isset($o['PhotoUrl'])) $this->PhotoUrl = $o['PhotoUrl'];
        if (isset($o['AtText'])) $this->AtText = $o['AtText'];
        if (isset($o['GpsOk'])) $this->GpsOk = $o['GpsOk'];
        if (isset($o['Units'])) $this->Units = $o['Units'];
        if (isset($o['DamageNote'])) $this->DamageNote = $o['DamageNote'];
        if (isset($o['DeliveredTo'])) $this->DeliveredTo = $o['DeliveredTo'];
        if (isset($o['WaitedMin'])) $this->WaitedMin = $o['WaitedMin'];
        if (isset($o['Attempts'])) $this->Attempts = $o['Attempts'];
        if (isset($o['ContactedText'])) $this->ContactedText = $o['ContactedText'];
        if (isset($o['EachTagged'])) $this->EachTagged = $o['EachTagged'];
        if (isset($o['EachScanned'])) $this->EachScanned = $o['EachScanned'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->Kind)) $o['Kind'] = $this->Kind;
        if (isset($this->PhotoUrl)) $o['PhotoUrl'] = $this->PhotoUrl;
        if (isset($this->AtText)) $o['AtText'] = $this->AtText;
        if (isset($this->GpsOk)) $o['GpsOk'] = $this->GpsOk;
        if (isset($this->Units)) $o['Units'] = $this->Units;
        if (isset($this->DamageNote)) $o['DamageNote'] = $this->DamageNote;
        if (isset($this->DeliveredTo)) $o['DeliveredTo'] = $this->DeliveredTo;
        if (isset($this->WaitedMin)) $o['WaitedMin'] = $this->WaitedMin;
        if (isset($this->Attempts)) $o['Attempts'] = $this->Attempts;
        if (isset($this->ContactedText)) $o['ContactedText'] = $this->ContactedText;
        if (isset($this->EachTagged)) $o['EachTagged'] = $this->EachTagged;
        if (isset($this->EachScanned)) $o['EachScanned'] = $this->EachScanned;
        return empty($o) ? new class(){} : $o;
    }
}

class CourierTrackRating implements JsonSerializable
{
    public function __construct(
        /** @var int */
        public int $Stars=0,
        /** @var string|null */
        public ?string $Tags=null,
        /** @var float */
        public float $Tip=0.0,
        /** @var string|null */
        public ?string $TipStatus=null
    ) {
    }

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

class CourierTrackSlot implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $Id=null,
        /** @var string|null */
        public ?string $Day=null,
        /** @var string|null */
        public ?string $DayEs=null,
        /** @var string|null */
        public ?string $Win=null
    ) {
    }

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

class CourierTrackMissed implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $Code=null,
        /** @var float */
        public float $Fee=0.0,
        /** @var int */
        public int $WaitedMin=0,
        /** @var bool|null */
        public ?bool $AutoRebook=null,
        /** @var string|null */
        public ?string $RebookWindowText=null,
        /** @var array<CourierTrackSlot>|null */
        public ?array $Slots=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['Code'])) $this->Code = $o['Code'];
        if (isset($o['Fee'])) $this->Fee = $o['Fee'];
        if (isset($o['WaitedMin'])) $this->WaitedMin = $o['WaitedMin'];
        if (isset($o['AutoRebook'])) $this->AutoRebook = $o['AutoRebook'];
        if (isset($o['RebookWindowText'])) $this->RebookWindowText = $o['RebookWindowText'];
        if (isset($o['Slots'])) $this->Slots = JsonConverters::fromArray('CourierTrackSlot', $o['Slots']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->Code)) $o['Code'] = $this->Code;
        if (isset($this->Fee)) $o['Fee'] = $this->Fee;
        if (isset($this->WaitedMin)) $o['WaitedMin'] = $this->WaitedMin;
        if (isset($this->AutoRebook)) $o['AutoRebook'] = $this->AutoRebook;
        if (isset($this->RebookWindowText)) $o['RebookWindowText'] = $this->RebookWindowText;
        if (isset($this->Slots)) $o['Slots'] = JsonConverters::toArray('CourierTrackSlot', $this->Slots);
        return empty($o) ? new class(){} : $o;
    }
}

class CourierTrackCan implements JsonSerializable
{
    public function __construct(
        /** @var bool|null */
        public ?bool $EditInstructions=null,
        /** @var bool|null */
        public ?bool $ChangeUnits=null,
        /** @var bool|null */
        public ?bool $Cancel=null,
        /** @var bool|null */
        public ?bool $RescheduleDelivery=null,
        /** @var bool|null */
        public ?bool $Rebook=null,
        /** @var bool|null */
        public ?bool $Rate=null,
        /** @var bool|null */
        public ?bool $Message=null,
        /** @var bool|null */
        public ?bool $Report=null,
        /** @var int */
        public int $MaxUnits=0
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['EditInstructions'])) $this->EditInstructions = $o['EditInstructions'];
        if (isset($o['ChangeUnits'])) $this->ChangeUnits = $o['ChangeUnits'];
        if (isset($o['Cancel'])) $this->Cancel = $o['Cancel'];
        if (isset($o['RescheduleDelivery'])) $this->RescheduleDelivery = $o['RescheduleDelivery'];
        if (isset($o['Rebook'])) $this->Rebook = $o['Rebook'];
        if (isset($o['Rate'])) $this->Rate = $o['Rate'];
        if (isset($o['Message'])) $this->Message = $o['Message'];
        if (isset($o['Report'])) $this->Report = $o['Report'];
        if (isset($o['MaxUnits'])) $this->MaxUnits = $o['MaxUnits'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->EditInstructions)) $o['EditInstructions'] = $this->EditInstructions;
        if (isset($this->ChangeUnits)) $o['ChangeUnits'] = $this->ChangeUnits;
        if (isset($this->Cancel)) $o['Cancel'] = $this->Cancel;
        if (isset($this->RescheduleDelivery)) $o['RescheduleDelivery'] = $this->RescheduleDelivery;
        if (isset($this->Rebook)) $o['Rebook'] = $this->Rebook;
        if (isset($this->Rate)) $o['Rate'] = $this->Rate;
        if (isset($this->Message)) $o['Message'] = $this->Message;
        if (isset($this->Report)) $o['Report'] = $this->Report;
        if (isset($this->MaxUnits)) $o['MaxUnits'] = $this->MaxUnits;
        return empty($o) ? new class(){} : $o;
    }
}

class CourierTrackMessage implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $Who=null,
        /** @var bool|null */
        public ?bool $Mine=null,
        /** @var bool|null */
        public ?bool $Office=null,
        /** @var string|null */
        public ?string $AtText=null,
        /** @var string|null */
        public ?string $Body=null
    ) {
    }

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

class CourierTrackView implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $State=null,
        /** @var string|null */
        public ?string $Code=null,
        /** @var string|null */
        public ?string $RunCode=null,
        /** @var string|null */
        public ?string $Shape=null,
        /** @var string|null */
        public ?string $Template=null,
        /** @var string|null */
        public ?string $CourierStep=null,
        /** @var string|null */
        public ?string $UnitOne=null,
        /** @var string|null */
        public ?string $UnitMany=null,
        /** @var string|null */
        public ?string $UnitOneEs=null,
        /** @var string|null */
        public ?string $UnitManyEs=null,
        /** @var string|null */
        public ?string $FacilityNoun=null,
        /** @var string|null */
        public ?string $FacilityNounEs=null,
        /** @var int */
        public int $Units=0,
        /** @var bool|null */
        public ?bool $UnitsCounted=null,
        /** @var string|null */
        public ?string $Address=null,
        /** @var string|null */
        public ?string $DropoffAddress=null,
        /** @var string|null */
        public ?string $DropoffName=null,
        /** @var string|null */
        public ?string $Instructions=null,
        /** @var string|null */
        public ?string $GateCode=null,
        /** @var string|null */
        public ?string $Handoff=null,
        /** @var string|null */
        public ?string $LevelName=null,
        /** @var string|null */
        public ?string $ReadyPromise=null,
        /** @var string|null */
        public ?string $WindowText=null,
        /** @var bool|null */
        public ?bool $IsAsap=null,
        /** @var array<string,string>|null */
        public ?array $Times=null,
        /** @var int|null */
        public ?int $StopPosition=null,
        /** @var int|null */
        public ?int $StopCount=null,
        /** @var string|null */
        public ?string $DeliveryWindowText=null,
        /** @var CourierTrackDriver|null */
        public ?CourierTrackDriver $Driver=null,
        /** @var CourierTrackProof|null */
        public ?CourierTrackProof $Proof=null,
        /** @var string|null */
        public ?string $HandoffCode=null,
        /** @var CourierTrackRating|null */
        public ?CourierTrackRating $Rating=null,
        /** @var bool|null */
        public ?bool $TipAllowed=null,
        /** @var float */
        public float $TipsPct=0.0,
        /** @var CourierTrackMissed|null */
        public ?CourierTrackMissed $Missed=null,
        /** @var float */
        public float $CancelFee=0.0,
        /** @var float */
        public float $CancelFeeCharged=0.0,
        /** @var string|null */
        public ?string $CancelledBy=null,
        /** @var string|null */
        public ?string $BookUrl=null,
        /** @var CourierTrackCan|null */
        public ?CourierTrackCan $Can=null,
        /** @var array<CourierTrackSlot>|null */
        public ?array $DeliverySlots=null,
        /** @var array<CourierTrackMessage>|null */
        public ?array $Messages=null,
        /** @var bool|null */
        public ?bool $MessagesOpen=null,
        /** @var string|null */
        public ?string $CaseCode=null,
        /** @var string|null */
        public ?string $CaseStatus=null,
        /** @var string|null */
        public ?string $CaseReply=null,
        /** @var int */
        public int $ThreadHrs=0,
        /** @var DateTime|null */
        public ?DateTime $ExpiresUtc=null,
        /** @var bool|null */
        public ?bool $LiveEta=null,
        /** @var bool|null */
        public ?bool $Live=null,
        /** @var DateTime */
        public DateTime $ServerUtc=new DateTime()
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['State'])) $this->State = $o['State'];
        if (isset($o['Code'])) $this->Code = $o['Code'];
        if (isset($o['RunCode'])) $this->RunCode = $o['RunCode'];
        if (isset($o['Shape'])) $this->Shape = $o['Shape'];
        if (isset($o['Template'])) $this->Template = $o['Template'];
        if (isset($o['CourierStep'])) $this->CourierStep = $o['CourierStep'];
        if (isset($o['UnitOne'])) $this->UnitOne = $o['UnitOne'];
        if (isset($o['UnitMany'])) $this->UnitMany = $o['UnitMany'];
        if (isset($o['UnitOneEs'])) $this->UnitOneEs = $o['UnitOneEs'];
        if (isset($o['UnitManyEs'])) $this->UnitManyEs = $o['UnitManyEs'];
        if (isset($o['FacilityNoun'])) $this->FacilityNoun = $o['FacilityNoun'];
        if (isset($o['FacilityNounEs'])) $this->FacilityNounEs = $o['FacilityNounEs'];
        if (isset($o['Units'])) $this->Units = $o['Units'];
        if (isset($o['UnitsCounted'])) $this->UnitsCounted = $o['UnitsCounted'];
        if (isset($o['Address'])) $this->Address = $o['Address'];
        if (isset($o['DropoffAddress'])) $this->DropoffAddress = $o['DropoffAddress'];
        if (isset($o['DropoffName'])) $this->DropoffName = $o['DropoffName'];
        if (isset($o['Instructions'])) $this->Instructions = $o['Instructions'];
        if (isset($o['GateCode'])) $this->GateCode = $o['GateCode'];
        if (isset($o['Handoff'])) $this->Handoff = $o['Handoff'];
        if (isset($o['LevelName'])) $this->LevelName = $o['LevelName'];
        if (isset($o['ReadyPromise'])) $this->ReadyPromise = $o['ReadyPromise'];
        if (isset($o['WindowText'])) $this->WindowText = $o['WindowText'];
        if (isset($o['IsAsap'])) $this->IsAsap = $o['IsAsap'];
        if (isset($o['Times'])) $this->Times = JsonConverters::from(JsonConverters::context('Dictionary',genericArgs:['string','string']), $o['Times']);
        if (isset($o['StopPosition'])) $this->StopPosition = $o['StopPosition'];
        if (isset($o['StopCount'])) $this->StopCount = $o['StopCount'];
        if (isset($o['DeliveryWindowText'])) $this->DeliveryWindowText = $o['DeliveryWindowText'];
        if (isset($o['Driver'])) $this->Driver = JsonConverters::from('CourierTrackDriver', $o['Driver']);
        if (isset($o['Proof'])) $this->Proof = JsonConverters::from('CourierTrackProof', $o['Proof']);
        if (isset($o['HandoffCode'])) $this->HandoffCode = $o['HandoffCode'];
        if (isset($o['Rating'])) $this->Rating = JsonConverters::from('CourierTrackRating', $o['Rating']);
        if (isset($o['TipAllowed'])) $this->TipAllowed = $o['TipAllowed'];
        if (isset($o['TipsPct'])) $this->TipsPct = $o['TipsPct'];
        if (isset($o['Missed'])) $this->Missed = JsonConverters::from('CourierTrackMissed', $o['Missed']);
        if (isset($o['CancelFee'])) $this->CancelFee = $o['CancelFee'];
        if (isset($o['CancelFeeCharged'])) $this->CancelFeeCharged = $o['CancelFeeCharged'];
        if (isset($o['CancelledBy'])) $this->CancelledBy = $o['CancelledBy'];
        if (isset($o['BookUrl'])) $this->BookUrl = $o['BookUrl'];
        if (isset($o['Can'])) $this->Can = JsonConverters::from('CourierTrackCan', $o['Can']);
        if (isset($o['DeliverySlots'])) $this->DeliverySlots = JsonConverters::fromArray('CourierTrackSlot', $o['DeliverySlots']);
        if (isset($o['Messages'])) $this->Messages = JsonConverters::fromArray('CourierTrackMessage', $o['Messages']);
        if (isset($o['MessagesOpen'])) $this->MessagesOpen = $o['MessagesOpen'];
        if (isset($o['CaseCode'])) $this->CaseCode = $o['CaseCode'];
        if (isset($o['CaseStatus'])) $this->CaseStatus = $o['CaseStatus'];
        if (isset($o['CaseReply'])) $this->CaseReply = $o['CaseReply'];
        if (isset($o['ThreadHrs'])) $this->ThreadHrs = $o['ThreadHrs'];
        if (isset($o['ExpiresUtc'])) $this->ExpiresUtc = JsonConverters::from('DateTime', $o['ExpiresUtc']);
        if (isset($o['LiveEta'])) $this->LiveEta = $o['LiveEta'];
        if (isset($o['Live'])) $this->Live = $o['Live'];
        if (isset($o['ServerUtc'])) $this->ServerUtc = JsonConverters::from('DateTime', $o['ServerUtc']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->State)) $o['State'] = $this->State;
        if (isset($this->Code)) $o['Code'] = $this->Code;
        if (isset($this->RunCode)) $o['RunCode'] = $this->RunCode;
        if (isset($this->Shape)) $o['Shape'] = $this->Shape;
        if (isset($this->Template)) $o['Template'] = $this->Template;
        if (isset($this->CourierStep)) $o['CourierStep'] = $this->CourierStep;
        if (isset($this->UnitOne)) $o['UnitOne'] = $this->UnitOne;
        if (isset($this->UnitMany)) $o['UnitMany'] = $this->UnitMany;
        if (isset($this->UnitOneEs)) $o['UnitOneEs'] = $this->UnitOneEs;
        if (isset($this->UnitManyEs)) $o['UnitManyEs'] = $this->UnitManyEs;
        if (isset($this->FacilityNoun)) $o['FacilityNoun'] = $this->FacilityNoun;
        if (isset($this->FacilityNounEs)) $o['FacilityNounEs'] = $this->FacilityNounEs;
        if (isset($this->Units)) $o['Units'] = $this->Units;
        if (isset($this->UnitsCounted)) $o['UnitsCounted'] = $this->UnitsCounted;
        if (isset($this->Address)) $o['Address'] = $this->Address;
        if (isset($this->DropoffAddress)) $o['DropoffAddress'] = $this->DropoffAddress;
        if (isset($this->DropoffName)) $o['DropoffName'] = $this->DropoffName;
        if (isset($this->Instructions)) $o['Instructions'] = $this->Instructions;
        if (isset($this->GateCode)) $o['GateCode'] = $this->GateCode;
        if (isset($this->Handoff)) $o['Handoff'] = $this->Handoff;
        if (isset($this->LevelName)) $o['LevelName'] = $this->LevelName;
        if (isset($this->ReadyPromise)) $o['ReadyPromise'] = $this->ReadyPromise;
        if (isset($this->WindowText)) $o['WindowText'] = $this->WindowText;
        if (isset($this->IsAsap)) $o['IsAsap'] = $this->IsAsap;
        if (isset($this->Times)) $o['Times'] = JsonConverters::to(JsonConverters::context('Dictionary',genericArgs:['string','string']), $this->Times);
        if (isset($this->StopPosition)) $o['StopPosition'] = $this->StopPosition;
        if (isset($this->StopCount)) $o['StopCount'] = $this->StopCount;
        if (isset($this->DeliveryWindowText)) $o['DeliveryWindowText'] = $this->DeliveryWindowText;
        if (isset($this->Driver)) $o['Driver'] = JsonConverters::to('CourierTrackDriver', $this->Driver);
        if (isset($this->Proof)) $o['Proof'] = JsonConverters::to('CourierTrackProof', $this->Proof);
        if (isset($this->HandoffCode)) $o['HandoffCode'] = $this->HandoffCode;
        if (isset($this->Rating)) $o['Rating'] = JsonConverters::to('CourierTrackRating', $this->Rating);
        if (isset($this->TipAllowed)) $o['TipAllowed'] = $this->TipAllowed;
        if (isset($this->TipsPct)) $o['TipsPct'] = $this->TipsPct;
        if (isset($this->Missed)) $o['Missed'] = JsonConverters::to('CourierTrackMissed', $this->Missed);
        if (isset($this->CancelFee)) $o['CancelFee'] = $this->CancelFee;
        if (isset($this->CancelFeeCharged)) $o['CancelFeeCharged'] = $this->CancelFeeCharged;
        if (isset($this->CancelledBy)) $o['CancelledBy'] = $this->CancelledBy;
        if (isset($this->BookUrl)) $o['BookUrl'] = $this->BookUrl;
        if (isset($this->Can)) $o['Can'] = JsonConverters::to('CourierTrackCan', $this->Can);
        if (isset($this->DeliverySlots)) $o['DeliverySlots'] = JsonConverters::toArray('CourierTrackSlot', $this->DeliverySlots);
        if (isset($this->Messages)) $o['Messages'] = JsonConverters::toArray('CourierTrackMessage', $this->Messages);
        if (isset($this->MessagesOpen)) $o['MessagesOpen'] = $this->MessagesOpen;
        if (isset($this->CaseCode)) $o['CaseCode'] = $this->CaseCode;
        if (isset($this->CaseStatus)) $o['CaseStatus'] = $this->CaseStatus;
        if (isset($this->CaseReply)) $o['CaseReply'] = $this->CaseReply;
        if (isset($this->ThreadHrs)) $o['ThreadHrs'] = $this->ThreadHrs;
        if (isset($this->ExpiresUtc)) $o['ExpiresUtc'] = JsonConverters::to('DateTime', $this->ExpiresUtc);
        if (isset($this->LiveEta)) $o['LiveEta'] = $this->LiveEta;
        if (isset($this->Live)) $o['Live'] = $this->Live;
        if (isset($this->ServerUtc)) $o['ServerUtc'] = JsonConverters::to('DateTime', $this->ServerUtc);
        return empty($o) ? new class(){} : $o;
    }
}

class DispatchTrackResponse implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $Kind=null,
        /** @var string|null */
        public ?string $Code=null,
        /** @var string|null */
        public ?string $What=null,
        /** @var string|null */
        public ?string $FromLoc=null,
        /** @var string|null */
        public ?string $ToLoc=null,
        /** @var int|null */
        public ?int $Bags=null,
        /** @var float|null */
        public ?float $Fare=null,
        /** @var string|null */
        public ?string $PayMode=null,
        /** @var string|null */
        public ?string $CardLast4=null,
        /** @var bool|null */
        public ?bool $Charged=null,
        /** @var string|null */
        public ?string $Stage=null,
        /** @var string|null */
        public ?string $Headline=null,
        /** @var string|null */
        public ?string $Sub=null,
        /** @var bool|null */
        public ?bool $IsClosed=null,
        /** @var string|null */
        public ?string $Eta=null,
        /** @var string|null */
        public ?string $DriverName=null,
        /** @var string|null */
        public ?string $CustomerName=null,
        /** @var array<DispatchTrackStepView>|null */
        public ?array $Steps=null,
        /** @var bool|null */
        public ?bool $Expired=null,
        /** @var bool|null */
        public ?bool $Invalid=null,
        /** @var CourierTrackBusiness|null */
        public ?CourierTrackBusiness $Business=null,
        /** @var CourierTrackView|null */
        public ?CourierTrackView $Courier=null,
        /** @var string|null */
        public ?string $Notice=null,
        /** @var ResponseStatus|null */
        public ?ResponseStatus $ResponseStatus=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['Kind'])) $this->Kind = $o['Kind'];
        if (isset($o['Code'])) $this->Code = $o['Code'];
        if (isset($o['What'])) $this->What = $o['What'];
        if (isset($o['FromLoc'])) $this->FromLoc = $o['FromLoc'];
        if (isset($o['ToLoc'])) $this->ToLoc = $o['ToLoc'];
        if (isset($o['Bags'])) $this->Bags = $o['Bags'];
        if (isset($o['Fare'])) $this->Fare = $o['Fare'];
        if (isset($o['PayMode'])) $this->PayMode = $o['PayMode'];
        if (isset($o['CardLast4'])) $this->CardLast4 = $o['CardLast4'];
        if (isset($o['Charged'])) $this->Charged = $o['Charged'];
        if (isset($o['Stage'])) $this->Stage = $o['Stage'];
        if (isset($o['Headline'])) $this->Headline = $o['Headline'];
        if (isset($o['Sub'])) $this->Sub = $o['Sub'];
        if (isset($o['IsClosed'])) $this->IsClosed = $o['IsClosed'];
        if (isset($o['Eta'])) $this->Eta = $o['Eta'];
        if (isset($o['DriverName'])) $this->DriverName = $o['DriverName'];
        if (isset($o['CustomerName'])) $this->CustomerName = $o['CustomerName'];
        if (isset($o['Steps'])) $this->Steps = JsonConverters::fromArray('DispatchTrackStepView', $o['Steps']);
        if (isset($o['Expired'])) $this->Expired = $o['Expired'];
        if (isset($o['Invalid'])) $this->Invalid = $o['Invalid'];
        if (isset($o['Business'])) $this->Business = JsonConverters::from('CourierTrackBusiness', $o['Business']);
        if (isset($o['Courier'])) $this->Courier = JsonConverters::from('CourierTrackView', $o['Courier']);
        if (isset($o['Notice'])) $this->Notice = $o['Notice'];
        if (isset($o['ResponseStatus'])) $this->ResponseStatus = JsonConverters::from('ResponseStatus', $o['ResponseStatus']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->Kind)) $o['Kind'] = $this->Kind;
        if (isset($this->Code)) $o['Code'] = $this->Code;
        if (isset($this->What)) $o['What'] = $this->What;
        if (isset($this->FromLoc)) $o['FromLoc'] = $this->FromLoc;
        if (isset($this->ToLoc)) $o['ToLoc'] = $this->ToLoc;
        if (isset($this->Bags)) $o['Bags'] = $this->Bags;
        if (isset($this->Fare)) $o['Fare'] = $this->Fare;
        if (isset($this->PayMode)) $o['PayMode'] = $this->PayMode;
        if (isset($this->CardLast4)) $o['CardLast4'] = $this->CardLast4;
        if (isset($this->Charged)) $o['Charged'] = $this->Charged;
        if (isset($this->Stage)) $o['Stage'] = $this->Stage;
        if (isset($this->Headline)) $o['Headline'] = $this->Headline;
        if (isset($this->Sub)) $o['Sub'] = $this->Sub;
        if (isset($this->IsClosed)) $o['IsClosed'] = $this->IsClosed;
        if (isset($this->Eta)) $o['Eta'] = $this->Eta;
        if (isset($this->DriverName)) $o['DriverName'] = $this->DriverName;
        if (isset($this->CustomerName)) $o['CustomerName'] = $this->CustomerName;
        if (isset($this->Steps)) $o['Steps'] = JsonConverters::toArray('DispatchTrackStepView', $this->Steps);
        if (isset($this->Expired)) $o['Expired'] = $this->Expired;
        if (isset($this->Invalid)) $o['Invalid'] = $this->Invalid;
        if (isset($this->Business)) $o['Business'] = JsonConverters::to('CourierTrackBusiness', $this->Business);
        if (isset($this->Courier)) $o['Courier'] = JsonConverters::to('CourierTrackView', $this->Courier);
        if (isset($this->Notice)) $o['Notice'] = $this->Notice;
        if (isset($this->ResponseStatus)) $o['ResponseStatus'] = JsonConverters::to('ResponseStatus', $this->ResponseStatus);
        return empty($o) ? new class(){} : $o;
    }
}

class CourierTrackCancelRequest extends CourierTrackActRequest implements JsonSerializable
{
    /**
     * @param string|null $Token
     * @param string|null $ActToken
     */
    public function __construct(
        ?string $Token=null,
        ?string $ActToken=null,
        /** @var float|null */
        public ?float $ExpectedFee=null
    ) {
        parent::__construct($Token,$ActToken);
    }

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

PHP CourierTrackCancelRequest DTOs

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

HTTP + XML

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

POST /v1/dispatch/track/{Token}/cancel HTTP/1.1 
Host: api.dev.dynamics.trendsic.com 
Accept: application/xml
Content-Type: application/xml
Content-Length: length

<CourierTrackCancelRequest xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/CRM.AgencyPlatform.API.Internal">
  <ActToken>String</ActToken>
  <Token>String</Token>
  <ExpectedFee>0</ExpectedFee>
</CourierTrackCancelRequest>
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

<DispatchTrackResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/CRM.AgencyPlatform.API.Internal">
  <Bags>0</Bags>
  <Business>
    <Name>String</Name>
    <Phone>String</Phone>
  </Business>
  <CardLast4>String</CardLast4>
  <Charged>false</Charged>
  <Code>String</Code>
  <Courier>
    <Address>String</Address>
    <BookUrl>String</BookUrl>
    <Can>
      <Cancel>false</Cancel>
      <ChangeUnits>false</ChangeUnits>
      <EditInstructions>false</EditInstructions>
      <MaxUnits>0</MaxUnits>
      <Message>false</Message>
      <Rate>false</Rate>
      <Rebook>false</Rebook>
      <Report>false</Report>
      <RescheduleDelivery>false</RescheduleDelivery>
    </Can>
    <CancelFee>0</CancelFee>
    <CancelFeeCharged>0</CancelFeeCharged>
    <CancelledBy>String</CancelledBy>
    <CaseCode>String</CaseCode>
    <CaseReply>String</CaseReply>
    <CaseStatus>String</CaseStatus>
    <Code>String</Code>
    <CourierStep>String</CourierStep>
    <DeliverySlots>
      <CourierTrackSlot>
        <Day>String</Day>
        <DayEs>String</DayEs>
        <Id>String</Id>
        <Win>String</Win>
      </CourierTrackSlot>
    </DeliverySlots>
    <DeliveryWindowText>String</DeliveryWindowText>
    <Driver>
      <EtaMin>0</EtaMin>
      <EtaPct>0</EtaPct>
      <FirstName>String</FirstName>
      <Initial>String</Initial>
      <Plate>String</Plate>
      <Vehicle>String</Vehicle>
    </Driver>
    <DropoffAddress>String</DropoffAddress>
    <DropoffName>String</DropoffName>
    <ExpiresUtc>0001-01-01T00:00:00</ExpiresUtc>
    <FacilityNoun>String</FacilityNoun>
    <FacilityNounEs>String</FacilityNounEs>
    <GateCode>String</GateCode>
    <Handoff>String</Handoff>
    <HandoffCode>String</HandoffCode>
    <Instructions>String</Instructions>
    <IsAsap>false</IsAsap>
    <LevelName>String</LevelName>
    <Live>false</Live>
    <LiveEta>false</LiveEta>
    <Messages>
      <CourierTrackMessage>
        <AtText>String</AtText>
        <Body>String</Body>
        <Mine>false</Mine>
        <Office>false</Office>
        <Who>String</Who>
      </CourierTrackMessage>
    </Messages>
    <MessagesOpen>false</MessagesOpen>
    <Missed>
      <AutoRebook>false</AutoRebook>
      <Code>String</Code>
      <Fee>0</Fee>
      <RebookWindowText>String</RebookWindowText>
      <Slots>
        <CourierTrackSlot>
          <Day>String</Day>
          <DayEs>String</DayEs>
          <Id>String</Id>
          <Win>String</Win>
        </CourierTrackSlot>
      </Slots>
      <WaitedMin>0</WaitedMin>
    </Missed>
    <Proof>
      <AtText>String</AtText>
      <Attempts>0</Attempts>
      <ContactedText>String</ContactedText>
      <DamageNote>String</DamageNote>
      <DeliveredTo>String</DeliveredTo>
      <EachScanned>false</EachScanned>
      <EachTagged>false</EachTagged>
      <GpsOk>false</GpsOk>
      <Kind>String</Kind>
      <PhotoUrl>String</PhotoUrl>
      <Units>0</Units>
      <WaitedMin>0</WaitedMin>
    </Proof>
    <Rating>
      <Stars>0</Stars>
      <Tags>String</Tags>
      <Tip>0</Tip>
      <TipStatus>String</TipStatus>
    </Rating>
    <ReadyPromise>String</ReadyPromise>
    <RunCode>String</RunCode>
    <ServerUtc>0001-01-01T00:00:00</ServerUtc>
    <Shape>String</Shape>
    <State>String</State>
    <StopCount>0</StopCount>
    <StopPosition>0</StopPosition>
    <Template>String</Template>
    <ThreadHrs>0</ThreadHrs>
    <Times xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
      <d3p1:KeyValueOfstringstring>
        <d3p1:Key>String</d3p1:Key>
        <d3p1:Value>String</d3p1:Value>
      </d3p1:KeyValueOfstringstring>
    </Times>
    <TipAllowed>false</TipAllowed>
    <TipsPct>0</TipsPct>
    <UnitMany>String</UnitMany>
    <UnitManyEs>String</UnitManyEs>
    <UnitOne>String</UnitOne>
    <UnitOneEs>String</UnitOneEs>
    <Units>0</Units>
    <UnitsCounted>false</UnitsCounted>
    <WindowText>String</WindowText>
  </Courier>
  <CustomerName>String</CustomerName>
  <DriverName>String</DriverName>
  <Eta>String</Eta>
  <Expired>false</Expired>
  <Fare>0</Fare>
  <FromLoc>String</FromLoc>
  <Headline>String</Headline>
  <Invalid>false</Invalid>
  <IsClosed>false</IsClosed>
  <Kind>String</Kind>
  <Notice>String</Notice>
  <PayMode>String</PayMode>
  <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>
  <Stage>String</Stage>
  <Steps>
    <DispatchTrackStepView>
      <At>0001-01-01T00:00:00</At>
      <Current>false</Current>
      <Done>false</Done>
      <Name>String</Name>
    </DispatchTrackStepView>
  </Steps>
  <Sub>String</Sub>
  <ToLoc>String</ToLoc>
  <What>String</What>
</DispatchTrackResponse>