| GET,OPTIONS | /v1/records/requests |
|---|
<?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 RecordsRequestDto implements JsonSerializable
{
public function __construct(
/** @var int */
public int $RequestId=0,
/** @var string|null */
public ?string $RequestKey=null,
/** @var string|null */
public ?string $Subject=null,
/** @var string|null */
public ?string $Body=null,
/** @var string|null */
public ?string $RequesterName=null,
/** @var string|null */
public ?string $RequesterContact=null,
/** @var string|null */
public ?string $Channel=null,
/** @var string|null */
public ?string $ReceivedLabel=null,
/** @var string|null */
public ?string $Status=null,
/** @var int */
public int $ExtendedDays=0,
/** @var string|null */
public ?string $ItemsJson=null,
/** @var string|null */
public ?string $LogJson=null,
/** @var string|null */
public ?string $DueDate=null,
/** @var int */
public int $DueDays=0
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['RequestId'])) $this->RequestId = $o['RequestId'];
if (isset($o['RequestKey'])) $this->RequestKey = $o['RequestKey'];
if (isset($o['Subject'])) $this->Subject = $o['Subject'];
if (isset($o['Body'])) $this->Body = $o['Body'];
if (isset($o['RequesterName'])) $this->RequesterName = $o['RequesterName'];
if (isset($o['RequesterContact'])) $this->RequesterContact = $o['RequesterContact'];
if (isset($o['Channel'])) $this->Channel = $o['Channel'];
if (isset($o['ReceivedLabel'])) $this->ReceivedLabel = $o['ReceivedLabel'];
if (isset($o['Status'])) $this->Status = $o['Status'];
if (isset($o['ExtendedDays'])) $this->ExtendedDays = $o['ExtendedDays'];
if (isset($o['ItemsJson'])) $this->ItemsJson = $o['ItemsJson'];
if (isset($o['LogJson'])) $this->LogJson = $o['LogJson'];
if (isset($o['DueDate'])) $this->DueDate = $o['DueDate'];
if (isset($o['DueDays'])) $this->DueDays = $o['DueDays'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->RequestId)) $o['RequestId'] = $this->RequestId;
if (isset($this->RequestKey)) $o['RequestKey'] = $this->RequestKey;
if (isset($this->Subject)) $o['Subject'] = $this->Subject;
if (isset($this->Body)) $o['Body'] = $this->Body;
if (isset($this->RequesterName)) $o['RequesterName'] = $this->RequesterName;
if (isset($this->RequesterContact)) $o['RequesterContact'] = $this->RequesterContact;
if (isset($this->Channel)) $o['Channel'] = $this->Channel;
if (isset($this->ReceivedLabel)) $o['ReceivedLabel'] = $this->ReceivedLabel;
if (isset($this->Status)) $o['Status'] = $this->Status;
if (isset($this->ExtendedDays)) $o['ExtendedDays'] = $this->ExtendedDays;
if (isset($this->ItemsJson)) $o['ItemsJson'] = $this->ItemsJson;
if (isset($this->LogJson)) $o['LogJson'] = $this->LogJson;
if (isset($this->DueDate)) $o['DueDate'] = $this->DueDate;
if (isset($this->DueDays)) $o['DueDays'] = $this->DueDays;
return empty($o) ? new class(){} : $o;
}
}
class RecordsRequestsResponse implements JsonSerializable
{
public function __construct(
/** @var ResponseStatus|null */
public ?ResponseStatus $ResponseStatus=null,
/** @var array<RecordsRequestDto>|null */
public ?array $Requests=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['ResponseStatus'])) $this->ResponseStatus = JsonConverters::from('ResponseStatus', $o['ResponseStatus']);
if (isset($o['Requests'])) $this->Requests = JsonConverters::fromArray('RecordsRequestDto', $o['Requests']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->ResponseStatus)) $o['ResponseStatus'] = JsonConverters::to('ResponseStatus', $this->ResponseStatus);
if (isset($this->Requests)) $o['Requests'] = JsonConverters::toArray('RecordsRequestDto', $this->Requests);
return empty($o) ? new class(){} : $o;
}
}
class RecordsRequestsRequest implements JsonSerializable
{
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
return empty($o) ? new class(){} : $o;
}
}
PHP RecordsRequestsRequest DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .xml suffix or ?format=xml
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
GET /v1/records/requests HTTP/1.1 Host: api.dev.dynamics.trendsic.com Accept: application/xml
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length
<RecordsRequestsResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/CRM.AgencyPlatform.API.Internal">
<Requests>
<RecordsRequestDto>
<Body>String</Body>
<Channel>String</Channel>
<DueDate>String</DueDate>
<DueDays>0</DueDays>
<ExtendedDays>0</ExtendedDays>
<ItemsJson>String</ItemsJson>
<LogJson>String</LogJson>
<ReceivedLabel>String</ReceivedLabel>
<RequestId>0</RequestId>
<RequestKey>String</RequestKey>
<RequesterContact>String</RequesterContact>
<RequesterName>String</RequesterName>
<Status>String</Status>
<Subject>String</Subject>
</RecordsRequestDto>
</Requests>
<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>
</RecordsRequestsResponse>