Trendsic Platform Service

<back to all web services

DropboxRequest

Requires Authentication
Requires any of the roles:Worker, Agent, Administrator, Worker, Agent, Administrator
The following routes are available for this service:
GET,OPTIONS/v1/Dropbox/{AgentName}
POST,OPTIONS/v1/Dropbox/{AttachmentId}
GET,POST,OPTIONS/v1/Dropbox
GET,OPTIONS/v1/Dropbox/ByAgentID/{ID}
GET,OPTIONS/v1/Dropbox/ByAgentID/{ID}/{LoggedInAgent}/{PageName}
GET,OPTIONS/v1/Dropbox/ByAgentID/{ID}/{PageName}
<?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 DropboxRequest implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $Attachment=null,
        /** @var array<Dropbox>|null */
        public ?array $Dropbox=null,
        /** @var string|null */
        public ?string $AttachmentId=null,
        /** @var int */
        public int $ID=0,
        /** @var int */
        public int $LoggedInAgent=0,
        /** @var string|null */
        public ?string $AgentName=null,
        /** @var string|null */
        public ?string $PageName=null,
        /** @var string|null */
        public ?string $TableName=null,
        /** @var string|null */
        public ?string $FieldName=null,
        /** @var array<int>|null */
        public ?array $RecordIds=null,
        /** @var bool|null */
        public ?bool $IsNewApplication=null,
        /** @var bool|null */
        public ?bool $IsFactFillerPro=null,
        /** @var bool|null */
        public ?bool $AgentId=null,
        /** @var string|null */
        public ?string $AgentEmail=null,
        /** @var string|null */
        public ?string $FullNameAttachee=null,
        /** @var bool|null */
        public ?bool $IsFactFinder=null,
        /** @var int */
        public int $SharedId=0,
        /** @var int */
        public int $Sharer=0,
        /** @var bool|null */
        public ?bool $IsSecurities=null,
        /** @var bool|null */
        public ?bool $Locked=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['Attachment'])) $this->Attachment = $o['Attachment'];
        if (isset($o['Dropbox'])) $this->Dropbox = JsonConverters::fromArray('Dropbox', $o['Dropbox']);
        if (isset($o['AttachmentId'])) $this->AttachmentId = $o['AttachmentId'];
        if (isset($o['ID'])) $this->ID = $o['ID'];
        if (isset($o['LoggedInAgent'])) $this->LoggedInAgent = $o['LoggedInAgent'];
        if (isset($o['AgentName'])) $this->AgentName = $o['AgentName'];
        if (isset($o['PageName'])) $this->PageName = $o['PageName'];
        if (isset($o['TableName'])) $this->TableName = $o['TableName'];
        if (isset($o['FieldName'])) $this->FieldName = $o['FieldName'];
        if (isset($o['RecordIds'])) $this->RecordIds = JsonConverters::fromArray('int', $o['RecordIds']);
        if (isset($o['IsNewApplication'])) $this->IsNewApplication = $o['IsNewApplication'];
        if (isset($o['IsFactFillerPro'])) $this->IsFactFillerPro = $o['IsFactFillerPro'];
        if (isset($o['AgentId'])) $this->AgentId = $o['AgentId'];
        if (isset($o['AgentEmail'])) $this->AgentEmail = $o['AgentEmail'];
        if (isset($o['FullNameAttachee'])) $this->FullNameAttachee = $o['FullNameAttachee'];
        if (isset($o['IsFactFinder'])) $this->IsFactFinder = $o['IsFactFinder'];
        if (isset($o['SharedId'])) $this->SharedId = $o['SharedId'];
        if (isset($o['Sharer'])) $this->Sharer = $o['Sharer'];
        if (isset($o['IsSecurities'])) $this->IsSecurities = $o['IsSecurities'];
        if (isset($o['Locked'])) $this->Locked = $o['Locked'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->Attachment)) $o['Attachment'] = $this->Attachment;
        if (isset($this->Dropbox)) $o['Dropbox'] = JsonConverters::toArray('Dropbox', $this->Dropbox);
        if (isset($this->AttachmentId)) $o['AttachmentId'] = $this->AttachmentId;
        if (isset($this->ID)) $o['ID'] = $this->ID;
        if (isset($this->LoggedInAgent)) $o['LoggedInAgent'] = $this->LoggedInAgent;
        if (isset($this->AgentName)) $o['AgentName'] = $this->AgentName;
        if (isset($this->PageName)) $o['PageName'] = $this->PageName;
        if (isset($this->TableName)) $o['TableName'] = $this->TableName;
        if (isset($this->FieldName)) $o['FieldName'] = $this->FieldName;
        if (isset($this->RecordIds)) $o['RecordIds'] = JsonConverters::toArray('int', $this->RecordIds);
        if (isset($this->IsNewApplication)) $o['IsNewApplication'] = $this->IsNewApplication;
        if (isset($this->IsFactFillerPro)) $o['IsFactFillerPro'] = $this->IsFactFillerPro;
        if (isset($this->AgentId)) $o['AgentId'] = $this->AgentId;
        if (isset($this->AgentEmail)) $o['AgentEmail'] = $this->AgentEmail;
        if (isset($this->FullNameAttachee)) $o['FullNameAttachee'] = $this->FullNameAttachee;
        if (isset($this->IsFactFinder)) $o['IsFactFinder'] = $this->IsFactFinder;
        if (isset($this->SharedId)) $o['SharedId'] = $this->SharedId;
        if (isset($this->Sharer)) $o['Sharer'] = $this->Sharer;
        if (isset($this->IsSecurities)) $o['IsSecurities'] = $this->IsSecurities;
        if (isset($this->Locked)) $o['Locked'] = $this->Locked;
        return empty($o) ? new class(){} : $o;
    }
}

PHP DropboxRequest DTOs

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

To embed the response in a jsonp callback, append ?callback=myCallback

HTTP + JSON

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

POST /v1/Dropbox/{AttachmentId} HTTP/1.1 
Host: api.dev.dynamics.trendsic.com 
Accept: application/json
Content-Type: application/json
Content-Length: length

{"Attachment":"String","Dropbox":[{"Id":0,"AttachmentId":"00000000000000000000000000000000","FirstName":"String","LastName":"String","TableName":"String","RecordId":0,"Description":"String","DocumentType":"String","DocumentGroup":"String","DateAdded":"0001-01-01T00:00:00.0000000","Locked":false,"FileSizeInKB":0}],"AttachmentId":"String","ID":0,"LoggedInAgent":0,"AgentName":"String","PageName":"String","TableName":"String","FieldName":"String","RecordIds":[0],"IsNewApplication":false,"IsFactFillerPro":false,"AgentId":false,"AgentEmail":"String","FullNameAttachee":"String","IsFactFinder":false,"SharedId":0,"Sharer":0,"IsSecurities":false,"Locked":false}
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length

{"ResponseStatus":{"ErrorCode":"String","Message":"String","StackTrace":"String","Errors":[{"ErrorCode":"String","FieldName":"String","Message":"String","Meta":{"String":"String"}}],"Meta":{"String":"String"}},"Dropbox":[{"AttachmentName":"String","AgentName":"String","MimeType":"String","IsAgent":false,"IsContact":false,"IsShared":false,"CanShare":false,"ShareList":"String","Id":0,"AttachmentId":"00000000000000000000000000000000","FirstName":"String","LastName":"String","TableName":"String","RecordId":0,"Description":"String","DocumentType":"String","DocumentGroup":"String","DateAdded":"0001-01-01T00:00:00.0000000","Locked":false,"FileSizeInKB":0}]}