| Requires any of the roles: | Agent, Administrator |
| POST,OPTIONS | /v1/cad/{AttachmentId}/render |
|---|
<?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 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 CadRenderResponse implements JsonSerializable
{
public function __construct(
/** @var ResponseStatus|null */
public ?ResponseStatus $ResponseStatus=null,
/** @var CadDerivative|null */
public ?CadDerivative $Derivative=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['ResponseStatus'])) $this->ResponseStatus = JsonConverters::from('ResponseStatus', $o['ResponseStatus']);
if (isset($o['Derivative'])) $this->Derivative = JsonConverters::from('CadDerivative', $o['Derivative']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->ResponseStatus)) $o['ResponseStatus'] = JsonConverters::to('ResponseStatus', $this->ResponseStatus);
if (isset($this->Derivative)) $o['Derivative'] = JsonConverters::to('CadDerivative', $this->Derivative);
return empty($o) ? new class(){} : $o;
}
}
class CadRenderRequest 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 .xml suffix or ?format=xml
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /v1/cad/{AttachmentId}/render HTTP/1.1
Host: api.dev.dynamics.trendsic.com
Accept: application/xml
Content-Type: application/xml
Content-Length: length
<CadRenderRequest xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/CRM.AgencyPlatform.API.Internal">
<AttachmentId>00000000-0000-0000-0000-000000000000</AttachmentId>
<VersionNo>0</VersionNo>
</CadRenderRequest>
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length
<CadRenderResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/CRM.AgencyPlatform.API.Internal">
<Derivative>
<AgeSeconds>0</AgeSeconds>
<AttachmentId>00000000-0000-0000-0000-000000000000</AttachmentId>
<CadDerivativeID>0</CadDerivativeID>
<ErrorText>String</ErrorText>
<FinishedAt>0001-01-01T00:00:00</FinishedAt>
<Has2d>false</Has2d>
<Has3d>false</Has3d>
<HasPdf>false</HasPdf>
<ObjectKey>String</ObjectKey>
<PdfAttachmentId>00000000-0000-0000-0000-000000000000</PdfAttachmentId>
<Progress>0</Progress>
<RequestedAt>0001-01-01T00:00:00</RequestedAt>
<RequestedBy>String</RequestedBy>
<StageLabel>String</StageLabel>
<Status>String</Status>
<ThumbKey>String</ThumbKey>
<ThumbUrl>String</ThumbUrl>
<Urn>String</Urn>
<VersionNo>0</VersionNo>
</Derivative>
<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>
</CadRenderResponse>