| 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;
}
}
To override the Content-type in your clients, use the HTTP Accept Header, append the .jsv suffix or ?format=jsv
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: text/jsv
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length
{
Office:
{
ServerUtc: 0001-01-01,
Vans:
[
{
DriverContactId: 0,
DriverCode: String,
Name: String,
Online: False,
Zone: String,
VehicleUnit: String,
FacilityName: String,
State: String,
LeaveByUtc: 0001-01-01,
LeaveByText: String,
SlackMin: 0,
InVan: 0,
Committed: 0,
Cap: 0,
CapUnit: String,
UnitMany: String,
CriticalCode: String,
DriveMin: 0,
SendNote: String,
Aboard:
[
{
Code: String,
CourierStep: String,
LevelCode: String,
LevelName: String,
Units: 0,
Area: String,
DueUtc: 0001-01-01,
DueText: String,
Movable: False,
NoMoveWhy: String,
Targets:
[
{
DriverContactId: 0,
Name: String,
Ok: False,
Why: String,
LeaveByText: String
}
]
}
],
Queued:
[
{
Code: String,
CourierStep: String,
LevelCode: String,
LevelName: String,
Units: 0,
Area: String,
DueUtc: 0001-01-01,
DueText: String,
Movable: False,
NoMoveWhy: String,
Targets:
[
{
DriverContactId: 0,
Name: String,
Ok: False,
Why: String,
LeaveByText: String
}
]
}
]
}
],
Held:
[
{
Code: String,
Area: String,
Units: 0,
UnitMany: String,
Miles: 0,
LevelCode: String,
LevelName: String,
DueText: String,
HeldReason: String,
HeldMin: 0,
Why:
[
String
],
BestDriverContactId: 0,
BestName: String,
BestLeaveByText: String
}
],
Vehicles:
[
{
CourierProfileId: 0,
EquipmentID: 0,
UnitNumber: String,
VehicleType: String,
CapacityUnit: String,
CapacityLimit: 0,
IsRefrigerated: False,
Status: String
}
],
Profiles:
[
{
CourierProfileID: 0,
Name: String,
RouteShape: String,
Enabled: False,
UnitOne: String,
UnitMany: String,
FacilityNoun: String,
Facilities:
[
{
CourierFacilityID: 0,
Code: String,
Name: String,
Address: String,
IntakeMin: 0
}
]
}
],
Drivers:
[
{
ContactId: 0,
Code: String,
Name: String,
Online: False,
Zone: String,
VehicleUnit: String,
EquipmentID: 0,
SentToFacility: False
}
],
Desk:
[
{
Code: String,
CourierProfileId: 0,
FacilityName: String,
LevelCode: String,
LevelName: String,
DueUtc: 0001-01-01,
DueText: String,
Units: 0,
UnitsFound: 0,
UnitMany: String,
Fare: 0,
FinalPrice: 0,
TipAmount: 0,
PayMode: String,
CaptureMode: String,
CustomerName: String,
Area: String,
IntakeUtc: 0001-01-01,
IntakeMinAgo: 0,
DamageNote: String,
FinalPriceAfterCount: False,
NeedsPrice: False,
ItemCount: 0,
MissingCount: 0,
PhotoCount: 0
}
],
GoCount: 0,
HeldCount: 0,
ReadyToOffer: 0,
IntakeMin: 0,
FacilityNoun: String
},
Available: False,
ResponseStatus:
{
ErrorCode: String,
Message: String,
StackTrace: String,
Errors:
[
{
ErrorCode: String,
FieldName: String,
Message: String,
Meta:
{
String: String
}
}
],
Meta:
{
String: String
}
}
}