| 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;
}
}
To override the Content-type in your clients, use the HTTP Accept Header, append the .xml suffix or ?format=xml
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: application/xml
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length
<WorkPhotoListResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/CRM.AgencyPlatform.API.Internal">
<Photos>
<WorkPhotoRow>
<AccuracyM>0</AccuracyM>
<Caption>String</Caption>
<CapturedAtUtc>0001-01-01T00:00:00</CapturedAtUtc>
<ContactId>0</ContactId>
<CountsAsProof>false</CountsAsProof>
<DistanceM>0</DistanceM>
<ExpiresAtUtc>0001-01-01T00:00:00</ExpiresAtUtc>
<FiledId>String</FiledId>
<FiledTitle>String</FiledTitle>
<FiledType>String</FiledType>
<FromGeneral>false</FromGeneral>
<InApp>false</InApp>
<IsLate>false</IsLate>
<IssueClosedBy>String</IssueClosedBy>
<IssueOpen>false</IssueOpen>
<Kind>String</Kind>
<Lat>0</Lat>
<Lng>0</Lng>
<MarkCount>0</MarkCount>
<MarkedUrl>String</MarkedUrl>
<ReplyText>String</ReplyText>
<RoleKey>String</RoleKey>
<RouteTo>String</RouteTo>
<Source>String</Source>
<SuggestId>String</SuggestId>
<SuggestTitle>String</SuggestTitle>
<SuggestType>String</SuggestType>
<SuggestWhy>String</SuggestWhy>
<TakerName>String</TakerName>
<TargetId>String</TargetId>
<TargetRef>String</TargetRef>
<TargetTitle>String</TargetTitle>
<TargetType>String</TargetType>
<TriageStatus>String</TriageStatus>
<TriagedAtUtc>0001-01-01T00:00:00</TriagedAtUtc>
<TriagedBy>String</TriagedBy>
<Url>String</Url>
<WorkPhotoID>0</WorkPhotoID>
</WorkPhotoRow>
</Photos>
<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>
</WorkPhotoListResponse>