Trendsic Platform Service

<back to all web services

DispatchCommsRequest

Requires Authentication
The following routes are available for this service:
GET,PUT/v1/dispatch/comms
<?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 WorkerCommsView implements JsonSerializable
{
    public function __construct(
        /** @var float */
        public float $MovingMph=0.0,
        /** @var int */
        public int $MovingHoldSecs=0,
        /** @var bool|null */
        public ?bool $RelayVoice=null,
        /** @var bool|null */
        public ?bool $RelayReady=null,
        /** @var bool|null */
        public ?bool $HasOwnNumber=null,
        /** @var string|null */
        public ?string $RelayNumber=null
    ) {
    }

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

class WorkerCommsResponse implements JsonSerializable
{
    public function __construct(
        /** @var WorkerCommsView|null */
        public ?WorkerCommsView $Comms=null,
        /** @var string|null */
        public ?string $Number=null,
        /** @var string|null */
        public ?string $Code=null,
        /** @var string|null */
        public ?string $Message=null,
        /** @var ResponseStatus|null */
        public ?ResponseStatus $ResponseStatus=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['Comms'])) $this->Comms = JsonConverters::from('WorkerCommsView', $o['Comms']);
        if (isset($o['Number'])) $this->Number = $o['Number'];
        if (isset($o['Code'])) $this->Code = $o['Code'];
        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->Comms)) $o['Comms'] = JsonConverters::to('WorkerCommsView', $this->Comms);
        if (isset($this->Number)) $o['Number'] = $this->Number;
        if (isset($this->Code)) $o['Code'] = $this->Code;
        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 DispatchCommsRequest implements JsonSerializable
{
    public function __construct(
        /** @var float */
        public float $MovingMph=0.0,
        /** @var int */
        public int $MovingHoldSecs=0,
        /** @var bool|null */
        public ?bool $RelayVoice=null
    ) {
    }

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

PHP DispatchCommsRequest 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.

PUT /v1/dispatch/comms HTTP/1.1 
Host: api.dev.dynamics.trendsic.com 
Accept: text/csv
Content-Type: text/csv
Content-Length: length

{"MovingMph":0,"MovingHoldSecs":0,"RelayVoice":false}
HTTP/1.1 200 OK
Content-Type: text/csv
Content-Length: length

{"Comms":{"MovingMph":0,"MovingHoldSecs":0,"RelayVoice":false,"RelayReady":false,"HasOwnNumber":false,"RelayNumber":"String"},"Number":"String","Code":"String","Message":"String","ResponseStatus":{"ErrorCode":"String","Message":"String","StackTrace":"String","Errors":[{"ErrorCode":"String","FieldName":"String","Message":"String","Meta":{"String":"String"}}],"Meta":{"String":"String"}}}