| GET | /api/getdocumentviewdetails |
|---|
<?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 Explorer implements JsonSerializable
{
public function __construct(
/** @var string */
public string $ID='',
/** @var string|null */
public ?string $Title=null,
/** @var int */
public int $Order=0
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['ID'])) $this->ID = $o['ID'];
if (isset($o['Title'])) $this->Title = $o['Title'];
if (isset($o['Order'])) $this->Order = $o['Order'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->ID)) $o['ID'] = $this->ID;
if (isset($this->Title)) $o['Title'] = $this->Title;
if (isset($this->Order)) $o['Order'] = $this->Order;
return empty($o) ? new class(){} : $o;
}
}
// @DataContract
class MobileView implements JsonSerializable
{
public function __construct(
// @DataMember
/** @var string */
public string $ID='',
// @DataMember
/** @var string|null */
public ?string $Title=null,
// @DataMember
/** @var string|null */
public ?string $ImageUrl=null,
// @DataMember
/** @var int|null */
public ?int $ChildrenCount=null,
// @DataMember
/** @var int */
public int $Order=0,
// @DataMember
/** @var array<Explorer>|null */
public ?array $Explorers=null,
// @DataMember
/** @var bool|null */
public ?bool $IsDirectSearch=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['ID'])) $this->ID = $o['ID'];
if (isset($o['Title'])) $this->Title = $o['Title'];
if (isset($o['ImageUrl'])) $this->ImageUrl = $o['ImageUrl'];
if (isset($o['ChildrenCount'])) $this->ChildrenCount = $o['ChildrenCount'];
if (isset($o['Order'])) $this->Order = $o['Order'];
if (isset($o['Explorers'])) $this->Explorers = JsonConverters::fromArray('Explorer', $o['Explorers']);
if (isset($o['IsDirectSearch'])) $this->IsDirectSearch = $o['IsDirectSearch'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->ID)) $o['ID'] = $this->ID;
if (isset($this->Title)) $o['Title'] = $this->Title;
if (isset($this->ImageUrl)) $o['ImageUrl'] = $this->ImageUrl;
if (isset($this->ChildrenCount)) $o['ChildrenCount'] = $this->ChildrenCount;
if (isset($this->Order)) $o['Order'] = $this->Order;
if (isset($this->Explorers)) $o['Explorers'] = JsonConverters::toArray('Explorer', $this->Explorers);
if (isset($this->IsDirectSearch)) $o['IsDirectSearch'] = $this->IsDirectSearch;
return empty($o) ? new class(){} : $o;
}
}
class DocumentView extends MobileView implements JsonSerializable
{
/**
* @param string $ID
* @param string|null $Title
* @param string|null $ImageUrl
* @param int|null $ChildrenCount
* @param int $Order
* @param array<Explorer>|null $Explorers
* @param bool|null $IsDirectSearch
*/
public function __construct(
string $ID='',
?string $Title=null,
?string $ImageUrl=null,
?int $ChildrenCount=null,
int $Order=0,
?array $Explorers=null,
?bool $IsDirectSearch=null,
// @DataMember
/** @var string|null */
public ?string $TranslateKey=null,
// @DataMember
/** @var string|null */
public ?string $SiteMapKey=null
) {
parent::__construct($ID,$Title,$ImageUrl,$ChildrenCount,$Order,$Explorers,$IsDirectSearch);
}
/** @throws Exception */
public function fromMap($o): void {
parent::fromMap($o);
if (isset($o['TranslateKey'])) $this->TranslateKey = $o['TranslateKey'];
if (isset($o['SiteMapKey'])) $this->SiteMapKey = $o['SiteMapKey'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = parent::jsonSerialize();
if (isset($this->TranslateKey)) $o['TranslateKey'] = $this->TranslateKey;
if (isset($this->SiteMapKey)) $o['SiteMapKey'] = $this->SiteMapKey;
return empty($o) ? new class(){} : $o;
}
}
class GetDocumentViewDetails implements JsonSerializable
{
public function __construct(
/** @var string */
public string $ViewID='',
/** @var bool|null */
public ?bool $IncludeExplorers=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['ViewID'])) $this->ViewID = $o['ViewID'];
if (isset($o['IncludeExplorers'])) $this->IncludeExplorers = $o['IncludeExplorers'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->ViewID)) $o['ViewID'] = $this->ViewID;
if (isset($this->IncludeExplorers)) $o['IncludeExplorers'] = $this->IncludeExplorers;
return empty($o) ? new class(){} : $o;
}
}
PHP GetDocumentViewDetails 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 /api/getdocumentviewdetails HTTP/1.1 Host: test-do-services.klokgroep.nl Accept: application/xml
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length
<DocumentView xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/IDB.API.DTO.Document">
<ChildrenCount xmlns="http://schemas.datacontract.org/2004/07/IDB.API.DTO.MobileViews">0</ChildrenCount>
<Explorers xmlns:d2p1="http://schemas.datacontract.org/2004/07/IDB.API.DTO.Navigation" xmlns="http://schemas.datacontract.org/2004/07/IDB.API.DTO.MobileViews">
<d2p1:Explorer>
<d2p1:ID>00000000-0000-0000-0000-000000000000</d2p1:ID>
<d2p1:Order>0</d2p1:Order>
<d2p1:Title>String</d2p1:Title>
</d2p1:Explorer>
</Explorers>
<ID xmlns="http://schemas.datacontract.org/2004/07/IDB.API.DTO.MobileViews">00000000-0000-0000-0000-000000000000</ID>
<ImageUrl xmlns="http://schemas.datacontract.org/2004/07/IDB.API.DTO.MobileViews">String</ImageUrl>
<IsDirectSearch xmlns="http://schemas.datacontract.org/2004/07/IDB.API.DTO.MobileViews">false</IsDirectSearch>
<Order xmlns="http://schemas.datacontract.org/2004/07/IDB.API.DTO.MobileViews">0</Order>
<Title xmlns="http://schemas.datacontract.org/2004/07/IDB.API.DTO.MobileViews">String</Title>
<SiteMapKey>String</SiteMapKey>
<TranslateKey>String</TranslateKey>
</DocumentView>