<?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 QuickAddOption implements JsonSerializable
{
public function __construct(
/** @var string|null */
public ?string $Name=null,
/** @var string|null */
public ?string $EntityType=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['Name'])) $this->Name = $o['Name'];
if (isset($o['EntityType'])) $this->EntityType = $o['EntityType'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->Name)) $o['Name'] = $this->Name;
if (isset($this->EntityType)) $o['EntityType'] = $this->EntityType;
return empty($o) ? new class(){} : $o;
}
}
class QuickLookupResponse implements IBaseQuickLookupResponse, JsonSerializable
{
public function __construct(
/** @var int */
public int $NumberOfAllRecords=0,
/** @var array<SerializableKeyValuePair<string,string>>|null */
public ?array $Values=null,
/** @var array<QuickAddOption>|null */
public ?array $QuickAddOptions=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['NumberOfAllRecords'])) $this->NumberOfAllRecords = $o['NumberOfAllRecords'];
if (isset($o['Values'])) $this->Values = JsonConverters::fromArray('SerializableKeyValuePair<String,String>', $o['Values']);
if (isset($o['QuickAddOptions'])) $this->QuickAddOptions = JsonConverters::fromArray('QuickAddOption', $o['QuickAddOptions']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->NumberOfAllRecords)) $o['NumberOfAllRecords'] = $this->NumberOfAllRecords;
if (isset($this->Values)) $o['Values'] = JsonConverters::toArray('SerializableKeyValuePair<String,String>', $this->Values);
if (isset($this->QuickAddOptions)) $o['QuickAddOptions'] = JsonConverters::toArray('QuickAddOption', $this->QuickAddOptions);
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 QuickLookup implements JsonSerializable
{
public function __construct(
/** @var string|null */
public ?string $DocumentID=null,
/** @var string|null */
public ?string $DocumentFieldID=null,
/** @var string|null */
public ?string $RegistrationProfileFieldID=null,
/** @var string|null */
public ?string $LookupValue=null,
/** @var array<RegistrationProfileFieldValue>|null */
public ?array $DependableFields=null,
/** @var bool|null */
public ?bool $ApplyOptionalFilters=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['DocumentID'])) $this->DocumentID = $o['DocumentID'];
if (isset($o['DocumentFieldID'])) $this->DocumentFieldID = $o['DocumentFieldID'];
if (isset($o['RegistrationProfileFieldID'])) $this->RegistrationProfileFieldID = $o['RegistrationProfileFieldID'];
if (isset($o['LookupValue'])) $this->LookupValue = $o['LookupValue'];
if (isset($o['DependableFields'])) $this->DependableFields = JsonConverters::fromArray('RegistrationProfileFieldValue', $o['DependableFields']);
if (isset($o['ApplyOptionalFilters'])) $this->ApplyOptionalFilters = $o['ApplyOptionalFilters'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->DocumentID)) $o['DocumentID'] = $this->DocumentID;
if (isset($this->DocumentFieldID)) $o['DocumentFieldID'] = $this->DocumentFieldID;
if (isset($this->RegistrationProfileFieldID)) $o['RegistrationProfileFieldID'] = $this->RegistrationProfileFieldID;
if (isset($this->LookupValue)) $o['LookupValue'] = $this->LookupValue;
if (isset($this->DependableFields)) $o['DependableFields'] = JsonConverters::toArray('RegistrationProfileFieldValue', $this->DependableFields);
if (isset($this->ApplyOptionalFilters)) $o['ApplyOptionalFilters'] = $this->ApplyOptionalFilters;
return empty($o) ? new class(){} : $o;
}
}
To override the Content-type in your clients, use the HTTP Accept Header, append the .json suffix or ?format=json
To embed the response in a jsonp callback, append ?callback=myCallback
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /json/reply/QuickLookup HTTP/1.1
Host: test-do-services.klokgroep.nl
Accept: application/json
Content-Type: application/json
Content-Length: length
{"DocumentID":"00000000-0000-0000-0000-000000000000","DocumentFieldID":"String","RegistrationProfileFieldID":"String","LookupValue":"String","DependableFields":[{"DocumentFieldID":"00000000-0000-0000-0000-000000000000","Value":"String","ShadowValue":"String","IsModifiedByUser":false}],"ApplyOptionalFilters":false}
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length
{"NumberOfAllRecords":0,"Values":[{}],"QuickAddOptions":[{"Name":"String","EntityType":"String"}]}