Trendsic Platform Service

<back to all web services

DriverIncidentMessageRequest

Requires Authentication
The following routes are available for this service:
POST,OPTIONS/v1/worker/dispatch/incident/{IncidentId}/message
<?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 DriverStampView implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $Stage=null,
        /** @var DateTime */
        public DateTime $AtUtc=new DateTime(),
        /** @var string|null */
        public ?string $Note=null
    ) {
    }

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

class DriverTruckView implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $Code=null,
        /** @var string|null */
        public ?string $Stage=null,
        /** @var DateTime|null */
        public ?DateTime $StageSinceUtc=null,
        /** @var int */
        public int $LoadsToday=0,
        /** @var float */
        public float $NetToday=0.0,
        /** @var float|null */
        public ?float $EstLoad=null,
        /** @var string|null */
        public ?string $Slot=null,
        /** @var string|null */
        public ?string $SiteName=null,
        /** @var string|null */
        public ?string $SupplierName=null,
        /** @var string|null */
        public ?string $NextSiteName=null,
        /** @var string|null */
        public ?string $Facility=null,
        /** @var string|null */
        public ?string $FacilityShort=null,
        /** @var string|null */
        public ?string $Unit=null,
        /** @var int|null */
        public ?int $QueuePosition=null,
        /** @var string|null */
        public ?string $HoldCode=null,
        /** @var string|null */
        public ?string $HoldReason=null,
        /** @var DateTime|null */
        public ?DateTime $HoldEndUtc=null,
        /** @var int|null */
        public ?int $OpenLoadId=null,
        /** @var string|null */
        public ?string $OpenLoadCode=null,
        /** @var int */
        public int $OpenLoadPhotos=0,
        /** @var array<DriverStampView>|null */
        public ?array $Stamps=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['Code'])) $this->Code = $o['Code'];
        if (isset($o['Stage'])) $this->Stage = $o['Stage'];
        if (isset($o['StageSinceUtc'])) $this->StageSinceUtc = JsonConverters::from('DateTime', $o['StageSinceUtc']);
        if (isset($o['LoadsToday'])) $this->LoadsToday = $o['LoadsToday'];
        if (isset($o['NetToday'])) $this->NetToday = $o['NetToday'];
        if (isset($o['EstLoad'])) $this->EstLoad = $o['EstLoad'];
        if (isset($o['Slot'])) $this->Slot = $o['Slot'];
        if (isset($o['SiteName'])) $this->SiteName = $o['SiteName'];
        if (isset($o['SupplierName'])) $this->SupplierName = $o['SupplierName'];
        if (isset($o['NextSiteName'])) $this->NextSiteName = $o['NextSiteName'];
        if (isset($o['Facility'])) $this->Facility = $o['Facility'];
        if (isset($o['FacilityShort'])) $this->FacilityShort = $o['FacilityShort'];
        if (isset($o['Unit'])) $this->Unit = $o['Unit'];
        if (isset($o['QueuePosition'])) $this->QueuePosition = $o['QueuePosition'];
        if (isset($o['HoldCode'])) $this->HoldCode = $o['HoldCode'];
        if (isset($o['HoldReason'])) $this->HoldReason = $o['HoldReason'];
        if (isset($o['HoldEndUtc'])) $this->HoldEndUtc = JsonConverters::from('DateTime', $o['HoldEndUtc']);
        if (isset($o['OpenLoadId'])) $this->OpenLoadId = $o['OpenLoadId'];
        if (isset($o['OpenLoadCode'])) $this->OpenLoadCode = $o['OpenLoadCode'];
        if (isset($o['OpenLoadPhotos'])) $this->OpenLoadPhotos = $o['OpenLoadPhotos'];
        if (isset($o['Stamps'])) $this->Stamps = JsonConverters::fromArray('DriverStampView', $o['Stamps']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->Code)) $o['Code'] = $this->Code;
        if (isset($this->Stage)) $o['Stage'] = $this->Stage;
        if (isset($this->StageSinceUtc)) $o['StageSinceUtc'] = JsonConverters::to('DateTime', $this->StageSinceUtc);
        if (isset($this->LoadsToday)) $o['LoadsToday'] = $this->LoadsToday;
        if (isset($this->NetToday)) $o['NetToday'] = $this->NetToday;
        if (isset($this->EstLoad)) $o['EstLoad'] = $this->EstLoad;
        if (isset($this->Slot)) $o['Slot'] = $this->Slot;
        if (isset($this->SiteName)) $o['SiteName'] = $this->SiteName;
        if (isset($this->SupplierName)) $o['SupplierName'] = $this->SupplierName;
        if (isset($this->NextSiteName)) $o['NextSiteName'] = $this->NextSiteName;
        if (isset($this->Facility)) $o['Facility'] = $this->Facility;
        if (isset($this->FacilityShort)) $o['FacilityShort'] = $this->FacilityShort;
        if (isset($this->Unit)) $o['Unit'] = $this->Unit;
        if (isset($this->QueuePosition)) $o['QueuePosition'] = $this->QueuePosition;
        if (isset($this->HoldCode)) $o['HoldCode'] = $this->HoldCode;
        if (isset($this->HoldReason)) $o['HoldReason'] = $this->HoldReason;
        if (isset($this->HoldEndUtc)) $o['HoldEndUtc'] = JsonConverters::to('DateTime', $this->HoldEndUtc);
        if (isset($this->OpenLoadId)) $o['OpenLoadId'] = $this->OpenLoadId;
        if (isset($this->OpenLoadCode)) $o['OpenLoadCode'] = $this->OpenLoadCode;
        if (isset($this->OpenLoadPhotos)) $o['OpenLoadPhotos'] = $this->OpenLoadPhotos;
        if (isset($this->Stamps)) $o['Stamps'] = JsonConverters::toArray('DriverStampView', $this->Stamps);
        return empty($o) ? new class(){} : $o;
    }
}

class DriverRigView implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $Code=null,
        /** @var string|null */
        public ?string $Name=null,
        /** @var string|null */
        public ?string $RigType=null,
        /** @var bool|null */
        public ?bool $IsFree=null,
        /** @var string|null */
        public ?string $HoldCode=null,
        /** @var string|null */
        public ?string $HoldReason=null,
        /** @var DateTime|null */
        public ?DateTime $HoldEndUtc=null
    ) {
    }

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

class DriverJobView implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $Kind=null,
        /** @var string|null */
        public ?string $Code=null,
        /** @var string|null */
        public ?string $Cargo=null,
        /** @var string|null */
        public ?string $Customer=null,
        /** @var string|null */
        public ?string $CustomerPhone=null,
        /** @var string|null */
        public ?string $HoldContact=null,
        /** @var string|null */
        public ?string $HoldPhone=null,
        /** @var string|null */
        public ?string $FromLoc=null,
        /** @var string|null */
        public ?string $ToLoc=null,
        /** @var int */
        public int $Miles=0,
        /** @var string|null */
        public ?string $WindowText=null,
        /** @var string|null */
        public ?string $Stage=null,
        /** @var float|null */
        public ?float $Rate=null,
        /** @var string|null */
        public ?string $RequiredRig=null,
        /** @var string|null */
        public ?string $EtaText=null,
        /** @var DateTime|null */
        public ?DateTime $OfferExpiresUtc=null,
        /** @var int|null */
        public ?int $RequestId=null,
        /** @var int|null */
        public ?int $LoadId=null,
        /** @var string|null */
        public ?string $LoadCode=null,
        /** @var float|null */
        public ?float $LoadPay=null,
        /** @var int */
        public int $Photos=0,
        /** @var array<DriverStampView>|null */
        public ?array $Stamps=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['Cargo'])) $this->Cargo = $o['Cargo'];
        if (isset($o['Customer'])) $this->Customer = $o['Customer'];
        if (isset($o['CustomerPhone'])) $this->CustomerPhone = $o['CustomerPhone'];
        if (isset($o['HoldContact'])) $this->HoldContact = $o['HoldContact'];
        if (isset($o['HoldPhone'])) $this->HoldPhone = $o['HoldPhone'];
        if (isset($o['FromLoc'])) $this->FromLoc = $o['FromLoc'];
        if (isset($o['ToLoc'])) $this->ToLoc = $o['ToLoc'];
        if (isset($o['Miles'])) $this->Miles = $o['Miles'];
        if (isset($o['WindowText'])) $this->WindowText = $o['WindowText'];
        if (isset($o['Stage'])) $this->Stage = $o['Stage'];
        if (isset($o['Rate'])) $this->Rate = $o['Rate'];
        if (isset($o['RequiredRig'])) $this->RequiredRig = $o['RequiredRig'];
        if (isset($o['EtaText'])) $this->EtaText = $o['EtaText'];
        if (isset($o['OfferExpiresUtc'])) $this->OfferExpiresUtc = JsonConverters::from('DateTime', $o['OfferExpiresUtc']);
        if (isset($o['RequestId'])) $this->RequestId = $o['RequestId'];
        if (isset($o['LoadId'])) $this->LoadId = $o['LoadId'];
        if (isset($o['LoadCode'])) $this->LoadCode = $o['LoadCode'];
        if (isset($o['LoadPay'])) $this->LoadPay = $o['LoadPay'];
        if (isset($o['Photos'])) $this->Photos = $o['Photos'];
        if (isset($o['Stamps'])) $this->Stamps = JsonConverters::fromArray('DriverStampView', $o['Stamps']);
    }
    
    /** @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->Cargo)) $o['Cargo'] = $this->Cargo;
        if (isset($this->Customer)) $o['Customer'] = $this->Customer;
        if (isset($this->CustomerPhone)) $o['CustomerPhone'] = $this->CustomerPhone;
        if (isset($this->HoldContact)) $o['HoldContact'] = $this->HoldContact;
        if (isset($this->HoldPhone)) $o['HoldPhone'] = $this->HoldPhone;
        if (isset($this->FromLoc)) $o['FromLoc'] = $this->FromLoc;
        if (isset($this->ToLoc)) $o['ToLoc'] = $this->ToLoc;
        if (isset($this->Miles)) $o['Miles'] = $this->Miles;
        if (isset($this->WindowText)) $o['WindowText'] = $this->WindowText;
        if (isset($this->Stage)) $o['Stage'] = $this->Stage;
        if (isset($this->Rate)) $o['Rate'] = $this->Rate;
        if (isset($this->RequiredRig)) $o['RequiredRig'] = $this->RequiredRig;
        if (isset($this->EtaText)) $o['EtaText'] = $this->EtaText;
        if (isset($this->OfferExpiresUtc)) $o['OfferExpiresUtc'] = JsonConverters::to('DateTime', $this->OfferExpiresUtc);
        if (isset($this->RequestId)) $o['RequestId'] = $this->RequestId;
        if (isset($this->LoadId)) $o['LoadId'] = $this->LoadId;
        if (isset($this->LoadCode)) $o['LoadCode'] = $this->LoadCode;
        if (isset($this->LoadPay)) $o['LoadPay'] = $this->LoadPay;
        if (isset($this->Photos)) $o['Photos'] = $this->Photos;
        if (isset($this->Stamps)) $o['Stamps'] = JsonConverters::toArray('DriverStampView', $this->Stamps);
        return empty($o) ? new class(){} : $o;
    }
}

class DriverOdView implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $Code=null,
        /** @var string|null */
        public ?string $Name=null,
        /** @var string|null */
        public ?string $Zone=null,
        /** @var string|null */
        public ?string $Status=null,
        /** @var string|null */
        public ?string $Tier=null,
        /** @var string|null */
        public ?string $Capabilities=null,
        /** @var string|null */
        public ?string $PingCode=null,
        /** @var string|null */
        public ?string $PingAddress=null,
        /** @var string|null */
        public ?string $PingZone=null,
        /** @var int|null */
        public ?int $PingBags=null,
        /** @var string|null */
        public ?string $PingNeeds=null,
        /** @var string|null */
        public ?string $PingNote=null,
        /** @var DateTime|null */
        public ?DateTime $PingExpiresUtc=null,
        /** @var string|null */
        public ?string $RunCode=null,
        /** @var string|null */
        public ?string $RunAddress=null,
        /** @var string|null */
        public ?string $RunZone=null,
        /** @var int|null */
        public ?int $RunBags=null,
        /** @var string|null */
        public ?string $RunStage=null,
        /** @var string|null */
        public ?string $RunNeeds=null,
        /** @var string|null */
        public ?string $RunNote=null,
        /** @var string|null */
        public ?string $RunEta=null,
        /** @var float|null */
        public ?float $OdBase=null,
        /** @var float|null */
        public ?float $OdPerBag=null,
        /** @var string|null */
        public ?string $HoldCode=null,
        /** @var string|null */
        public ?string $HoldReason=null,
        /** @var DateTime|null */
        public ?DateTime $HoldEndUtc=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['Code'])) $this->Code = $o['Code'];
        if (isset($o['Name'])) $this->Name = $o['Name'];
        if (isset($o['Zone'])) $this->Zone = $o['Zone'];
        if (isset($o['Status'])) $this->Status = $o['Status'];
        if (isset($o['Tier'])) $this->Tier = $o['Tier'];
        if (isset($o['Capabilities'])) $this->Capabilities = $o['Capabilities'];
        if (isset($o['PingCode'])) $this->PingCode = $o['PingCode'];
        if (isset($o['PingAddress'])) $this->PingAddress = $o['PingAddress'];
        if (isset($o['PingZone'])) $this->PingZone = $o['PingZone'];
        if (isset($o['PingBags'])) $this->PingBags = $o['PingBags'];
        if (isset($o['PingNeeds'])) $this->PingNeeds = $o['PingNeeds'];
        if (isset($o['PingNote'])) $this->PingNote = $o['PingNote'];
        if (isset($o['PingExpiresUtc'])) $this->PingExpiresUtc = JsonConverters::from('DateTime', $o['PingExpiresUtc']);
        if (isset($o['RunCode'])) $this->RunCode = $o['RunCode'];
        if (isset($o['RunAddress'])) $this->RunAddress = $o['RunAddress'];
        if (isset($o['RunZone'])) $this->RunZone = $o['RunZone'];
        if (isset($o['RunBags'])) $this->RunBags = $o['RunBags'];
        if (isset($o['RunStage'])) $this->RunStage = $o['RunStage'];
        if (isset($o['RunNeeds'])) $this->RunNeeds = $o['RunNeeds'];
        if (isset($o['RunNote'])) $this->RunNote = $o['RunNote'];
        if (isset($o['RunEta'])) $this->RunEta = $o['RunEta'];
        if (isset($o['OdBase'])) $this->OdBase = $o['OdBase'];
        if (isset($o['OdPerBag'])) $this->OdPerBag = $o['OdPerBag'];
        if (isset($o['HoldCode'])) $this->HoldCode = $o['HoldCode'];
        if (isset($o['HoldReason'])) $this->HoldReason = $o['HoldReason'];
        if (isset($o['HoldEndUtc'])) $this->HoldEndUtc = JsonConverters::from('DateTime', $o['HoldEndUtc']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->Code)) $o['Code'] = $this->Code;
        if (isset($this->Name)) $o['Name'] = $this->Name;
        if (isset($this->Zone)) $o['Zone'] = $this->Zone;
        if (isset($this->Status)) $o['Status'] = $this->Status;
        if (isset($this->Tier)) $o['Tier'] = $this->Tier;
        if (isset($this->Capabilities)) $o['Capabilities'] = $this->Capabilities;
        if (isset($this->PingCode)) $o['PingCode'] = $this->PingCode;
        if (isset($this->PingAddress)) $o['PingAddress'] = $this->PingAddress;
        if (isset($this->PingZone)) $o['PingZone'] = $this->PingZone;
        if (isset($this->PingBags)) $o['PingBags'] = $this->PingBags;
        if (isset($this->PingNeeds)) $o['PingNeeds'] = $this->PingNeeds;
        if (isset($this->PingNote)) $o['PingNote'] = $this->PingNote;
        if (isset($this->PingExpiresUtc)) $o['PingExpiresUtc'] = JsonConverters::to('DateTime', $this->PingExpiresUtc);
        if (isset($this->RunCode)) $o['RunCode'] = $this->RunCode;
        if (isset($this->RunAddress)) $o['RunAddress'] = $this->RunAddress;
        if (isset($this->RunZone)) $o['RunZone'] = $this->RunZone;
        if (isset($this->RunBags)) $o['RunBags'] = $this->RunBags;
        if (isset($this->RunStage)) $o['RunStage'] = $this->RunStage;
        if (isset($this->RunNeeds)) $o['RunNeeds'] = $this->RunNeeds;
        if (isset($this->RunNote)) $o['RunNote'] = $this->RunNote;
        if (isset($this->RunEta)) $o['RunEta'] = $this->RunEta;
        if (isset($this->OdBase)) $o['OdBase'] = $this->OdBase;
        if (isset($this->OdPerBag)) $o['OdPerBag'] = $this->OdPerBag;
        if (isset($this->HoldCode)) $o['HoldCode'] = $this->HoldCode;
        if (isset($this->HoldReason)) $o['HoldReason'] = $this->HoldReason;
        if (isset($this->HoldEndUtc)) $o['HoldEndUtc'] = JsonConverters::to('DateTime', $this->HoldEndUtc);
        return empty($o) ? new class(){} : $o;
    }
}

class DispatchIncidentMessageView implements JsonSerializable
{
    public function __construct(
        /** @var int */
        public int $MessageId=0,
        /** @var string|null */
        public ?string $Who=null,
        /** @var string|null */
        public ?string $Role=null,
        /** @var string|null */
        public ?string $Msg=null,
        /** @var DateTime */
        public DateTime $AtUtc=new DateTime()
    ) {
    }

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

class DriverIncidentView implements JsonSerializable
{
    public function __construct(
        /** @var int */
        public int $IncidentId=0,
        /** @var string|null */
        public ?string $Code=null,
        /** @var string|null */
        public ?string $Kind=null,
        /** @var string|null */
        public ?string $KindDetail=null,
        /** @var string|null */
        public ?string $Status=null,
        /** @var string|null */
        public ?string $LoadCode=null,
        /** @var string|null */
        public ?string $TruckCode=null,
        /** @var string|null */
        public ?string $LocationText=null,
        /** @var string|null */
        public ?string $DriverPref=null,
        /** @var string|null */
        public ?string $TruckRecovery=null,
        /** @var string|null */
        public ?string $LoadRecovery=null,
        /** @var string|null */
        public ?string $TransloadTruckCode=null,
        /** @var string|null */
        public ?string $HoldCode=null,
        /** @var DateTime */
        public DateTime $OpenedUtc=new DateTime(),
        /** @var DateTime|null */
        public ?DateTime $ResolvedUtc=null,
        /** @var array<DispatchIncidentMessageView>|null */
        public ?array $Messages=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['IncidentId'])) $this->IncidentId = $o['IncidentId'];
        if (isset($o['Code'])) $this->Code = $o['Code'];
        if (isset($o['Kind'])) $this->Kind = $o['Kind'];
        if (isset($o['KindDetail'])) $this->KindDetail = $o['KindDetail'];
        if (isset($o['Status'])) $this->Status = $o['Status'];
        if (isset($o['LoadCode'])) $this->LoadCode = $o['LoadCode'];
        if (isset($o['TruckCode'])) $this->TruckCode = $o['TruckCode'];
        if (isset($o['LocationText'])) $this->LocationText = $o['LocationText'];
        if (isset($o['DriverPref'])) $this->DriverPref = $o['DriverPref'];
        if (isset($o['TruckRecovery'])) $this->TruckRecovery = $o['TruckRecovery'];
        if (isset($o['LoadRecovery'])) $this->LoadRecovery = $o['LoadRecovery'];
        if (isset($o['TransloadTruckCode'])) $this->TransloadTruckCode = $o['TransloadTruckCode'];
        if (isset($o['HoldCode'])) $this->HoldCode = $o['HoldCode'];
        if (isset($o['OpenedUtc'])) $this->OpenedUtc = JsonConverters::from('DateTime', $o['OpenedUtc']);
        if (isset($o['ResolvedUtc'])) $this->ResolvedUtc = JsonConverters::from('DateTime', $o['ResolvedUtc']);
        if (isset($o['Messages'])) $this->Messages = JsonConverters::fromArray('DispatchIncidentMessageView', $o['Messages']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->IncidentId)) $o['IncidentId'] = $this->IncidentId;
        if (isset($this->Code)) $o['Code'] = $this->Code;
        if (isset($this->Kind)) $o['Kind'] = $this->Kind;
        if (isset($this->KindDetail)) $o['KindDetail'] = $this->KindDetail;
        if (isset($this->Status)) $o['Status'] = $this->Status;
        if (isset($this->LoadCode)) $o['LoadCode'] = $this->LoadCode;
        if (isset($this->TruckCode)) $o['TruckCode'] = $this->TruckCode;
        if (isset($this->LocationText)) $o['LocationText'] = $this->LocationText;
        if (isset($this->DriverPref)) $o['DriverPref'] = $this->DriverPref;
        if (isset($this->TruckRecovery)) $o['TruckRecovery'] = $this->TruckRecovery;
        if (isset($this->LoadRecovery)) $o['LoadRecovery'] = $this->LoadRecovery;
        if (isset($this->TransloadTruckCode)) $o['TransloadTruckCode'] = $this->TransloadTruckCode;
        if (isset($this->HoldCode)) $o['HoldCode'] = $this->HoldCode;
        if (isset($this->OpenedUtc)) $o['OpenedUtc'] = JsonConverters::to('DateTime', $this->OpenedUtc);
        if (isset($this->ResolvedUtc)) $o['ResolvedUtc'] = JsonConverters::to('DateTime', $this->ResolvedUtc);
        if (isset($this->Messages)) $o['Messages'] = JsonConverters::toArray('DispatchIncidentMessageView', $this->Messages);
        return empty($o) ? new class(){} : $o;
    }
}

class DriverPayLineView implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $Code=null,
        /** @var string|null */
        public ?string $Module=null,
        /** @var string|null */
        public ?string $SourceLabel=null,
        /** @var string|null */
        public ?string $DestinationLabel=null,
        /** @var string|null */
        public ?string $QtyText=null,
        /** @var float|null */
        public ?float $Pay=null,
        /** @var string|null */
        public ?string $PayPlanLabel=null,
        /** @var string|null */
        public ?string $Status=null,
        /** @var DateTime|null */
        public ?DateTime $ClosedUtc=null,
        /** @var DateTime */
        public DateTime $OpenedUtc=new DateTime(),
        /** @var string|null */
        public ?string $TicketCode=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['Code'])) $this->Code = $o['Code'];
        if (isset($o['Module'])) $this->Module = $o['Module'];
        if (isset($o['SourceLabel'])) $this->SourceLabel = $o['SourceLabel'];
        if (isset($o['DestinationLabel'])) $this->DestinationLabel = $o['DestinationLabel'];
        if (isset($o['QtyText'])) $this->QtyText = $o['QtyText'];
        if (isset($o['Pay'])) $this->Pay = $o['Pay'];
        if (isset($o['PayPlanLabel'])) $this->PayPlanLabel = $o['PayPlanLabel'];
        if (isset($o['Status'])) $this->Status = $o['Status'];
        if (isset($o['ClosedUtc'])) $this->ClosedUtc = JsonConverters::from('DateTime', $o['ClosedUtc']);
        if (isset($o['OpenedUtc'])) $this->OpenedUtc = JsonConverters::from('DateTime', $o['OpenedUtc']);
        if (isset($o['TicketCode'])) $this->TicketCode = $o['TicketCode'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->Code)) $o['Code'] = $this->Code;
        if (isset($this->Module)) $o['Module'] = $this->Module;
        if (isset($this->SourceLabel)) $o['SourceLabel'] = $this->SourceLabel;
        if (isset($this->DestinationLabel)) $o['DestinationLabel'] = $this->DestinationLabel;
        if (isset($this->QtyText)) $o['QtyText'] = $this->QtyText;
        if (isset($this->Pay)) $o['Pay'] = $this->Pay;
        if (isset($this->PayPlanLabel)) $o['PayPlanLabel'] = $this->PayPlanLabel;
        if (isset($this->Status)) $o['Status'] = $this->Status;
        if (isset($this->ClosedUtc)) $o['ClosedUtc'] = JsonConverters::to('DateTime', $this->ClosedUtc);
        if (isset($this->OpenedUtc)) $o['OpenedUtc'] = JsonConverters::to('DateTime', $this->OpenedUtc);
        if (isset($this->TicketCode)) $o['TicketCode'] = $this->TicketCode;
        return empty($o) ? new class(){} : $o;
    }
}

class DriverMeResponse implements JsonSerializable
{
    public function __construct(
        /** @var int */
        public int $ContactId=0,
        /** @var string|null */
        public ?string $Name=null,
        /** @var string|null */
        public ?string $Phone=null,
        /** @var string|null */
        public ?string $PayPlanName=null,
        /** @var string|null */
        public ?string $PayPlanBasis=null,
        /** @var float|null */
        public ?float $PayPlanRate=null,
        /** @var DriverTruckView|null */
        public ?DriverTruckView $Truck=null,
        /** @var DriverRigView|null */
        public ?DriverRigView $Rig=null,
        /** @var array<DriverJobView>|null */
        public ?array $Jobs=null,
        /** @var DriverOdView|null */
        public ?DriverOdView $Od=null,
        /** @var array<DriverIncidentView>|null */
        public ?array $Incidents=null,
        /** @var array<DriverPayLineView>|null */
        public ?array $Pay=null,
        /** @var DateTime */
        public DateTime $ServerUtc=new DateTime(),
        /** @var string|null */
        public ?string $Message=null,
        /** @var ResponseStatus|null */
        public ?ResponseStatus $ResponseStatus=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['ContactId'])) $this->ContactId = $o['ContactId'];
        if (isset($o['Name'])) $this->Name = $o['Name'];
        if (isset($o['Phone'])) $this->Phone = $o['Phone'];
        if (isset($o['PayPlanName'])) $this->PayPlanName = $o['PayPlanName'];
        if (isset($o['PayPlanBasis'])) $this->PayPlanBasis = $o['PayPlanBasis'];
        if (isset($o['PayPlanRate'])) $this->PayPlanRate = $o['PayPlanRate'];
        if (isset($o['Truck'])) $this->Truck = JsonConverters::from('DriverTruckView', $o['Truck']);
        if (isset($o['Rig'])) $this->Rig = JsonConverters::from('DriverRigView', $o['Rig']);
        if (isset($o['Jobs'])) $this->Jobs = JsonConverters::fromArray('DriverJobView', $o['Jobs']);
        if (isset($o['Od'])) $this->Od = JsonConverters::from('DriverOdView', $o['Od']);
        if (isset($o['Incidents'])) $this->Incidents = JsonConverters::fromArray('DriverIncidentView', $o['Incidents']);
        if (isset($o['Pay'])) $this->Pay = JsonConverters::fromArray('DriverPayLineView', $o['Pay']);
        if (isset($o['ServerUtc'])) $this->ServerUtc = JsonConverters::from('DateTime', $o['ServerUtc']);
        if (isset($o['Message'])) $this->Message = $o['Message'];
        if (isset($o['ResponseStatus'])) $this->ResponseStatus = JsonConverters::from('ResponseStatus', $o['ResponseStatus']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->ContactId)) $o['ContactId'] = $this->ContactId;
        if (isset($this->Name)) $o['Name'] = $this->Name;
        if (isset($this->Phone)) $o['Phone'] = $this->Phone;
        if (isset($this->PayPlanName)) $o['PayPlanName'] = $this->PayPlanName;
        if (isset($this->PayPlanBasis)) $o['PayPlanBasis'] = $this->PayPlanBasis;
        if (isset($this->PayPlanRate)) $o['PayPlanRate'] = $this->PayPlanRate;
        if (isset($this->Truck)) $o['Truck'] = JsonConverters::to('DriverTruckView', $this->Truck);
        if (isset($this->Rig)) $o['Rig'] = JsonConverters::to('DriverRigView', $this->Rig);
        if (isset($this->Jobs)) $o['Jobs'] = JsonConverters::toArray('DriverJobView', $this->Jobs);
        if (isset($this->Od)) $o['Od'] = JsonConverters::to('DriverOdView', $this->Od);
        if (isset($this->Incidents)) $o['Incidents'] = JsonConverters::toArray('DriverIncidentView', $this->Incidents);
        if (isset($this->Pay)) $o['Pay'] = JsonConverters::toArray('DriverPayLineView', $this->Pay);
        if (isset($this->ServerUtc)) $o['ServerUtc'] = JsonConverters::to('DateTime', $this->ServerUtc);
        if (isset($this->Message)) $o['Message'] = $this->Message;
        if (isset($this->ResponseStatus)) $o['ResponseStatus'] = JsonConverters::to('ResponseStatus', $this->ResponseStatus);
        return empty($o) ? new class(){} : $o;
    }
}

class DriverIncidentMessageRequest implements JsonSerializable
{
    public function __construct(
        /** @var int */
        public int $IncidentId=0,
        /** @var string|null */
        public ?string $Msg=null
    ) {
    }

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

PHP DriverIncidentMessageRequest 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/worker/dispatch/incident/{IncidentId}/message HTTP/1.1 
Host: api.dev.dynamics.trendsic.com 
Accept: application/xml
Content-Type: application/xml
Content-Length: length

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

<DriverMeResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/CRM.AgencyPlatform.API.Internal">
  <ContactId>0</ContactId>
  <Incidents>
    <DriverIncidentView>
      <Code>String</Code>
      <DriverPref>String</DriverPref>
      <HoldCode>String</HoldCode>
      <IncidentId>0</IncidentId>
      <Kind>String</Kind>
      <KindDetail>String</KindDetail>
      <LoadCode>String</LoadCode>
      <LoadRecovery>String</LoadRecovery>
      <LocationText>String</LocationText>
      <Messages>
        <DispatchIncidentMessageView>
          <AtUtc>0001-01-01T00:00:00</AtUtc>
          <MessageId>0</MessageId>
          <Msg>String</Msg>
          <Role>String</Role>
          <Who>String</Who>
        </DispatchIncidentMessageView>
      </Messages>
      <OpenedUtc>0001-01-01T00:00:00</OpenedUtc>
      <ResolvedUtc>0001-01-01T00:00:00</ResolvedUtc>
      <Status>String</Status>
      <TransloadTruckCode>String</TransloadTruckCode>
      <TruckCode>String</TruckCode>
      <TruckRecovery>String</TruckRecovery>
    </DriverIncidentView>
  </Incidents>
  <Jobs>
    <DriverJobView>
      <Cargo>String</Cargo>
      <Code>String</Code>
      <Customer>String</Customer>
      <CustomerPhone>String</CustomerPhone>
      <EtaText>String</EtaText>
      <FromLoc>String</FromLoc>
      <HoldContact>String</HoldContact>
      <HoldPhone>String</HoldPhone>
      <Kind>String</Kind>
      <LoadCode>String</LoadCode>
      <LoadId>0</LoadId>
      <LoadPay>0</LoadPay>
      <Miles>0</Miles>
      <OfferExpiresUtc>0001-01-01T00:00:00</OfferExpiresUtc>
      <Photos>0</Photos>
      <Rate>0</Rate>
      <RequestId>0</RequestId>
      <RequiredRig>String</RequiredRig>
      <Stage>String</Stage>
      <Stamps>
        <DriverStampView>
          <AtUtc>0001-01-01T00:00:00</AtUtc>
          <Note>String</Note>
          <Stage>String</Stage>
        </DriverStampView>
      </Stamps>
      <ToLoc>String</ToLoc>
      <WindowText>String</WindowText>
    </DriverJobView>
  </Jobs>
  <Message>String</Message>
  <Name>String</Name>
  <Od>
    <Capabilities>String</Capabilities>
    <Code>String</Code>
    <HoldCode>String</HoldCode>
    <HoldEndUtc>0001-01-01T00:00:00</HoldEndUtc>
    <HoldReason>String</HoldReason>
    <Name>String</Name>
    <OdBase>0</OdBase>
    <OdPerBag>0</OdPerBag>
    <PingAddress>String</PingAddress>
    <PingBags>0</PingBags>
    <PingCode>String</PingCode>
    <PingExpiresUtc>0001-01-01T00:00:00</PingExpiresUtc>
    <PingNeeds>String</PingNeeds>
    <PingNote>String</PingNote>
    <PingZone>String</PingZone>
    <RunAddress>String</RunAddress>
    <RunBags>0</RunBags>
    <RunCode>String</RunCode>
    <RunEta>String</RunEta>
    <RunNeeds>String</RunNeeds>
    <RunNote>String</RunNote>
    <RunStage>String</RunStage>
    <RunZone>String</RunZone>
    <Status>String</Status>
    <Tier>String</Tier>
    <Zone>String</Zone>
  </Od>
  <Pay>
    <DriverPayLineView>
      <ClosedUtc>0001-01-01T00:00:00</ClosedUtc>
      <Code>String</Code>
      <DestinationLabel>String</DestinationLabel>
      <Module>String</Module>
      <OpenedUtc>0001-01-01T00:00:00</OpenedUtc>
      <Pay>0</Pay>
      <PayPlanLabel>String</PayPlanLabel>
      <QtyText>String</QtyText>
      <SourceLabel>String</SourceLabel>
      <Status>String</Status>
      <TicketCode>String</TicketCode>
    </DriverPayLineView>
  </Pay>
  <PayPlanBasis>String</PayPlanBasis>
  <PayPlanName>String</PayPlanName>
  <PayPlanRate>0</PayPlanRate>
  <Phone>String</Phone>
  <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>
  <Rig>
    <Code>String</Code>
    <HoldCode>String</HoldCode>
    <HoldEndUtc>0001-01-01T00:00:00</HoldEndUtc>
    <HoldReason>String</HoldReason>
    <IsFree>false</IsFree>
    <Name>String</Name>
    <RigType>String</RigType>
  </Rig>
  <ServerUtc>0001-01-01T00:00:00</ServerUtc>
  <Truck>
    <Code>String</Code>
    <EstLoad>0</EstLoad>
    <Facility>String</Facility>
    <FacilityShort>String</FacilityShort>
    <HoldCode>String</HoldCode>
    <HoldEndUtc>0001-01-01T00:00:00</HoldEndUtc>
    <HoldReason>String</HoldReason>
    <LoadsToday>0</LoadsToday>
    <NetToday>0</NetToday>
    <NextSiteName>String</NextSiteName>
    <OpenLoadCode>String</OpenLoadCode>
    <OpenLoadId>0</OpenLoadId>
    <OpenLoadPhotos>0</OpenLoadPhotos>
    <QueuePosition>0</QueuePosition>
    <SiteName>String</SiteName>
    <Slot>String</Slot>
    <Stage>String</Stage>
    <StageSinceUtc>0001-01-01T00:00:00</StageSinceUtc>
    <Stamps>
      <DriverStampView>
        <AtUtc>0001-01-01T00:00:00</AtUtc>
        <Note>String</Note>
        <Stage>String</Stage>
      </DriverStampView>
    </Stamps>
    <SupplierName>String</SupplierName>
    <Unit>String</Unit>
  </Truck>
</DriverMeResponse>