| POST | /api/v1/brennstofflieferung |
|---|
<?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 PostBrennstoffResponse 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 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 Brennstofflieferung implements JsonSerializable
{
public function __construct(
// @DataMember
/** @var string */
public string $guid='',
// @DataMember
/** @var DateTime */
public DateTime $deliveryDate=new DateTime(),
// @DataMember
/** @var float|null */
public ?float $salexTax=null,
// @DataMember
/** @var float|null */
public ?float $emisionsTax=null,
// @DataMember
/** @var float|null */
public ?float $c02Taxes=null,
// @DataMember
/** @var float|null */
public ?float $customsTax=null,
// @DataMember
/** @var float|null */
public ?float $otherCharges=null,
// @DataMember
/** @var float|null */
public ?float $c02Price=null,
// @DataMember
/** @var float|null */
public ?float $c02Tons=null,
// @DataMember
/** @var float|null */
public ?float $quantity=null,
// @DataMember
/** @var float|null */
public ?float $amount=null,
// @DataMember
/** @var float|null */
public ?float $startMeterReadingValue=null,
// @DataMember
/** @var float|null */
public ?float $endMeterReadingValue=null,
// @DataMember
/** @var float */
public float $heizwert=0.0,
// @DataMember
/** @var bool|null */
public ?bool $brennwert=null,
// @DataMember
/** @var string|null */
public ?string $energyReliefAmountDescription=null,
// @DataMember
/** @var float|null */
public ?float $energyReliefAmount=null,
// @DataMember
/** @var string|null */
public ?string $electricityReliefAmountDescription=null,
// @DataMember
/** @var float|null */
public ?float $electricityReliefAmount=null,
// @DataMember
/** @var float|null */
public ?float $cO2EmissionsFactor=null,
// @DataMember
/** @var string|null */
public ?string $cO2Text=null,
// @DataMember
/** @var bool|null */
public ?bool $cO2Active=null,
// @DataMember
/** @var bool|null */
public ?bool $cO2PriceKnd=null,
// @DataMember
/** @var float|null */
public ?float $cO2PriceLandlord=null,
// @DataMember
/** @var float|null */
public ?float $cO2PriceRenter=null,
// @DataMember
/** @var float|null */
public ?float $cO2Area=null,
// @DataMember
/** @var bool|null */
public ?bool $isForCommercialUse=null,
// @DataMember
/** @var bool|null */
public ?bool $isRenovationRequired=null,
// @DataMember
/** @var bool|null */
public ?bool $isHeatingPadsImproved=null,
// @DataMember
/** @var float|null */
public ?float $cO2KWh=null,
// @DataMember
/** @var float|null */
public ?float $includedCO2SalesTax=null,
// @DataMember
/** @var float|null */
public ?float $cO2Costs=null,
// @DataMember
/** @var float|null */
public ?float $totalC02Weight=null,
// @DataMember
/** @var bool|null */
public ?bool $noTotalDeductionC02Costs=null,
// @DataMember
/** @var bool|null */
public ?bool $isDeleted=null,
// @DataMember
/** @var bool|null */
public ?bool $isCreatedByApp=null,
// @DataMember
/** @var string */
public string $brennstoffMediumGuid='',
// @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['deliveryDate'])) $this->deliveryDate = JsonConverters::from('DateTime', $o['deliveryDate']);
if (isset($o['salexTax'])) $this->salexTax = $o['salexTax'];
if (isset($o['emisionsTax'])) $this->emisionsTax = $o['emisionsTax'];
if (isset($o['c02Taxes'])) $this->c02Taxes = $o['c02Taxes'];
if (isset($o['customsTax'])) $this->customsTax = $o['customsTax'];
if (isset($o['otherCharges'])) $this->otherCharges = $o['otherCharges'];
if (isset($o['c02Price'])) $this->c02Price = $o['c02Price'];
if (isset($o['c02Tons'])) $this->c02Tons = $o['c02Tons'];
if (isset($o['quantity'])) $this->quantity = $o['quantity'];
if (isset($o['amount'])) $this->amount = $o['amount'];
if (isset($o['startMeterReadingValue'])) $this->startMeterReadingValue = $o['startMeterReadingValue'];
if (isset($o['endMeterReadingValue'])) $this->endMeterReadingValue = $o['endMeterReadingValue'];
if (isset($o['heizwert'])) $this->heizwert = $o['heizwert'];
if (isset($o['brennwert'])) $this->brennwert = $o['brennwert'];
if (isset($o['energyReliefAmountDescription'])) $this->energyReliefAmountDescription = $o['energyReliefAmountDescription'];
if (isset($o['energyReliefAmount'])) $this->energyReliefAmount = $o['energyReliefAmount'];
if (isset($o['electricityReliefAmountDescription'])) $this->electricityReliefAmountDescription = $o['electricityReliefAmountDescription'];
if (isset($o['electricityReliefAmount'])) $this->electricityReliefAmount = $o['electricityReliefAmount'];
if (isset($o['cO2EmissionsFactor'])) $this->cO2EmissionsFactor = $o['cO2EmissionsFactor'];
if (isset($o['cO2Text'])) $this->cO2Text = $o['cO2Text'];
if (isset($o['cO2Active'])) $this->cO2Active = $o['cO2Active'];
if (isset($o['cO2PriceKnd'])) $this->cO2PriceKnd = $o['cO2PriceKnd'];
if (isset($o['cO2PriceLandlord'])) $this->cO2PriceLandlord = $o['cO2PriceLandlord'];
if (isset($o['cO2PriceRenter'])) $this->cO2PriceRenter = $o['cO2PriceRenter'];
if (isset($o['cO2Area'])) $this->cO2Area = $o['cO2Area'];
if (isset($o['isForCommercialUse'])) $this->isForCommercialUse = $o['isForCommercialUse'];
if (isset($o['isRenovationRequired'])) $this->isRenovationRequired = $o['isRenovationRequired'];
if (isset($o['isHeatingPadsImproved'])) $this->isHeatingPadsImproved = $o['isHeatingPadsImproved'];
if (isset($o['cO2KWh'])) $this->cO2KWh = $o['cO2KWh'];
if (isset($o['includedCO2SalesTax'])) $this->includedCO2SalesTax = $o['includedCO2SalesTax'];
if (isset($o['cO2Costs'])) $this->cO2Costs = $o['cO2Costs'];
if (isset($o['totalC02Weight'])) $this->totalC02Weight = $o['totalC02Weight'];
if (isset($o['noTotalDeductionC02Costs'])) $this->noTotalDeductionC02Costs = $o['noTotalDeductionC02Costs'];
if (isset($o['isDeleted'])) $this->isDeleted = $o['isDeleted'];
if (isset($o['isCreatedByApp'])) $this->isCreatedByApp = $o['isCreatedByApp'];
if (isset($o['brennstoffMediumGuid'])) $this->brennstoffMediumGuid = $o['brennstoffMediumGuid'];
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->deliveryDate)) $o['deliveryDate'] = JsonConverters::to('DateTime', $this->deliveryDate);
if (isset($this->salexTax)) $o['salexTax'] = $this->salexTax;
if (isset($this->emisionsTax)) $o['emisionsTax'] = $this->emisionsTax;
if (isset($this->c02Taxes)) $o['c02Taxes'] = $this->c02Taxes;
if (isset($this->customsTax)) $o['customsTax'] = $this->customsTax;
if (isset($this->otherCharges)) $o['otherCharges'] = $this->otherCharges;
if (isset($this->c02Price)) $o['c02Price'] = $this->c02Price;
if (isset($this->c02Tons)) $o['c02Tons'] = $this->c02Tons;
if (isset($this->quantity)) $o['quantity'] = $this->quantity;
if (isset($this->amount)) $o['amount'] = $this->amount;
if (isset($this->startMeterReadingValue)) $o['startMeterReadingValue'] = $this->startMeterReadingValue;
if (isset($this->endMeterReadingValue)) $o['endMeterReadingValue'] = $this->endMeterReadingValue;
if (isset($this->heizwert)) $o['heizwert'] = $this->heizwert;
if (isset($this->brennwert)) $o['brennwert'] = $this->brennwert;
if (isset($this->energyReliefAmountDescription)) $o['energyReliefAmountDescription'] = $this->energyReliefAmountDescription;
if (isset($this->energyReliefAmount)) $o['energyReliefAmount'] = $this->energyReliefAmount;
if (isset($this->electricityReliefAmountDescription)) $o['electricityReliefAmountDescription'] = $this->electricityReliefAmountDescription;
if (isset($this->electricityReliefAmount)) $o['electricityReliefAmount'] = $this->electricityReliefAmount;
if (isset($this->cO2EmissionsFactor)) $o['cO2EmissionsFactor'] = $this->cO2EmissionsFactor;
if (isset($this->cO2Text)) $o['cO2Text'] = $this->cO2Text;
if (isset($this->cO2Active)) $o['cO2Active'] = $this->cO2Active;
if (isset($this->cO2PriceKnd)) $o['cO2PriceKnd'] = $this->cO2PriceKnd;
if (isset($this->cO2PriceLandlord)) $o['cO2PriceLandlord'] = $this->cO2PriceLandlord;
if (isset($this->cO2PriceRenter)) $o['cO2PriceRenter'] = $this->cO2PriceRenter;
if (isset($this->cO2Area)) $o['cO2Area'] = $this->cO2Area;
if (isset($this->isForCommercialUse)) $o['isForCommercialUse'] = $this->isForCommercialUse;
if (isset($this->isRenovationRequired)) $o['isRenovationRequired'] = $this->isRenovationRequired;
if (isset($this->isHeatingPadsImproved)) $o['isHeatingPadsImproved'] = $this->isHeatingPadsImproved;
if (isset($this->cO2KWh)) $o['cO2KWh'] = $this->cO2KWh;
if (isset($this->includedCO2SalesTax)) $o['includedCO2SalesTax'] = $this->includedCO2SalesTax;
if (isset($this->cO2Costs)) $o['cO2Costs'] = $this->cO2Costs;
if (isset($this->totalC02Weight)) $o['totalC02Weight'] = $this->totalC02Weight;
if (isset($this->noTotalDeductionC02Costs)) $o['noTotalDeductionC02Costs'] = $this->noTotalDeductionC02Costs;
if (isset($this->isDeleted)) $o['isDeleted'] = $this->isDeleted;
if (isset($this->isCreatedByApp)) $o['isCreatedByApp'] = $this->isCreatedByApp;
if (isset($this->brennstoffMediumGuid)) $o['brennstoffMediumGuid'] = $this->brennstoffMediumGuid;
if (isset($this->billingInformation)) $o['billingInformation'] = JsonConverters::to('BillingInformation', $this->billingInformation);
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 PostBrennstoff implements IHasBearerToken, JsonSerializable
{
public function __construct(
// @ApiMember(IsRequired=true, ParameterType="body")
/** @var Brennstofflieferung|null */
public ?Brennstofflieferung $brennstofflieferung=null,
// @ApiMember(IsRequired=true, ParameterType="body")
/** @var RelatedTo|null */
public ?RelatedTo $relatedToEnergieVerwerter=null,
// @ApiMember(IsRequired=true, ParameterType="body")
/** @var RelatedTo|null */
public ?RelatedTo $relatedToBrennstoffMedium=null,
// @ApiMember(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['brennstofflieferung'])) $this->brennstofflieferung = JsonConverters::from('Brennstofflieferung', $o['brennstofflieferung']);
if (isset($o['relatedToEnergieVerwerter'])) $this->relatedToEnergieVerwerter = JsonConverters::from('RelatedTo', $o['relatedToEnergieVerwerter']);
if (isset($o['relatedToBrennstoffMedium'])) $this->relatedToBrennstoffMedium = JsonConverters::from('RelatedTo', $o['relatedToBrennstoffMedium']);
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->brennstofflieferung)) $o['brennstofflieferung'] = JsonConverters::to('Brennstofflieferung', $this->brennstofflieferung);
if (isset($this->relatedToEnergieVerwerter)) $o['relatedToEnergieVerwerter'] = JsonConverters::to('RelatedTo', $this->relatedToEnergieVerwerter);
if (isset($this->relatedToBrennstoffMedium)) $o['relatedToBrennstoffMedium'] = JsonConverters::to('RelatedTo', $this->relatedToBrennstoffMedium);
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;
}
}
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.
POST /api/v1/brennstofflieferung HTTP/1.1
Host: mitchell-servdesk.eras-online.de
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length
{
brennstofflieferung:
{
guid: 00000000000000000000000000000000,
deliveryDate: 0001-01-01T00:00:00Z,
salexTax: 0,
emisionsTax: 0,
c02Taxes: 0,
customsTax: 0,
otherCharges: 0,
c02Price: 0,
c02Tons: 0,
quantity: 0,
amount: 0,
startMeterReadingValue: 0,
endMeterReadingValue: 0,
heizwert: 0,
brennwert: False,
energyReliefAmountDescription: String,
energyReliefAmount: 0,
electricityReliefAmountDescription: String,
electricityReliefAmount: 0,
cO2EmissionsFactor: 0,
cO2Text: String,
cO2Active: False,
cO2PriceKnd: False,
cO2PriceLandlord: 0,
cO2PriceRenter: 0,
cO2Area: 0,
isForCommercialUse: False,
isRenovationRequired: False,
isHeatingPadsImproved: False,
cO2KWh: 0,
includedCO2SalesTax: 0,
cO2Costs: 0,
totalC02Weight: 0,
noTotalDeductionC02Costs: False,
isDeleted: False,
isCreatedByApp: False,
brennstoffMediumGuid: 00000000000000000000000000000000,
billingInformation:
{
guid: String,
from: 0001-01-01T00:00:00Z,
to: 0001-01-01T00:00:00Z,
isCompleted: False,
hasNebenkosten: False
}
},
relatedToEnergieVerwerter:
{
guid: 00000000000000000000000000000000
},
relatedToBrennstoffMedium:
{
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
}
},
checksumMD5: String
}