| POST | /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 PostHeizbetriebskostenResponse implements JsonSerializable
{
public function __construct(
/** @var ResponseStatus|null */
public ?ResponseStatus $responseStatus=null,
/** @var string|null */
public ?string $checksumMD5=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['responseStatus'])) $this->responseStatus = JsonConverters::from('ResponseStatus', $o['responseStatus']);
if (isset($o['checksumMD5'])) $this->checksumMD5 = $o['checksumMD5'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->responseStatus)) $o['responseStatus'] = JsonConverters::to('ResponseStatus', $this->responseStatus);
if (isset($this->checksumMD5)) $o['checksumMD5'] = $this->checksumMD5;
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 PostHeizbetriebskosten 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 PostHeizbetriebskosten DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .csv suffix or ?format=csv
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /api/v1/heizbetriebskosten HTTP/1.1
Host: immo-account-servdesk.eras-online.de
Accept: text/csv
Content-Type: text/csv
Content-Length: length
{"heizbetriebskosten":{"guid":"00000000000000000000000000000000","from":"0001-01-01T00:00:00.0000000Z","to":"0001-01-01T00:00:00.0000000Z","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/csv
Content-Length: length
{"responseStatus":{"errorCode":"String","message":"String","stackTrace":"String","errors":[{"errorCode":"String","fieldName":"String","message":"String","meta":{"String":"String"}}],"meta":{"String":"String"}},"checksumMD5":"String"}