Trendsic Platform Service

<back to all web services

DropboxDocumentGroupRequest

Requires Authentication
Requires any of the roles:Agent, Administrator
The following routes are available for this service:
GET,OPTIONS/v1/Dropbox/DocumentGroups/{ContactId}
GET,OPTIONS/v1/Dropbox/DocumentGroups/Agent/{AgentId}
<?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 Dropbox implements JsonSerializable
{
    public function __construct(
        /** @var int */
        public int $Id=0,
        /** @var string */
        public string $AttachmentId='',
        /** @var string|null */
        public ?string $FirstName=null,
        /** @var string|null */
        public ?string $LastName=null,
        /** @var string|null */
        public ?string $TableName=null,
        /** @var int */
        public int $RecordId=0,
        /** @var string|null */
        public ?string $Description=null,
        /** @var string|null */
        public ?string $DocumentType=null,
        /** @var string|null */
        public ?string $DocumentGroup=null,
        /** @var DateTime */
        public DateTime $DateAdded=new DateTime(),
        /** @var bool|null */
        public ?bool $Locked=null,
        /** @var float */
        public float $FileSizeInKB=0.0
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['Id'])) $this->Id = $o['Id'];
        if (isset($o['AttachmentId'])) $this->AttachmentId = $o['AttachmentId'];
        if (isset($o['FirstName'])) $this->FirstName = $o['FirstName'];
        if (isset($o['LastName'])) $this->LastName = $o['LastName'];
        if (isset($o['TableName'])) $this->TableName = $o['TableName'];
        if (isset($o['RecordId'])) $this->RecordId = $o['RecordId'];
        if (isset($o['Description'])) $this->Description = $o['Description'];
        if (isset($o['DocumentType'])) $this->DocumentType = $o['DocumentType'];
        if (isset($o['DocumentGroup'])) $this->DocumentGroup = $o['DocumentGroup'];
        if (isset($o['DateAdded'])) $this->DateAdded = JsonConverters::from('DateTime', $o['DateAdded']);
        if (isset($o['Locked'])) $this->Locked = $o['Locked'];
        if (isset($o['FileSizeInKB'])) $this->FileSizeInKB = $o['FileSizeInKB'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->Id)) $o['Id'] = $this->Id;
        if (isset($this->AttachmentId)) $o['AttachmentId'] = $this->AttachmentId;
        if (isset($this->FirstName)) $o['FirstName'] = $this->FirstName;
        if (isset($this->LastName)) $o['LastName'] = $this->LastName;
        if (isset($this->TableName)) $o['TableName'] = $this->TableName;
        if (isset($this->RecordId)) $o['RecordId'] = $this->RecordId;
        if (isset($this->Description)) $o['Description'] = $this->Description;
        if (isset($this->DocumentType)) $o['DocumentType'] = $this->DocumentType;
        if (isset($this->DocumentGroup)) $o['DocumentGroup'] = $this->DocumentGroup;
        if (isset($this->DateAdded)) $o['DateAdded'] = JsonConverters::to('DateTime', $this->DateAdded);
        if (isset($this->Locked)) $o['Locked'] = $this->Locked;
        if (isset($this->FileSizeInKB)) $o['FileSizeInKB'] = $this->FileSizeInKB;
        return empty($o) ? new class(){} : $o;
    }
}

class DropboxExtended extends Dropbox implements JsonSerializable
{
    /**
     * @param int $Id
     * @param string $AttachmentId
     * @param string|null $FirstName
     * @param string|null $LastName
     * @param string|null $TableName
     * @param int $RecordId
     * @param string|null $Description
     * @param string|null $DocumentType
     * @param string|null $DocumentGroup
     * @param DateTime $DateAdded
     * @param bool|null $Locked
     * @param float $FileSizeInKB
     */
    public function __construct(
        int $Id=0,
        string $AttachmentId='',
        ?string $FirstName=null,
        ?string $LastName=null,
        ?string $TableName=null,
        int $RecordId=0,
        ?string $Description=null,
        ?string $DocumentType=null,
        ?string $DocumentGroup=null,
        DateTime $DateAdded=new DateTime(),
        ?bool $Locked=null,
        float $FileSizeInKB=0.0,
        /** @var string|null */
        public ?string $AttachmentName=null,
        /** @var string|null */
        public ?string $AgentName=null,
        /** @var string|null */
        public ?string $MimeType=null,
        /** @var bool|null */
        public ?bool $IsAgent=null,
        /** @var bool|null */
        public ?bool $IsContact=null,
        /** @var bool|null */
        public ?bool $IsShared=null,
        /** @var bool|null */
        public ?bool $CanShare=null,
        /** @var string|null */
        public ?string $ShareList=null
    ) {
        parent::__construct($Id,$AttachmentId,$FirstName,$LastName,$TableName,$RecordId,$Description,$DocumentType,$DocumentGroup,$DateAdded,$Locked,$FileSizeInKB);
    }

    /** @throws Exception */
    public function fromMap($o): void {
        parent::fromMap($o);
        if (isset($o['AttachmentName'])) $this->AttachmentName = $o['AttachmentName'];
        if (isset($o['AgentName'])) $this->AgentName = $o['AgentName'];
        if (isset($o['MimeType'])) $this->MimeType = $o['MimeType'];
        if (isset($o['IsAgent'])) $this->IsAgent = $o['IsAgent'];
        if (isset($o['IsContact'])) $this->IsContact = $o['IsContact'];
        if (isset($o['IsShared'])) $this->IsShared = $o['IsShared'];
        if (isset($o['CanShare'])) $this->CanShare = $o['CanShare'];
        if (isset($o['ShareList'])) $this->ShareList = $o['ShareList'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = parent::jsonSerialize();
        if (isset($this->AttachmentName)) $o['AttachmentName'] = $this->AttachmentName;
        if (isset($this->AgentName)) $o['AgentName'] = $this->AgentName;
        if (isset($this->MimeType)) $o['MimeType'] = $this->MimeType;
        if (isset($this->IsAgent)) $o['IsAgent'] = $this->IsAgent;
        if (isset($this->IsContact)) $o['IsContact'] = $this->IsContact;
        if (isset($this->IsShared)) $o['IsShared'] = $this->IsShared;
        if (isset($this->CanShare)) $o['CanShare'] = $this->CanShare;
        if (isset($this->ShareList)) $o['ShareList'] = $this->ShareList;
        return empty($o) ? new class(){} : $o;
    }
}

class DropboxResponse implements JsonSerializable
{
    public function __construct(
        /** @var ResponseStatus|null */
        public ?ResponseStatus $ResponseStatus=null,
        /** @var array<DropboxExtended>|null */
        public ?array $Dropbox=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['ResponseStatus'])) $this->ResponseStatus = JsonConverters::from('ResponseStatus', $o['ResponseStatus']);
        if (isset($o['Dropbox'])) $this->Dropbox = JsonConverters::fromArray('DropboxExtended', $o['Dropbox']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->ResponseStatus)) $o['ResponseStatus'] = JsonConverters::to('ResponseStatus', $this->ResponseStatus);
        if (isset($this->Dropbox)) $o['Dropbox'] = JsonConverters::toArray('DropboxExtended', $this->Dropbox);
        return empty($o) ? new class(){} : $o;
    }
}

class DropboxDocumentGroupRequest implements JsonSerializable
{
    public function __construct(
        /** @var array<Dropbox>|null */
        public ?array $Dropbox=null,
        /** @var int */
        public int $ContactId=0,
        /** @var int */
        public int $AgentId=0
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['Dropbox'])) $this->Dropbox = JsonConverters::fromArray('Dropbox', $o['Dropbox']);
        if (isset($o['ContactId'])) $this->ContactId = $o['ContactId'];
        if (isset($o['AgentId'])) $this->AgentId = $o['AgentId'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->Dropbox)) $o['Dropbox'] = JsonConverters::toArray('Dropbox', $this->Dropbox);
        if (isset($this->ContactId)) $o['ContactId'] = $this->ContactId;
        if (isset($this->AgentId)) $o['AgentId'] = $this->AgentId;
        return empty($o) ? new class(){} : $o;
    }
}

PHP DropboxDocumentGroupRequest 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.

GET /v1/Dropbox/DocumentGroups/{ContactId} HTTP/1.1 
Host: api.dev.dynamics.trendsic.com 
Accept: application/xml
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

<DropboxResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/CRM.AgencyPlatform.API.Internal">
  <Dropbox>
    <DropboxExtended>
      <AttachmentId>00000000-0000-0000-0000-000000000000</AttachmentId>
      <DateAdded>0001-01-01T00:00:00</DateAdded>
      <Description>String</Description>
      <DocumentGroup>String</DocumentGroup>
      <DocumentType>String</DocumentType>
      <FileSizeInKB>0</FileSizeInKB>
      <FirstName>String</FirstName>
      <Id>0</Id>
      <LastName>String</LastName>
      <Locked>false</Locked>
      <RecordId>0</RecordId>
      <TableName>String</TableName>
      <AgentName>String</AgentName>
      <AttachmentName>String</AttachmentName>
      <CanShare>false</CanShare>
      <IsAgent>false</IsAgent>
      <IsContact>false</IsContact>
      <IsShared>false</IsShared>
      <MimeType>String</MimeType>
      <ShareList>String</ShareList>
    </DropboxExtended>
  </Dropbox>
  <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>
</DropboxResponse>