| GET | /App/{UserId}/HkReferenceData |
|---|
<?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};
// @DataContract
class Eras2AppServiceModelBase implements JsonSerializable
{
public function __construct(
// @DataMember(Name="UserId")
/** @var string */
public string $UserId=''
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['UserId'])) $this->UserId = $o['UserId'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->UserId)) $o['UserId'] = $this->UserId;
return empty($o) ? new class(){} : $o;
}
}
// @DataContract
class HkSection implements JsonSerializable
{
public function __construct(
// @DataMember(Name="Id")
/** @var int */
public int $Id=0,
// @DataMember(Name="Number")
/** @var int|null */
public ?int $Number=null,
// @DataMember(Name="Code")
/** @var string|null */
public ?string $Code=null,
// @DataMember(Name="Name")
/** @var string|null */
public ?string $Name=null,
// @DataMember(Name="Comment")
/** @var string|null */
public ?string $Comment=null,
// @DataMember(Name="Image")
/** @var ByteArray|null */
public ?ByteArray $Image=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['Id'])) $this->Id = $o['Id'];
if (isset($o['Number'])) $this->Number = $o['Number'];
if (isset($o['Code'])) $this->Code = $o['Code'];
if (isset($o['Name'])) $this->Name = $o['Name'];
if (isset($o['Comment'])) $this->Comment = $o['Comment'];
if (isset($o['Image'])) $this->Image = JsonConverters::from('ByteArray', $o['Image']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->Id)) $o['Id'] = $this->Id;
if (isset($this->Number)) $o['Number'] = $this->Number;
if (isset($this->Code)) $o['Code'] = $this->Code;
if (isset($this->Name)) $o['Name'] = $this->Name;
if (isset($this->Comment)) $o['Comment'] = $this->Comment;
if (isset($this->Image)) $o['Image'] = JsonConverters::to('ByteArray', $this->Image);
return empty($o) ? new class(){} : $o;
}
}
// @DataContract
class HkParameter implements JsonSerializable
{
public function __construct(
// @DataMember(Name="RadiatisId")
/** @var int|null */
public ?int $RadiatisId=null,
// @DataMember(Name="Code")
/** @var string|null */
public ?string $Code=null,
// @DataMember(Name="Name")
/** @var string|null */
public ?string $Name=null,
// @DataMember(Name="Comment")
/** @var string|null */
public ?string $Comment=null,
// @DataMember(Name="Unit")
/** @var string|null */
public ?string $Unit=null,
// @DataMember(Name="Mandatory")
/** @var bool|null */
public ?bool $Mandatory=null,
// @DataMember(Name="Position")
/** @var int|null */
public ?int $Position=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['RadiatisId'])) $this->RadiatisId = $o['RadiatisId'];
if (isset($o['Code'])) $this->Code = $o['Code'];
if (isset($o['Name'])) $this->Name = $o['Name'];
if (isset($o['Comment'])) $this->Comment = $o['Comment'];
if (isset($o['Unit'])) $this->Unit = $o['Unit'];
if (isset($o['Mandatory'])) $this->Mandatory = $o['Mandatory'];
if (isset($o['Position'])) $this->Position = $o['Position'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->RadiatisId)) $o['RadiatisId'] = $this->RadiatisId;
if (isset($this->Code)) $o['Code'] = $this->Code;
if (isset($this->Name)) $o['Name'] = $this->Name;
if (isset($this->Comment)) $o['Comment'] = $this->Comment;
if (isset($this->Unit)) $o['Unit'] = $this->Unit;
if (isset($this->Mandatory)) $o['Mandatory'] = $this->Mandatory;
if (isset($this->Position)) $o['Position'] = $this->Position;
return empty($o) ? new class(){} : $o;
}
}
// @DataContract
class HkAttributeNote implements JsonSerializable
{
public function __construct(
// @DataMember(Name="NoteId")
/** @var int */
public int $NoteId=0,
// @DataMember(Name="Name")
/** @var string|null */
public ?string $Name=null,
// @DataMember(Name="ImageSlice")
/** @var ByteArray|null */
public ?ByteArray $ImageSlice=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['NoteId'])) $this->NoteId = $o['NoteId'];
if (isset($o['Name'])) $this->Name = $o['Name'];
if (isset($o['ImageSlice'])) $this->ImageSlice = JsonConverters::from('ByteArray', $o['ImageSlice']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->NoteId)) $o['NoteId'] = $this->NoteId;
if (isset($this->Name)) $o['Name'] = $this->Name;
if (isset($this->ImageSlice)) $o['ImageSlice'] = JsonConverters::to('ByteArray', $this->ImageSlice);
return empty($o) ? new class(){} : $o;
}
}
// @DataContract
class HkAttribute implements JsonSerializable
{
public function __construct(
// @DataMember(Name="RadiatisId")
/** @var int */
public int $RadiatisId=0,
// @DataMember(Name="Code")
/** @var string|null */
public ?string $Code=null,
// @DataMember(Name="Name")
/** @var string|null */
public ?string $Name=null,
// @DataMember(Name="Notes")
/** @var array<HkAttributeNote>|null */
public ?array $Notes=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['RadiatisId'])) $this->RadiatisId = $o['RadiatisId'];
if (isset($o['Code'])) $this->Code = $o['Code'];
if (isset($o['Name'])) $this->Name = $o['Name'];
if (isset($o['Notes'])) $this->Notes = JsonConverters::fromArray('HkAttributeNote', $o['Notes']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->RadiatisId)) $o['RadiatisId'] = $this->RadiatisId;
if (isset($this->Code)) $o['Code'] = $this->Code;
if (isset($this->Name)) $o['Name'] = $this->Name;
if (isset($this->Notes)) $o['Notes'] = JsonConverters::toArray('HkAttributeNote', $this->Notes);
return empty($o) ? new class(){} : $o;
}
}
// @DataContract
class HkLayout implements JsonSerializable
{
public function __construct(
// @DataMember(Name="Title")
/** @var string|null */
public ?string $Title=null,
// @DataMember(Name="Comment")
/** @var string|null */
public ?string $Comment=null,
// @DataMember(Name="Image")
/** @var ByteArray|null */
public ?ByteArray $Image=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['Title'])) $this->Title = $o['Title'];
if (isset($o['Comment'])) $this->Comment = $o['Comment'];
if (isset($o['Image'])) $this->Image = JsonConverters::from('ByteArray', $o['Image']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->Title)) $o['Title'] = $this->Title;
if (isset($this->Comment)) $o['Comment'] = $this->Comment;
if (isset($this->Image)) $o['Image'] = JsonConverters::to('ByteArray', $this->Image);
return empty($o) ? new class(){} : $o;
}
}
// @DataContract
class HkGroup implements JsonSerializable
{
public function __construct(
// @DataMember(Name="Id")
/** @var int */
public int $Id=0,
// @DataMember(Name="Number")
/** @var int|null */
public ?int $Number=null,
// @DataMember(Name="Name")
/** @var string|null */
public ?string $Name=null,
// @DataMember(Name="Comment")
/** @var string|null */
public ?string $Comment=null,
// @DataMember(Name="SectionId")
/** @var int|null */
public ?int $SectionId=null,
// @DataMember(Name="Characteristic")
/** @var string|null */
public ?string $Characteristic=null,
// @DataMember(Name="Parameters")
/** @var array<HkParameter>|null */
public ?array $Parameters=null,
// @DataMember(Name="Attributes")
/** @var array<HkAttribute>|null */
public ?array $Attributes=null,
// @DataMember(Name="Images")
/** @var array<ByteArray>|null */
public ?array $Images=null,
// @DataMember(Name="Layouts")
/** @var array<HkLayout>|null */
public ?array $Layouts=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['Id'])) $this->Id = $o['Id'];
if (isset($o['Number'])) $this->Number = $o['Number'];
if (isset($o['Name'])) $this->Name = $o['Name'];
if (isset($o['Comment'])) $this->Comment = $o['Comment'];
if (isset($o['SectionId'])) $this->SectionId = $o['SectionId'];
if (isset($o['Characteristic'])) $this->Characteristic = $o['Characteristic'];
if (isset($o['Parameters'])) $this->Parameters = JsonConverters::fromArray('HkParameter', $o['Parameters']);
if (isset($o['Attributes'])) $this->Attributes = JsonConverters::fromArray('HkAttribute', $o['Attributes']);
if (isset($o['Images'])) $this->Images = JsonConverters::fromArray('Byte[]', $o['Images']);
if (isset($o['Layouts'])) $this->Layouts = JsonConverters::fromArray('HkLayout', $o['Layouts']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->Id)) $o['Id'] = $this->Id;
if (isset($this->Number)) $o['Number'] = $this->Number;
if (isset($this->Name)) $o['Name'] = $this->Name;
if (isset($this->Comment)) $o['Comment'] = $this->Comment;
if (isset($this->SectionId)) $o['SectionId'] = $this->SectionId;
if (isset($this->Characteristic)) $o['Characteristic'] = $this->Characteristic;
if (isset($this->Parameters)) $o['Parameters'] = JsonConverters::toArray('HkParameter', $this->Parameters);
if (isset($this->Attributes)) $o['Attributes'] = JsonConverters::toArray('HkAttribute', $this->Attributes);
if (isset($this->Images)) $o['Images'] = JsonConverters::toArray('Byte[]', $this->Images);
if (isset($this->Layouts)) $o['Layouts'] = JsonConverters::toArray('HkLayout', $this->Layouts);
return empty($o) ? new class(){} : $o;
}
}
// @DataContract
class GetHkReferenceDataResponse implements JsonSerializable
{
public function __construct(
// @DataMember(Name="LoadedAt")
/** @var DateTime */
public DateTime $LoadedAt=new DateTime(),
// @DataMember(Name="Sections")
/** @var array<HkSection>|null */
public ?array $Sections=null,
// @DataMember(Name="Groups")
/** @var array<HkGroup>|null */
public ?array $Groups=null,
// @DataMember(Name="ResponseStatus")
/** @var ResponseStatus|null */
public ?ResponseStatus $ResponseStatus=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['LoadedAt'])) $this->LoadedAt = JsonConverters::from('DateTime', $o['LoadedAt']);
if (isset($o['Sections'])) $this->Sections = JsonConverters::fromArray('HkSection', $o['Sections']);
if (isset($o['Groups'])) $this->Groups = JsonConverters::fromArray('HkGroup', $o['Groups']);
if (isset($o['ResponseStatus'])) $this->ResponseStatus = JsonConverters::from('ResponseStatus', $o['ResponseStatus']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->LoadedAt)) $o['LoadedAt'] = JsonConverters::to('DateTime', $this->LoadedAt);
if (isset($this->Sections)) $o['Sections'] = JsonConverters::toArray('HkSection', $this->Sections);
if (isset($this->Groups)) $o['Groups'] = JsonConverters::toArray('HkGroup', $this->Groups);
if (isset($this->ResponseStatus)) $o['ResponseStatus'] = JsonConverters::to('ResponseStatus', $this->ResponseStatus);
return empty($o) ? new class(){} : $o;
}
}
// @DataContract
class GetHkReferenceData extends Eras2AppServiceModelBase implements JsonSerializable
{
/**
* @param string $UserId
*/
public function __construct(
string $UserId=''
) {
parent::__construct($UserId);
}
/** @throws Exception */
public function fromMap($o): void {
parent::fromMap($o);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = parent::jsonSerialize();
return empty($o) ? new class(){} : $o;
}
}
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 /App/{UserId}/HkReferenceData HTTP/1.1
Host: kromer-servamw.eras-online.de
Accept: application/xml
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length
<GetHkReferenceDataResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Eras2Amw.Service.Server.ServiceModel.Eras2App.Get">
<Groups xmlns:d2p1="http://schemas.datacontract.org/2004/07/Eras2Amw.Service.Server.ServiceModel.Common" i:nil="true" />
<LoadedAt>0001-01-01T00:00:00</LoadedAt>
<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>
<Sections xmlns:d2p1="http://schemas.datacontract.org/2004/07/Eras2Amw.Service.Server.ServiceModel.Common" i:nil="true" />
</GetHkReferenceDataResponse>