| POST | /App/{UserId}/HkEvaluate |
|---|
<?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 HkMatchDifference implements JsonSerializable
{
public function __construct(
// @DataMember(Name="Code")
/** @var string|null */
public ?string $Code=null,
// @DataMember(Name="Name")
/** @var string|null */
public ?string $Name=null,
// @DataMember(Name="Value")
/** @var string|null */
public ?string $Value=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['Code'])) $this->Code = $o['Code'];
if (isset($o['Name'])) $this->Name = $o['Name'];
if (isset($o['Value'])) $this->Value = $o['Value'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->Code)) $o['Code'] = $this->Code;
if (isset($this->Name)) $o['Name'] = $this->Name;
if (isset($this->Value)) $o['Value'] = $this->Value;
return empty($o) ? new class(){} : $o;
}
}
// @DataContract
class HkRadiatorMatch implements JsonSerializable
{
public function __construct(
// @DataMember(Name="Match")
/** @var int */
public int $Match=0,
// @DataMember(Name="RadiatisRadiatorId")
/** @var int|null */
public ?int $RadiatisRadiatorId=null,
// @DataMember(Name="Producer")
/** @var string|null */
public ?string $Producer=null,
// @DataMember(Name="Model")
/** @var string|null */
public ?string $Model=null,
// @DataMember(Name="ModelNoteReference")
/** @var string|null */
public ?string $ModelNoteReference=null,
// @DataMember(Name="KcValue")
/** @var float|null */
public ?float $KcValue=null,
// @DataMember(Name="KqValue")
/** @var float|null */
public ?float $KqValue=null,
// @DataMember(Name="KtValue")
/** @var float|null */
public ?float $KtValue=null,
// @DataMember(Name="Differences")
/** @var array<HkMatchDifference>|null */
public ?array $Differences=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['Match'])) $this->Match = $o['Match'];
if (isset($o['RadiatisRadiatorId'])) $this->RadiatisRadiatorId = $o['RadiatisRadiatorId'];
if (isset($o['Producer'])) $this->Producer = $o['Producer'];
if (isset($o['Model'])) $this->Model = $o['Model'];
if (isset($o['ModelNoteReference'])) $this->ModelNoteReference = $o['ModelNoteReference'];
if (isset($o['KcValue'])) $this->KcValue = $o['KcValue'];
if (isset($o['KqValue'])) $this->KqValue = $o['KqValue'];
if (isset($o['KtValue'])) $this->KtValue = $o['KtValue'];
if (isset($o['Differences'])) $this->Differences = JsonConverters::fromArray('HkMatchDifference', $o['Differences']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->Match)) $o['Match'] = $this->Match;
if (isset($this->RadiatisRadiatorId)) $o['RadiatisRadiatorId'] = $this->RadiatisRadiatorId;
if (isset($this->Producer)) $o['Producer'] = $this->Producer;
if (isset($this->Model)) $o['Model'] = $this->Model;
if (isset($this->ModelNoteReference)) $o['ModelNoteReference'] = $this->ModelNoteReference;
if (isset($this->KcValue)) $o['KcValue'] = $this->KcValue;
if (isset($this->KqValue)) $o['KqValue'] = $this->KqValue;
if (isset($this->KtValue)) $o['KtValue'] = $this->KtValue;
if (isset($this->Differences)) $o['Differences'] = JsonConverters::toArray('HkMatchDifference', $this->Differences);
return empty($o) ? new class(){} : $o;
}
}
// @DataContract
class EvaluateHkRadiatorsResponse implements JsonSerializable
{
public function __construct(
// @DataMember(Name="Radiators")
/** @var array<HkRadiatorMatch>|null */
public ?array $Radiators=null,
// @DataMember(Name="ResponseStatus")
/** @var ResponseStatus|null */
public ?ResponseStatus $ResponseStatus=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['Radiators'])) $this->Radiators = JsonConverters::fromArray('HkRadiatorMatch', $o['Radiators']);
if (isset($o['ResponseStatus'])) $this->ResponseStatus = JsonConverters::from('ResponseStatus', $o['ResponseStatus']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->Radiators)) $o['Radiators'] = JsonConverters::toArray('HkRadiatorMatch', $this->Radiators);
if (isset($this->ResponseStatus)) $o['ResponseStatus'] = JsonConverters::to('ResponseStatus', $this->ResponseStatus);
return empty($o) ? new class(){} : $o;
}
}
// @DataContract
class HkEvaluateParameter implements JsonSerializable
{
public function __construct(
// @DataMember(Name="RadiatisId")
/** @var int */
public int $RadiatisId=0,
// @DataMember(Name="Value")
/** @var string|null */
public ?string $Value=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['RadiatisId'])) $this->RadiatisId = $o['RadiatisId'];
if (isset($o['Value'])) $this->Value = $o['Value'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->RadiatisId)) $o['RadiatisId'] = $this->RadiatisId;
if (isset($this->Value)) $o['Value'] = $this->Value;
return empty($o) ? new class(){} : $o;
}
}
// @DataContract
class HkEvaluateAttribute implements JsonSerializable
{
public function __construct(
// @DataMember(Name="RadiatisId")
/** @var int */
public int $RadiatisId=0,
// @DataMember(Name="Value")
/** @var int */
public int $Value=0
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['RadiatisId'])) $this->RadiatisId = $o['RadiatisId'];
if (isset($o['Value'])) $this->Value = $o['Value'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->RadiatisId)) $o['RadiatisId'] = $this->RadiatisId;
if (isset($this->Value)) $o['Value'] = $this->Value;
return empty($o) ? new class(){} : $o;
}
}
// @DataContract
class EvaluateHkRadiators extends Eras2AppServiceModelBase implements JsonSerializable
{
/**
* @param string $UserId
*/
public function __construct(
string $UserId='',
// @DataMember(Name="RadiatorGroupId")
/** @var int */
public int $RadiatorGroupId=0,
// @DataMember(Name="Parameters")
/** @var array<HkEvaluateParameter>|null */
public ?array $Parameters=null,
// @DataMember(Name="Attributes")
/** @var array<HkEvaluateAttribute>|null */
public ?array $Attributes=null,
// @DataMember(Name="DeviceTypeIdentifier")
/** @var string|null */
public ?string $DeviceTypeIdentifier=null,
// @DataMember(Name="MountingPoint")
/** @var string|null */
public ?string $MountingPoint=null,
// @DataMember(Name="MaxResultSize")
/** @var int */
public int $MaxResultSize=0
) {
parent::__construct($UserId);
}
/** @throws Exception */
public function fromMap($o): void {
parent::fromMap($o);
if (isset($o['RadiatorGroupId'])) $this->RadiatorGroupId = $o['RadiatorGroupId'];
if (isset($o['Parameters'])) $this->Parameters = JsonConverters::fromArray('HkEvaluateParameter', $o['Parameters']);
if (isset($o['Attributes'])) $this->Attributes = JsonConverters::fromArray('HkEvaluateAttribute', $o['Attributes']);
if (isset($o['DeviceTypeIdentifier'])) $this->DeviceTypeIdentifier = $o['DeviceTypeIdentifier'];
if (isset($o['MountingPoint'])) $this->MountingPoint = $o['MountingPoint'];
if (isset($o['MaxResultSize'])) $this->MaxResultSize = $o['MaxResultSize'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = parent::jsonSerialize();
if (isset($this->RadiatorGroupId)) $o['RadiatorGroupId'] = $this->RadiatorGroupId;
if (isset($this->Parameters)) $o['Parameters'] = JsonConverters::toArray('HkEvaluateParameter', $this->Parameters);
if (isset($this->Attributes)) $o['Attributes'] = JsonConverters::toArray('HkEvaluateAttribute', $this->Attributes);
if (isset($this->DeviceTypeIdentifier)) $o['DeviceTypeIdentifier'] = $this->DeviceTypeIdentifier;
if (isset($this->MountingPoint)) $o['MountingPoint'] = $this->MountingPoint;
if (isset($this->MaxResultSize)) $o['MaxResultSize'] = $this->MaxResultSize;
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 /App/{UserId}/HkEvaluate HTTP/1.1
Host: imm-con-gmbh-servamw.eras-online.de
Accept: application/json
Content-Type: application/json
Content-Length: length
{"RadiatorGroupId":0,"DeviceTypeIdentifier":"String","MountingPoint":"String","MaxResultSize":0,"UserId":"00000000000000000000000000000000"}
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length
{"ResponseStatus":{"errorCode":"String","message":"String","stackTrace":"String","errors":[{"errorCode":"String","fieldName":"String","message":"String","meta":{"String":"String"}}],"meta":{"String":"String"}}}