Trendsic Platform Service

<back to all web services

DriverPhotoRequest

Requires Authentication
The following routes are available for this service:
POST,OPTIONS/v1/worker/dispatch/photo
<?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 DriverPhotoRequest implements JsonSerializable
{
    public function __construct(
        /** @var int */
        public int $LoadId=0,
        /** @var string|null */
        public ?string $Kind=null
    ) {
    }

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

PHP DriverPhotoRequest DTOs

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

HTTP + OTHER

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

POST /v1/worker/dispatch/photo HTTP/1.1 
Host: api.dev.dynamics.trendsic.com 
Accept: text/jsonl
Content-Type: text/jsonl
Content-Length: length

{"LoadId":0,"Kind":"String"}
HTTP/1.1 200 OK
Content-Type: text/jsonl
Content-Length: length

{"ContactId":0,"Name":"String","Phone":"String","PayPlanName":"String","PayPlanBasis":"String","PayPlanRate":0,"Truck":{"Code":"String","Stage":"String","StageSinceUtc":"0001-01-01T00:00:00.0000000","LoadsToday":0,"NetToday":0,"EstLoad":0,"Slot":"String","SiteName":"String","SupplierName":"String","NextSiteName":"String","Facility":"String","FacilityShort":"String","Unit":"String","QueuePosition":0,"HoldCode":"String","HoldReason":"String","HoldEndUtc":"0001-01-01T00:00:00.0000000","OpenLoadId":0,"OpenLoadCode":"String","OpenLoadPhotos":0,"Stamps":[{"Stage":"String","AtUtc":"0001-01-01T00:00:00.0000000","Note":"String"}]},"Rig":{"Code":"String","Name":"String","RigType":"String","IsFree":false,"HoldCode":"String","HoldReason":"String","HoldEndUtc":"0001-01-01T00:00:00.0000000"},"Jobs":[{"Kind":"String","Code":"String","Cargo":"String","Customer":"String","CustomerPhone":"String","HoldContact":"String","HoldPhone":"String","FromLoc":"String","ToLoc":"String","Miles":0,"WindowText":"String","Stage":"String","Rate":0,"RequiredRig":"String","EtaText":"String","OfferExpiresUtc":"0001-01-01T00:00:00.0000000","RequestId":0,"LoadId":0,"LoadCode":"String","LoadPay":0,"Photos":0,"Stamps":[{"Stage":"String","AtUtc":"0001-01-01T00:00:00.0000000","Note":"String"}]}],"Od":{"Code":"String","Name":"String","Zone":"String","Status":"String","Tier":"String","Capabilities":"String","PingCode":"String","PingAddress":"String","PingZone":"String","PingBags":0,"PingNeeds":"String","PingNote":"String","PingExpiresUtc":"0001-01-01T00:00:00.0000000","RunCode":"String","RunAddress":"String","RunZone":"String","RunBags":0,"RunStage":"String","RunNeeds":"String","RunNote":"String","RunEta":"String","OdBase":0,"OdPerBag":0,"HoldCode":"String","HoldReason":"String","HoldEndUtc":"0001-01-01T00:00:00.0000000"},"Incidents":[{"IncidentId":0,"Code":"String","Kind":"String","KindDetail":"String","Status":"String","LoadCode":"String","TruckCode":"String","LocationText":"String","DriverPref":"String","TruckRecovery":"String","LoadRecovery":"String","TransloadTruckCode":"String","HoldCode":"String","OpenedUtc":"0001-01-01T00:00:00.0000000","ResolvedUtc":"0001-01-01T00:00:00.0000000","Messages":[{"MessageId":0,"Who":"String","Role":"String","Msg":"String","AtUtc":"0001-01-01T00:00:00.0000000"}]}],"Pay":[{"Code":"String","Module":"String","SourceLabel":"String","DestinationLabel":"String","QtyText":"String","Pay":0,"PayPlanLabel":"String","Status":"String","ClosedUtc":"0001-01-01T00:00:00.0000000","OpenedUtc":"0001-01-01T00:00:00.0000000","TicketCode":"String"}],"ServerUtc":"0001-01-01T00:00:00.0000000","Message":"String","ResponseStatus":{"ErrorCode":"String","Message":"String","StackTrace":"String","Errors":[{"ErrorCode":"String","FieldName":"String","Message":"String","Meta":{"String":"String"}}],"Meta":{"String":"String"}}}