| GET,OPTIONS | /v1/forms/office |
|---|
<?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 FormOfficeApp implements JsonSerializable
{
public function __construct(
/** @var string|null */
public ?string $FormUID=null,
/** @var string|null */
public ?string $Name=null,
/** @var string|null */
public ?string $Noun=null,
/** @var string|null */
public ?string $DefaultBranchId=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['FormUID'])) $this->FormUID = $o['FormUID'];
if (isset($o['Name'])) $this->Name = $o['Name'];
if (isset($o['Noun'])) $this->Noun = $o['Noun'];
if (isset($o['DefaultBranchId'])) $this->DefaultBranchId = $o['DefaultBranchId'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->FormUID)) $o['FormUID'] = $this->FormUID;
if (isset($this->Name)) $o['Name'] = $this->Name;
if (isset($this->Noun)) $o['Noun'] = $this->Noun;
if (isset($this->DefaultBranchId)) $o['DefaultBranchId'] = $this->DefaultBranchId;
return empty($o) ? new class(){} : $o;
}
}
class FormInboxCount implements JsonSerializable
{
public function __construct(
/** @var string|null */
public ?string $V=null,
/** @var string|null */
public ?string $L=null,
/** @var int */
public int $N=0
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['V'])) $this->V = $o['V'];
if (isset($o['L'])) $this->L = $o['L'];
if (isset($o['N'])) $this->N = $o['N'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->V)) $o['V'] = $this->V;
if (isset($this->L)) $o['L'] = $this->L;
if (isset($this->N)) $o['N'] = $this->N;
return empty($o) ? new class(){} : $o;
}
}
class FormOfficeDraftRow implements JsonSerializable
{
public function __construct(
/** @var string|null */
public ?string $SubmissionUID=null,
/** @var string|null */
public ?string $FormUID=null,
/** @var string|null */
public ?string $FormName=null,
/** @var string|null */
public ?string $ForName=null,
/** @var string|null */
public ?string $BranchName=null,
/** @var int|null */
public ?int $ContactId=null,
/** @var int */
public int $Page=0,
/** @var int */
public int $Pages=0,
/** @var string|null */
public ?string $SavedBy=null,
/** @var string|null */
public ?string $SavedAt=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['SubmissionUID'])) $this->SubmissionUID = $o['SubmissionUID'];
if (isset($o['FormUID'])) $this->FormUID = $o['FormUID'];
if (isset($o['FormName'])) $this->FormName = $o['FormName'];
if (isset($o['ForName'])) $this->ForName = $o['ForName'];
if (isset($o['BranchName'])) $this->BranchName = $o['BranchName'];
if (isset($o['ContactId'])) $this->ContactId = $o['ContactId'];
if (isset($o['Page'])) $this->Page = $o['Page'];
if (isset($o['Pages'])) $this->Pages = $o['Pages'];
if (isset($o['SavedBy'])) $this->SavedBy = $o['SavedBy'];
if (isset($o['SavedAt'])) $this->SavedAt = $o['SavedAt'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->SubmissionUID)) $o['SubmissionUID'] = $this->SubmissionUID;
if (isset($this->FormUID)) $o['FormUID'] = $this->FormUID;
if (isset($this->FormName)) $o['FormName'] = $this->FormName;
if (isset($this->ForName)) $o['ForName'] = $this->ForName;
if (isset($this->BranchName)) $o['BranchName'] = $this->BranchName;
if (isset($this->ContactId)) $o['ContactId'] = $this->ContactId;
if (isset($this->Page)) $o['Page'] = $this->Page;
if (isset($this->Pages)) $o['Pages'] = $this->Pages;
if (isset($this->SavedBy)) $o['SavedBy'] = $this->SavedBy;
if (isset($this->SavedAt)) $o['SavedAt'] = $this->SavedAt;
return empty($o) ? new class(){} : $o;
}
}
class FormOfficeOfferedResponse implements JsonSerializable
{
public function __construct(
/** @var array<FormOfficeApp>|null */
public ?array $Apps=null,
/** @var array<FormInboxCount>|null */
public ?array $Branches=null,
/** @var array<FormOfficeDraftRow>|null */
public ?array $Drafts=null,
/** @var bool|null */
public ?bool $CanSearchContacts=null,
/** @var ResponseStatus|null */
public ?ResponseStatus $ResponseStatus=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['Apps'])) $this->Apps = JsonConverters::fromArray('FormOfficeApp', $o['Apps']);
if (isset($o['Branches'])) $this->Branches = JsonConverters::fromArray('FormInboxCount', $o['Branches']);
if (isset($o['Drafts'])) $this->Drafts = JsonConverters::fromArray('FormOfficeDraftRow', $o['Drafts']);
if (isset($o['CanSearchContacts'])) $this->CanSearchContacts = $o['CanSearchContacts'];
if (isset($o['ResponseStatus'])) $this->ResponseStatus = JsonConverters::from('ResponseStatus', $o['ResponseStatus']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->Apps)) $o['Apps'] = JsonConverters::toArray('FormOfficeApp', $this->Apps);
if (isset($this->Branches)) $o['Branches'] = JsonConverters::toArray('FormInboxCount', $this->Branches);
if (isset($this->Drafts)) $o['Drafts'] = JsonConverters::toArray('FormOfficeDraftRow', $this->Drafts);
if (isset($this->CanSearchContacts)) $o['CanSearchContacts'] = $this->CanSearchContacts;
if (isset($this->ResponseStatus)) $o['ResponseStatus'] = JsonConverters::to('ResponseStatus', $this->ResponseStatus);
return empty($o) ? new class(){} : $o;
}
}
class FormOfficeOfferedRequest implements JsonSerializable
{
public function __construct(
/** @var string|null */
public ?string $FormUID=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['FormUID'])) $this->FormUID = $o['FormUID'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->FormUID)) $o['FormUID'] = $this->FormUID;
return empty($o) ? new class(){} : $o;
}
}
PHP FormOfficeOfferedRequest 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/forms/office HTTP/1.1 Host: api.dev.dynamics.trendsic.com Accept: application/xml
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length
<FormOfficeOfferedResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/CRM.AgencyPlatform.API.Internal">
<Apps>
<FormOfficeApp>
<DefaultBranchId>String</DefaultBranchId>
<FormUID>String</FormUID>
<Name>String</Name>
<Noun>String</Noun>
</FormOfficeApp>
</Apps>
<Branches>
<FormInboxCount>
<L>String</L>
<N>0</N>
<V>String</V>
</FormInboxCount>
</Branches>
<CanSearchContacts>false</CanSearchContacts>
<Drafts>
<FormOfficeDraftRow>
<BranchName>String</BranchName>
<ContactId>0</ContactId>
<ForName>String</ForName>
<FormName>String</FormName>
<FormUID>String</FormUID>
<Page>0</Page>
<Pages>0</Pages>
<SavedAt>String</SavedAt>
<SavedBy>String</SavedBy>
<SubmissionUID>String</SubmissionUID>
</FormOfficeDraftRow>
</Drafts>
<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>
</FormOfficeOfferedResponse>