Server

<back to all web services

GetNebenkosten

Nebenkosten
Requires Authentication
The following routes are available for this service:
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;
    }
}

PHP GetNebenkosten DTOs

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

HTTP + JSON

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: messtechnik-horb-servdesk.eras-online.de 
Accept: application/json
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length

{"nebenkosten":{"guid":"00000000000000000000000000000000","number":0,"from":"0001-01-01T00:00:00.0000000Z","to":"0001-01-01T00:00:00.0000000Z","targetAllocation":"Null","targetAllocationIn":"Nebenkosten","nebenkostenKind":"String","kostenart":"String","brutto":0,"bruttoLastYear":0,"salesTax":0,"haushaltsnahediensteLabel":"String","haushaltsnahediensteBrutto":0,"kostenartUnit":"String","reduzierungsartType":"String","comment":"String","isDeleted":false,"isCreatedByApp":false,"nebenkostenNutzeinheiten":[{"relativeAmount":0,"isDeleted":false,"isCreatedByApp":false,"nutzeinheitGuid":"00000000000000000000000000000000"}],"nebenkostenNutzer":[{"relativeAmount":0,"isDeleted":false,"isCreatedByApp":false,"nutzerGuid":"00000000000000000000000000000000"}],"billingInformation":{"guid":"String","from":"0001-01-01T00:00:00.0000000Z","to":"0001-01-01T00:00:00.0000000Z","isCompleted":false,"hasNebenkosten":false}},"responseStatus":{"errorCode":"String","message":"String","stackTrace":"String","errors":[{"errorCode":"String","fieldName":"String","message":"String","meta":{"String":"String"}}],"meta":{"String":"String"}}}