Server

<back to all web services

PutHeizbetriebskosten

Heizbetriebskosten
Requires Authentication
The following routes are available for this service:
PUT/api/v1/heizbetriebskosten
<?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};


class PutHeizbetriebskostenResponse implements JsonSerializable
{
    public function __construct(
        /** @var ResponseStatus|null */
        public ?ResponseStatus $responseStatus=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['responseStatus'])) $this->responseStatus = JsonConverters::from('ResponseStatus', $o['responseStatus']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->responseStatus)) $o['responseStatus'] = JsonConverters::to('ResponseStatus', $this->responseStatus);
        return empty($o) ? new class(){} : $o;
    }
}

// @DataContract
class Heizbetriebskosten implements JsonSerializable
{
    public function __construct(
        // @DataMember
        /** @var string */
        public string $guid='',

        // @DataMember
        /** @var DateTime */
        public DateTime $from=new DateTime(),

        // @DataMember
        /** @var DateTime */
        public DateTime $to=new DateTime(),

        // @DataMember
        /** @var float */
        public float $salesTax=0.0,

        // @DataMember
        /** @var float|null */
        public ?float $haushatlsnahediensteBrutto=null,

        // @DataMember
        /** @var float|null */
        public ?float $brutto=null,

        // @DataMember
        /** @var string|null */
        public ?string $haushatlsnahediensteLabel=null,

        // @DataMember
        /** @var string|null */
        public ?string $description=null,

        // @DataMember
        /** @var bool|null */
        public ?bool $isDeleted=null,

        // @DataMember
        /** @var bool|null */
        public ?bool $isCreatedByApp=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['salesTax'])) $this->salesTax = $o['salesTax'];
        if (isset($o['haushatlsnahediensteBrutto'])) $this->haushatlsnahediensteBrutto = $o['haushatlsnahediensteBrutto'];
        if (isset($o['brutto'])) $this->brutto = $o['brutto'];
        if (isset($o['haushatlsnahediensteLabel'])) $this->haushatlsnahediensteLabel = $o['haushatlsnahediensteLabel'];
        if (isset($o['description'])) $this->description = $o['description'];
        if (isset($o['isDeleted'])) $this->isDeleted = $o['isDeleted'];
        if (isset($o['isCreatedByApp'])) $this->isCreatedByApp = $o['isCreatedByApp'];
    }
    
    /** @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->salesTax)) $o['salesTax'] = $this->salesTax;
        if (isset($this->haushatlsnahediensteBrutto)) $o['haushatlsnahediensteBrutto'] = $this->haushatlsnahediensteBrutto;
        if (isset($this->brutto)) $o['brutto'] = $this->brutto;
        if (isset($this->haushatlsnahediensteLabel)) $o['haushatlsnahediensteLabel'] = $this->haushatlsnahediensteLabel;
        if (isset($this->description)) $o['description'] = $this->description;
        if (isset($this->isDeleted)) $o['isDeleted'] = $this->isDeleted;
        if (isset($this->isCreatedByApp)) $o['isCreatedByApp'] = $this->isCreatedByApp;
        return empty($o) ? new class(){} : $o;
    }
}

// @DataContract
class RelatedTo implements JsonSerializable
{
    public function __construct(
        // @DataMember
        /** @var string */
        public string $guid=''
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['guid'])) $this->guid = $o['guid'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->guid)) $o['guid'] = $this->guid;
        return empty($o) ? new class(){} : $o;
    }
}

class PutHeizbetriebskosten implements IHasBearerToken, JsonSerializable
{
    public function __construct(
        // @ApiMember(IsRequired=true, ParameterType="body")
        /** @var Heizbetriebskosten|null */
        public ?Heizbetriebskosten $heizbetriebskosten=null,

        // @ApiMember(IsRequired=true, ParameterType="body")
        /** @var RelatedTo|null */
        public ?RelatedTo $relatedToObjekt=null,

        // @ApiMember(IsRequired=true, ParameterType="body")
        /** @var RelatedTo|null */
        public ?RelatedTo $relatedToBillingInformation=null,

        // @ApiMember(IsRequired=true, ParameterType="body")
        /** @var string */
        public string $bearerToken=''
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['heizbetriebskosten'])) $this->heizbetriebskosten = JsonConverters::from('Heizbetriebskosten', $o['heizbetriebskosten']);
        if (isset($o['relatedToObjekt'])) $this->relatedToObjekt = JsonConverters::from('RelatedTo', $o['relatedToObjekt']);
        if (isset($o['relatedToBillingInformation'])) $this->relatedToBillingInformation = JsonConverters::from('RelatedTo', $o['relatedToBillingInformation']);
        if (isset($o['bearerToken'])) $this->bearerToken = $o['bearerToken'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->heizbetriebskosten)) $o['heizbetriebskosten'] = JsonConverters::to('Heizbetriebskosten', $this->heizbetriebskosten);
        if (isset($this->relatedToObjekt)) $o['relatedToObjekt'] = JsonConverters::to('RelatedTo', $this->relatedToObjekt);
        if (isset($this->relatedToBillingInformation)) $o['relatedToBillingInformation'] = JsonConverters::to('RelatedTo', $this->relatedToBillingInformation);
        if (isset($this->bearerToken)) $o['bearerToken'] = $this->bearerToken;
        return empty($o) ? new class(){} : $o;
    }
}

PHP PutHeizbetriebskosten DTOs

To override the Content-type in your clients, use the HTTP Accept Header, append the .jsv suffix or ?format=jsv

HTTP + JSV

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

PUT /api/v1/heizbetriebskosten HTTP/1.1 
Host: marneth-messdienst-servdesk.eras-online.de 
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length

{
	heizbetriebskosten: 
	{
		guid: 00000000000000000000000000000000,
		from: 0001-01-01T00:00:00Z,
		to: 0001-01-01T00:00:00Z,
		salesTax: 0,
		haushatlsnahediensteBrutto: 0,
		brutto: 0,
		haushatlsnahediensteLabel: String,
		description: String,
		isDeleted: False,
		isCreatedByApp: False
	},
	relatedToObjekt: 
	{
		guid: 00000000000000000000000000000000
	},
	relatedToBillingInformation: 
	{
		guid: 00000000000000000000000000000000
	},
	bearerToken: String
}
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length

{
	responseStatus: 
	{
		errorCode: String,
		message: String,
		stackTrace: String,
		errors: 
		[
			{
				errorCode: String,
				fieldName: String,
				message: String,
				meta: 
				{
					String: String
				}
			}
		],
		meta: 
		{
			String: String
		}
	}
}