Trendsic Platform Service

<back to all web services

MyWorkPhotosRequest

Requires Authentication
The following routes are available for this service:
GET,OPTIONS/v1/worker/photos/mine
<?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 WorkPhotoRow implements JsonSerializable
{
    public function __construct(
        /** @var int */
        public int $WorkPhotoID=0,
        /** @var int */
        public int $ContactId=0,
        /** @var string|null */
        public ?string $TakerName=null,
        /** @var string|null */
        public ?string $RoleKey=null,
        /** @var string|null */
        public ?string $TargetType=null,
        /** @var string|null */
        public ?string $TargetId=null,
        /** @var string|null */
        public ?string $TargetRef=null,
        /** @var string|null */
        public ?string $TargetTitle=null,
        /** @var string|null */
        public ?string $Kind=null,
        /** @var string|null */
        public ?string $Caption=null,
        /** @var DateTime */
        public DateTime $CapturedAtUtc=new DateTime(),
        /** @var float|null */
        public ?float $Lat=null,
        /** @var float|null */
        public ?float $Lng=null,
        /** @var int|null */
        public ?int $AccuracyM=null,
        /** @var int|null */
        public ?int $DistanceM=null,
        /** @var bool|null */
        public ?bool $InApp=null,
        /** @var string|null */
        public ?string $Source=null,
        /** @var bool|null */
        public ?bool $IsLate=null,
        /** @var bool|null */
        public ?bool $CountsAsProof=null,
        /** @var int */
        public int $MarkCount=0,
        /** @var bool|null */
        public ?bool $IssueOpen=null,
        /** @var string|null */
        public ?string $IssueClosedBy=null,
        /** @var bool|null */
        public ?bool $FromGeneral=null,
        /** @var string|null */
        public ?string $Url=null,
        /** @var string|null */
        public ?string $MarkedUrl=null,
        /** @var string|null */
        public ?string $TriageStatus=null,
        /** @var string|null */
        public ?string $RouteTo=null,
        /** @var string|null */
        public ?string $SuggestType=null,
        /** @var string|null */
        public ?string $SuggestId=null,
        /** @var string|null */
        public ?string $SuggestTitle=null,
        /** @var string|null */
        public ?string $SuggestWhy=null,
        /** @var string|null */
        public ?string $FiledType=null,
        /** @var string|null */
        public ?string $FiledId=null,
        /** @var string|null */
        public ?string $FiledTitle=null,
        /** @var string|null */
        public ?string $ReplyText=null,
        /** @var string|null */
        public ?string $TriagedBy=null,
        /** @var DateTime|null */
        public ?DateTime $TriagedAtUtc=null,
        /** @var DateTime|null */
        public ?DateTime $ExpiresAtUtc=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['WorkPhotoID'])) $this->WorkPhotoID = $o['WorkPhotoID'];
        if (isset($o['ContactId'])) $this->ContactId = $o['ContactId'];
        if (isset($o['TakerName'])) $this->TakerName = $o['TakerName'];
        if (isset($o['RoleKey'])) $this->RoleKey = $o['RoleKey'];
        if (isset($o['TargetType'])) $this->TargetType = $o['TargetType'];
        if (isset($o['TargetId'])) $this->TargetId = $o['TargetId'];
        if (isset($o['TargetRef'])) $this->TargetRef = $o['TargetRef'];
        if (isset($o['TargetTitle'])) $this->TargetTitle = $o['TargetTitle'];
        if (isset($o['Kind'])) $this->Kind = $o['Kind'];
        if (isset($o['Caption'])) $this->Caption = $o['Caption'];
        if (isset($o['CapturedAtUtc'])) $this->CapturedAtUtc = JsonConverters::from('DateTime', $o['CapturedAtUtc']);
        if (isset($o['Lat'])) $this->Lat = $o['Lat'];
        if (isset($o['Lng'])) $this->Lng = $o['Lng'];
        if (isset($o['AccuracyM'])) $this->AccuracyM = $o['AccuracyM'];
        if (isset($o['DistanceM'])) $this->DistanceM = $o['DistanceM'];
        if (isset($o['InApp'])) $this->InApp = $o['InApp'];
        if (isset($o['Source'])) $this->Source = $o['Source'];
        if (isset($o['IsLate'])) $this->IsLate = $o['IsLate'];
        if (isset($o['CountsAsProof'])) $this->CountsAsProof = $o['CountsAsProof'];
        if (isset($o['MarkCount'])) $this->MarkCount = $o['MarkCount'];
        if (isset($o['IssueOpen'])) $this->IssueOpen = $o['IssueOpen'];
        if (isset($o['IssueClosedBy'])) $this->IssueClosedBy = $o['IssueClosedBy'];
        if (isset($o['FromGeneral'])) $this->FromGeneral = $o['FromGeneral'];
        if (isset($o['Url'])) $this->Url = $o['Url'];
        if (isset($o['MarkedUrl'])) $this->MarkedUrl = $o['MarkedUrl'];
        if (isset($o['TriageStatus'])) $this->TriageStatus = $o['TriageStatus'];
        if (isset($o['RouteTo'])) $this->RouteTo = $o['RouteTo'];
        if (isset($o['SuggestType'])) $this->SuggestType = $o['SuggestType'];
        if (isset($o['SuggestId'])) $this->SuggestId = $o['SuggestId'];
        if (isset($o['SuggestTitle'])) $this->SuggestTitle = $o['SuggestTitle'];
        if (isset($o['SuggestWhy'])) $this->SuggestWhy = $o['SuggestWhy'];
        if (isset($o['FiledType'])) $this->FiledType = $o['FiledType'];
        if (isset($o['FiledId'])) $this->FiledId = $o['FiledId'];
        if (isset($o['FiledTitle'])) $this->FiledTitle = $o['FiledTitle'];
        if (isset($o['ReplyText'])) $this->ReplyText = $o['ReplyText'];
        if (isset($o['TriagedBy'])) $this->TriagedBy = $o['TriagedBy'];
        if (isset($o['TriagedAtUtc'])) $this->TriagedAtUtc = JsonConverters::from('DateTime', $o['TriagedAtUtc']);
        if (isset($o['ExpiresAtUtc'])) $this->ExpiresAtUtc = JsonConverters::from('DateTime', $o['ExpiresAtUtc']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->WorkPhotoID)) $o['WorkPhotoID'] = $this->WorkPhotoID;
        if (isset($this->ContactId)) $o['ContactId'] = $this->ContactId;
        if (isset($this->TakerName)) $o['TakerName'] = $this->TakerName;
        if (isset($this->RoleKey)) $o['RoleKey'] = $this->RoleKey;
        if (isset($this->TargetType)) $o['TargetType'] = $this->TargetType;
        if (isset($this->TargetId)) $o['TargetId'] = $this->TargetId;
        if (isset($this->TargetRef)) $o['TargetRef'] = $this->TargetRef;
        if (isset($this->TargetTitle)) $o['TargetTitle'] = $this->TargetTitle;
        if (isset($this->Kind)) $o['Kind'] = $this->Kind;
        if (isset($this->Caption)) $o['Caption'] = $this->Caption;
        if (isset($this->CapturedAtUtc)) $o['CapturedAtUtc'] = JsonConverters::to('DateTime', $this->CapturedAtUtc);
        if (isset($this->Lat)) $o['Lat'] = $this->Lat;
        if (isset($this->Lng)) $o['Lng'] = $this->Lng;
        if (isset($this->AccuracyM)) $o['AccuracyM'] = $this->AccuracyM;
        if (isset($this->DistanceM)) $o['DistanceM'] = $this->DistanceM;
        if (isset($this->InApp)) $o['InApp'] = $this->InApp;
        if (isset($this->Source)) $o['Source'] = $this->Source;
        if (isset($this->IsLate)) $o['IsLate'] = $this->IsLate;
        if (isset($this->CountsAsProof)) $o['CountsAsProof'] = $this->CountsAsProof;
        if (isset($this->MarkCount)) $o['MarkCount'] = $this->MarkCount;
        if (isset($this->IssueOpen)) $o['IssueOpen'] = $this->IssueOpen;
        if (isset($this->IssueClosedBy)) $o['IssueClosedBy'] = $this->IssueClosedBy;
        if (isset($this->FromGeneral)) $o['FromGeneral'] = $this->FromGeneral;
        if (isset($this->Url)) $o['Url'] = $this->Url;
        if (isset($this->MarkedUrl)) $o['MarkedUrl'] = $this->MarkedUrl;
        if (isset($this->TriageStatus)) $o['TriageStatus'] = $this->TriageStatus;
        if (isset($this->RouteTo)) $o['RouteTo'] = $this->RouteTo;
        if (isset($this->SuggestType)) $o['SuggestType'] = $this->SuggestType;
        if (isset($this->SuggestId)) $o['SuggestId'] = $this->SuggestId;
        if (isset($this->SuggestTitle)) $o['SuggestTitle'] = $this->SuggestTitle;
        if (isset($this->SuggestWhy)) $o['SuggestWhy'] = $this->SuggestWhy;
        if (isset($this->FiledType)) $o['FiledType'] = $this->FiledType;
        if (isset($this->FiledId)) $o['FiledId'] = $this->FiledId;
        if (isset($this->FiledTitle)) $o['FiledTitle'] = $this->FiledTitle;
        if (isset($this->ReplyText)) $o['ReplyText'] = $this->ReplyText;
        if (isset($this->TriagedBy)) $o['TriagedBy'] = $this->TriagedBy;
        if (isset($this->TriagedAtUtc)) $o['TriagedAtUtc'] = JsonConverters::to('DateTime', $this->TriagedAtUtc);
        if (isset($this->ExpiresAtUtc)) $o['ExpiresAtUtc'] = JsonConverters::to('DateTime', $this->ExpiresAtUtc);
        return empty($o) ? new class(){} : $o;
    }
}

class WorkPhotoListResponse implements JsonSerializable
{
    public function __construct(
        /** @var array<WorkPhotoRow>|null */
        public ?array $Photos=null,
        /** @var ResponseStatus|null */
        public ?ResponseStatus $ResponseStatus=null
    ) {
    }

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

class MyWorkPhotosRequest implements JsonSerializable
{
    public function __construct(
        /** @var int */
        public int $Take=0
    ) {
    }

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

PHP MyWorkPhotosRequest DTOs

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

HTTP + OTHER

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

GET /v1/worker/photos/mine HTTP/1.1 
Host: api.dev.dynamics.trendsic.com 
Accept: text/jsonl
HTTP/1.1 200 OK
Content-Type: text/jsonl
Content-Length: length

{"Photos":[{"WorkPhotoID":0,"ContactId":0,"TakerName":"String","RoleKey":"String","TargetType":"String","TargetId":"String","TargetRef":"String","TargetTitle":"String","Kind":"String","Caption":"String","CapturedAtUtc":"0001-01-01T00:00:00.0000000","Lat":0,"Lng":0,"AccuracyM":0,"DistanceM":0,"InApp":false,"Source":"String","IsLate":false,"CountsAsProof":false,"MarkCount":0,"IssueOpen":false,"IssueClosedBy":"String","FromGeneral":false,"Url":"String","MarkedUrl":"String","TriageStatus":"String","RouteTo":"String","SuggestType":"String","SuggestId":"String","SuggestTitle":"String","SuggestWhy":"String","FiledType":"String","FiledId":"String","FiledTitle":"String","ReplyText":"String","TriagedBy":"String","TriagedAtUtc":"0001-01-01T00:00:00.0000000","ExpiresAtUtc":"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"}}}