Trendsic Platform Service

<back to all web services

DispatchLoadsRequest

Requires Authentication
The following routes are available for this service:
GET,OPTIONS/v1/dispatch/loads
<?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 DispatchLoadStageView 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 DispatchLoadView implements JsonSerializable
{
    public function __construct(
        /** @var int */
        public int $LoadId=0,
        /** @var string|null */
        public ?string $Code=null,
        /** @var string|null */
        public ?string $Module=null,
        /** @var string|null */
        public ?string $TruckLabel=null,
        /** @var string|null */
        public ?string $DriverLabel=null,
        /** @var string|null */
        public ?string $CarrierLabel=null,
        /** @var string|null */
        public ?string $SourceLabel=null,
        /** @var string|null */
        public ?string $DestinationLabel=null,
        /** @var float|null */
        public ?float $Qty=null,
        /** @var string|null */
        public ?string $Unit=null,
        /** @var string|null */
        public ?string $QtyText=null,
        /** @var string|null */
        public ?string $TicketCode=null,
        /** @var float|null */
        public ?float $RateApplied=null,
        /** @var string|null */
        public ?string $RateBasis=null,
        /** @var float|null */
        public ?float $Revenue=null,
        /** @var string|null */
        public ?string $PayPlanLabel=null,
        /** @var float|null */
        public ?float $Pay=null,
        /** @var string|null */
        public ?string $Status=null,
        /** @var DateTime */
        public DateTime $OpenedUtc=new DateTime(),
        /** @var DateTime|null */
        public ?DateTime $ClosedUtc=null,
        /** @var int */
        public int $Photos=0,
        /** @var array<DispatchLoadStageView>|null */
        public ?array $Stages=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['LoadId'])) $this->LoadId = $o['LoadId'];
        if (isset($o['Code'])) $this->Code = $o['Code'];
        if (isset($o['Module'])) $this->Module = $o['Module'];
        if (isset($o['TruckLabel'])) $this->TruckLabel = $o['TruckLabel'];
        if (isset($o['DriverLabel'])) $this->DriverLabel = $o['DriverLabel'];
        if (isset($o['CarrierLabel'])) $this->CarrierLabel = $o['CarrierLabel'];
        if (isset($o['SourceLabel'])) $this->SourceLabel = $o['SourceLabel'];
        if (isset($o['DestinationLabel'])) $this->DestinationLabel = $o['DestinationLabel'];
        if (isset($o['Qty'])) $this->Qty = $o['Qty'];
        if (isset($o['Unit'])) $this->Unit = $o['Unit'];
        if (isset($o['QtyText'])) $this->QtyText = $o['QtyText'];
        if (isset($o['TicketCode'])) $this->TicketCode = $o['TicketCode'];
        if (isset($o['RateApplied'])) $this->RateApplied = $o['RateApplied'];
        if (isset($o['RateBasis'])) $this->RateBasis = $o['RateBasis'];
        if (isset($o['Revenue'])) $this->Revenue = $o['Revenue'];
        if (isset($o['PayPlanLabel'])) $this->PayPlanLabel = $o['PayPlanLabel'];
        if (isset($o['Pay'])) $this->Pay = $o['Pay'];
        if (isset($o['Status'])) $this->Status = $o['Status'];
        if (isset($o['OpenedUtc'])) $this->OpenedUtc = JsonConverters::from('DateTime', $o['OpenedUtc']);
        if (isset($o['ClosedUtc'])) $this->ClosedUtc = JsonConverters::from('DateTime', $o['ClosedUtc']);
        if (isset($o['Photos'])) $this->Photos = $o['Photos'];
        if (isset($o['Stages'])) $this->Stages = JsonConverters::fromArray('DispatchLoadStageView', $o['Stages']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->LoadId)) $o['LoadId'] = $this->LoadId;
        if (isset($this->Code)) $o['Code'] = $this->Code;
        if (isset($this->Module)) $o['Module'] = $this->Module;
        if (isset($this->TruckLabel)) $o['TruckLabel'] = $this->TruckLabel;
        if (isset($this->DriverLabel)) $o['DriverLabel'] = $this->DriverLabel;
        if (isset($this->CarrierLabel)) $o['CarrierLabel'] = $this->CarrierLabel;
        if (isset($this->SourceLabel)) $o['SourceLabel'] = $this->SourceLabel;
        if (isset($this->DestinationLabel)) $o['DestinationLabel'] = $this->DestinationLabel;
        if (isset($this->Qty)) $o['Qty'] = $this->Qty;
        if (isset($this->Unit)) $o['Unit'] = $this->Unit;
        if (isset($this->QtyText)) $o['QtyText'] = $this->QtyText;
        if (isset($this->TicketCode)) $o['TicketCode'] = $this->TicketCode;
        if (isset($this->RateApplied)) $o['RateApplied'] = $this->RateApplied;
        if (isset($this->RateBasis)) $o['RateBasis'] = $this->RateBasis;
        if (isset($this->Revenue)) $o['Revenue'] = $this->Revenue;
        if (isset($this->PayPlanLabel)) $o['PayPlanLabel'] = $this->PayPlanLabel;
        if (isset($this->Pay)) $o['Pay'] = $this->Pay;
        if (isset($this->Status)) $o['Status'] = $this->Status;
        if (isset($this->OpenedUtc)) $o['OpenedUtc'] = JsonConverters::to('DateTime', $this->OpenedUtc);
        if (isset($this->ClosedUtc)) $o['ClosedUtc'] = JsonConverters::to('DateTime', $this->ClosedUtc);
        if (isset($this->Photos)) $o['Photos'] = $this->Photos;
        if (isset($this->Stages)) $o['Stages'] = JsonConverters::toArray('DispatchLoadStageView', $this->Stages);
        return empty($o) ? new class(){} : $o;
    }
}

class DispatchLoadsResponse implements JsonSerializable
{
    public function __construct(
        /** @var array<DispatchLoadView>|null */
        public ?array $Loads=null,
        /** @var int */
        public int $Hours=0,
        /** @var ResponseStatus|null */
        public ?ResponseStatus $ResponseStatus=null
    ) {
    }

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

class DispatchLoadsRequest implements JsonSerializable
{
    public function __construct(
        /** @var int */
        public int $Hours=0,
        /** @var string|null */
        public ?string $Module=null
    ) {
    }

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

PHP DispatchLoadsRequest DTOs

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

HTTP + XML

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

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

<DispatchLoadsResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/CRM.AgencyPlatform.API.Internal">
  <Hours>0</Hours>
  <Loads>
    <DispatchLoadView>
      <CarrierLabel>String</CarrierLabel>
      <ClosedUtc>0001-01-01T00:00:00</ClosedUtc>
      <Code>String</Code>
      <DestinationLabel>String</DestinationLabel>
      <DriverLabel>String</DriverLabel>
      <LoadId>0</LoadId>
      <Module>String</Module>
      <OpenedUtc>0001-01-01T00:00:00</OpenedUtc>
      <Pay>0</Pay>
      <PayPlanLabel>String</PayPlanLabel>
      <Photos>0</Photos>
      <Qty>0</Qty>
      <QtyText>String</QtyText>
      <RateApplied>0</RateApplied>
      <RateBasis>String</RateBasis>
      <Revenue>0</Revenue>
      <SourceLabel>String</SourceLabel>
      <Stages>
        <DispatchLoadStageView>
          <AtUtc>0001-01-01T00:00:00</AtUtc>
          <Note>String</Note>
          <Stage>String</Stage>
        </DispatchLoadStageView>
      </Stages>
      <Status>String</Status>
      <TicketCode>String</TicketCode>
      <TruckLabel>String</TruckLabel>
      <Unit>String</Unit>
    </DispatchLoadView>
  </Loads>
  <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>
</DispatchLoadsResponse>