| GET | /api/v1/Energieverwerter/{Guid} |
|---|
<?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 EnergieVerwerter implements JsonSerializable
{
public function __construct(
// @DataMember
/** @var string|null */
public ?string $guid=null,
// @DataMember
/** @var string|null */
public ?string $label=null,
// @DataMember
/** @var float|null */
public ?float $efficiencyFactor=null,
// @DataMember
/** @var DateTime */
public DateTime $assemblyDate=new DateTime(),
// @DataMember
/** @var DateTime|null */
public ?DateTime $disassemblyDate=null,
// @DataMember
/** @var int|null */
public ?int $buildYear=null,
// @DataMember
/** @var int|null */
public ?int $temperature=null,
// @DataMember
/** @var bool|null */
public ?bool $commercialSupply=null,
// @DataMember
/** @var bool|null */
public ?bool $brennwert=null,
// @DataMember
/** @var string */
public string $brennstoffMediumGuid=''
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['guid'])) $this->guid = $o['guid'];
if (isset($o['label'])) $this->label = $o['label'];
if (isset($o['efficiencyFactor'])) $this->efficiencyFactor = $o['efficiencyFactor'];
if (isset($o['assemblyDate'])) $this->assemblyDate = JsonConverters::from('DateTime', $o['assemblyDate']);
if (isset($o['disassemblyDate'])) $this->disassemblyDate = JsonConverters::from('DateTime', $o['disassemblyDate']);
if (isset($o['buildYear'])) $this->buildYear = $o['buildYear'];
if (isset($o['temperature'])) $this->temperature = $o['temperature'];
if (isset($o['commercialSupply'])) $this->commercialSupply = $o['commercialSupply'];
if (isset($o['brennwert'])) $this->brennwert = $o['brennwert'];
if (isset($o['brennstoffMediumGuid'])) $this->brennstoffMediumGuid = $o['brennstoffMediumGuid'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->guid)) $o['guid'] = $this->guid;
if (isset($this->label)) $o['label'] = $this->label;
if (isset($this->efficiencyFactor)) $o['efficiencyFactor'] = $this->efficiencyFactor;
if (isset($this->assemblyDate)) $o['assemblyDate'] = JsonConverters::to('DateTime', $this->assemblyDate);
if (isset($this->disassemblyDate)) $o['disassemblyDate'] = JsonConverters::to('DateTime', $this->disassemblyDate);
if (isset($this->buildYear)) $o['buildYear'] = $this->buildYear;
if (isset($this->temperature)) $o['temperature'] = $this->temperature;
if (isset($this->commercialSupply)) $o['commercialSupply'] = $this->commercialSupply;
if (isset($this->brennwert)) $o['brennwert'] = $this->brennwert;
if (isset($this->brennstoffMediumGuid)) $o['brennstoffMediumGuid'] = $this->brennstoffMediumGuid;
return empty($o) ? new class(){} : $o;
}
}
// @DataContract
class BrennstoffMedium implements JsonSerializable
{
public function __construct(
// @DataMember(Name="Guid")
/** @var string|null */
public ?string $Guid=null,
// @DataMember(Name="Bezeichnung")
/** @var string|null */
public ?string $Bezeichnung=null,
// @DataMember(Name="Lagernd")
/** @var bool|null */
public ?bool $Lagernd=null,
// @DataMember(Name="EinheitTyp")
/** @var string|null */
public ?string $EinheitTyp=null,
// @DataMember(Name="Heizwert")
/** @var float|null */
public ?float $Heizwert=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['Guid'])) $this->Guid = $o['Guid'];
if (isset($o['Bezeichnung'])) $this->Bezeichnung = $o['Bezeichnung'];
if (isset($o['Lagernd'])) $this->Lagernd = $o['Lagernd'];
if (isset($o['EinheitTyp'])) $this->EinheitTyp = $o['EinheitTyp'];
if (isset($o['Heizwert'])) $this->Heizwert = $o['Heizwert'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->Guid)) $o['Guid'] = $this->Guid;
if (isset($this->Bezeichnung)) $o['Bezeichnung'] = $this->Bezeichnung;
if (isset($this->Lagernd)) $o['Lagernd'] = $this->Lagernd;
if (isset($this->EinheitTyp)) $o['EinheitTyp'] = $this->EinheitTyp;
if (isset($this->Heizwert)) $o['Heizwert'] = $this->Heizwert;
return empty($o) ? new class(){} : $o;
}
}
class GetEnergieVerwerterResponse implements JsonSerializable
{
public function __construct(
/** @var EnergieVerwerter|null */
public ?EnergieVerwerter $energieVerwerter=null,
/** @var BrennstoffMedium|null */
public ?BrennstoffMedium $brennstoffMedium=null,
/** @var ResponseStatus|null */
public ?ResponseStatus $responseStatus=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['energieVerwerter'])) $this->energieVerwerter = JsonConverters::from('EnergieVerwerter', $o['energieVerwerter']);
if (isset($o['brennstoffMedium'])) $this->brennstoffMedium = JsonConverters::from('BrennstoffMedium', $o['brennstoffMedium']);
if (isset($o['responseStatus'])) $this->responseStatus = JsonConverters::from('ResponseStatus', $o['responseStatus']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->energieVerwerter)) $o['energieVerwerter'] = JsonConverters::to('EnergieVerwerter', $this->energieVerwerter);
if (isset($this->brennstoffMedium)) $o['brennstoffMedium'] = JsonConverters::to('BrennstoffMedium', $this->brennstoffMedium);
if (isset($this->responseStatus)) $o['responseStatus'] = JsonConverters::to('ResponseStatus', $this->responseStatus);
return empty($o) ? new class(){} : $o;
}
}
class GetEnergieVerwerter implements IHasBearerToken, JsonSerializable
{
public function __construct(
// @ApiMember(IsRequired=true, ParameterType="query")
/** @var string */
public string $bearerToken='',
// @ApiMember(IsRequired=true, ParameterType="path")
/** @var string */
public string $guid=''
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['bearerToken'])) $this->bearerToken = $o['bearerToken'];
if (isset($o['guid'])) $this->guid = $o['guid'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->bearerToken)) $o['bearerToken'] = $this->bearerToken;
if (isset($this->guid)) $o['guid'] = $this->guid;
return empty($o) ? new class(){} : $o;
}
}
To override the Content-type in your clients, use the HTTP Accept Header, append the .jsv suffix or ?format=jsv
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
GET /api/v1/Energieverwerter/{Guid} HTTP/1.1
Host: calotec-portal-servdesk.eras-online.de
Accept: text/jsv
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length
{
energieVerwerter:
{
guid: String,
label: String,
efficiencyFactor: 0,
assemblyDate: 0001-01-01T00:00:00Z,
disassemblyDate: 0001-01-01T00:00:00Z,
buildYear: 0,
temperature: 0,
commercialSupply: False,
brennwert: False,
brennstoffMediumGuid: 00000000000000000000000000000000
},
brennstoffMedium:
{
Guid: String,
Bezeichnung: String,
Lagernd: False,
EinheitTyp: String,
Heizwert: 0
},
responseStatus:
{
errorCode: String,
message: String,
stackTrace: String,
errors:
[
{
errorCode: String,
fieldName: String,
message: String,
meta:
{
String: String
}
}
],
meta:
{
String: String
}
}
}