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 .xml suffix or ?format=xml

HTTP + XML

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: application/xml
Content-Type: application/xml
Content-Length: length

<MarkupPageRequest 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>
  <LayerJson>String</LayerJson>
  <PageIndex>0</PageIndex>
  <VersionNo>0</VersionNo>
</MarkupPageRequest>
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

<MarkupPageResponse 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>
  <CanCreatePunch>false</CanCreatePunch>
  <CanCreateRfi>false</CanCreateRfi>
  <Layers>
    <DocumentMarkupLayer>
      <AttachmentId>00000000-0000-0000-0000-000000000000</AttachmentId>
      <AuthorName>String</AuthorName>
      <AuthorUserId>String</AuthorUserId>
      <CreatedAt>0001-01-01T00:00:00</CreatedAt>
      <DocumentMarkupID>0</DocumentMarkupID>
      <IsMine>false</IsMine>
      <IsPublished>false</IsPublished>
      <LayerJson>String</LayerJson>
      <PageIndex>0</PageIndex>
      <ShapeCount>0</ShapeCount>
      <UpdatedAt>0001-01-01T00:00:00</UpdatedAt>
      <VersionNo>0</VersionNo>
    </DocumentMarkupLayer>
  </Layers>
  <Links>
    <DocumentMarkupLink>
      <AttachmentId>00000000-0000-0000-0000-000000000000</AttachmentId>
      <CreatedAt>0001-01-01T00:00:00</CreatedAt>
      <CreatedBy>String</CreatedBy>
      <DocumentMarkupLinkID>0</DocumentMarkupLinkID>
      <EntityID>0</EntityID>
      <EntityNo>String</EntityNo>
      <EntityType>String</EntityType>
      <PageIndex>0</PageIndex>
      <ShapeId>String</ShapeId>
      <VersionNo>0</VersionNo>
    </DocumentMarkupLink>
  </Links>
  <Mine>
    <AttachmentId>00000000-0000-0000-0000-000000000000</AttachmentId>
    <AuthorName>String</AuthorName>
    <AuthorUserId>String</AuthorUserId>
    <CreatedAt>0001-01-01T00:00:00</CreatedAt>
    <DocumentMarkupID>0</DocumentMarkupID>
    <IsMine>false</IsMine>
    <IsPublished>false</IsPublished>
    <LayerJson>String</LayerJson>
    <PageIndex>0</PageIndex>
    <ShapeCount>0</ShapeCount>
    <UpdatedAt>0001-01-01T00:00:00</UpdatedAt>
    <VersionNo>0</VersionNo>
  </Mine>
  <PageIndex>0</PageIndex>
  <ProjectID>0</ProjectID>
  <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>
  <VersionNo>0</VersionNo>
</MarkupPageResponse>