| Requires any of the roles: | Worker, Agent, Administrator |
| GET,OPTIONS | /v1/cad/{AttachmentId}/{VersionNo} | ||
|---|---|---|---|
| GET,OPTIONS | /v1/cad/{AttachmentId} |
<?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 CadLayout implements JsonSerializable
{
public function __construct(
/** @var string|null */
public ?string $Name=null,
/** @var bool|null */
public ?bool $IsPaperSpace=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['Name'])) $this->Name = $o['Name'];
if (isset($o['IsPaperSpace'])) $this->IsPaperSpace = $o['IsPaperSpace'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->Name)) $o['Name'] = $this->Name;
if (isset($this->IsPaperSpace)) $o['IsPaperSpace'] = $this->IsPaperSpace;
return empty($o) ? new class(){} : $o;
}
}
class CadFileInfo implements JsonSerializable
{
public function __construct(
/** @var int */
public int $CadFileInfoID=0,
/** @var string */
public string $AttachmentId='',
/** @var int */
public int $VersionNo=0,
/** @var string|null */
public ?string $FileName=null,
/** @var string|null */
public ?string $Format=null,
/** @var string|null */
public ?string $FormatLabel=null,
/** @var string|null */
public ?string $CadVersion=null,
/** @var string|null */
public ?string $CadVersionCode=null,
/** @var string|null */
public ?string $Units=null,
/** @var string|null */
public ?string $DrawingNumber=null,
/** @var string|null */
public ?string $Title=null,
/** @var int */
public int $LayoutCount=0,
/** @var array<CadLayout>|null */
public ?array $Layouts=null,
/** @var int */
public int $LayerCount=0,
/** @var int */
public int $EntityCount=0,
/** @var int */
public int $TextChars=0,
/** @var string|null */
public ?string $ExtractedText=null,
/** @var string|null */
public ?string $Reader=null,
/** @var string|null */
public ?string $Status=null,
/** @var string|null */
public ?string $ErrorText=null,
/** @var DateTime|null */
public ?DateTime $CreatedAt=null,
/** @var DateTime|null */
public ?DateTime $UpdatedAt=null,
/** @var int */
public int $AgeSeconds=0
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['CadFileInfoID'])) $this->CadFileInfoID = $o['CadFileInfoID'];
if (isset($o['AttachmentId'])) $this->AttachmentId = $o['AttachmentId'];
if (isset($o['VersionNo'])) $this->VersionNo = $o['VersionNo'];
if (isset($o['FileName'])) $this->FileName = $o['FileName'];
if (isset($o['Format'])) $this->Format = $o['Format'];
if (isset($o['FormatLabel'])) $this->FormatLabel = $o['FormatLabel'];
if (isset($o['CadVersion'])) $this->CadVersion = $o['CadVersion'];
if (isset($o['CadVersionCode'])) $this->CadVersionCode = $o['CadVersionCode'];
if (isset($o['Units'])) $this->Units = $o['Units'];
if (isset($o['DrawingNumber'])) $this->DrawingNumber = $o['DrawingNumber'];
if (isset($o['Title'])) $this->Title = $o['Title'];
if (isset($o['LayoutCount'])) $this->LayoutCount = $o['LayoutCount'];
if (isset($o['Layouts'])) $this->Layouts = JsonConverters::fromArray('CadLayout', $o['Layouts']);
if (isset($o['LayerCount'])) $this->LayerCount = $o['LayerCount'];
if (isset($o['EntityCount'])) $this->EntityCount = $o['EntityCount'];
if (isset($o['TextChars'])) $this->TextChars = $o['TextChars'];
if (isset($o['ExtractedText'])) $this->ExtractedText = $o['ExtractedText'];
if (isset($o['Reader'])) $this->Reader = $o['Reader'];
if (isset($o['Status'])) $this->Status = $o['Status'];
if (isset($o['ErrorText'])) $this->ErrorText = $o['ErrorText'];
if (isset($o['CreatedAt'])) $this->CreatedAt = JsonConverters::from('DateTime', $o['CreatedAt']);
if (isset($o['UpdatedAt'])) $this->UpdatedAt = JsonConverters::from('DateTime', $o['UpdatedAt']);
if (isset($o['AgeSeconds'])) $this->AgeSeconds = $o['AgeSeconds'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->CadFileInfoID)) $o['CadFileInfoID'] = $this->CadFileInfoID;
if (isset($this->AttachmentId)) $o['AttachmentId'] = $this->AttachmentId;
if (isset($this->VersionNo)) $o['VersionNo'] = $this->VersionNo;
if (isset($this->FileName)) $o['FileName'] = $this->FileName;
if (isset($this->Format)) $o['Format'] = $this->Format;
if (isset($this->FormatLabel)) $o['FormatLabel'] = $this->FormatLabel;
if (isset($this->CadVersion)) $o['CadVersion'] = $this->CadVersion;
if (isset($this->CadVersionCode)) $o['CadVersionCode'] = $this->CadVersionCode;
if (isset($this->Units)) $o['Units'] = $this->Units;
if (isset($this->DrawingNumber)) $o['DrawingNumber'] = $this->DrawingNumber;
if (isset($this->Title)) $o['Title'] = $this->Title;
if (isset($this->LayoutCount)) $o['LayoutCount'] = $this->LayoutCount;
if (isset($this->Layouts)) $o['Layouts'] = JsonConverters::toArray('CadLayout', $this->Layouts);
if (isset($this->LayerCount)) $o['LayerCount'] = $this->LayerCount;
if (isset($this->EntityCount)) $o['EntityCount'] = $this->EntityCount;
if (isset($this->TextChars)) $o['TextChars'] = $this->TextChars;
if (isset($this->ExtractedText)) $o['ExtractedText'] = $this->ExtractedText;
if (isset($this->Reader)) $o['Reader'] = $this->Reader;
if (isset($this->Status)) $o['Status'] = $this->Status;
if (isset($this->ErrorText)) $o['ErrorText'] = $this->ErrorText;
if (isset($this->CreatedAt)) $o['CreatedAt'] = JsonConverters::to('DateTime', $this->CreatedAt);
if (isset($this->UpdatedAt)) $o['UpdatedAt'] = JsonConverters::to('DateTime', $this->UpdatedAt);
if (isset($this->AgeSeconds)) $o['AgeSeconds'] = $this->AgeSeconds;
return empty($o) ? new class(){} : $o;
}
}
class CadDerivative implements JsonSerializable
{
public function __construct(
/** @var int */
public int $CadDerivativeID=0,
/** @var string */
public string $AttachmentId='',
/** @var int */
public int $VersionNo=0,
/** @var string|null */
public ?string $Urn=null,
/** @var string|null */
public ?string $ObjectKey=null,
/** @var string|null */
public ?string $Status=null,
/** @var int */
public int $Progress=0,
/** @var string|null */
public ?string $StageLabel=null,
/** @var bool|null */
public ?bool $Has2d=null,
/** @var bool|null */
public ?bool $Has3d=null,
/** @var bool|null */
public ?bool $HasPdf=null,
/** @var string|null */
public ?string $ThumbKey=null,
/** @var string|null */
public ?string $ThumbUrl=null,
/** @var string|null */
public ?string $PdfAttachmentId=null,
/** @var string|null */
public ?string $ErrorText=null,
/** @var string|null */
public ?string $RequestedBy=null,
/** @var DateTime|null */
public ?DateTime $RequestedAt=null,
/** @var DateTime|null */
public ?DateTime $FinishedAt=null,
/** @var int */
public int $AgeSeconds=0
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['CadDerivativeID'])) $this->CadDerivativeID = $o['CadDerivativeID'];
if (isset($o['AttachmentId'])) $this->AttachmentId = $o['AttachmentId'];
if (isset($o['VersionNo'])) $this->VersionNo = $o['VersionNo'];
if (isset($o['Urn'])) $this->Urn = $o['Urn'];
if (isset($o['ObjectKey'])) $this->ObjectKey = $o['ObjectKey'];
if (isset($o['Status'])) $this->Status = $o['Status'];
if (isset($o['Progress'])) $this->Progress = $o['Progress'];
if (isset($o['StageLabel'])) $this->StageLabel = $o['StageLabel'];
if (isset($o['Has2d'])) $this->Has2d = $o['Has2d'];
if (isset($o['Has3d'])) $this->Has3d = $o['Has3d'];
if (isset($o['HasPdf'])) $this->HasPdf = $o['HasPdf'];
if (isset($o['ThumbKey'])) $this->ThumbKey = $o['ThumbKey'];
if (isset($o['ThumbUrl'])) $this->ThumbUrl = $o['ThumbUrl'];
if (isset($o['PdfAttachmentId'])) $this->PdfAttachmentId = $o['PdfAttachmentId'];
if (isset($o['ErrorText'])) $this->ErrorText = $o['ErrorText'];
if (isset($o['RequestedBy'])) $this->RequestedBy = $o['RequestedBy'];
if (isset($o['RequestedAt'])) $this->RequestedAt = JsonConverters::from('DateTime', $o['RequestedAt']);
if (isset($o['FinishedAt'])) $this->FinishedAt = JsonConverters::from('DateTime', $o['FinishedAt']);
if (isset($o['AgeSeconds'])) $this->AgeSeconds = $o['AgeSeconds'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->CadDerivativeID)) $o['CadDerivativeID'] = $this->CadDerivativeID;
if (isset($this->AttachmentId)) $o['AttachmentId'] = $this->AttachmentId;
if (isset($this->VersionNo)) $o['VersionNo'] = $this->VersionNo;
if (isset($this->Urn)) $o['Urn'] = $this->Urn;
if (isset($this->ObjectKey)) $o['ObjectKey'] = $this->ObjectKey;
if (isset($this->Status)) $o['Status'] = $this->Status;
if (isset($this->Progress)) $o['Progress'] = $this->Progress;
if (isset($this->StageLabel)) $o['StageLabel'] = $this->StageLabel;
if (isset($this->Has2d)) $o['Has2d'] = $this->Has2d;
if (isset($this->Has3d)) $o['Has3d'] = $this->Has3d;
if (isset($this->HasPdf)) $o['HasPdf'] = $this->HasPdf;
if (isset($this->ThumbKey)) $o['ThumbKey'] = $this->ThumbKey;
if (isset($this->ThumbUrl)) $o['ThumbUrl'] = $this->ThumbUrl;
if (isset($this->PdfAttachmentId)) $o['PdfAttachmentId'] = $this->PdfAttachmentId;
if (isset($this->ErrorText)) $o['ErrorText'] = $this->ErrorText;
if (isset($this->RequestedBy)) $o['RequestedBy'] = $this->RequestedBy;
if (isset($this->RequestedAt)) $o['RequestedAt'] = JsonConverters::to('DateTime', $this->RequestedAt);
if (isset($this->FinishedAt)) $o['FinishedAt'] = JsonConverters::to('DateTime', $this->FinishedAt);
if (isset($this->AgeSeconds)) $o['AgeSeconds'] = $this->AgeSeconds;
return empty($o) ? new class(){} : $o;
}
}
class CadCompanion implements JsonSerializable
{
public function __construct(
/** @var string */
public string $AttachmentId='',
/** @var string|null */
public ?string $AttachmentName=null,
/** @var DateTime|null */
public ?DateTime $CreatedDate=null,
/** @var float|null */
public ?float $FileSizeInKB=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['AttachmentId'])) $this->AttachmentId = $o['AttachmentId'];
if (isset($o['AttachmentName'])) $this->AttachmentName = $o['AttachmentName'];
if (isset($o['CreatedDate'])) $this->CreatedDate = JsonConverters::from('DateTime', $o['CreatedDate']);
if (isset($o['FileSizeInKB'])) $this->FileSizeInKB = $o['FileSizeInKB'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->AttachmentId)) $o['AttachmentId'] = $this->AttachmentId;
if (isset($this->AttachmentName)) $o['AttachmentName'] = $this->AttachmentName;
if (isset($this->CreatedDate)) $o['CreatedDate'] = JsonConverters::to('DateTime', $this->CreatedDate);
if (isset($this->FileSizeInKB)) $o['FileSizeInKB'] = $this->FileSizeInKB;
return empty($o) ? new class(){} : $o;
}
}
class CadInfoResponse implements JsonSerializable
{
public function __construct(
/** @var ResponseStatus|null */
public ?ResponseStatus $ResponseStatus=null,
/** @var string */
public string $AttachmentId='',
/** @var string|null */
public ?string $FileName=null,
/** @var CadFileInfo|null */
public ?CadFileInfo $Info=null,
/** @var CadDerivative|null */
public ?CadDerivative $Derivative=null,
/** @var array<CadCompanion>|null */
public ?array $Companions=null,
/** @var bool|null */
public ?bool $ApsConnected=null,
/** @var bool|null */
public ?bool $CanRender=null,
/** @var string|null */
public ?string $ViewerScriptUrl=null,
/** @var string|null */
public ?string $ViewerStyleUrl=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['ResponseStatus'])) $this->ResponseStatus = JsonConverters::from('ResponseStatus', $o['ResponseStatus']);
if (isset($o['AttachmentId'])) $this->AttachmentId = $o['AttachmentId'];
if (isset($o['FileName'])) $this->FileName = $o['FileName'];
if (isset($o['Info'])) $this->Info = JsonConverters::from('CadFileInfo', $o['Info']);
if (isset($o['Derivative'])) $this->Derivative = JsonConverters::from('CadDerivative', $o['Derivative']);
if (isset($o['Companions'])) $this->Companions = JsonConverters::fromArray('CadCompanion', $o['Companions']);
if (isset($o['ApsConnected'])) $this->ApsConnected = $o['ApsConnected'];
if (isset($o['CanRender'])) $this->CanRender = $o['CanRender'];
if (isset($o['ViewerScriptUrl'])) $this->ViewerScriptUrl = $o['ViewerScriptUrl'];
if (isset($o['ViewerStyleUrl'])) $this->ViewerStyleUrl = $o['ViewerStyleUrl'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->ResponseStatus)) $o['ResponseStatus'] = JsonConverters::to('ResponseStatus', $this->ResponseStatus);
if (isset($this->AttachmentId)) $o['AttachmentId'] = $this->AttachmentId;
if (isset($this->FileName)) $o['FileName'] = $this->FileName;
if (isset($this->Info)) $o['Info'] = JsonConverters::to('CadFileInfo', $this->Info);
if (isset($this->Derivative)) $o['Derivative'] = JsonConverters::to('CadDerivative', $this->Derivative);
if (isset($this->Companions)) $o['Companions'] = JsonConverters::toArray('CadCompanion', $this->Companions);
if (isset($this->ApsConnected)) $o['ApsConnected'] = $this->ApsConnected;
if (isset($this->CanRender)) $o['CanRender'] = $this->CanRender;
if (isset($this->ViewerScriptUrl)) $o['ViewerScriptUrl'] = $this->ViewerScriptUrl;
if (isset($this->ViewerStyleUrl)) $o['ViewerStyleUrl'] = $this->ViewerStyleUrl;
return empty($o) ? new class(){} : $o;
}
}
class CadInfoRequest implements JsonSerializable
{
public function __construct(
/** @var string */
public string $AttachmentId='',
/** @var int|null */
public ?int $VersionNo=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['AttachmentId'])) $this->AttachmentId = $o['AttachmentId'];
if (isset($o['VersionNo'])) $this->VersionNo = $o['VersionNo'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->AttachmentId)) $o['AttachmentId'] = $this->AttachmentId;
if (isset($this->VersionNo)) $o['VersionNo'] = $this->VersionNo;
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/cad/{AttachmentId}/{VersionNo} 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
}
},
AttachmentId: 00000000000000000000000000000000,
FileName: String,
Info:
{
CadFileInfoID: 0,
AttachmentId: 00000000000000000000000000000000,
VersionNo: 0,
FileName: String,
Format: String,
FormatLabel: String,
CadVersion: String,
CadVersionCode: String,
Units: String,
DrawingNumber: String,
Title: String,
LayoutCount: 0,
Layouts:
[
{
Name: String,
IsPaperSpace: False
}
],
LayerCount: 0,
EntityCount: 0,
TextChars: 0,
ExtractedText: String,
Reader: String,
Status: String,
ErrorText: String,
CreatedAt: 0001-01-01,
UpdatedAt: 0001-01-01,
AgeSeconds: 0
},
Derivative:
{
CadDerivativeID: 0,
AttachmentId: 00000000000000000000000000000000,
VersionNo: 0,
Urn: String,
ObjectKey: String,
Status: String,
Progress: 0,
StageLabel: String,
Has2d: False,
Has3d: False,
HasPdf: False,
ThumbKey: String,
ThumbUrl: String,
PdfAttachmentId: 00000000000000000000000000000000,
ErrorText: String,
RequestedBy: String,
RequestedAt: 0001-01-01,
FinishedAt: 0001-01-01,
AgeSeconds: 0
},
Companions:
[
{
AttachmentId: 00000000000000000000000000000000,
AttachmentName: String,
CreatedDate: 0001-01-01,
FileSizeInKB: 0
}
],
ApsConnected: False,
CanRender: False,
ViewerScriptUrl: String,
ViewerStyleUrl: String
}