| 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 .xml suffix or ?format=xml
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: andreiuologmbh-servdesk.eras-online.de
Accept: application/xml
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length
<GetEnergieVerwerterResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Eras2Web.Service.Desktop.Server.ServiceModel.Eras2WebExt.Get">
<BrennstoffMedium xmlns:d2p1="http://schemas.datacontract.org/2004/07/Eras2Web.Service.Desktop.Server.ServiceModel.Stammdaten">
<d2p1:Bezeichnung>String</d2p1:Bezeichnung>
<d2p1:EinheitTyp>String</d2p1:EinheitTyp>
<d2p1:Guid>String</d2p1:Guid>
<d2p1:Heizwert>0</d2p1:Heizwert>
<d2p1:Lagernd>false</d2p1:Lagernd>
</BrennstoffMedium>
<EnergieVerwerter xmlns:d2p1="http://schemas.datacontract.org/2004/07/Eras2Web.Service.Desktop.Server.ServiceModel.Eras2WebExt.Models">
<d2p1:AssemblyDate>0001-01-01T00:00:00</d2p1:AssemblyDate>
<d2p1:BrennstoffMediumGuid>00000000-0000-0000-0000-000000000000</d2p1:BrennstoffMediumGuid>
<d2p1:Brennwert>false</d2p1:Brennwert>
<d2p1:BuildYear>0</d2p1:BuildYear>
<d2p1:CommercialSupply>false</d2p1:CommercialSupply>
<d2p1:DisassemblyDate>0001-01-01T00:00:00</d2p1:DisassemblyDate>
<d2p1:EfficiencyFactor>0</d2p1:EfficiencyFactor>
<d2p1:Guid>String</d2p1:Guid>
<d2p1:Label>String</d2p1:Label>
<d2p1:Temperature>0</d2p1:Temperature>
</EnergieVerwerter>
<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>
</GetEnergieVerwerterResponse>