| GET,OPTIONS | /v1/AttachmentView/{AttachmentId} |
|---|
<?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 AttachmentViewResponse implements JsonSerializable
{
public function __construct(
/** @var ResponseStatus|null */
public ?ResponseStatus $ResponseStatus=null,
/** @var string */
public string $AttachmentId='',
/** @var string|null */
public ?string $FileName=null,
/** @var string|null */
public ?string $MimeType=null,
/** @var float */
public float $FileSizeInKB=0.0,
/** @var string|null */
public ?string $Extension=null,
/** @var string|null */
public ?string $Category=null,
/** @var string|null */
public ?string $Viewer=null,
/** @var bool|null */
public ?bool $IsSensitive=null,
/** @var bool|null */
public ?bool $CanDownload=null,
/** @var string|null */
public ?string $ContentUrl=null,
/** @var string|null */
public ?string $MediaUrl=null,
/** @var int */
public int $PageCount=0,
/** @var int */
public int $CurrentVersionNo=0,
/** @var int */
public int $VersionCount=0,
/** @var string|null */
public ?string $TableName=null,
/** @var int */
public int $RecordId=0,
/** @var string|null */
public ?string $CreatedBy=null,
/** @var DateTime|null */
public ?DateTime $CreatedDate=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['FileName'])) $this->FileName = $o['FileName'];
if (isset($o['MimeType'])) $this->MimeType = $o['MimeType'];
if (isset($o['FileSizeInKB'])) $this->FileSizeInKB = $o['FileSizeInKB'];
if (isset($o['Extension'])) $this->Extension = $o['Extension'];
if (isset($o['Category'])) $this->Category = $o['Category'];
if (isset($o['Viewer'])) $this->Viewer = $o['Viewer'];
if (isset($o['IsSensitive'])) $this->IsSensitive = $o['IsSensitive'];
if (isset($o['CanDownload'])) $this->CanDownload = $o['CanDownload'];
if (isset($o['ContentUrl'])) $this->ContentUrl = $o['ContentUrl'];
if (isset($o['MediaUrl'])) $this->MediaUrl = $o['MediaUrl'];
if (isset($o['PageCount'])) $this->PageCount = $o['PageCount'];
if (isset($o['CurrentVersionNo'])) $this->CurrentVersionNo = $o['CurrentVersionNo'];
if (isset($o['VersionCount'])) $this->VersionCount = $o['VersionCount'];
if (isset($o['TableName'])) $this->TableName = $o['TableName'];
if (isset($o['RecordId'])) $this->RecordId = $o['RecordId'];
if (isset($o['CreatedBy'])) $this->CreatedBy = $o['CreatedBy'];
if (isset($o['CreatedDate'])) $this->CreatedDate = JsonConverters::from('DateTime', $o['CreatedDate']);
}
/** @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->FileName)) $o['FileName'] = $this->FileName;
if (isset($this->MimeType)) $o['MimeType'] = $this->MimeType;
if (isset($this->FileSizeInKB)) $o['FileSizeInKB'] = $this->FileSizeInKB;
if (isset($this->Extension)) $o['Extension'] = $this->Extension;
if (isset($this->Category)) $o['Category'] = $this->Category;
if (isset($this->Viewer)) $o['Viewer'] = $this->Viewer;
if (isset($this->IsSensitive)) $o['IsSensitive'] = $this->IsSensitive;
if (isset($this->CanDownload)) $o['CanDownload'] = $this->CanDownload;
if (isset($this->ContentUrl)) $o['ContentUrl'] = $this->ContentUrl;
if (isset($this->MediaUrl)) $o['MediaUrl'] = $this->MediaUrl;
if (isset($this->PageCount)) $o['PageCount'] = $this->PageCount;
if (isset($this->CurrentVersionNo)) $o['CurrentVersionNo'] = $this->CurrentVersionNo;
if (isset($this->VersionCount)) $o['VersionCount'] = $this->VersionCount;
if (isset($this->TableName)) $o['TableName'] = $this->TableName;
if (isset($this->RecordId)) $o['RecordId'] = $this->RecordId;
if (isset($this->CreatedBy)) $o['CreatedBy'] = $this->CreatedBy;
if (isset($this->CreatedDate)) $o['CreatedDate'] = JsonConverters::to('DateTime', $this->CreatedDate);
return empty($o) ? new class(){} : $o;
}
}
class AttachmentViewRequest implements JsonSerializable
{
public function __construct(
/** @var string */
public string $AttachmentId=''
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['AttachmentId'])) $this->AttachmentId = $o['AttachmentId'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->AttachmentId)) $o['AttachmentId'] = $this->AttachmentId;
return empty($o) ? new class(){} : $o;
}
}
PHP AttachmentViewRequest DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .csv suffix or ?format=csv
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
GET /v1/AttachmentView/{AttachmentId} HTTP/1.1
Host: api.dev.dynamics.trendsic.com
Accept: text/csv
HTTP/1.1 200 OK
Content-Type: text/csv
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","FileName":"String","MimeType":"String","FileSizeInKB":0,"Extension":"String","Category":"String","Viewer":"String","IsSensitive":false,"CanDownload":false,"ContentUrl":"String","MediaUrl":"String","PageCount":0,"CurrentVersionNo":0,"VersionCount":0,"TableName":"String","RecordId":0,"CreatedBy":"String","CreatedDate":"0001-01-01T00:00:00.0000000"}