| GET | /api/v1/direktkosten |
|---|
<?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};
// @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 Direktkosten implements JsonSerializable
{
public function __construct(
// @DataMember
/** @var string */
public string $guid='',
// @DataMember
/** @var string|null */
public ?string $label=null,
// @DataMember
/** @var DateTime */
public DateTime $date=new DateTime(),
// @DataMember
/** @var float */
public float $brutto=0.0,
// @DataMember
/** @var float */
public float $salesTax=0.0,
// @DataMember
/** @var float */
public float $quantity=0.0,
// @DataMember
/** @var string|null */
public ?string $type=null,
// @DataMember
/** @var bool|null */
public ?bool $isDeleted=null,
// @DataMember
/** @var bool|null */
public ?bool $isCreatedByApp=null,
// @DataMember
/** @var string */
public string $nutzerGuid='',
// @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['label'])) $this->label = $o['label'];
if (isset($o['date'])) $this->date = JsonConverters::from('DateTime', $o['date']);
if (isset($o['brutto'])) $this->brutto = $o['brutto'];
if (isset($o['salesTax'])) $this->salesTax = $o['salesTax'];
if (isset($o['quantity'])) $this->quantity = $o['quantity'];
if (isset($o['type'])) $this->type = $o['type'];
if (isset($o['isDeleted'])) $this->isDeleted = $o['isDeleted'];
if (isset($o['isCreatedByApp'])) $this->isCreatedByApp = $o['isCreatedByApp'];
if (isset($o['nutzerGuid'])) $this->nutzerGuid = $o['nutzerGuid'];
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->label)) $o['label'] = $this->label;
if (isset($this->date)) $o['date'] = JsonConverters::to('DateTime', $this->date);
if (isset($this->brutto)) $o['brutto'] = $this->brutto;
if (isset($this->salesTax)) $o['salesTax'] = $this->salesTax;
if (isset($this->quantity)) $o['quantity'] = $this->quantity;
if (isset($this->type)) $o['type'] = $this->type;
if (isset($this->isDeleted)) $o['isDeleted'] = $this->isDeleted;
if (isset($this->isCreatedByApp)) $o['isCreatedByApp'] = $this->isCreatedByApp;
if (isset($this->nutzerGuid)) $o['nutzerGuid'] = $this->nutzerGuid;
if (isset($this->billingInformation)) $o['billingInformation'] = JsonConverters::to('BillingInformation', $this->billingInformation);
return empty($o) ? new class(){} : $o;
}
}
class GetDirektkostenListResponse implements JsonSerializable
{
public function __construct(
/** @var array<Direktkosten>|null */
public ?array $direktkostenList=null,
/** @var ResponseStatus|null */
public ?ResponseStatus $responseStatus=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['direktkostenList'])) $this->direktkostenList = JsonConverters::fromArray('Direktkosten', $o['direktkostenList']);
if (isset($o['responseStatus'])) $this->responseStatus = JsonConverters::from('ResponseStatus', $o['responseStatus']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->direktkostenList)) $o['direktkostenList'] = JsonConverters::toArray('Direktkosten', $this->direktkostenList);
if (isset($this->responseStatus)) $o['responseStatus'] = JsonConverters::to('ResponseStatus', $this->responseStatus);
return empty($o) ? new class(){} : $o;
}
}
class GetDirektkostenList implements IHasBearerToken, JsonSerializable
{
public function __construct(
// @ApiMember(IsRequired=true, ParameterType="query")
/** @var string */
public string $bearerToken='',
/** @description Optional! Follow the format : /api/v1/direktkosten?filter[ObjektGuid]=* */
// @DataMember(Name="filter[ObjektGuid]")
// @ApiMember(Description="Optional! Follow the format : /api/v1/direktkosten?filter[ObjektGuid]=*", ParameterType="query")
/** @var string|null */
public ?string $filter_ObjektGuid_=null,
/** @description Optional! Follow the format : /api/v1/direktkosten?filter[NutzerGuid]=* */
// @DataMember(Name="filter[NutzerGuid]")
// @ApiMember(Description="Optional! Follow the format : /api/v1/direktkosten?filter[NutzerGuid]=*", ParameterType="query")
/** @var string|null */
public ?string $filter_NutzerGuid_=null,
/** @description Optional! Follow the format : /api/v1/direktkosten?filter[BillingInformationGuid]=* */
// @DataMember(Name="filter[BillingInformationGuid]")
// @ApiMember(Description="Optional! Follow the format : /api/v1/direktkosten?filter[BillingInformationGuid]=*", ParameterType="query")
/** @var string|null */
public ?string $filter_BillingInformationGuid_=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['bearerToken'])) $this->bearerToken = $o['bearerToken'];
if (isset($o['filter_ObjektGuid_'])) $this->filter_ObjektGuid_ = $o['filter_ObjektGuid_'];
if (isset($o['filter_NutzerGuid_'])) $this->filter_NutzerGuid_ = $o['filter_NutzerGuid_'];
if (isset($o['filter_BillingInformationGuid_'])) $this->filter_BillingInformationGuid_ = $o['filter_BillingInformationGuid_'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->bearerToken)) $o['bearerToken'] = $this->bearerToken;
if (isset($this->filter_ObjektGuid_)) $o['filter_ObjektGuid_'] = $this->filter_ObjektGuid_;
if (isset($this->filter_NutzerGuid_)) $o['filter_NutzerGuid_'] = $this->filter_NutzerGuid_;
if (isset($this->filter_BillingInformationGuid_)) $o['filter_BillingInformationGuid_'] = $this->filter_BillingInformationGuid_;
return empty($o) ? new class(){} : $o;
}
}
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
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
GET /api/v1/direktkosten HTTP/1.1 Host: hbr-regional-servdesk.eras-online.de Accept: application/json
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length
{"responseStatus":{"errorCode":"String","message":"String","stackTrace":"String","errors":[{"errorCode":"String","fieldName":"String","message":"String","meta":{"String":"String"}}],"meta":{"String":"String"}}}