<?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};
enum MessageType : int
{
case Information = 1;
case Warning = 2;
case Error = 3;
case Success = 4;
}
class InformationMessageBase implements IInformationMessage, JsonSerializable
{
public function __construct(
/** @var MessageType|null */
public ?MessageType $Type=null,
/** @var string|null */
public ?string $Summary=null,
/** @var string|null */
public ?string $FullMessage=null,
/** @var string|null */
public ?string $FieldName=null,
/** @var bool|null */
public ?bool $KeepOpen=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['Type'])) $this->Type = JsonConverters::from('MessageType', $o['Type']);
if (isset($o['Summary'])) $this->Summary = $o['Summary'];
if (isset($o['FullMessage'])) $this->FullMessage = $o['FullMessage'];
if (isset($o['FieldName'])) $this->FieldName = $o['FieldName'];
if (isset($o['KeepOpen'])) $this->KeepOpen = $o['KeepOpen'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->Type)) $o['Type'] = JsonConverters::to('MessageType', $this->Type);
if (isset($this->Summary)) $o['Summary'] = $this->Summary;
if (isset($this->FullMessage)) $o['FullMessage'] = $this->FullMessage;
if (isset($this->FieldName)) $o['FieldName'] = $this->FieldName;
if (isset($this->KeepOpen)) $o['KeepOpen'] = $this->KeepOpen;
return empty($o) ? new class(){} : $o;
}
}
/**
* @template array of InformationMessageBase
*/
class InformationMessages extends \ArrayObject implements IInformationMessages, JsonSerializable
{
public function __construct(InformationMessageBase ...$items) {
parent::__construct($items, \ArrayObject::STD_PROP_LIST);
}
/** @throws \Exception */
public function append($value): void {
if ($value instanceof InformationMessageBase)
parent::append($value);
else
throw new \Exception("Can only append a InformationMessageBase to " . __CLASS__);
}
/** @throws Exception */
public function fromMap($o): void {
foreach ($o as $item) {
$el = new InformationMessageBase();
$el->fromMap($item);
$this->append($el);
}
}
/** @throws Exception */
public function jsonSerialize(): array {
return parent::getArrayCopy();
}
}
class FieldState implements JsonSerializable
{
public function __construct(
/** @var bool|null */
public ?bool $Required=null,
/** @var bool|null */
public ?bool $Visible=null,
/** @var bool|null */
public ?bool $Readonly=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['Required'])) $this->Required = $o['Required'];
if (isset($o['Visible'])) $this->Visible = $o['Visible'];
if (isset($o['Readonly'])) $this->Readonly = $o['Readonly'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->Required)) $o['Required'] = $this->Required;
if (isset($this->Visible)) $o['Visible'] = $this->Visible;
if (isset($this->Readonly)) $o['Readonly'] = $this->Readonly;
return empty($o) ? new class(){} : $o;
}
}
class RegistrationProfileFieldStateBase extends FieldState implements JsonSerializable
{
/**
* @param bool|null $Required
* @param bool|null $Visible
* @param bool|null $Readonly
*/
public function __construct(
?bool $Required=null,
?bool $Visible=null,
?bool $Readonly=null,
/** @var string */
public string $DocumentFieldID=''
) {
parent::__construct($Required,$Visible,$Readonly);
}
/** @throws Exception */
public function fromMap($o): void {
parent::fromMap($o);
if (isset($o['DocumentFieldID'])) $this->DocumentFieldID = $o['DocumentFieldID'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = parent::jsonSerialize();
if (isset($this->DocumentFieldID)) $o['DocumentFieldID'] = $this->DocumentFieldID;
return empty($o) ? new class(){} : $o;
}
}
class RegistrationProfileFieldStates implements JsonSerializable
{
public function __construct(
/** @var bool|null */
public ?bool $ReadOnly=null,
/** @var InformationMessages|null */
public ?InformationMessages $Messages=null,
/** @var array<RegistrationProfileFieldStateBase>|null */
public ?array $ControlStates=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['ReadOnly'])) $this->ReadOnly = $o['ReadOnly'];
if (isset($o['Messages'])) $this->Messages = JsonConverters::from('InformationMessages', $o['Messages']);
if (isset($o['ControlStates'])) $this->ControlStates = JsonConverters::fromArray('RegistrationProfileFieldStateBase', $o['ControlStates']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->ReadOnly)) $o['ReadOnly'] = $this->ReadOnly;
if (isset($this->Messages)) $o['Messages'] = JsonConverters::to('InformationMessages', $this->Messages);
if (isset($this->ControlStates)) $o['ControlStates'] = JsonConverters::toArray('RegistrationProfileFieldStateBase', $this->ControlStates);
return empty($o) ? new class(){} : $o;
}
}
class RegistrationProfileFieldValue implements JsonSerializable
{
public function __construct(
/** @var string */
public string $DocumentFieldID='',
/** @var string|null */
public ?string $Value=null,
/** @var string|null */
public ?string $ShadowValue=null,
/** @var bool|null */
public ?bool $IsModifiedByUser=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['DocumentFieldID'])) $this->DocumentFieldID = $o['DocumentFieldID'];
if (isset($o['Value'])) $this->Value = $o['Value'];
if (isset($o['ShadowValue'])) $this->ShadowValue = $o['ShadowValue'];
if (isset($o['IsModifiedByUser'])) $this->IsModifiedByUser = $o['IsModifiedByUser'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->DocumentFieldID)) $o['DocumentFieldID'] = $this->DocumentFieldID;
if (isset($this->Value)) $o['Value'] = $this->Value;
if (isset($this->ShadowValue)) $o['ShadowValue'] = $this->ShadowValue;
if (isset($this->IsModifiedByUser)) $o['IsModifiedByUser'] = $this->IsModifiedByUser;
return empty($o) ? new class(){} : $o;
}
}
class GetRegistrationprofileFieldStates implements JsonSerializable
{
public function __construct(
/** @var string */
public string $RegistrationprofileID='',
/** @var string|null */
public ?string $DocumentID=null,
/** @var int|null */
public ?int $QueueDocumentID=null,
/** @var string|null */
public ?string $StandardDocumentID=null,
/** @var array<string>|null */
public ?array $RequestTriggeredByDependentDocumentFieldIds=null,
/** @var array<RegistrationProfileFieldValue>|null */
public ?array $CurrentRegistrationprofileFieldValues=null,
/** @var bool|null */
public ?bool $IsOffice365Context=null,
/** @var bool|null */
public ?bool $IsOpenedFromNonDMSLocation=null,
/** @var string|null */
public ?string $PidTag=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['RegistrationprofileID'])) $this->RegistrationprofileID = $o['RegistrationprofileID'];
if (isset($o['DocumentID'])) $this->DocumentID = $o['DocumentID'];
if (isset($o['QueueDocumentID'])) $this->QueueDocumentID = $o['QueueDocumentID'];
if (isset($o['StandardDocumentID'])) $this->StandardDocumentID = $o['StandardDocumentID'];
if (isset($o['RequestTriggeredByDependentDocumentFieldIds'])) $this->RequestTriggeredByDependentDocumentFieldIds = JsonConverters::fromArray('Guid', $o['RequestTriggeredByDependentDocumentFieldIds']);
if (isset($o['CurrentRegistrationprofileFieldValues'])) $this->CurrentRegistrationprofileFieldValues = JsonConverters::fromArray('RegistrationProfileFieldValue', $o['CurrentRegistrationprofileFieldValues']);
if (isset($o['IsOffice365Context'])) $this->IsOffice365Context = $o['IsOffice365Context'];
if (isset($o['IsOpenedFromNonDMSLocation'])) $this->IsOpenedFromNonDMSLocation = $o['IsOpenedFromNonDMSLocation'];
if (isset($o['PidTag'])) $this->PidTag = $o['PidTag'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->RegistrationprofileID)) $o['RegistrationprofileID'] = $this->RegistrationprofileID;
if (isset($this->DocumentID)) $o['DocumentID'] = $this->DocumentID;
if (isset($this->QueueDocumentID)) $o['QueueDocumentID'] = $this->QueueDocumentID;
if (isset($this->StandardDocumentID)) $o['StandardDocumentID'] = $this->StandardDocumentID;
if (isset($this->RequestTriggeredByDependentDocumentFieldIds)) $o['RequestTriggeredByDependentDocumentFieldIds'] = JsonConverters::toArray('Guid', $this->RequestTriggeredByDependentDocumentFieldIds);
if (isset($this->CurrentRegistrationprofileFieldValues)) $o['CurrentRegistrationprofileFieldValues'] = JsonConverters::toArray('RegistrationProfileFieldValue', $this->CurrentRegistrationprofileFieldValues);
if (isset($this->IsOffice365Context)) $o['IsOffice365Context'] = $this->IsOffice365Context;
if (isset($this->IsOpenedFromNonDMSLocation)) $o['IsOpenedFromNonDMSLocation'] = $this->IsOpenedFromNonDMSLocation;
if (isset($this->PidTag)) $o['PidTag'] = $this->PidTag;
return empty($o) ? new class(){} : $o;
}
}
PHP GetRegistrationprofileFieldStates 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.
POST /xml/reply/GetRegistrationprofileFieldStates HTTP/1.1
Host: test-dogw.klokgroep.nl
Accept: application/xml
Content-Type: application/xml
Content-Length: length
<GetRegistrationprofileFieldStates xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/IDB.API.DTO.Registrationprofile.Operations">
<CurrentRegistrationprofileFieldValues xmlns:d2p1="http://schemas.datacontract.org/2004/07/IDB.API.DTO.Registrationprofile">
<d2p1:RegistrationProfileFieldValue>
<d2p1:DocumentFieldID>00000000-0000-0000-0000-000000000000</d2p1:DocumentFieldID>
<d2p1:IsModifiedByUser>false</d2p1:IsModifiedByUser>
<d2p1:ShadowValue>String</d2p1:ShadowValue>
<d2p1:Value>String</d2p1:Value>
</d2p1:RegistrationProfileFieldValue>
</CurrentRegistrationprofileFieldValues>
<DocumentID>00000000-0000-0000-0000-000000000000</DocumentID>
<IsOffice365Context>false</IsOffice365Context>
<IsOpenedFromNonDMSLocation>false</IsOpenedFromNonDMSLocation>
<PidTag>String</PidTag>
<QueueDocumentID>0</QueueDocumentID>
<RegistrationprofileID>00000000-0000-0000-0000-000000000000</RegistrationprofileID>
<RequestTriggeredByDependentDocumentFieldIds xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d2p1:guid>00000000-0000-0000-0000-000000000000</d2p1:guid>
</RequestTriggeredByDependentDocumentFieldIds>
<StandardDocumentID>00000000-0000-0000-0000-000000000000</StandardDocumentID>
</GetRegistrationprofileFieldStates>
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length
<RegistrationProfileFieldStates xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/IDB.API.DTO.Registrationprofile">
<ControlStates>
<RegistrationProfileFieldStateBase>
<Readonly xmlns="http://schemas.datacontract.org/2004/07/IDB.API.DTO.Common">false</Readonly>
<Required xmlns="http://schemas.datacontract.org/2004/07/IDB.API.DTO.Common">false</Required>
<Visible xmlns="http://schemas.datacontract.org/2004/07/IDB.API.DTO.Common">false</Visible>
<DocumentFieldID>00000000-0000-0000-0000-000000000000</DocumentFieldID>
</RegistrationProfileFieldStateBase>
</ControlStates>
<Messages xmlns:d2p1="http://schemas.datacontract.org/2004/07/IDB.Core.Diagnostics.Interfaces">
<d2p1:InformationMessageBase i:nil="true" />
</Messages>
<ReadOnly>false</ReadOnly>
</RegistrationProfileFieldStates>