| 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 .jsv suffix or ?format=jsv
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: text/jsv
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length
{
ResponseStatus:
{
ErrorCode: String,
Message: String,
StackTrace: String,
Errors:
[
{
ErrorCode: String,
FieldName: String,
Message: String,
Meta:
{
String: String
}
}
],
Meta:
{
String: String
}
},
Pins:
[
{
SheetPinID: 0,
SheetID: 0,
EntityType: String,
EntityID: 0,
EntityUID: 00000000000000000000000000000000,
X: 0,
Y: 0,
Label: String,
CreatedBy: String,
CreatedAt: 0001-01-01,
EntityNo: String,
EntityTitle: String,
EntityStatus: String,
InspectionUID: 00000000000000000000000000000000,
SheetNumber: String,
SheetTitle: String,
PlanSetID: 0,
PlanSetUID: 00000000000000000000000000000000,
PlanSetName: String
}
]
}