| GET,OPTIONS | /v1/pins/{EntityType}/{EntityID} | ||
|---|---|---|---|
| GET,OPTIONS | /v1/pins/{EntityType} |
<?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 SheetPin implements JsonSerializable
{
public function __construct(
/** @var int */
public int $SheetPinID=0,
/** @var int */
public int $SheetID=0,
/** @var string|null */
public ?string $EntityType=null,
/** @var int|null */
public ?int $EntityID=null,
/** @var string|null */
public ?string $EntityUID=null,
/** @var float */
public float $X=0.0,
/** @var float */
public float $Y=0.0,
/** @var string|null */
public ?string $Label=null,
/** @var string|null */
public ?string $CreatedBy=null,
/** @var DateTime|null */
public ?DateTime $CreatedAt=null,
/** @var string|null */
public ?string $EntityNo=null,
/** @var string|null */
public ?string $EntityTitle=null,
/** @var string|null */
public ?string $EntityStatus=null,
/** @var string|null */
public ?string $InspectionUID=null,
/** @var string|null */
public ?string $SheetNumber=null,
/** @var string|null */
public ?string $SheetTitle=null,
/** @var int|null */
public ?int $PlanSetID=null,
/** @var string|null */
public ?string $PlanSetUID=null,
/** @var string|null */
public ?string $PlanSetName=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['SheetPinID'])) $this->SheetPinID = $o['SheetPinID'];
if (isset($o['SheetID'])) $this->SheetID = $o['SheetID'];
if (isset($o['EntityType'])) $this->EntityType = $o['EntityType'];
if (isset($o['EntityID'])) $this->EntityID = $o['EntityID'];
if (isset($o['EntityUID'])) $this->EntityUID = $o['EntityUID'];
if (isset($o['X'])) $this->X = $o['X'];
if (isset($o['Y'])) $this->Y = $o['Y'];
if (isset($o['Label'])) $this->Label = $o['Label'];
if (isset($o['CreatedBy'])) $this->CreatedBy = $o['CreatedBy'];
if (isset($o['CreatedAt'])) $this->CreatedAt = JsonConverters::from('DateTime', $o['CreatedAt']);
if (isset($o['EntityNo'])) $this->EntityNo = $o['EntityNo'];
if (isset($o['EntityTitle'])) $this->EntityTitle = $o['EntityTitle'];
if (isset($o['EntityStatus'])) $this->EntityStatus = $o['EntityStatus'];
if (isset($o['InspectionUID'])) $this->InspectionUID = $o['InspectionUID'];
if (isset($o['SheetNumber'])) $this->SheetNumber = $o['SheetNumber'];
if (isset($o['SheetTitle'])) $this->SheetTitle = $o['SheetTitle'];
if (isset($o['PlanSetID'])) $this->PlanSetID = $o['PlanSetID'];
if (isset($o['PlanSetUID'])) $this->PlanSetUID = $o['PlanSetUID'];
if (isset($o['PlanSetName'])) $this->PlanSetName = $o['PlanSetName'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->SheetPinID)) $o['SheetPinID'] = $this->SheetPinID;
if (isset($this->SheetID)) $o['SheetID'] = $this->SheetID;
if (isset($this->EntityType)) $o['EntityType'] = $this->EntityType;
if (isset($this->EntityID)) $o['EntityID'] = $this->EntityID;
if (isset($this->EntityUID)) $o['EntityUID'] = $this->EntityUID;
if (isset($this->X)) $o['X'] = $this->X;
if (isset($this->Y)) $o['Y'] = $this->Y;
if (isset($this->Label)) $o['Label'] = $this->Label;
if (isset($this->CreatedBy)) $o['CreatedBy'] = $this->CreatedBy;
if (isset($this->CreatedAt)) $o['CreatedAt'] = JsonConverters::to('DateTime', $this->CreatedAt);
if (isset($this->EntityNo)) $o['EntityNo'] = $this->EntityNo;
if (isset($this->EntityTitle)) $o['EntityTitle'] = $this->EntityTitle;
if (isset($this->EntityStatus)) $o['EntityStatus'] = $this->EntityStatus;
if (isset($this->InspectionUID)) $o['InspectionUID'] = $this->InspectionUID;
if (isset($this->SheetNumber)) $o['SheetNumber'] = $this->SheetNumber;
if (isset($this->SheetTitle)) $o['SheetTitle'] = $this->SheetTitle;
if (isset($this->PlanSetID)) $o['PlanSetID'] = $this->PlanSetID;
if (isset($this->PlanSetUID)) $o['PlanSetUID'] = $this->PlanSetUID;
if (isset($this->PlanSetName)) $o['PlanSetName'] = $this->PlanSetName;
return empty($o) ? new class(){} : $o;
}
}
class SheetPinListResponse implements JsonSerializable
{
public function __construct(
/** @var ResponseStatus|null */
public ?ResponseStatus $ResponseStatus=null,
/** @var array<SheetPin>|null */
public ?array $Pins=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['ResponseStatus'])) $this->ResponseStatus = JsonConverters::from('ResponseStatus', $o['ResponseStatus']);
if (isset($o['Pins'])) $this->Pins = JsonConverters::fromArray('SheetPin', $o['Pins']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->ResponseStatus)) $o['ResponseStatus'] = JsonConverters::to('ResponseStatus', $this->ResponseStatus);
if (isset($this->Pins)) $o['Pins'] = JsonConverters::toArray('SheetPin', $this->Pins);
return empty($o) ? new class(){} : $o;
}
}
class PinsForEntityRequest implements JsonSerializable
{
public function __construct(
/** @var string|null */
public ?string $EntityType=null,
/** @var int|null */
public ?int $EntityID=null,
/** @var string|null */
public ?string $EntityUID=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['EntityType'])) $this->EntityType = $o['EntityType'];
if (isset($o['EntityID'])) $this->EntityID = $o['EntityID'];
if (isset($o['EntityUID'])) $this->EntityUID = $o['EntityUID'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->EntityType)) $o['EntityType'] = $this->EntityType;
if (isset($this->EntityID)) $o['EntityID'] = $this->EntityID;
if (isset($this->EntityUID)) $o['EntityUID'] = $this->EntityUID;
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/pins/{EntityType}/{EntityID} HTTP/1.1
Host: api.dev.dynamics.trendsic.com
Accept: application/xml
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length
<SheetPinListResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/CRM.AgencyPlatform.API.Internal">
<Pins>
<SheetPin>
<CreatedAt>0001-01-01T00:00:00</CreatedAt>
<CreatedBy>String</CreatedBy>
<EntityID>0</EntityID>
<EntityNo>String</EntityNo>
<EntityStatus>String</EntityStatus>
<EntityTitle>String</EntityTitle>
<EntityType>String</EntityType>
<EntityUID>00000000-0000-0000-0000-000000000000</EntityUID>
<InspectionUID>00000000-0000-0000-0000-000000000000</InspectionUID>
<Label>String</Label>
<PlanSetID>0</PlanSetID>
<PlanSetName>String</PlanSetName>
<PlanSetUID>00000000-0000-0000-0000-000000000000</PlanSetUID>
<SheetID>0</SheetID>
<SheetNumber>String</SheetNumber>
<SheetPinID>0</SheetPinID>
<SheetTitle>String</SheetTitle>
<X>0</X>
<Y>0</Y>
</SheetPin>
</Pins>
<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>
</SheetPinListResponse>