| GET | /api/v1/direktkosten/{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};
// @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 GetDirektkostenResponse implements JsonSerializable
{
public function __construct(
/** @var Direktkosten|null */
public ?Direktkosten $direktkosten=null,
/** @var ResponseStatus|null */
public ?ResponseStatus $responseStatus=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['direktkosten'])) $this->direktkosten = JsonConverters::from('Direktkosten', $o['direktkosten']);
if (isset($o['responseStatus'])) $this->responseStatus = JsonConverters::from('ResponseStatus', $o['responseStatus']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->direktkosten)) $o['direktkosten'] = JsonConverters::to('Direktkosten', $this->direktkosten);
if (isset($this->responseStatus)) $o['responseStatus'] = JsonConverters::to('ResponseStatus', $this->responseStatus);
return empty($o) ? new class(){} : $o;
}
}
class GetDirektkosten 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;
}
}
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/{Guid} HTTP/1.1
Host: dumpro-servdesk.eras-online.de
Accept: application/json
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length
{"direktkosten":{"guid":"00000000000000000000000000000000","label":"String","date":"0001-01-01T00:00:00.0000000Z","brutto":0,"salesTax":0,"quantity":0,"type":"String","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"}}}