Trendsic Platform Service

<back to all web services

CourierDriverStopsRequest

Requires Authentication
The following routes are available for this service:
GET,OPTIONS/v1/worker/dispatch/od/stops
<?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 CourierStopRow implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $Kind=null,
        /** @var DateTime */
        public DateTime $AtUtc=new DateTime(),
        /** @var string|null */
        public ?string $OrderCode=null,
        /** @var int */
        public int $Units=0,
        /** @var int|null */
        public ?int $OrderCount=null,
        /** @var string|null */
        public ?string $RunCode=null,
        /** @var int|null */
        public ?int $StopSeq=null,
        /** @var string|null */
        public ?string $Street=null,
        /** @var string|null */
        public ?string $City=null,
        /** @var string|null */
        public ?string $Zip=null,
        /** @var string|null */
        public ?string $FacilityName=null,
        /** @var string|null */
        public ?string $Reason=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['Kind'])) $this->Kind = $o['Kind'];
        if (isset($o['AtUtc'])) $this->AtUtc = JsonConverters::from('DateTime', $o['AtUtc']);
        if (isset($o['OrderCode'])) $this->OrderCode = $o['OrderCode'];
        if (isset($o['Units'])) $this->Units = $o['Units'];
        if (isset($o['OrderCount'])) $this->OrderCount = $o['OrderCount'];
        if (isset($o['RunCode'])) $this->RunCode = $o['RunCode'];
        if (isset($o['StopSeq'])) $this->StopSeq = $o['StopSeq'];
        if (isset($o['Street'])) $this->Street = $o['Street'];
        if (isset($o['City'])) $this->City = $o['City'];
        if (isset($o['Zip'])) $this->Zip = $o['Zip'];
        if (isset($o['FacilityName'])) $this->FacilityName = $o['FacilityName'];
        if (isset($o['Reason'])) $this->Reason = $o['Reason'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->Kind)) $o['Kind'] = $this->Kind;
        if (isset($this->AtUtc)) $o['AtUtc'] = JsonConverters::to('DateTime', $this->AtUtc);
        if (isset($this->OrderCode)) $o['OrderCode'] = $this->OrderCode;
        if (isset($this->Units)) $o['Units'] = $this->Units;
        if (isset($this->OrderCount)) $o['OrderCount'] = $this->OrderCount;
        if (isset($this->RunCode)) $o['RunCode'] = $this->RunCode;
        if (isset($this->StopSeq)) $o['StopSeq'] = $this->StopSeq;
        if (isset($this->Street)) $o['Street'] = $this->Street;
        if (isset($this->City)) $o['City'] = $this->City;
        if (isset($this->Zip)) $o['Zip'] = $this->Zip;
        if (isset($this->FacilityName)) $o['FacilityName'] = $this->FacilityName;
        if (isset($this->Reason)) $o['Reason'] = $this->Reason;
        return empty($o) ? new class(){} : $o;
    }
}

class CourierPingFacts implements JsonSerializable
{
    public function __construct(
        /** @var bool|null */
        public ?bool $Busy=null,
        /** @var float|null */
        public ?float $RadiusMi=null,
        /** @var bool|null */
        public ?bool $HideAddressesInHistory=null,
        /** @var float|null */
        public ?float $PingRadiusMi=null,
        /** @var DateTime|null */
        public ?DateTime $PingRadiusUntilUtc=null,
        /** @var string|null */
        public ?string $UnitOne=null,
        /** @var string|null */
        public ?string $UnitMany=null,
        /** @var string|null */
        public ?string $UnitOneEs=null,
        /** @var string|null */
        public ?string $UnitManyEs=null,
        /** @var string|null */
        public ?string $FacilityNoun=null,
        /** @var string|null */
        public ?string $FacilityNounEs=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['Busy'])) $this->Busy = $o['Busy'];
        if (isset($o['RadiusMi'])) $this->RadiusMi = $o['RadiusMi'];
        if (isset($o['HideAddressesInHistory'])) $this->HideAddressesInHistory = $o['HideAddressesInHistory'];
        if (isset($o['PingRadiusMi'])) $this->PingRadiusMi = $o['PingRadiusMi'];
        if (isset($o['PingRadiusUntilUtc'])) $this->PingRadiusUntilUtc = JsonConverters::from('DateTime', $o['PingRadiusUntilUtc']);
        if (isset($o['UnitOne'])) $this->UnitOne = $o['UnitOne'];
        if (isset($o['UnitMany'])) $this->UnitMany = $o['UnitMany'];
        if (isset($o['UnitOneEs'])) $this->UnitOneEs = $o['UnitOneEs'];
        if (isset($o['UnitManyEs'])) $this->UnitManyEs = $o['UnitManyEs'];
        if (isset($o['FacilityNoun'])) $this->FacilityNoun = $o['FacilityNoun'];
        if (isset($o['FacilityNounEs'])) $this->FacilityNounEs = $o['FacilityNounEs'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->Busy)) $o['Busy'] = $this->Busy;
        if (isset($this->RadiusMi)) $o['RadiusMi'] = $this->RadiusMi;
        if (isset($this->HideAddressesInHistory)) $o['HideAddressesInHistory'] = $this->HideAddressesInHistory;
        if (isset($this->PingRadiusMi)) $o['PingRadiusMi'] = $this->PingRadiusMi;
        if (isset($this->PingRadiusUntilUtc)) $o['PingRadiusUntilUtc'] = JsonConverters::to('DateTime', $this->PingRadiusUntilUtc);
        if (isset($this->UnitOne)) $o['UnitOne'] = $this->UnitOne;
        if (isset($this->UnitMany)) $o['UnitMany'] = $this->UnitMany;
        if (isset($this->UnitOneEs)) $o['UnitOneEs'] = $this->UnitOneEs;
        if (isset($this->UnitManyEs)) $o['UnitManyEs'] = $this->UnitManyEs;
        if (isset($this->FacilityNoun)) $o['FacilityNoun'] = $this->FacilityNoun;
        if (isset($this->FacilityNounEs)) $o['FacilityNounEs'] = $this->FacilityNounEs;
        return empty($o) ? new class(){} : $o;
    }
}

class CourierDriverStopsResponse implements JsonSerializable
{
    public function __construct(
        /** @var array<CourierStopRow>|null */
        public ?array $Rows=null,
        /** @var bool|null */
        public ?bool $Hidden=null,
        /** @var CourierPingFacts|null */
        public ?CourierPingFacts $Facts=null,
        /** @var bool|null */
        public ?bool $Available=null,
        /** @var DateTime */
        public DateTime $ServerUtc=new DateTime(),
        /** @var ResponseStatus|null */
        public ?ResponseStatus $ResponseStatus=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['Rows'])) $this->Rows = JsonConverters::fromArray('CourierStopRow', $o['Rows']);
        if (isset($o['Hidden'])) $this->Hidden = $o['Hidden'];
        if (isset($o['Facts'])) $this->Facts = JsonConverters::from('CourierPingFacts', $o['Facts']);
        if (isset($o['Available'])) $this->Available = $o['Available'];
        if (isset($o['ServerUtc'])) $this->ServerUtc = JsonConverters::from('DateTime', $o['ServerUtc']);
        if (isset($o['ResponseStatus'])) $this->ResponseStatus = JsonConverters::from('ResponseStatus', $o['ResponseStatus']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->Rows)) $o['Rows'] = JsonConverters::toArray('CourierStopRow', $this->Rows);
        if (isset($this->Hidden)) $o['Hidden'] = $this->Hidden;
        if (isset($this->Facts)) $o['Facts'] = JsonConverters::to('CourierPingFacts', $this->Facts);
        if (isset($this->Available)) $o['Available'] = $this->Available;
        if (isset($this->ServerUtc)) $o['ServerUtc'] = JsonConverters::to('DateTime', $this->ServerUtc);
        if (isset($this->ResponseStatus)) $o['ResponseStatus'] = JsonConverters::to('ResponseStatus', $this->ResponseStatus);
        return empty($o) ? new class(){} : $o;
    }
}

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

PHP CourierDriverStopsRequest 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/worker/dispatch/od/stops HTTP/1.1 
Host: api.dev.dynamics.trendsic.com 
Accept: application/xml
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

<CourierDriverStopsResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/CRM.AgencyPlatform.API.Internal">
  <Available>false</Available>
  <Facts>
    <Busy>false</Busy>
    <FacilityNoun>String</FacilityNoun>
    <FacilityNounEs>String</FacilityNounEs>
    <HideAddressesInHistory>false</HideAddressesInHistory>
    <PingRadiusMi>0</PingRadiusMi>
    <PingRadiusUntilUtc>0001-01-01T00:00:00</PingRadiusUntilUtc>
    <RadiusMi>0</RadiusMi>
    <UnitMany>String</UnitMany>
    <UnitManyEs>String</UnitManyEs>
    <UnitOne>String</UnitOne>
    <UnitOneEs>String</UnitOneEs>
  </Facts>
  <Hidden>false</Hidden>
  <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>
  <Rows>
    <CourierStopRow>
      <AtUtc>0001-01-01T00:00:00</AtUtc>
      <City>String</City>
      <FacilityName>String</FacilityName>
      <Kind>String</Kind>
      <OrderCode>String</OrderCode>
      <OrderCount>0</OrderCount>
      <Reason>String</Reason>
      <RunCode>String</RunCode>
      <StopSeq>0</StopSeq>
      <Street>String</Street>
      <Units>0</Units>
      <Zip>String</Zip>
    </CourierStopRow>
  </Rows>
  <ServerUtc>0001-01-01T00:00:00</ServerUtc>
</CourierDriverStopsResponse>