Trendsic Platform Service

<back to all web services

CourierVansRequest

Requires Authentication
The following routes are available for this service:
GET,OPTIONS/v1/dispatch/courier/vans
<?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 CourierMoveTarget implements JsonSerializable
{
    public function __construct(
        /** @var int */
        public int $DriverContactId=0,
        /** @var string|null */
        public ?string $Name=null,
        /** @var bool|null */
        public ?bool $Ok=null,
        /** @var string|null */
        public ?string $Why=null,
        /** @var string|null */
        public ?string $LeaveByText=null
    ) {
    }

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

class CourierVanChip implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $Code=null,
        /** @var string|null */
        public ?string $CourierStep=null,
        /** @var string|null */
        public ?string $LevelCode=null,
        /** @var string|null */
        public ?string $LevelName=null,
        /** @var int */
        public int $Units=0,
        /** @var string|null */
        public ?string $Area=null,
        /** @var DateTime|null */
        public ?DateTime $DueUtc=null,
        /** @var string|null */
        public ?string $DueText=null,
        /** @var bool|null */
        public ?bool $Movable=null,
        /** @var string|null */
        public ?string $NoMoveWhy=null,
        /** @var array<CourierMoveTarget>|null */
        public ?array $Targets=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['Code'])) $this->Code = $o['Code'];
        if (isset($o['CourierStep'])) $this->CourierStep = $o['CourierStep'];
        if (isset($o['LevelCode'])) $this->LevelCode = $o['LevelCode'];
        if (isset($o['LevelName'])) $this->LevelName = $o['LevelName'];
        if (isset($o['Units'])) $this->Units = $o['Units'];
        if (isset($o['Area'])) $this->Area = $o['Area'];
        if (isset($o['DueUtc'])) $this->DueUtc = JsonConverters::from('DateTime', $o['DueUtc']);
        if (isset($o['DueText'])) $this->DueText = $o['DueText'];
        if (isset($o['Movable'])) $this->Movable = $o['Movable'];
        if (isset($o['NoMoveWhy'])) $this->NoMoveWhy = $o['NoMoveWhy'];
        if (isset($o['Targets'])) $this->Targets = JsonConverters::fromArray('CourierMoveTarget', $o['Targets']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->Code)) $o['Code'] = $this->Code;
        if (isset($this->CourierStep)) $o['CourierStep'] = $this->CourierStep;
        if (isset($this->LevelCode)) $o['LevelCode'] = $this->LevelCode;
        if (isset($this->LevelName)) $o['LevelName'] = $this->LevelName;
        if (isset($this->Units)) $o['Units'] = $this->Units;
        if (isset($this->Area)) $o['Area'] = $this->Area;
        if (isset($this->DueUtc)) $o['DueUtc'] = JsonConverters::to('DateTime', $this->DueUtc);
        if (isset($this->DueText)) $o['DueText'] = $this->DueText;
        if (isset($this->Movable)) $o['Movable'] = $this->Movable;
        if (isset($this->NoMoveWhy)) $o['NoMoveWhy'] = $this->NoMoveWhy;
        if (isset($this->Targets)) $o['Targets'] = JsonConverters::toArray('CourierMoveTarget', $this->Targets);
        return empty($o) ? new class(){} : $o;
    }
}

class CourierOfficeVan implements JsonSerializable
{
    public function __construct(
        /** @var int */
        public int $DriverContactId=0,
        /** @var string|null */
        public ?string $DriverCode=null,
        /** @var string|null */
        public ?string $Name=null,
        /** @var bool|null */
        public ?bool $Online=null,
        /** @var string|null */
        public ?string $Zone=null,
        /** @var string|null */
        public ?string $VehicleUnit=null,
        /** @var string|null */
        public ?string $FacilityName=null,
        /** @var string|null */
        public ?string $State=null,
        /** @var DateTime|null */
        public ?DateTime $LeaveByUtc=null,
        /** @var string|null */
        public ?string $LeaveByText=null,
        /** @var int|null */
        public ?int $SlackMin=null,
        /** @var int */
        public int $InVan=0,
        /** @var int */
        public int $Committed=0,
        /** @var float|null */
        public ?float $Cap=null,
        /** @var string|null */
        public ?string $CapUnit=null,
        /** @var string|null */
        public ?string $UnitMany=null,
        /** @var string|null */
        public ?string $CriticalCode=null,
        /** @var int */
        public int $DriveMin=0,
        /** @var string|null */
        public ?string $SendNote=null,
        /** @var array<CourierVanChip>|null */
        public ?array $Aboard=null,
        /** @var array<CourierVanChip>|null */
        public ?array $Queued=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['DriverContactId'])) $this->DriverContactId = $o['DriverContactId'];
        if (isset($o['DriverCode'])) $this->DriverCode = $o['DriverCode'];
        if (isset($o['Name'])) $this->Name = $o['Name'];
        if (isset($o['Online'])) $this->Online = $o['Online'];
        if (isset($o['Zone'])) $this->Zone = $o['Zone'];
        if (isset($o['VehicleUnit'])) $this->VehicleUnit = $o['VehicleUnit'];
        if (isset($o['FacilityName'])) $this->FacilityName = $o['FacilityName'];
        if (isset($o['State'])) $this->State = $o['State'];
        if (isset($o['LeaveByUtc'])) $this->LeaveByUtc = JsonConverters::from('DateTime', $o['LeaveByUtc']);
        if (isset($o['LeaveByText'])) $this->LeaveByText = $o['LeaveByText'];
        if (isset($o['SlackMin'])) $this->SlackMin = $o['SlackMin'];
        if (isset($o['InVan'])) $this->InVan = $o['InVan'];
        if (isset($o['Committed'])) $this->Committed = $o['Committed'];
        if (isset($o['Cap'])) $this->Cap = $o['Cap'];
        if (isset($o['CapUnit'])) $this->CapUnit = $o['CapUnit'];
        if (isset($o['UnitMany'])) $this->UnitMany = $o['UnitMany'];
        if (isset($o['CriticalCode'])) $this->CriticalCode = $o['CriticalCode'];
        if (isset($o['DriveMin'])) $this->DriveMin = $o['DriveMin'];
        if (isset($o['SendNote'])) $this->SendNote = $o['SendNote'];
        if (isset($o['Aboard'])) $this->Aboard = JsonConverters::fromArray('CourierVanChip', $o['Aboard']);
        if (isset($o['Queued'])) $this->Queued = JsonConverters::fromArray('CourierVanChip', $o['Queued']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->DriverContactId)) $o['DriverContactId'] = $this->DriverContactId;
        if (isset($this->DriverCode)) $o['DriverCode'] = $this->DriverCode;
        if (isset($this->Name)) $o['Name'] = $this->Name;
        if (isset($this->Online)) $o['Online'] = $this->Online;
        if (isset($this->Zone)) $o['Zone'] = $this->Zone;
        if (isset($this->VehicleUnit)) $o['VehicleUnit'] = $this->VehicleUnit;
        if (isset($this->FacilityName)) $o['FacilityName'] = $this->FacilityName;
        if (isset($this->State)) $o['State'] = $this->State;
        if (isset($this->LeaveByUtc)) $o['LeaveByUtc'] = JsonConverters::to('DateTime', $this->LeaveByUtc);
        if (isset($this->LeaveByText)) $o['LeaveByText'] = $this->LeaveByText;
        if (isset($this->SlackMin)) $o['SlackMin'] = $this->SlackMin;
        if (isset($this->InVan)) $o['InVan'] = $this->InVan;
        if (isset($this->Committed)) $o['Committed'] = $this->Committed;
        if (isset($this->Cap)) $o['Cap'] = $this->Cap;
        if (isset($this->CapUnit)) $o['CapUnit'] = $this->CapUnit;
        if (isset($this->UnitMany)) $o['UnitMany'] = $this->UnitMany;
        if (isset($this->CriticalCode)) $o['CriticalCode'] = $this->CriticalCode;
        if (isset($this->DriveMin)) $o['DriveMin'] = $this->DriveMin;
        if (isset($this->SendNote)) $o['SendNote'] = $this->SendNote;
        if (isset($this->Aboard)) $o['Aboard'] = JsonConverters::toArray('CourierVanChip', $this->Aboard);
        if (isset($this->Queued)) $o['Queued'] = JsonConverters::toArray('CourierVanChip', $this->Queued);
        return empty($o) ? new class(){} : $o;
    }
}

class CourierHeldView implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $Code=null,
        /** @var string|null */
        public ?string $Area=null,
        /** @var int */
        public int $Units=0,
        /** @var string|null */
        public ?string $UnitMany=null,
        /** @var float|null */
        public ?float $Miles=null,
        /** @var string|null */
        public ?string $LevelCode=null,
        /** @var string|null */
        public ?string $LevelName=null,
        /** @var string|null */
        public ?string $DueText=null,
        /** @var string|null */
        public ?string $HeldReason=null,
        /** @var int|null */
        public ?int $HeldMin=null,
        /** @var array<string>|null */
        public ?array $Why=null,
        /** @var int|null */
        public ?int $BestDriverContactId=null,
        /** @var string|null */
        public ?string $BestName=null,
        /** @var string|null */
        public ?string $BestLeaveByText=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['Code'])) $this->Code = $o['Code'];
        if (isset($o['Area'])) $this->Area = $o['Area'];
        if (isset($o['Units'])) $this->Units = $o['Units'];
        if (isset($o['UnitMany'])) $this->UnitMany = $o['UnitMany'];
        if (isset($o['Miles'])) $this->Miles = $o['Miles'];
        if (isset($o['LevelCode'])) $this->LevelCode = $o['LevelCode'];
        if (isset($o['LevelName'])) $this->LevelName = $o['LevelName'];
        if (isset($o['DueText'])) $this->DueText = $o['DueText'];
        if (isset($o['HeldReason'])) $this->HeldReason = $o['HeldReason'];
        if (isset($o['HeldMin'])) $this->HeldMin = $o['HeldMin'];
        if (isset($o['Why'])) $this->Why = JsonConverters::fromArray('string', $o['Why']);
        if (isset($o['BestDriverContactId'])) $this->BestDriverContactId = $o['BestDriverContactId'];
        if (isset($o['BestName'])) $this->BestName = $o['BestName'];
        if (isset($o['BestLeaveByText'])) $this->BestLeaveByText = $o['BestLeaveByText'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->Code)) $o['Code'] = $this->Code;
        if (isset($this->Area)) $o['Area'] = $this->Area;
        if (isset($this->Units)) $o['Units'] = $this->Units;
        if (isset($this->UnitMany)) $o['UnitMany'] = $this->UnitMany;
        if (isset($this->Miles)) $o['Miles'] = $this->Miles;
        if (isset($this->LevelCode)) $o['LevelCode'] = $this->LevelCode;
        if (isset($this->LevelName)) $o['LevelName'] = $this->LevelName;
        if (isset($this->DueText)) $o['DueText'] = $this->DueText;
        if (isset($this->HeldReason)) $o['HeldReason'] = $this->HeldReason;
        if (isset($this->HeldMin)) $o['HeldMin'] = $this->HeldMin;
        if (isset($this->Why)) $o['Why'] = JsonConverters::toArray('string', $this->Why);
        if (isset($this->BestDriverContactId)) $o['BestDriverContactId'] = $this->BestDriverContactId;
        if (isset($this->BestName)) $o['BestName'] = $this->BestName;
        if (isset($this->BestLeaveByText)) $o['BestLeaveByText'] = $this->BestLeaveByText;
        return empty($o) ? new class(){} : $o;
    }
}

class CourierVehicleOption implements JsonSerializable
{
    public function __construct(
        /** @var int */
        public int $CourierProfileId=0,
        /** @var int */
        public int $EquipmentID=0,
        /** @var string|null */
        public ?string $UnitNumber=null,
        /** @var string|null */
        public ?string $VehicleType=null,
        /** @var string|null */
        public ?string $CapacityUnit=null,
        /** @var float|null */
        public ?float $CapacityLimit=null,
        /** @var bool|null */
        public ?bool $IsRefrigerated=null,
        /** @var string|null */
        public ?string $Status=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['CourierProfileId'])) $this->CourierProfileId = $o['CourierProfileId'];
        if (isset($o['EquipmentID'])) $this->EquipmentID = $o['EquipmentID'];
        if (isset($o['UnitNumber'])) $this->UnitNumber = $o['UnitNumber'];
        if (isset($o['VehicleType'])) $this->VehicleType = $o['VehicleType'];
        if (isset($o['CapacityUnit'])) $this->CapacityUnit = $o['CapacityUnit'];
        if (isset($o['CapacityLimit'])) $this->CapacityLimit = $o['CapacityLimit'];
        if (isset($o['IsRefrigerated'])) $this->IsRefrigerated = $o['IsRefrigerated'];
        if (isset($o['Status'])) $this->Status = $o['Status'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->CourierProfileId)) $o['CourierProfileId'] = $this->CourierProfileId;
        if (isset($this->EquipmentID)) $o['EquipmentID'] = $this->EquipmentID;
        if (isset($this->UnitNumber)) $o['UnitNumber'] = $this->UnitNumber;
        if (isset($this->VehicleType)) $o['VehicleType'] = $this->VehicleType;
        if (isset($this->CapacityUnit)) $o['CapacityUnit'] = $this->CapacityUnit;
        if (isset($this->CapacityLimit)) $o['CapacityLimit'] = $this->CapacityLimit;
        if (isset($this->IsRefrigerated)) $o['IsRefrigerated'] = $this->IsRefrigerated;
        if (isset($this->Status)) $o['Status'] = $this->Status;
        return empty($o) ? new class(){} : $o;
    }
}

class CourierFacilityOption implements JsonSerializable
{
    public function __construct(
        /** @var int */
        public int $CourierFacilityID=0,
        /** @var string|null */
        public ?string $Code=null,
        /** @var string|null */
        public ?string $Name=null,
        /** @var string|null */
        public ?string $Address=null,
        /** @var int */
        public int $IntakeMin=0
    ) {
    }

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

class CourierProfileOption implements JsonSerializable
{
    public function __construct(
        /** @var int */
        public int $CourierProfileID=0,
        /** @var string|null */
        public ?string $Name=null,
        /** @var string|null */
        public ?string $RouteShape=null,
        /** @var bool|null */
        public ?bool $Enabled=null,
        /** @var string|null */
        public ?string $UnitOne=null,
        /** @var string|null */
        public ?string $UnitMany=null,
        /** @var string|null */
        public ?string $FacilityNoun=null,
        /** @var array<CourierFacilityOption>|null */
        public ?array $Facilities=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['CourierProfileID'])) $this->CourierProfileID = $o['CourierProfileID'];
        if (isset($o['Name'])) $this->Name = $o['Name'];
        if (isset($o['RouteShape'])) $this->RouteShape = $o['RouteShape'];
        if (isset($o['Enabled'])) $this->Enabled = $o['Enabled'];
        if (isset($o['UnitOne'])) $this->UnitOne = $o['UnitOne'];
        if (isset($o['UnitMany'])) $this->UnitMany = $o['UnitMany'];
        if (isset($o['FacilityNoun'])) $this->FacilityNoun = $o['FacilityNoun'];
        if (isset($o['Facilities'])) $this->Facilities = JsonConverters::fromArray('CourierFacilityOption', $o['Facilities']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->CourierProfileID)) $o['CourierProfileID'] = $this->CourierProfileID;
        if (isset($this->Name)) $o['Name'] = $this->Name;
        if (isset($this->RouteShape)) $o['RouteShape'] = $this->RouteShape;
        if (isset($this->Enabled)) $o['Enabled'] = $this->Enabled;
        if (isset($this->UnitOne)) $o['UnitOne'] = $this->UnitOne;
        if (isset($this->UnitMany)) $o['UnitMany'] = $this->UnitMany;
        if (isset($this->FacilityNoun)) $o['FacilityNoun'] = $this->FacilityNoun;
        if (isset($this->Facilities)) $o['Facilities'] = JsonConverters::toArray('CourierFacilityOption', $this->Facilities);
        return empty($o) ? new class(){} : $o;
    }
}

class CourierDriverOption implements JsonSerializable
{
    public function __construct(
        /** @var int */
        public int $ContactId=0,
        /** @var string|null */
        public ?string $Code=null,
        /** @var string|null */
        public ?string $Name=null,
        /** @var bool|null */
        public ?bool $Online=null,
        /** @var string|null */
        public ?string $Zone=null,
        /** @var string|null */
        public ?string $VehicleUnit=null,
        /** @var int|null */
        public ?int $EquipmentID=null,
        /** @var bool|null */
        public ?bool $SentToFacility=null
    ) {
    }

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

class CourierDeskRow implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $Code=null,
        /** @var int */
        public int $CourierProfileId=0,
        /** @var string|null */
        public ?string $FacilityName=null,
        /** @var string|null */
        public ?string $LevelCode=null,
        /** @var string|null */
        public ?string $LevelName=null,
        /** @var DateTime|null */
        public ?DateTime $DueUtc=null,
        /** @var string|null */
        public ?string $DueText=null,
        /** @var int */
        public int $Units=0,
        /** @var int|null */
        public ?int $UnitsFound=null,
        /** @var string|null */
        public ?string $UnitMany=null,
        /** @var float|null */
        public ?float $Fare=null,
        /** @var float|null */
        public ?float $FinalPrice=null,
        /** @var float|null */
        public ?float $TipAmount=null,
        /** @var string|null */
        public ?string $PayMode=null,
        /** @var string|null */
        public ?string $CaptureMode=null,
        /** @var string|null */
        public ?string $CustomerName=null,
        /** @var string|null */
        public ?string $Area=null,
        /** @var DateTime|null */
        public ?DateTime $IntakeUtc=null,
        /** @var int|null */
        public ?int $IntakeMinAgo=null,
        /** @var string|null */
        public ?string $DamageNote=null,
        /** @var bool|null */
        public ?bool $FinalPriceAfterCount=null,
        /** @var bool|null */
        public ?bool $NeedsPrice=null,
        /** @var int */
        public int $ItemCount=0,
        /** @var int */
        public int $MissingCount=0,
        /** @var int */
        public int $PhotoCount=0
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['Code'])) $this->Code = $o['Code'];
        if (isset($o['CourierProfileId'])) $this->CourierProfileId = $o['CourierProfileId'];
        if (isset($o['FacilityName'])) $this->FacilityName = $o['FacilityName'];
        if (isset($o['LevelCode'])) $this->LevelCode = $o['LevelCode'];
        if (isset($o['LevelName'])) $this->LevelName = $o['LevelName'];
        if (isset($o['DueUtc'])) $this->DueUtc = JsonConverters::from('DateTime', $o['DueUtc']);
        if (isset($o['DueText'])) $this->DueText = $o['DueText'];
        if (isset($o['Units'])) $this->Units = $o['Units'];
        if (isset($o['UnitsFound'])) $this->UnitsFound = $o['UnitsFound'];
        if (isset($o['UnitMany'])) $this->UnitMany = $o['UnitMany'];
        if (isset($o['Fare'])) $this->Fare = $o['Fare'];
        if (isset($o['FinalPrice'])) $this->FinalPrice = $o['FinalPrice'];
        if (isset($o['TipAmount'])) $this->TipAmount = $o['TipAmount'];
        if (isset($o['PayMode'])) $this->PayMode = $o['PayMode'];
        if (isset($o['CaptureMode'])) $this->CaptureMode = $o['CaptureMode'];
        if (isset($o['CustomerName'])) $this->CustomerName = $o['CustomerName'];
        if (isset($o['Area'])) $this->Area = $o['Area'];
        if (isset($o['IntakeUtc'])) $this->IntakeUtc = JsonConverters::from('DateTime', $o['IntakeUtc']);
        if (isset($o['IntakeMinAgo'])) $this->IntakeMinAgo = $o['IntakeMinAgo'];
        if (isset($o['DamageNote'])) $this->DamageNote = $o['DamageNote'];
        if (isset($o['FinalPriceAfterCount'])) $this->FinalPriceAfterCount = $o['FinalPriceAfterCount'];
        if (isset($o['NeedsPrice'])) $this->NeedsPrice = $o['NeedsPrice'];
        if (isset($o['ItemCount'])) $this->ItemCount = $o['ItemCount'];
        if (isset($o['MissingCount'])) $this->MissingCount = $o['MissingCount'];
        if (isset($o['PhotoCount'])) $this->PhotoCount = $o['PhotoCount'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->Code)) $o['Code'] = $this->Code;
        if (isset($this->CourierProfileId)) $o['CourierProfileId'] = $this->CourierProfileId;
        if (isset($this->FacilityName)) $o['FacilityName'] = $this->FacilityName;
        if (isset($this->LevelCode)) $o['LevelCode'] = $this->LevelCode;
        if (isset($this->LevelName)) $o['LevelName'] = $this->LevelName;
        if (isset($this->DueUtc)) $o['DueUtc'] = JsonConverters::to('DateTime', $this->DueUtc);
        if (isset($this->DueText)) $o['DueText'] = $this->DueText;
        if (isset($this->Units)) $o['Units'] = $this->Units;
        if (isset($this->UnitsFound)) $o['UnitsFound'] = $this->UnitsFound;
        if (isset($this->UnitMany)) $o['UnitMany'] = $this->UnitMany;
        if (isset($this->Fare)) $o['Fare'] = $this->Fare;
        if (isset($this->FinalPrice)) $o['FinalPrice'] = $this->FinalPrice;
        if (isset($this->TipAmount)) $o['TipAmount'] = $this->TipAmount;
        if (isset($this->PayMode)) $o['PayMode'] = $this->PayMode;
        if (isset($this->CaptureMode)) $o['CaptureMode'] = $this->CaptureMode;
        if (isset($this->CustomerName)) $o['CustomerName'] = $this->CustomerName;
        if (isset($this->Area)) $o['Area'] = $this->Area;
        if (isset($this->IntakeUtc)) $o['IntakeUtc'] = JsonConverters::to('DateTime', $this->IntakeUtc);
        if (isset($this->IntakeMinAgo)) $o['IntakeMinAgo'] = $this->IntakeMinAgo;
        if (isset($this->DamageNote)) $o['DamageNote'] = $this->DamageNote;
        if (isset($this->FinalPriceAfterCount)) $o['FinalPriceAfterCount'] = $this->FinalPriceAfterCount;
        if (isset($this->NeedsPrice)) $o['NeedsPrice'] = $this->NeedsPrice;
        if (isset($this->ItemCount)) $o['ItemCount'] = $this->ItemCount;
        if (isset($this->MissingCount)) $o['MissingCount'] = $this->MissingCount;
        if (isset($this->PhotoCount)) $o['PhotoCount'] = $this->PhotoCount;
        return empty($o) ? new class(){} : $o;
    }
}

class CourierOfficeView implements JsonSerializable
{
    public function __construct(
        /** @var DateTime */
        public DateTime $ServerUtc=new DateTime(),
        /** @var array<CourierOfficeVan>|null */
        public ?array $Vans=null,
        /** @var array<CourierHeldView>|null */
        public ?array $Held=null,
        /** @var array<CourierVehicleOption>|null */
        public ?array $Vehicles=null,
        /** @var array<CourierProfileOption>|null */
        public ?array $Profiles=null,
        /** @var array<CourierDriverOption>|null */
        public ?array $Drivers=null,
        /** @var array<CourierDeskRow>|null */
        public ?array $Desk=null,
        /** @var int */
        public int $GoCount=0,
        /** @var int */
        public int $HeldCount=0,
        /** @var int */
        public int $ReadyToOffer=0,
        /** @var int|null */
        public ?int $IntakeMin=null,
        /** @var string|null */
        public ?string $FacilityNoun=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['ServerUtc'])) $this->ServerUtc = JsonConverters::from('DateTime', $o['ServerUtc']);
        if (isset($o['Vans'])) $this->Vans = JsonConverters::fromArray('CourierOfficeVan', $o['Vans']);
        if (isset($o['Held'])) $this->Held = JsonConverters::fromArray('CourierHeldView', $o['Held']);
        if (isset($o['Vehicles'])) $this->Vehicles = JsonConverters::fromArray('CourierVehicleOption', $o['Vehicles']);
        if (isset($o['Profiles'])) $this->Profiles = JsonConverters::fromArray('CourierProfileOption', $o['Profiles']);
        if (isset($o['Drivers'])) $this->Drivers = JsonConverters::fromArray('CourierDriverOption', $o['Drivers']);
        if (isset($o['Desk'])) $this->Desk = JsonConverters::fromArray('CourierDeskRow', $o['Desk']);
        if (isset($o['GoCount'])) $this->GoCount = $o['GoCount'];
        if (isset($o['HeldCount'])) $this->HeldCount = $o['HeldCount'];
        if (isset($o['ReadyToOffer'])) $this->ReadyToOffer = $o['ReadyToOffer'];
        if (isset($o['IntakeMin'])) $this->IntakeMin = $o['IntakeMin'];
        if (isset($o['FacilityNoun'])) $this->FacilityNoun = $o['FacilityNoun'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->ServerUtc)) $o['ServerUtc'] = JsonConverters::to('DateTime', $this->ServerUtc);
        if (isset($this->Vans)) $o['Vans'] = JsonConverters::toArray('CourierOfficeVan', $this->Vans);
        if (isset($this->Held)) $o['Held'] = JsonConverters::toArray('CourierHeldView', $this->Held);
        if (isset($this->Vehicles)) $o['Vehicles'] = JsonConverters::toArray('CourierVehicleOption', $this->Vehicles);
        if (isset($this->Profiles)) $o['Profiles'] = JsonConverters::toArray('CourierProfileOption', $this->Profiles);
        if (isset($this->Drivers)) $o['Drivers'] = JsonConverters::toArray('CourierDriverOption', $this->Drivers);
        if (isset($this->Desk)) $o['Desk'] = JsonConverters::toArray('CourierDeskRow', $this->Desk);
        if (isset($this->GoCount)) $o['GoCount'] = $this->GoCount;
        if (isset($this->HeldCount)) $o['HeldCount'] = $this->HeldCount;
        if (isset($this->ReadyToOffer)) $o['ReadyToOffer'] = $this->ReadyToOffer;
        if (isset($this->IntakeMin)) $o['IntakeMin'] = $this->IntakeMin;
        if (isset($this->FacilityNoun)) $o['FacilityNoun'] = $this->FacilityNoun;
        return empty($o) ? new class(){} : $o;
    }
}

class CourierOfficeResponse implements JsonSerializable
{
    public function __construct(
        /** @var CourierOfficeView|null */
        public ?CourierOfficeView $Office=null,
        /** @var bool|null */
        public ?bool $Available=null,
        /** @var ResponseStatus|null */
        public ?ResponseStatus $ResponseStatus=null
    ) {
    }

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

class CourierVansRequest implements JsonSerializable
{
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        return empty($o) ? new class(){} : $o;
    }
}

PHP CourierVansRequest 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.

GET /v1/dispatch/courier/vans HTTP/1.1 
Host: api.dev.dynamics.trendsic.com 
Accept: application/xml
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

<CourierOfficeResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/CRM.AgencyPlatform.API.Internal">
  <Available>false</Available>
  <Office>
    <Desk>
      <CourierDeskRow>
        <Area>String</Area>
        <CaptureMode>String</CaptureMode>
        <Code>String</Code>
        <CourierProfileId>0</CourierProfileId>
        <CustomerName>String</CustomerName>
        <DamageNote>String</DamageNote>
        <DueText>String</DueText>
        <DueUtc>0001-01-01T00:00:00</DueUtc>
        <FacilityName>String</FacilityName>
        <Fare>0</Fare>
        <FinalPrice>0</FinalPrice>
        <FinalPriceAfterCount>false</FinalPriceAfterCount>
        <IntakeMinAgo>0</IntakeMinAgo>
        <IntakeUtc>0001-01-01T00:00:00</IntakeUtc>
        <ItemCount>0</ItemCount>
        <LevelCode>String</LevelCode>
        <LevelName>String</LevelName>
        <MissingCount>0</MissingCount>
        <NeedsPrice>false</NeedsPrice>
        <PayMode>String</PayMode>
        <PhotoCount>0</PhotoCount>
        <TipAmount>0</TipAmount>
        <UnitMany>String</UnitMany>
        <Units>0</Units>
        <UnitsFound>0</UnitsFound>
      </CourierDeskRow>
    </Desk>
    <Drivers>
      <CourierDriverOption>
        <Code>String</Code>
        <ContactId>0</ContactId>
        <EquipmentID>0</EquipmentID>
        <Name>String</Name>
        <Online>false</Online>
        <SentToFacility>false</SentToFacility>
        <VehicleUnit>String</VehicleUnit>
        <Zone>String</Zone>
      </CourierDriverOption>
    </Drivers>
    <FacilityNoun>String</FacilityNoun>
    <GoCount>0</GoCount>
    <Held>
      <CourierHeldView>
        <Area>String</Area>
        <BestDriverContactId>0</BestDriverContactId>
        <BestLeaveByText>String</BestLeaveByText>
        <BestName>String</BestName>
        <Code>String</Code>
        <DueText>String</DueText>
        <HeldMin>0</HeldMin>
        <HeldReason>String</HeldReason>
        <LevelCode>String</LevelCode>
        <LevelName>String</LevelName>
        <Miles>0</Miles>
        <UnitMany>String</UnitMany>
        <Units>0</Units>
        <Why xmlns:d5p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
          <d5p1:string>String</d5p1:string>
        </Why>
      </CourierHeldView>
    </Held>
    <HeldCount>0</HeldCount>
    <IntakeMin>0</IntakeMin>
    <Profiles>
      <CourierProfileOption>
        <CourierProfileID>0</CourierProfileID>
        <Enabled>false</Enabled>
        <Facilities>
          <CourierFacilityOption>
            <Address>String</Address>
            <Code>String</Code>
            <CourierFacilityID>0</CourierFacilityID>
            <IntakeMin>0</IntakeMin>
            <Name>String</Name>
          </CourierFacilityOption>
        </Facilities>
        <FacilityNoun>String</FacilityNoun>
        <Name>String</Name>
        <RouteShape>String</RouteShape>
        <UnitMany>String</UnitMany>
        <UnitOne>String</UnitOne>
      </CourierProfileOption>
    </Profiles>
    <ReadyToOffer>0</ReadyToOffer>
    <ServerUtc>0001-01-01T00:00:00</ServerUtc>
    <Vans>
      <CourierOfficeVan>
        <Aboard>
          <CourierVanChip>
            <Area>String</Area>
            <Code>String</Code>
            <CourierStep>String</CourierStep>
            <DueText>String</DueText>
            <DueUtc>0001-01-01T00:00:00</DueUtc>
            <LevelCode>String</LevelCode>
            <LevelName>String</LevelName>
            <Movable>false</Movable>
            <NoMoveWhy>String</NoMoveWhy>
            <Targets>
              <CourierMoveTarget>
                <DriverContactId>0</DriverContactId>
                <LeaveByText>String</LeaveByText>
                <Name>String</Name>
                <Ok>false</Ok>
                <Why>String</Why>
              </CourierMoveTarget>
            </Targets>
            <Units>0</Units>
          </CourierVanChip>
        </Aboard>
        <Cap>0</Cap>
        <CapUnit>String</CapUnit>
        <Committed>0</Committed>
        <CriticalCode>String</CriticalCode>
        <DriveMin>0</DriveMin>
        <DriverCode>String</DriverCode>
        <DriverContactId>0</DriverContactId>
        <FacilityName>String</FacilityName>
        <InVan>0</InVan>
        <LeaveByText>String</LeaveByText>
        <LeaveByUtc>0001-01-01T00:00:00</LeaveByUtc>
        <Name>String</Name>
        <Online>false</Online>
        <Queued>
          <CourierVanChip>
            <Area>String</Area>
            <Code>String</Code>
            <CourierStep>String</CourierStep>
            <DueText>String</DueText>
            <DueUtc>0001-01-01T00:00:00</DueUtc>
            <LevelCode>String</LevelCode>
            <LevelName>String</LevelName>
            <Movable>false</Movable>
            <NoMoveWhy>String</NoMoveWhy>
            <Targets>
              <CourierMoveTarget>
                <DriverContactId>0</DriverContactId>
                <LeaveByText>String</LeaveByText>
                <Name>String</Name>
                <Ok>false</Ok>
                <Why>String</Why>
              </CourierMoveTarget>
            </Targets>
            <Units>0</Units>
          </CourierVanChip>
        </Queued>
        <SendNote>String</SendNote>
        <SlackMin>0</SlackMin>
        <State>String</State>
        <UnitMany>String</UnitMany>
        <VehicleUnit>String</VehicleUnit>
        <Zone>String</Zone>
      </CourierOfficeVan>
    </Vans>
    <Vehicles>
      <CourierVehicleOption>
        <CapacityLimit>0</CapacityLimit>
        <CapacityUnit>String</CapacityUnit>
        <CourierProfileId>0</CourierProfileId>
        <EquipmentID>0</EquipmentID>
        <IsRefrigerated>false</IsRefrigerated>
        <Status>String</Status>
        <UnitNumber>String</UnitNumber>
        <VehicleType>String</VehicleType>
      </CourierVehicleOption>
    </Vehicles>
  </Office>
  <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>
</CourierOfficeResponse>