Trendsic Platform Service

<back to all web services

CameraTargetsRequest

Requires Authentication
The following routes are available for this service:
GET,OPTIONS/v1/worker/camera/targets
<?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 CameraRoleTargets implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $Role=null,
        /** @var string|null */
        public ?string $Cur=null,
        /** @var array<string>|null */
        public ?array $Alts=null,
        /** @var array<string>|null */
        public ?array $Recent=null,
        /** @var array<string>|null */
        public ?array $Upcoming=null,
        /** @var string|null */
        public ?string $Gen=null,
        /** @var string|null */
        public ?string $Lock=null,
        /** @var bool|null */
        public ?bool $Hidden=null,
        /** @var bool|null */
        public ?bool $Driving=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['Role'])) $this->Role = $o['Role'];
        if (isset($o['Cur'])) $this->Cur = $o['Cur'];
        if (isset($o['Alts'])) $this->Alts = JsonConverters::fromArray('string', $o['Alts']);
        if (isset($o['Recent'])) $this->Recent = JsonConverters::fromArray('string', $o['Recent']);
        if (isset($o['Upcoming'])) $this->Upcoming = JsonConverters::fromArray('string', $o['Upcoming']);
        if (isset($o['Gen'])) $this->Gen = $o['Gen'];
        if (isset($o['Lock'])) $this->Lock = $o['Lock'];
        if (isset($o['Hidden'])) $this->Hidden = $o['Hidden'];
        if (isset($o['Driving'])) $this->Driving = $o['Driving'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->Role)) $o['Role'] = $this->Role;
        if (isset($this->Cur)) $o['Cur'] = $this->Cur;
        if (isset($this->Alts)) $o['Alts'] = JsonConverters::toArray('string', $this->Alts);
        if (isset($this->Recent)) $o['Recent'] = JsonConverters::toArray('string', $this->Recent);
        if (isset($this->Upcoming)) $o['Upcoming'] = JsonConverters::toArray('string', $this->Upcoming);
        if (isset($this->Gen)) $o['Gen'] = $this->Gen;
        if (isset($this->Lock)) $o['Lock'] = $this->Lock;
        if (isset($this->Hidden)) $o['Hidden'] = $this->Hidden;
        if (isset($this->Driving)) $o['Driving'] = $this->Driving;
        return empty($o) ? new class(){} : $o;
    }
}

class CameraTarget implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $Id=null,
        /** @var string|null */
        public ?string $Type=null,
        /** @var string|null */
        public ?string $RecordId=null,
        /** @var string|null */
        public ?string $Role=null,
        /** @var string|null */
        public ?string $Code=null,
        /** @var string|null */
        public ?string $Title=null,
        /** @var string|null */
        public ?string $Detail=null,
        /** @var string|null */
        public ?string $State=null,
        /** @var array<string>|null */
        public ?array $Kinds=null,
        /** @var string|null */
        public ?string $Def=null,
        /** @var bool|null */
        public ?bool $Closed=null,
        /** @var string|null */
        public ?string $ProofNeed=null,
        /** @var bool|null */
        public ?bool $InApp=null,
        /** @var bool|null */
        public ?bool $Gallery=null,
        /** @var bool|null */
        public ?bool $Tomorrow=null,
        /** @var float|null */
        public ?float $SiteLat=null,
        /** @var float|null */
        public ?float $SiteLng=null,
        /** @var array<string,int>|null */
        public ?array $Counts=null,
        /** @var string|null */
        public ?string $LogDate=null,
        /** @var int */
        public int $Seq=0,
        /** @var int */
        public int $SeqOf=0,
        /** @var string|null */
        public ?string $Window=null,
        /** @var string|null */
        public ?string $Service=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['Id'])) $this->Id = $o['Id'];
        if (isset($o['Type'])) $this->Type = $o['Type'];
        if (isset($o['RecordId'])) $this->RecordId = $o['RecordId'];
        if (isset($o['Role'])) $this->Role = $o['Role'];
        if (isset($o['Code'])) $this->Code = $o['Code'];
        if (isset($o['Title'])) $this->Title = $o['Title'];
        if (isset($o['Detail'])) $this->Detail = $o['Detail'];
        if (isset($o['State'])) $this->State = $o['State'];
        if (isset($o['Kinds'])) $this->Kinds = JsonConverters::fromArray('string', $o['Kinds']);
        if (isset($o['Def'])) $this->Def = $o['Def'];
        if (isset($o['Closed'])) $this->Closed = $o['Closed'];
        if (isset($o['ProofNeed'])) $this->ProofNeed = $o['ProofNeed'];
        if (isset($o['InApp'])) $this->InApp = $o['InApp'];
        if (isset($o['Gallery'])) $this->Gallery = $o['Gallery'];
        if (isset($o['Tomorrow'])) $this->Tomorrow = $o['Tomorrow'];
        if (isset($o['SiteLat'])) $this->SiteLat = $o['SiteLat'];
        if (isset($o['SiteLng'])) $this->SiteLng = $o['SiteLng'];
        if (isset($o['Counts'])) $this->Counts = JsonConverters::from(JsonConverters::context('Dictionary',genericArgs:['string','int']), $o['Counts']);
        if (isset($o['LogDate'])) $this->LogDate = $o['LogDate'];
        if (isset($o['Seq'])) $this->Seq = $o['Seq'];
        if (isset($o['SeqOf'])) $this->SeqOf = $o['SeqOf'];
        if (isset($o['Window'])) $this->Window = $o['Window'];
        if (isset($o['Service'])) $this->Service = $o['Service'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->Id)) $o['Id'] = $this->Id;
        if (isset($this->Type)) $o['Type'] = $this->Type;
        if (isset($this->RecordId)) $o['RecordId'] = $this->RecordId;
        if (isset($this->Role)) $o['Role'] = $this->Role;
        if (isset($this->Code)) $o['Code'] = $this->Code;
        if (isset($this->Title)) $o['Title'] = $this->Title;
        if (isset($this->Detail)) $o['Detail'] = $this->Detail;
        if (isset($this->State)) $o['State'] = $this->State;
        if (isset($this->Kinds)) $o['Kinds'] = JsonConverters::toArray('string', $this->Kinds);
        if (isset($this->Def)) $o['Def'] = $this->Def;
        if (isset($this->Closed)) $o['Closed'] = $this->Closed;
        if (isset($this->ProofNeed)) $o['ProofNeed'] = $this->ProofNeed;
        if (isset($this->InApp)) $o['InApp'] = $this->InApp;
        if (isset($this->Gallery)) $o['Gallery'] = $this->Gallery;
        if (isset($this->Tomorrow)) $o['Tomorrow'] = $this->Tomorrow;
        if (isset($this->SiteLat)) $o['SiteLat'] = $this->SiteLat;
        if (isset($this->SiteLng)) $o['SiteLng'] = $this->SiteLng;
        if (isset($this->Counts)) $o['Counts'] = JsonConverters::to(JsonConverters::context('Dictionary',genericArgs:['string','int']), $this->Counts);
        if (isset($this->LogDate)) $o['LogDate'] = $this->LogDate;
        if (isset($this->Seq)) $o['Seq'] = $this->Seq;
        if (isset($this->SeqOf)) $o['SeqOf'] = $this->SeqOf;
        if (isset($this->Window)) $o['Window'] = $this->Window;
        if (isset($this->Service)) $o['Service'] = $this->Service;
        return empty($o) ? new class(){} : $o;
    }
}

class CameraTargetsResponse implements JsonSerializable
{
    public function __construct(
        /** @var array<CameraRoleTargets>|null */
        public ?array $Roles=null,
        /** @var array<CameraTarget>|null */
        public ?array $Items=null,
        /** @var string|null */
        public ?string $ArrivalPhoto=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['Roles'])) $this->Roles = JsonConverters::fromArray('CameraRoleTargets', $o['Roles']);
        if (isset($o['Items'])) $this->Items = JsonConverters::fromArray('CameraTarget', $o['Items']);
        if (isset($o['ArrivalPhoto'])) $this->ArrivalPhoto = $o['ArrivalPhoto'];
        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->Roles)) $o['Roles'] = JsonConverters::toArray('CameraRoleTargets', $this->Roles);
        if (isset($this->Items)) $o['Items'] = JsonConverters::toArray('CameraTarget', $this->Items);
        if (isset($this->ArrivalPhoto)) $o['ArrivalPhoto'] = $this->ArrivalPhoto;
        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 CameraTargetsRequest implements JsonSerializable
{
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        return empty($o) ? new class(){} : $o;
    }
}

PHP CameraTargetsRequest DTOs

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

To embed the response in a jsonp callback, append ?callback=myCallback

HTTP + JSON

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

GET /v1/worker/camera/targets HTTP/1.1 
Host: api.dev.dynamics.trendsic.com 
Accept: application/json
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length

{"Roles":[{"Role":"String","Cur":"String","Alts":["String"],"Recent":["String"],"Upcoming":["String"],"Gen":"String","Lock":"String","Hidden":false,"Driving":false}],"Items":[{"Id":"String","Type":"String","RecordId":"String","Role":"String","Code":"String","Title":"String","Detail":"String","State":"String","Kinds":["String"],"Def":"String","Closed":false,"ProofNeed":"String","InApp":false,"Gallery":false,"Tomorrow":false,"SiteLat":0,"SiteLng":0,"Counts":{"String":0},"LogDate":"String","Seq":0,"SeqOf":0,"Window":"String","Service":"String"}],"ArrivalPhoto":"String","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"}}}