Server

<back to all web services

GetHkReferenceData

Requires Authentication
The following routes are available for this service:
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;
    }
}

PHP GetHkReferenceData DTOs

To override the Content-type in your clients, use the HTTP Accept Header, append the .other suffix or ?format=other

HTTP + OTHER

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: immo-account-servamw.eras-online.de 
Accept: text/jsonl
HTTP/1.1 200 OK
Content-Type: text/jsonl
Content-Length: length

{"LoadedAt":"0001-01-01T00:00:00.0000000Z","ResponseStatus":{"errorCode":"String","message":"String","stackTrace":"String","errors":[{"errorCode":"String","fieldName":"String","message":"String","meta":{"String":"String"}}],"meta":{"String":"String"}}}