| GET,POST,OPTIONS | /v1/Dropbox/Customer/{CustomerId} | ||
|---|---|---|---|
| GET,POST,OPTIONS | /v1/Dropbox/Customer/CustomerCheckIn/{CustomerCheckInId} |
<?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 DropboxCustomerRequest implements JsonSerializable
{
public function __construct(
/** @var array<Dropbox>|null */
public ?array $Dropbox=null,
/** @var string */
public string $CustomerId='',
/** @var string */
public string $CustomerCheckInId=''
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['Dropbox'])) $this->Dropbox = JsonConverters::fromArray('Dropbox', $o['Dropbox']);
if (isset($o['CustomerId'])) $this->CustomerId = $o['CustomerId'];
if (isset($o['CustomerCheckInId'])) $this->CustomerCheckInId = $o['CustomerCheckInId'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->Dropbox)) $o['Dropbox'] = JsonConverters::toArray('Dropbox', $this->Dropbox);
if (isset($this->CustomerId)) $o['CustomerId'] = $this->CustomerId;
if (isset($this->CustomerCheckInId)) $o['CustomerCheckInId'] = $this->CustomerCheckInId;
return empty($o) ? new class(){} : $o;
}
}
PHP DropboxCustomerRequest 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
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /v1/Dropbox/Customer/{CustomerId} HTTP/1.1
Host: api.dev.dynamics.trendsic.com
Accept: application/json
Content-Type: application/json
Content-Length: length
{"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}],"CustomerId":"00000000000000000000000000000000","CustomerCheckInId":"00000000000000000000000000000000"}
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}]}