Trendsic Platform Service

<back to all web services

MarkupPageRequest

Requires Authentication
The following routes are available for this service:
GET,PUT,OPTIONS/v1/markup/{AttachmentId}/{VersionNo}/{PageIndex}
<?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 DocumentMarkupLayer implements JsonSerializable
{
    public function __construct(
        /** @var int */
        public int $DocumentMarkupID=0,
        /** @var string */
        public string $AttachmentId='',
        /** @var int */
        public int $VersionNo=0,
        /** @var int */
        public int $PageIndex=0,
        /** @var string|null */
        public ?string $AuthorUserId=null,
        /** @var string|null */
        public ?string $AuthorName=null,
        /** @var string|null */
        public ?string $LayerJson=null,
        /** @var int */
        public int $ShapeCount=0,
        /** @var bool|null */
        public ?bool $IsPublished=null,
        /** @var DateTime|null */
        public ?DateTime $CreatedAt=null,
        /** @var DateTime|null */
        public ?DateTime $UpdatedAt=null,
        /** @var bool|null */
        public ?bool $IsMine=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['DocumentMarkupID'])) $this->DocumentMarkupID = $o['DocumentMarkupID'];
        if (isset($o['AttachmentId'])) $this->AttachmentId = $o['AttachmentId'];
        if (isset($o['VersionNo'])) $this->VersionNo = $o['VersionNo'];
        if (isset($o['PageIndex'])) $this->PageIndex = $o['PageIndex'];
        if (isset($o['AuthorUserId'])) $this->AuthorUserId = $o['AuthorUserId'];
        if (isset($o['AuthorName'])) $this->AuthorName = $o['AuthorName'];
        if (isset($o['LayerJson'])) $this->LayerJson = $o['LayerJson'];
        if (isset($o['ShapeCount'])) $this->ShapeCount = $o['ShapeCount'];
        if (isset($o['IsPublished'])) $this->IsPublished = $o['IsPublished'];
        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['IsMine'])) $this->IsMine = $o['IsMine'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->DocumentMarkupID)) $o['DocumentMarkupID'] = $this->DocumentMarkupID;
        if (isset($this->AttachmentId)) $o['AttachmentId'] = $this->AttachmentId;
        if (isset($this->VersionNo)) $o['VersionNo'] = $this->VersionNo;
        if (isset($this->PageIndex)) $o['PageIndex'] = $this->PageIndex;
        if (isset($this->AuthorUserId)) $o['AuthorUserId'] = $this->AuthorUserId;
        if (isset($this->AuthorName)) $o['AuthorName'] = $this->AuthorName;
        if (isset($this->LayerJson)) $o['LayerJson'] = $this->LayerJson;
        if (isset($this->ShapeCount)) $o['ShapeCount'] = $this->ShapeCount;
        if (isset($this->IsPublished)) $o['IsPublished'] = $this->IsPublished;
        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->IsMine)) $o['IsMine'] = $this->IsMine;
        return empty($o) ? new class(){} : $o;
    }
}

class DocumentMarkupLink implements JsonSerializable
{
    public function __construct(
        /** @var int */
        public int $DocumentMarkupLinkID=0,
        /** @var string */
        public string $AttachmentId='',
        /** @var int */
        public int $VersionNo=0,
        /** @var int */
        public int $PageIndex=0,
        /** @var string|null */
        public ?string $ShapeId=null,
        /** @var string|null */
        public ?string $EntityType=null,
        /** @var int */
        public int $EntityID=0,
        /** @var string|null */
        public ?string $EntityNo=null,
        /** @var string|null */
        public ?string $CreatedBy=null,
        /** @var DateTime|null */
        public ?DateTime $CreatedAt=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['DocumentMarkupLinkID'])) $this->DocumentMarkupLinkID = $o['DocumentMarkupLinkID'];
        if (isset($o['AttachmentId'])) $this->AttachmentId = $o['AttachmentId'];
        if (isset($o['VersionNo'])) $this->VersionNo = $o['VersionNo'];
        if (isset($o['PageIndex'])) $this->PageIndex = $o['PageIndex'];
        if (isset($o['ShapeId'])) $this->ShapeId = $o['ShapeId'];
        if (isset($o['EntityType'])) $this->EntityType = $o['EntityType'];
        if (isset($o['EntityID'])) $this->EntityID = $o['EntityID'];
        if (isset($o['EntityNo'])) $this->EntityNo = $o['EntityNo'];
        if (isset($o['CreatedBy'])) $this->CreatedBy = $o['CreatedBy'];
        if (isset($o['CreatedAt'])) $this->CreatedAt = JsonConverters::from('DateTime', $o['CreatedAt']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->DocumentMarkupLinkID)) $o['DocumentMarkupLinkID'] = $this->DocumentMarkupLinkID;
        if (isset($this->AttachmentId)) $o['AttachmentId'] = $this->AttachmentId;
        if (isset($this->VersionNo)) $o['VersionNo'] = $this->VersionNo;
        if (isset($this->PageIndex)) $o['PageIndex'] = $this->PageIndex;
        if (isset($this->ShapeId)) $o['ShapeId'] = $this->ShapeId;
        if (isset($this->EntityType)) $o['EntityType'] = $this->EntityType;
        if (isset($this->EntityID)) $o['EntityID'] = $this->EntityID;
        if (isset($this->EntityNo)) $o['EntityNo'] = $this->EntityNo;
        if (isset($this->CreatedBy)) $o['CreatedBy'] = $this->CreatedBy;
        if (isset($this->CreatedAt)) $o['CreatedAt'] = JsonConverters::to('DateTime', $this->CreatedAt);
        return empty($o) ? new class(){} : $o;
    }
}

class MarkupPageResponse implements JsonSerializable
{
    public function __construct(
        /** @var ResponseStatus|null */
        public ?ResponseStatus $ResponseStatus=null,
        /** @var string */
        public string $AttachmentId='',
        /** @var int */
        public int $VersionNo=0,
        /** @var int */
        public int $PageIndex=0,
        /** @var array<DocumentMarkupLayer>|null */
        public ?array $Layers=null,
        /** @var array<DocumentMarkupLink>|null */
        public ?array $Links=null,
        /** @var DocumentMarkupLayer|null */
        public ?DocumentMarkupLayer $Mine=null,
        /** @var bool|null */
        public ?bool $CanCreatePunch=null,
        /** @var bool|null */
        public ?bool $CanCreateRfi=null,
        /** @var int|null */
        public ?int $ProjectID=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['VersionNo'])) $this->VersionNo = $o['VersionNo'];
        if (isset($o['PageIndex'])) $this->PageIndex = $o['PageIndex'];
        if (isset($o['Layers'])) $this->Layers = JsonConverters::fromArray('DocumentMarkupLayer', $o['Layers']);
        if (isset($o['Links'])) $this->Links = JsonConverters::fromArray('DocumentMarkupLink', $o['Links']);
        if (isset($o['Mine'])) $this->Mine = JsonConverters::from('DocumentMarkupLayer', $o['Mine']);
        if (isset($o['CanCreatePunch'])) $this->CanCreatePunch = $o['CanCreatePunch'];
        if (isset($o['CanCreateRfi'])) $this->CanCreateRfi = $o['CanCreateRfi'];
        if (isset($o['ProjectID'])) $this->ProjectID = $o['ProjectID'];
    }
    
    /** @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->VersionNo)) $o['VersionNo'] = $this->VersionNo;
        if (isset($this->PageIndex)) $o['PageIndex'] = $this->PageIndex;
        if (isset($this->Layers)) $o['Layers'] = JsonConverters::toArray('DocumentMarkupLayer', $this->Layers);
        if (isset($this->Links)) $o['Links'] = JsonConverters::toArray('DocumentMarkupLink', $this->Links);
        if (isset($this->Mine)) $o['Mine'] = JsonConverters::to('DocumentMarkupLayer', $this->Mine);
        if (isset($this->CanCreatePunch)) $o['CanCreatePunch'] = $this->CanCreatePunch;
        if (isset($this->CanCreateRfi)) $o['CanCreateRfi'] = $this->CanCreateRfi;
        if (isset($this->ProjectID)) $o['ProjectID'] = $this->ProjectID;
        return empty($o) ? new class(){} : $o;
    }
}

class MarkupPageRequest implements JsonSerializable
{
    public function __construct(
        /** @var string */
        public string $AttachmentId='',
        /** @var int */
        public int $VersionNo=0,
        /** @var int */
        public int $PageIndex=0,
        /** @var string|null */
        public ?string $LayerJson=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['AttachmentId'])) $this->AttachmentId = $o['AttachmentId'];
        if (isset($o['VersionNo'])) $this->VersionNo = $o['VersionNo'];
        if (isset($o['PageIndex'])) $this->PageIndex = $o['PageIndex'];
        if (isset($o['LayerJson'])) $this->LayerJson = $o['LayerJson'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->AttachmentId)) $o['AttachmentId'] = $this->AttachmentId;
        if (isset($this->VersionNo)) $o['VersionNo'] = $this->VersionNo;
        if (isset($this->PageIndex)) $o['PageIndex'] = $this->PageIndex;
        if (isset($this->LayerJson)) $o['LayerJson'] = $this->LayerJson;
        return empty($o) ? new class(){} : $o;
    }
}

PHP MarkupPageRequest DTOs

To override the Content-type in your clients, use the HTTP Accept Header, append the .other suffix or ?format=other

HTTP + OTHER

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

PUT /v1/markup/{AttachmentId}/{VersionNo}/{PageIndex} HTTP/1.1 
Host: api.dev.dynamics.trendsic.com 
Accept: text/jsonl
Content-Type: text/jsonl
Content-Length: length

{"AttachmentId":"00000000000000000000000000000000","VersionNo":0,"PageIndex":0,"LayerJson":"String"}
HTTP/1.1 200 OK
Content-Type: text/jsonl
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","VersionNo":0,"PageIndex":0,"Layers":[{"DocumentMarkupID":0,"AttachmentId":"00000000000000000000000000000000","VersionNo":0,"PageIndex":0,"AuthorUserId":"String","AuthorName":"String","LayerJson":"String","ShapeCount":0,"IsPublished":false,"CreatedAt":"0001-01-01T00:00:00.0000000","UpdatedAt":"0001-01-01T00:00:00.0000000","IsMine":false}],"Links":[{"DocumentMarkupLinkID":0,"AttachmentId":"00000000000000000000000000000000","VersionNo":0,"PageIndex":0,"ShapeId":"String","EntityType":"String","EntityID":0,"EntityNo":"String","CreatedBy":"String","CreatedAt":"0001-01-01T00:00:00.0000000"}],"Mine":{"DocumentMarkupID":0,"AttachmentId":"00000000000000000000000000000000","VersionNo":0,"PageIndex":0,"AuthorUserId":"String","AuthorName":"String","LayerJson":"String","ShapeCount":0,"IsPublished":false,"CreatedAt":"0001-01-01T00:00:00.0000000","UpdatedAt":"0001-01-01T00:00:00.0000000","IsMine":false},"CanCreatePunch":false,"CanCreateRfi":false,"ProjectID":0}