| GET | /api/v1/nebenkosten/{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};
enum NebenkostenTargetAllocation : string
{
case Null = 'Null';
case AlleNutzer = 'AlleNutzer';
case ZugeordneteNutzer = 'ZugeordneteNutzer';
case ZugeordneteNutzeinheiten = 'ZugeordneteNutzeinheiten';
case ZugeordneteNutzerDiff = 'ZugeordneteNutzerDiff';
case ZugeordneteNutzeinheitenDiff = 'ZugeordneteNutzeinheitenDiff';
}
enum NebenkostenTargetAllocationIn : string
{
case Nebenkosten = 'Nebenkosten';
case Heizkosten = 'Heizkosten';
case Warmwasserkosten = 'Warmwasserkosten';
}
// @DataContract
class NebenkostenNutzeinheit implements JsonSerializable
{
public function __construct(
// @DataMember
/** @var float|null */
public ?float $relativeAmount=null,
// @DataMember
/** @var bool|null */
public ?bool $isDeleted=null,
// @DataMember
/** @var bool|null */
public ?bool $isCreatedByApp=null,
// @DataMember
/** @var string */
public string $nutzeinheitGuid=''
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['relativeAmount'])) $this->relativeAmount = $o['relativeAmount'];
if (isset($o['isDeleted'])) $this->isDeleted = $o['isDeleted'];
if (isset($o['isCreatedByApp'])) $this->isCreatedByApp = $o['isCreatedByApp'];
if (isset($o['nutzeinheitGuid'])) $this->nutzeinheitGuid = $o['nutzeinheitGuid'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->relativeAmount)) $o['relativeAmount'] = $this->relativeAmount;
if (isset($this->isDeleted)) $o['isDeleted'] = $this->isDeleted;
if (isset($this->isCreatedByApp)) $o['isCreatedByApp'] = $this->isCreatedByApp;
if (isset($this->nutzeinheitGuid)) $o['nutzeinheitGuid'] = $this->nutzeinheitGuid;
return empty($o) ? new class(){} : $o;
}
}
// @DataContract
class NebenkostenNutzer implements JsonSerializable
{
public function __construct(
// @DataMember
/** @var float|null */
public ?float $relativeAmount=null,
// @DataMember
/** @var bool|null */
public ?bool $isDeleted=null,
// @DataMember
/** @var bool|null */
public ?bool $isCreatedByApp=null,
// @DataMember
/** @var string */
public string $nutzerGuid=''
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['relativeAmount'])) $this->relativeAmount = $o['relativeAmount'];
if (isset($o['isDeleted'])) $this->isDeleted = $o['isDeleted'];
if (isset($o['isCreatedByApp'])) $this->isCreatedByApp = $o['isCreatedByApp'];
if (isset($o['nutzerGuid'])) $this->nutzerGuid = $o['nutzerGuid'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->relativeAmount)) $o['relativeAmount'] = $this->relativeAmount;
if (isset($this->isDeleted)) $o['isDeleted'] = $this->isDeleted;
if (isset($this->isCreatedByApp)) $o['isCreatedByApp'] = $this->isCreatedByApp;
if (isset($this->nutzerGuid)) $o['nutzerGuid'] = $this->nutzerGuid;
return empty($o) ? new class(){} : $o;
}
}
// @DataContract
class BillingInformation implements JsonSerializable
{
public function __construct(
// @DataMember
/** @var string|null */
public ?string $guid=null,
// @DataMember
/** @var DateTime */
public DateTime $from=new DateTime(),
// @DataMember
/** @var DateTime */
public DateTime $to=new DateTime(),
// @DataMember
/** @var bool|null */
public ?bool $isCompleted=null,
// @DataMember
/** @var bool|null */
public ?bool $hasNebenkosten=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['guid'])) $this->guid = $o['guid'];
if (isset($o['from'])) $this->from = JsonConverters::from('DateTime', $o['from']);
if (isset($o['to'])) $this->to = JsonConverters::from('DateTime', $o['to']);
if (isset($o['isCompleted'])) $this->isCompleted = $o['isCompleted'];
if (isset($o['hasNebenkosten'])) $this->hasNebenkosten = $o['hasNebenkosten'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->guid)) $o['guid'] = $this->guid;
if (isset($this->from)) $o['from'] = JsonConverters::to('DateTime', $this->from);
if (isset($this->to)) $o['to'] = JsonConverters::to('DateTime', $this->to);
if (isset($this->isCompleted)) $o['isCompleted'] = $this->isCompleted;
if (isset($this->hasNebenkosten)) $o['hasNebenkosten'] = $this->hasNebenkosten;
return empty($o) ? new class(){} : $o;
}
}
// @DataContract
class Nebenkosten implements JsonSerializable
{
public function __construct(
// @DataMember
/** @var string */
public string $guid='',
// @DataMember
/** @var int */
public int $number=0,
// @DataMember
/** @var DateTime */
public DateTime $from=new DateTime(),
// @DataMember
/** @var DateTime */
public DateTime $to=new DateTime(),
// @DataMember
/** @var NebenkostenTargetAllocation|null */
public ?NebenkostenTargetAllocation $targetAllocation=null,
// @DataMember
/** @var NebenkostenTargetAllocationIn|null */
public ?NebenkostenTargetAllocationIn $targetAllocationIn=null,
// @DataMember
/** @var string|null */
public ?string $nebenkostenKind=null,
/** @description Freitext */
// @DataMember
// @ApiMember(Description="Freitext")
/** @var string|null */
public ?string $kostenart=null,
// @DataMember
/** @var float|null */
public ?float $brutto=null,
// @DataMember
/** @var float|null */
public ?float $bruttoLastYear=null,
// @DataMember
/** @var float|null */
public ?float $salesTax=null,
// @DataMember
/** @var string|null */
public ?string $haushaltsnahediensteLabel=null,
// @DataMember
/** @var float|null */
public ?float $haushaltsnahediensteBrutto=null,
/** @description Freitext */
// @DataMember
// @ApiMember(Description="Freitext")
/** @var string|null */
public ?string $kostenartUnit=null,
// @DataMember
/** @var string|null */
public ?string $reduzierungsartType=null,
// @DataMember
/** @var string|null */
public ?string $comment=null,
// @DataMember
/** @var bool|null */
public ?bool $isDeleted=null,
// @DataMember
/** @var bool|null */
public ?bool $isCreatedByApp=null,
// @DataMember
/** @var array<NebenkostenNutzeinheit>|null */
public ?array $nebenkostenNutzeinheiten=null,
// @DataMember
/** @var array<NebenkostenNutzer>|null */
public ?array $nebenkostenNutzer=null,
// @DataMember
/** @var BillingInformation|null */
public ?BillingInformation $billingInformation=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['from'])) $this->from = JsonConverters::from('DateTime', $o['from']);
if (isset($o['to'])) $this->to = JsonConverters::from('DateTime', $o['to']);
if (isset($o['targetAllocation'])) $this->targetAllocation = JsonConverters::from('NebenkostenTargetAllocation', $o['targetAllocation']);
if (isset($o['targetAllocationIn'])) $this->targetAllocationIn = JsonConverters::from('NebenkostenTargetAllocationIn', $o['targetAllocationIn']);
if (isset($o['nebenkostenKind'])) $this->nebenkostenKind = $o['nebenkostenKind'];
if (isset($o['kostenart'])) $this->kostenart = $o['kostenart'];
if (isset($o['brutto'])) $this->brutto = $o['brutto'];
if (isset($o['bruttoLastYear'])) $this->bruttoLastYear = $o['bruttoLastYear'];
if (isset($o['salesTax'])) $this->salesTax = $o['salesTax'];
if (isset($o['haushaltsnahediensteLabel'])) $this->haushaltsnahediensteLabel = $o['haushaltsnahediensteLabel'];
if (isset($o['haushaltsnahediensteBrutto'])) $this->haushaltsnahediensteBrutto = $o['haushaltsnahediensteBrutto'];
if (isset($o['kostenartUnit'])) $this->kostenartUnit = $o['kostenartUnit'];
if (isset($o['reduzierungsartType'])) $this->reduzierungsartType = $o['reduzierungsartType'];
if (isset($o['comment'])) $this->comment = $o['comment'];
if (isset($o['isDeleted'])) $this->isDeleted = $o['isDeleted'];
if (isset($o['isCreatedByApp'])) $this->isCreatedByApp = $o['isCreatedByApp'];
if (isset($o['nebenkostenNutzeinheiten'])) $this->nebenkostenNutzeinheiten = JsonConverters::fromArray('NebenkostenNutzeinheit', $o['nebenkostenNutzeinheiten']);
if (isset($o['nebenkostenNutzer'])) $this->nebenkostenNutzer = JsonConverters::fromArray('NebenkostenNutzer', $o['nebenkostenNutzer']);
if (isset($o['billingInformation'])) $this->billingInformation = JsonConverters::from('BillingInformation', $o['billingInformation']);
}
/** @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->from)) $o['from'] = JsonConverters::to('DateTime', $this->from);
if (isset($this->to)) $o['to'] = JsonConverters::to('DateTime', $this->to);
if (isset($this->targetAllocation)) $o['targetAllocation'] = JsonConverters::to('NebenkostenTargetAllocation', $this->targetAllocation);
if (isset($this->targetAllocationIn)) $o['targetAllocationIn'] = JsonConverters::to('NebenkostenTargetAllocationIn', $this->targetAllocationIn);
if (isset($this->nebenkostenKind)) $o['nebenkostenKind'] = $this->nebenkostenKind;
if (isset($this->kostenart)) $o['kostenart'] = $this->kostenart;
if (isset($this->brutto)) $o['brutto'] = $this->brutto;
if (isset($this->bruttoLastYear)) $o['bruttoLastYear'] = $this->bruttoLastYear;
if (isset($this->salesTax)) $o['salesTax'] = $this->salesTax;
if (isset($this->haushaltsnahediensteLabel)) $o['haushaltsnahediensteLabel'] = $this->haushaltsnahediensteLabel;
if (isset($this->haushaltsnahediensteBrutto)) $o['haushaltsnahediensteBrutto'] = $this->haushaltsnahediensteBrutto;
if (isset($this->kostenartUnit)) $o['kostenartUnit'] = $this->kostenartUnit;
if (isset($this->reduzierungsartType)) $o['reduzierungsartType'] = $this->reduzierungsartType;
if (isset($this->comment)) $o['comment'] = $this->comment;
if (isset($this->isDeleted)) $o['isDeleted'] = $this->isDeleted;
if (isset($this->isCreatedByApp)) $o['isCreatedByApp'] = $this->isCreatedByApp;
if (isset($this->nebenkostenNutzeinheiten)) $o['nebenkostenNutzeinheiten'] = JsonConverters::toArray('NebenkostenNutzeinheit', $this->nebenkostenNutzeinheiten);
if (isset($this->nebenkostenNutzer)) $o['nebenkostenNutzer'] = JsonConverters::toArray('NebenkostenNutzer', $this->nebenkostenNutzer);
if (isset($this->billingInformation)) $o['billingInformation'] = JsonConverters::to('BillingInformation', $this->billingInformation);
return empty($o) ? new class(){} : $o;
}
}
class GetNebenkostenResponse implements JsonSerializable
{
public function __construct(
/** @var Nebenkosten|null */
public ?Nebenkosten $nebenkosten=null,
/** @var ResponseStatus|null */
public ?ResponseStatus $responseStatus=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['nebenkosten'])) $this->nebenkosten = JsonConverters::from('Nebenkosten', $o['nebenkosten']);
if (isset($o['responseStatus'])) $this->responseStatus = JsonConverters::from('ResponseStatus', $o['responseStatus']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->nebenkosten)) $o['nebenkosten'] = JsonConverters::to('Nebenkosten', $this->nebenkosten);
if (isset($this->responseStatus)) $o['responseStatus'] = JsonConverters::to('ResponseStatus', $this->responseStatus);
return empty($o) ? new class(){} : $o;
}
}
class GetNebenkosten 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/nebenkosten/{Guid} HTTP/1.1
Host: faabrechnungen-servdesk.eras-online.de
Accept: application/xml
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length
<GetNebenkostenResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Eras2Web.Service.Desktop.Server.ServiceModel.Eras2WebExt.Get">
<Nebenkosten xmlns:d2p1="http://schemas.datacontract.org/2004/07/Eras2Web.Service.Desktop.Server.ServiceModel.Eras2WebExt.Models">
<d2p1:BillingInformation>
<d2p1:From>0001-01-01T00:00:00</d2p1:From>
<d2p1:Guid>String</d2p1:Guid>
<d2p1:HasNebenkosten>false</d2p1:HasNebenkosten>
<d2p1:IsCompleted>false</d2p1:IsCompleted>
<d2p1:To>0001-01-01T00:00:00</d2p1:To>
</d2p1:BillingInformation>
<d2p1:Brutto>0</d2p1:Brutto>
<d2p1:BruttoLastYear>0</d2p1:BruttoLastYear>
<d2p1:Comment>String</d2p1:Comment>
<d2p1:From>0001-01-01T00:00:00</d2p1:From>
<d2p1:Guid>00000000-0000-0000-0000-000000000000</d2p1:Guid>
<d2p1:HaushaltsnahediensteBrutto>0</d2p1:HaushaltsnahediensteBrutto>
<d2p1:HaushaltsnahediensteLabel>String</d2p1:HaushaltsnahediensteLabel>
<d2p1:IsCreatedByApp>false</d2p1:IsCreatedByApp>
<d2p1:IsDeleted>false</d2p1:IsDeleted>
<d2p1:Kostenart>String</d2p1:Kostenart>
<d2p1:KostenartUnit>String</d2p1:KostenartUnit>
<d2p1:NebenkostenKind>String</d2p1:NebenkostenKind>
<d2p1:NebenkostenNutzeinheiten>
<d2p1:NebenkostenNutzeinheit>
<d2p1:IsCreatedByApp>false</d2p1:IsCreatedByApp>
<d2p1:IsDeleted>false</d2p1:IsDeleted>
<d2p1:NutzeinheitGuid>00000000-0000-0000-0000-000000000000</d2p1:NutzeinheitGuid>
<d2p1:RelativeAmount>0</d2p1:RelativeAmount>
</d2p1:NebenkostenNutzeinheit>
</d2p1:NebenkostenNutzeinheiten>
<d2p1:NebenkostenNutzer>
<d2p1:NebenkostenNutzer>
<d2p1:IsCreatedByApp>false</d2p1:IsCreatedByApp>
<d2p1:IsDeleted>false</d2p1:IsDeleted>
<d2p1:NutzerGuid>00000000-0000-0000-0000-000000000000</d2p1:NutzerGuid>
<d2p1:RelativeAmount>0</d2p1:RelativeAmount>
</d2p1:NebenkostenNutzer>
</d2p1:NebenkostenNutzer>
<d2p1:Number>0</d2p1:Number>
<d2p1:ReduzierungsartType>String</d2p1:ReduzierungsartType>
<d2p1:SalesTax>0</d2p1:SalesTax>
<d2p1:TargetAllocation>Null</d2p1:TargetAllocation>
<d2p1:TargetAllocationIn>Nebenkosten</d2p1:TargetAllocationIn>
<d2p1:To>0001-01-01T00:00:00</d2p1:To>
</Nebenkosten>
<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>
</GetNebenkostenResponse>