| GET | /App/{UserId}/HkEvaluations |
|---|
<?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 HkEvaluationParameter 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="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['Code'])) $this->Code = $o['Code'];
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->Code)) $o['Code'] = $this->Code;
if (isset($this->Value)) $o['Value'] = $this->Value;
return empty($o) ? new class(){} : $o;
}
}
// @DataContract
class HkEvaluationAttribute 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="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['Code'])) $this->Code = $o['Code'];
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->Code)) $o['Code'] = $this->Code;
if (isset($this->Value)) $o['Value'] = $this->Value;
return empty($o) ? new class(){} : $o;
}
}
// @DataContract
class HkEvaluation implements JsonSerializable
{
public function __construct(
// @DataMember(Name="Guid")
/** @var string */
public string $Guid='',
// @DataMember(Name="DeviceGuid")
/** @var string */
public string $DeviceGuid='',
// @DataMember(Name="DeviceNumber")
/** @var string|null */
public ?string $DeviceNumber=null,
// @DataMember(Name="NutzeinheitNumber")
/** @var string|null */
public ?string $NutzeinheitNumber=null,
// @DataMember(Name="NutzeinheitAddress")
/** @var string|null */
public ?string $NutzeinheitAddress=null,
// @DataMember(Name="HkveModel")
/** @var string|null */
public ?string $HkveModel=null,
// @DataMember(Name="HkveModelCustom")
/** @var string|null */
public ?string $HkveModelCustom=null,
// @DataMember(Name="MountingPoint")
/** @var string|null */
public ?string $MountingPoint=null,
// @DataMember(Name="MountingPointCustom")
/** @var string|null */
public ?string $MountingPointCustom=null,
// @DataMember(Name="GroupId")
/** @var int */
public int $GroupId=0,
// @DataMember(Name="GroupName")
/** @var string|null */
public ?string $GroupName=null,
// @DataMember(Name="TopMatch")
/** @var string|null */
public ?string $TopMatch=null,
// @DataMember(Name="RadiatisRadiatorId")
/** @var int|null */
public ?int $RadiatisRadiatorId=null,
// @DataMember(Name="ModelNoteReference")
/** @var string|null */
public ?string $ModelNoteReference=null,
// @DataMember(Name="Match")
/** @var int */
public int $Match=0,
// @DataMember(Name="KcValue")
/** @var float|null */
public ?float $KcValue=null,
// @DataMember(Name="KqValue")
/** @var float|null */
public ?float $KqValue=null,
// @DataMember(Name="Created")
/** @var DateTime */
public DateTime $Created=new DateTime(),
// @DataMember(Name="LastModified")
/** @var DateTime|null */
public ?DateTime $LastModified=null,
// @DataMember(Name="TechnicianUserId")
/** @var string|null */
public ?string $TechnicianUserId=null,
// @DataMember(Name="ReceivedAt")
/** @var DateTime|null */
public ?DateTime $ReceivedAt=null,
// @DataMember(Name="Parameters")
/** @var array<HkEvaluationParameter>|null */
public ?array $Parameters=null,
// @DataMember(Name="Attributes")
/** @var array<HkEvaluationAttribute>|null */
public ?array $Attributes=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['Guid'])) $this->Guid = $o['Guid'];
if (isset($o['DeviceGuid'])) $this->DeviceGuid = $o['DeviceGuid'];
if (isset($o['DeviceNumber'])) $this->DeviceNumber = $o['DeviceNumber'];
if (isset($o['NutzeinheitNumber'])) $this->NutzeinheitNumber = $o['NutzeinheitNumber'];
if (isset($o['NutzeinheitAddress'])) $this->NutzeinheitAddress = $o['NutzeinheitAddress'];
if (isset($o['HkveModel'])) $this->HkveModel = $o['HkveModel'];
if (isset($o['HkveModelCustom'])) $this->HkveModelCustom = $o['HkveModelCustom'];
if (isset($o['MountingPoint'])) $this->MountingPoint = $o['MountingPoint'];
if (isset($o['MountingPointCustom'])) $this->MountingPointCustom = $o['MountingPointCustom'];
if (isset($o['GroupId'])) $this->GroupId = $o['GroupId'];
if (isset($o['GroupName'])) $this->GroupName = $o['GroupName'];
if (isset($o['TopMatch'])) $this->TopMatch = $o['TopMatch'];
if (isset($o['RadiatisRadiatorId'])) $this->RadiatisRadiatorId = $o['RadiatisRadiatorId'];
if (isset($o['ModelNoteReference'])) $this->ModelNoteReference = $o['ModelNoteReference'];
if (isset($o['Match'])) $this->Match = $o['Match'];
if (isset($o['KcValue'])) $this->KcValue = $o['KcValue'];
if (isset($o['KqValue'])) $this->KqValue = $o['KqValue'];
if (isset($o['Created'])) $this->Created = JsonConverters::from('DateTime', $o['Created']);
if (isset($o['LastModified'])) $this->LastModified = JsonConverters::from('DateTime', $o['LastModified']);
if (isset($o['TechnicianUserId'])) $this->TechnicianUserId = $o['TechnicianUserId'];
if (isset($o['ReceivedAt'])) $this->ReceivedAt = JsonConverters::from('DateTime', $o['ReceivedAt']);
if (isset($o['Parameters'])) $this->Parameters = JsonConverters::fromArray('HkEvaluationParameter', $o['Parameters']);
if (isset($o['Attributes'])) $this->Attributes = JsonConverters::fromArray('HkEvaluationAttribute', $o['Attributes']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->Guid)) $o['Guid'] = $this->Guid;
if (isset($this->DeviceGuid)) $o['DeviceGuid'] = $this->DeviceGuid;
if (isset($this->DeviceNumber)) $o['DeviceNumber'] = $this->DeviceNumber;
if (isset($this->NutzeinheitNumber)) $o['NutzeinheitNumber'] = $this->NutzeinheitNumber;
if (isset($this->NutzeinheitAddress)) $o['NutzeinheitAddress'] = $this->NutzeinheitAddress;
if (isset($this->HkveModel)) $o['HkveModel'] = $this->HkveModel;
if (isset($this->HkveModelCustom)) $o['HkveModelCustom'] = $this->HkveModelCustom;
if (isset($this->MountingPoint)) $o['MountingPoint'] = $this->MountingPoint;
if (isset($this->MountingPointCustom)) $o['MountingPointCustom'] = $this->MountingPointCustom;
if (isset($this->GroupId)) $o['GroupId'] = $this->GroupId;
if (isset($this->GroupName)) $o['GroupName'] = $this->GroupName;
if (isset($this->TopMatch)) $o['TopMatch'] = $this->TopMatch;
if (isset($this->RadiatisRadiatorId)) $o['RadiatisRadiatorId'] = $this->RadiatisRadiatorId;
if (isset($this->ModelNoteReference)) $o['ModelNoteReference'] = $this->ModelNoteReference;
if (isset($this->Match)) $o['Match'] = $this->Match;
if (isset($this->KcValue)) $o['KcValue'] = $this->KcValue;
if (isset($this->KqValue)) $o['KqValue'] = $this->KqValue;
if (isset($this->Created)) $o['Created'] = JsonConverters::to('DateTime', $this->Created);
if (isset($this->LastModified)) $o['LastModified'] = JsonConverters::to('DateTime', $this->LastModified);
if (isset($this->TechnicianUserId)) $o['TechnicianUserId'] = $this->TechnicianUserId;
if (isset($this->ReceivedAt)) $o['ReceivedAt'] = JsonConverters::to('DateTime', $this->ReceivedAt);
if (isset($this->Parameters)) $o['Parameters'] = JsonConverters::toArray('HkEvaluationParameter', $this->Parameters);
if (isset($this->Attributes)) $o['Attributes'] = JsonConverters::toArray('HkEvaluationAttribute', $this->Attributes);
return empty($o) ? new class(){} : $o;
}
}
// @DataContract
class GetHkEvaluationsResponse implements JsonSerializable
{
public function __construct(
// @DataMember(Name="Evaluations")
/** @var array<HkEvaluation>|null */
public ?array $Evaluations=null,
// @DataMember(Name="ResponseStatus")
/** @var ResponseStatus|null */
public ?ResponseStatus $ResponseStatus=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['Evaluations'])) $this->Evaluations = JsonConverters::fromArray('HkEvaluation', $o['Evaluations']);
if (isset($o['ResponseStatus'])) $this->ResponseStatus = JsonConverters::from('ResponseStatus', $o['ResponseStatus']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->Evaluations)) $o['Evaluations'] = JsonConverters::toArray('HkEvaluation', $this->Evaluations);
if (isset($this->ResponseStatus)) $o['ResponseStatus'] = JsonConverters::to('ResponseStatus', $this->ResponseStatus);
return empty($o) ? new class(){} : $o;
}
}
// @DataContract
class GetHkEvaluations extends Eras2AppServiceModelBase implements JsonSerializable
{
/**
* @param string $UserId
*/
public function __construct(
string $UserId='',
// @DataMember(Name="DeviceGuids")
/** @var array<string>|null */
public ?array $DeviceGuids=null,
// @DataMember(Name="ReceivedSince")
/** @var DateTime|null */
public ?DateTime $ReceivedSince=null,
// @DataMember(Name="LatestPerDeviceOnly")
/** @var bool|null */
public ?bool $LatestPerDeviceOnly=null
) {
parent::__construct($UserId);
}
/** @throws Exception */
public function fromMap($o): void {
parent::fromMap($o);
if (isset($o['DeviceGuids'])) $this->DeviceGuids = JsonConverters::fromArray('Guid', $o['DeviceGuids']);
if (isset($o['ReceivedSince'])) $this->ReceivedSince = JsonConverters::from('DateTime', $o['ReceivedSince']);
if (isset($o['LatestPerDeviceOnly'])) $this->LatestPerDeviceOnly = $o['LatestPerDeviceOnly'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = parent::jsonSerialize();
if (isset($this->DeviceGuids)) $o['DeviceGuids'] = JsonConverters::toArray('Guid', $this->DeviceGuids);
if (isset($this->ReceivedSince)) $o['ReceivedSince'] = JsonConverters::to('DateTime', $this->ReceivedSince);
if (isset($this->LatestPerDeviceOnly)) $o['LatestPerDeviceOnly'] = $this->LatestPerDeviceOnly;
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.
GET /App/{UserId}/HkEvaluations HTTP/1.1
Host: kromer-servamw.eras-online.de
Accept: application/json
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"}}}