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 .csv suffix or ?format=csv

HTTP + CSV

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: text/csv
HTTP/1.1 200 OK
Content-Type: text/csv
Content-Length: length

{"Rows":[{"Kind":"String","AtUtc":"0001-01-01T00:00:00.0000000","OrderCode":"String","Units":0,"OrderCount":0,"RunCode":"String","StopSeq":0,"Street":"String","City":"String","Zip":"String","FacilityName":"String","Reason":"String"}],"Hidden":false,"Facts":{"Busy":false,"RadiusMi":0,"HideAddressesInHistory":false,"PingRadiusMi":0,"PingRadiusUntilUtc":"0001-01-01T00:00:00.0000000","UnitOne":"String","UnitMany":"String","UnitOneEs":"String","UnitManyEs":"String","FacilityNoun":"String","FacilityNounEs":"String"},"Available":false,"ServerUtc":"0001-01-01T00:00:00.0000000","ResponseStatus":{"ErrorCode":"String","Message":"String","StackTrace":"String","Errors":[{"ErrorCode":"String","FieldName":"String","Message":"String","Meta":{"String":"String"}}],"Meta":{"String":"String"}}}