| GET | /api/v1/nutzeinheiten/{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 Address implements JsonSerializable
{
public function __construct(
// @DataMember
/** @var string */
public string $guid='',
// @DataMember
/** @var string|null */
public ?string $street=null,
// @DataMember
/** @var string|null */
public ?string $street2=null,
// @DataMember
/** @var string|null */
public ?string $streetNumber=null,
// @DataMember
/** @var string|null */
public ?string $zipcode=null,
// @DataMember
/** @var string|null */
public ?string $city=null,
// @DataMember
/** @var string|null */
public ?string $mailbox=null,
// @DataMember
/** @var string|null */
public ?string $additional=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['guid'])) $this->guid = $o['guid'];
if (isset($o['street'])) $this->street = $o['street'];
if (isset($o['street2'])) $this->street2 = $o['street2'];
if (isset($o['streetNumber'])) $this->streetNumber = $o['streetNumber'];
if (isset($o['zipcode'])) $this->zipcode = $o['zipcode'];
if (isset($o['city'])) $this->city = $o['city'];
if (isset($o['mailbox'])) $this->mailbox = $o['mailbox'];
if (isset($o['additional'])) $this->additional = $o['additional'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->guid)) $o['guid'] = $this->guid;
if (isset($this->street)) $o['street'] = $this->street;
if (isset($this->street2)) $o['street2'] = $this->street2;
if (isset($this->streetNumber)) $o['streetNumber'] = $this->streetNumber;
if (isset($this->zipcode)) $o['zipcode'] = $this->zipcode;
if (isset($this->city)) $o['city'] = $this->city;
if (isset($this->mailbox)) $o['mailbox'] = $this->mailbox;
if (isset($this->additional)) $o['additional'] = $this->additional;
return empty($o) ? new class(){} : $o;
}
}
enum NutzerType : string
{
case Leerstand = 'Leerstand';
case Gewerblich = 'Gewerblich';
case Privat = 'Privat';
case AllgemeineNutzung = 'AllgemeineNutzung';
}
// @DataContract
class Nutzer implements JsonSerializable
{
public function __construct(
// @DataMember
/** @var string */
public string $guid='',
// @DataMember
/** @var string|null */
public ?string $name1=null,
// @DataMember
/** @var string|null */
public ?string $name2=null,
// @DataMember
/** @var string|null */
public ?string $name3=null,
// @DataMember
/** @var string|null */
public ?string $name4=null,
// @DataMember
// @ApiMember(IsRequired=true)
/** @var NutzerType|null */
public ?NutzerType $nutzerType=null,
// @DataMember
/** @var string|null */
public ?string $nutzeinheitNumberExternal=null,
// @DataMember
// @ApiMember(IsRequired=true)
/** @var int */
public int $nutzerInNutzeinheitSequence=0,
// @DataMember
// @ApiMember(IsRequired=true)
/** @var DateTime */
public DateTime $rangeFrom=new DateTime(),
// @DataMember
/** @var DateTime|null */
public ?DateTime $rangeTo=null,
// @DataMember
/** @var bool|null */
public ?bool $isDeleted=null,
// @DataMember
/** @var bool|null */
public ?bool $isCreatedByApp=null,
// @DataMember(Name="IstUvi")
/** @var string|null */
public ?string $IstUvi=null,
// @DataMember(Name="EigentuemerBewohnt")
/** @var string|null */
public ?string $EigentuemerBewohnt=null,
// @DataMember(Name="Email")
/** @var string|null */
public ?string $Email=null,
// @DataMember(Name="Mobil")
/** @var string|null */
public ?string $Mobil=null,
// @DataMember
/** @var string|null */
public ?string $title=null,
// @DataMember
// @ApiMember(IsRequired=true, ParameterType="body")
/** @var string */
public string $salutation=''
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['guid'])) $this->guid = $o['guid'];
if (isset($o['name1'])) $this->name1 = $o['name1'];
if (isset($o['name2'])) $this->name2 = $o['name2'];
if (isset($o['name3'])) $this->name3 = $o['name3'];
if (isset($o['name4'])) $this->name4 = $o['name4'];
if (isset($o['nutzerType'])) $this->nutzerType = JsonConverters::from('NutzerType', $o['nutzerType']);
if (isset($o['nutzeinheitNumberExternal'])) $this->nutzeinheitNumberExternal = $o['nutzeinheitNumberExternal'];
if (isset($o['nutzerInNutzeinheitSequence'])) $this->nutzerInNutzeinheitSequence = $o['nutzerInNutzeinheitSequence'];
if (isset($o['rangeFrom'])) $this->rangeFrom = JsonConverters::from('DateTime', $o['rangeFrom']);
if (isset($o['rangeTo'])) $this->rangeTo = JsonConverters::from('DateTime', $o['rangeTo']);
if (isset($o['isDeleted'])) $this->isDeleted = $o['isDeleted'];
if (isset($o['isCreatedByApp'])) $this->isCreatedByApp = $o['isCreatedByApp'];
if (isset($o['IstUvi'])) $this->IstUvi = $o['IstUvi'];
if (isset($o['EigentuemerBewohnt'])) $this->EigentuemerBewohnt = $o['EigentuemerBewohnt'];
if (isset($o['Email'])) $this->Email = $o['Email'];
if (isset($o['Mobil'])) $this->Mobil = $o['Mobil'];
if (isset($o['title'])) $this->title = $o['title'];
if (isset($o['salutation'])) $this->salutation = $o['salutation'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->guid)) $o['guid'] = $this->guid;
if (isset($this->name1)) $o['name1'] = $this->name1;
if (isset($this->name2)) $o['name2'] = $this->name2;
if (isset($this->name3)) $o['name3'] = $this->name3;
if (isset($this->name4)) $o['name4'] = $this->name4;
if (isset($this->nutzerType)) $o['nutzerType'] = JsonConverters::to('NutzerType', $this->nutzerType);
if (isset($this->nutzeinheitNumberExternal)) $o['nutzeinheitNumberExternal'] = $this->nutzeinheitNumberExternal;
if (isset($this->nutzerInNutzeinheitSequence)) $o['nutzerInNutzeinheitSequence'] = $this->nutzerInNutzeinheitSequence;
if (isset($this->rangeFrom)) $o['rangeFrom'] = JsonConverters::to('DateTime', $this->rangeFrom);
if (isset($this->rangeTo)) $o['rangeTo'] = JsonConverters::to('DateTime', $this->rangeTo);
if (isset($this->isDeleted)) $o['isDeleted'] = $this->isDeleted;
if (isset($this->isCreatedByApp)) $o['isCreatedByApp'] = $this->isCreatedByApp;
if (isset($this->IstUvi)) $o['IstUvi'] = $this->IstUvi;
if (isset($this->EigentuemerBewohnt)) $o['EigentuemerBewohnt'] = $this->EigentuemerBewohnt;
if (isset($this->Email)) $o['Email'] = $this->Email;
if (isset($this->Mobil)) $o['Mobil'] = $this->Mobil;
if (isset($this->title)) $o['title'] = $this->title;
if (isset($this->salutation)) $o['salutation'] = $this->salutation;
return empty($o) ? new class(){} : $o;
}
}
// @DataContract
class OwnerNutzeinheit implements JsonSerializable
{
public function __construct(
// @DataMember(Name="Guid")
/** @var string|null */
public ?string $Guid=null,
// @DataMember(Name="Name1")
/** @var string|null */
public ?string $Name1=null,
// @DataMember(Name="Name2")
/** @var string|null */
public ?string $Name2=null,
// @DataMember(Name="Name3")
/** @var string|null */
public ?string $Name3=null,
// @DataMember(Name="Name4")
/** @var string|null */
public ?string $Name4=null,
// @DataMember(Name="ZeitraumVon")
/** @var DateTime */
public DateTime $ZeitraumVon=new DateTime(),
// @DataMember(Name="ZeitraumBis")
/** @var DateTime|null */
public ?DateTime $ZeitraumBis=null,
// @DataMember(Name="Titel")
/** @var string|null */
public ?string $Titel=null,
// @DataMember(Name="Anrede")
/** @var string|null */
public ?string $Anrede=null,
// @DataMember(Name="AdressGuid")
/** @var string|null */
public ?string $AdressGuid=null,
// @DataMember(Name="NutzeinheitGuid")
/** @var string|null */
public ?string $NutzeinheitGuid=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['Guid'])) $this->Guid = $o['Guid'];
if (isset($o['Name1'])) $this->Name1 = $o['Name1'];
if (isset($o['Name2'])) $this->Name2 = $o['Name2'];
if (isset($o['Name3'])) $this->Name3 = $o['Name3'];
if (isset($o['Name4'])) $this->Name4 = $o['Name4'];
if (isset($o['ZeitraumVon'])) $this->ZeitraumVon = JsonConverters::from('DateTime', $o['ZeitraumVon']);
if (isset($o['ZeitraumBis'])) $this->ZeitraumBis = JsonConverters::from('DateTime', $o['ZeitraumBis']);
if (isset($o['Titel'])) $this->Titel = $o['Titel'];
if (isset($o['Anrede'])) $this->Anrede = $o['Anrede'];
if (isset($o['AdressGuid'])) $this->AdressGuid = $o['AdressGuid'];
if (isset($o['NutzeinheitGuid'])) $this->NutzeinheitGuid = $o['NutzeinheitGuid'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->Guid)) $o['Guid'] = $this->Guid;
if (isset($this->Name1)) $o['Name1'] = $this->Name1;
if (isset($this->Name2)) $o['Name2'] = $this->Name2;
if (isset($this->Name3)) $o['Name3'] = $this->Name3;
if (isset($this->Name4)) $o['Name4'] = $this->Name4;
if (isset($this->ZeitraumVon)) $o['ZeitraumVon'] = JsonConverters::to('DateTime', $this->ZeitraumVon);
if (isset($this->ZeitraumBis)) $o['ZeitraumBis'] = JsonConverters::to('DateTime', $this->ZeitraumBis);
if (isset($this->Titel)) $o['Titel'] = $this->Titel;
if (isset($this->Anrede)) $o['Anrede'] = $this->Anrede;
if (isset($this->AdressGuid)) $o['AdressGuid'] = $this->AdressGuid;
if (isset($this->NutzeinheitGuid)) $o['NutzeinheitGuid'] = $this->NutzeinheitGuid;
return empty($o) ? new class(){} : $o;
}
}
// @DataContract
class NutzeinheitDevice implements JsonSerializable
{
public function __construct(
// @DataMember(Name="Guid")
/** @var string|null */
public ?string $Guid=null,
// @DataMember(Name="ZuordnungVon")
/** @var DateTime */
public DateTime $ZuordnungVon=new DateTime(),
// @DataMember(Name="ZuordnungBis")
/** @var DateTime|null */
public ?DateTime $ZuordnungBis=null,
// @DataMember(Name="Raum")
/** @var string|null */
public ?string $Raum=null,
// @DataMember(Name="LaufendeNummer")
/** @var string|null */
public ?string $LaufendeNummer=null,
// @DataMember(Name="gemietet")
/** @var bool|null */
public ?bool $gemietet=null,
// @DataMember(Name="gewartet")
/** @var bool|null */
public ?bool $gewartet=null,
// @DataMember(Name="DeviceGuid")
/** @var string|null */
public ?string $DeviceGuid=null,
// @DataMember(Name="NutzeinheitGuid")
/** @var string|null */
public ?string $NutzeinheitGuid=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['Guid'])) $this->Guid = $o['Guid'];
if (isset($o['ZuordnungVon'])) $this->ZuordnungVon = JsonConverters::from('DateTime', $o['ZuordnungVon']);
if (isset($o['ZuordnungBis'])) $this->ZuordnungBis = JsonConverters::from('DateTime', $o['ZuordnungBis']);
if (isset($o['Raum'])) $this->Raum = $o['Raum'];
if (isset($o['LaufendeNummer'])) $this->LaufendeNummer = $o['LaufendeNummer'];
if (isset($o['gemietet'])) $this->gemietet = $o['gemietet'];
if (isset($o['gewartet'])) $this->gewartet = $o['gewartet'];
if (isset($o['DeviceGuid'])) $this->DeviceGuid = $o['DeviceGuid'];
if (isset($o['NutzeinheitGuid'])) $this->NutzeinheitGuid = $o['NutzeinheitGuid'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->Guid)) $o['Guid'] = $this->Guid;
if (isset($this->ZuordnungVon)) $o['ZuordnungVon'] = JsonConverters::to('DateTime', $this->ZuordnungVon);
if (isset($this->ZuordnungBis)) $o['ZuordnungBis'] = JsonConverters::to('DateTime', $this->ZuordnungBis);
if (isset($this->Raum)) $o['Raum'] = $this->Raum;
if (isset($this->LaufendeNummer)) $o['LaufendeNummer'] = $this->LaufendeNummer;
if (isset($this->gemietet)) $o['gemietet'] = $this->gemietet;
if (isset($this->gewartet)) $o['gewartet'] = $this->gewartet;
if (isset($this->DeviceGuid)) $o['DeviceGuid'] = $this->DeviceGuid;
if (isset($this->NutzeinheitGuid)) $o['NutzeinheitGuid'] = $this->NutzeinheitGuid;
return empty($o) ? new class(){} : $o;
}
}
// @DataContract
class Nutzeinheit implements JsonSerializable
{
public function __construct(
// @DataMember
/** @var string */
public string $guid='',
// @DataMember
/** @var string|null */
public ?string $number=null,
// @DataMember
/** @var string|null */
public ?string $location=null,
// @DataMember
/** @var Address|null */
public ?Address $address=null,
// @DataMember
/** @var array<Nutzer>|null */
public ?array $nutzer=null,
// @DataMember
/** @var array<OwnerNutzeinheit>|null */
public ?array $ownerNutzeinheiten=null,
// @DataMember
/** @var array<NutzeinheitDevice>|null */
public ?array $nutzeinheitenDevices=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['guid'])) $this->guid = $o['guid'];
if (isset($o['number'])) $this->number = $o['number'];
if (isset($o['location'])) $this->location = $o['location'];
if (isset($o['address'])) $this->address = JsonConverters::from('Address', $o['address']);
if (isset($o['nutzer'])) $this->nutzer = JsonConverters::fromArray('Nutzer', $o['nutzer']);
if (isset($o['ownerNutzeinheiten'])) $this->ownerNutzeinheiten = JsonConverters::fromArray('OwnerNutzeinheit', $o['ownerNutzeinheiten']);
if (isset($o['nutzeinheitenDevices'])) $this->nutzeinheitenDevices = JsonConverters::fromArray('NutzeinheitDevice', $o['nutzeinheitenDevices']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->guid)) $o['guid'] = $this->guid;
if (isset($this->number)) $o['number'] = $this->number;
if (isset($this->location)) $o['location'] = $this->location;
if (isset($this->address)) $o['address'] = JsonConverters::to('Address', $this->address);
if (isset($this->nutzer)) $o['nutzer'] = JsonConverters::toArray('Nutzer', $this->nutzer);
if (isset($this->ownerNutzeinheiten)) $o['ownerNutzeinheiten'] = JsonConverters::toArray('OwnerNutzeinheit', $this->ownerNutzeinheiten);
if (isset($this->nutzeinheitenDevices)) $o['nutzeinheitenDevices'] = JsonConverters::toArray('NutzeinheitDevice', $this->nutzeinheitenDevices);
return empty($o) ? new class(){} : $o;
}
}
class GetNutzeinheitResponse implements JsonSerializable
{
public function __construct(
/** @var Nutzeinheit|null */
public ?Nutzeinheit $nutzeinheit=null,
/** @var ResponseStatus|null */
public ?ResponseStatus $responseStatus=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['nutzeinheit'])) $this->nutzeinheit = JsonConverters::from('Nutzeinheit', $o['nutzeinheit']);
if (isset($o['responseStatus'])) $this->responseStatus = JsonConverters::from('ResponseStatus', $o['responseStatus']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->nutzeinheit)) $o['nutzeinheit'] = JsonConverters::to('Nutzeinheit', $this->nutzeinheit);
if (isset($this->responseStatus)) $o['responseStatus'] = JsonConverters::to('ResponseStatus', $this->responseStatus);
return empty($o) ? new class(){} : $o;
}
}
class GetNutzeinheit 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='',
// @ApiMember(ParameterType="query")
/** @var string|null */
public ?string $include=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['bearerToken'])) $this->bearerToken = $o['bearerToken'];
if (isset($o['guid'])) $this->guid = $o['guid'];
if (isset($o['include'])) $this->include = $o['include'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->bearerToken)) $o['bearerToken'] = $this->bearerToken;
if (isset($this->guid)) $o['guid'] = $this->guid;
if (isset($this->include)) $o['include'] = $this->include;
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/nutzeinheiten/{Guid} HTTP/1.1
Host: inea-servdesk.eras-online.de
Accept: text/jsv
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length
{
nutzeinheit:
{
guid: 00000000000000000000000000000000,
number: String,
location: String,
address:
{
guid: 00000000000000000000000000000000,
street: String,
street2: String,
streetNumber: String,
zipcode: String,
city: String,
mailbox: String,
additional: String
},
nutzer:
[
{
guid: 00000000000000000000000000000000,
name1: String,
name2: String,
name3: String,
name4: String,
nutzerType: Leerstand,
nutzeinheitNumberExternal: String,
nutzerInNutzeinheitSequence: 0,
rangeFrom: 0001-01-01T00:00:00Z,
rangeTo: 0001-01-01T00:00:00Z,
isDeleted: False,
isCreatedByApp: False,
IstUvi: String,
EigentuemerBewohnt: String,
Email: String,
Mobil: String,
title: String,
salutation: String
}
],
ownerNutzeinheiten:
[
{
guid: 00000000000000000000000000000000,
name1: String,
name2: String,
name3: String,
name4: String,
rangeFrom: 0001-01-01T00:00:00Z,
rangeTo: 0001-01-01T00:00:00Z,
title: String,
salutation: String,
address:
{
guid: 00000000000000000000000000000000,
street: String,
street2: String,
streetNumber: String,
zipcode: String,
city: String,
mailbox: String,
additional: String
}
}
],
nutzeinheitenDevices:
[
{
guid: 00000000000000000000000000000000,
assignedFromDate: 0001-01-01T00:00:00Z,
assignedToDate: 0001-01-01T00:00:00Z,
room: String,
ongoingNumber: String,
isRented: False,
isMaintained: False,
device:
{
guid: 00000000000000000000000000000000,
number: String,
label: String,
description: String,
installationDate: 0001-01-01T00:00:00Z,
deinstallationDate: 0001-01-01T00:00:00Z,
calibrationDate: 0001-01-01T00:00:00Z,
unit: L,
note: String,
deviceCatalog:
{
Guid: String,
TypKurz: String,
TypLang: String,
Ablesbar: False,
Klasse: String,
Abzug: False,
Hkvv: False,
Funk: False
},
deviceConsumptions:
[
{
guid: 00000000000000000000000000000000,
deviceReading: 0,
deviceReadingDate: 0001-01-01T00:00:00Z,
deviceReadingKind: ZA,
changeDate: 0001-01-01T00:00:00Z,
note: String,
ampouleColour: String,
deviceGuid: String
}
]
}
}
]
},
responseStatus:
{
errorCode: String,
message: String,
stackTrace: String,
errors:
[
{
errorCode: String,
fieldName: String,
message: String,
meta:
{
String: String
}
}
],
meta:
{
String: String
}
}
}