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 .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/camera/targets HTTP/1.1 
Host: api.dev.dynamics.trendsic.com 
Accept: application/xml
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

<CameraTargetsResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/CRM.AgencyPlatform.API.Internal">
  <ArrivalPhoto>String</ArrivalPhoto>
  <Items>
    <CameraTarget>
      <Closed>false</Closed>
      <Code>String</Code>
      <Counts xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
        <d4p1:KeyValueOfstringint>
          <d4p1:Key>String</d4p1:Key>
          <d4p1:Value>0</d4p1:Value>
        </d4p1:KeyValueOfstringint>
      </Counts>
      <Def>String</Def>
      <Detail>String</Detail>
      <Gallery>false</Gallery>
      <Id>String</Id>
      <InApp>false</InApp>
      <Kinds xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
        <d4p1:string>String</d4p1:string>
      </Kinds>
      <LogDate>String</LogDate>
      <ProofNeed>String</ProofNeed>
      <RecordId>String</RecordId>
      <Role>String</Role>
      <Seq>0</Seq>
      <SeqOf>0</SeqOf>
      <Service>String</Service>
      <SiteLat>0</SiteLat>
      <SiteLng>0</SiteLng>
      <State>String</State>
      <Title>String</Title>
      <Tomorrow>false</Tomorrow>
      <Type>String</Type>
      <Window>String</Window>
    </CameraTarget>
  </Items>
  <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>
  <Roles>
    <CameraRoleTargets>
      <Alts xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
        <d4p1:string>String</d4p1:string>
      </Alts>
      <Cur>String</Cur>
      <Driving>false</Driving>
      <Gen>String</Gen>
      <Hidden>false</Hidden>
      <Lock>String</Lock>
      <Recent xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
        <d4p1:string>String</d4p1:string>
      </Recent>
      <Role>String</Role>
      <Upcoming xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
        <d4p1:string>String</d4p1:string>
      </Upcoming>
    </CameraRoleTargets>
  </Roles>
  <ServerUtc>0001-01-01T00:00:00</ServerUtc>
</CameraTargetsResponse>