GET | /GetDefinitionKeys | A synchronous service to retrieve keys for the identification of VAT properties. |
---|
<?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};
enum VatType : string
{
case UStVA = 'UStVA';
case UStDV = 'UStDV';
case UStSV = 'UStSV';
case USt = 'USt';
case ZM = 'ZM';
}
/** @description Create a VAT return from a Return Builder definition. Use the retrieved values as keys for the dictionary of properties that Return Builder provides. */
// @Api(Description="Create a VAT return from a Return Builder definition.\n Use the retrieved values as keys for the dictionary of properties that Return Builder provides.")
class GetDefinitionKeysBase implements IGet, JsonSerializable
{
public function __construct(
/** @description The year of the assessment (Veranlagungsjahr). */
// @ApiMember(Description="The year of the assessment (Veranlagungsjahr).")
/** @var int */
public int $year=0,
/** @description The type of VAT return. */
// @ApiMember(Description="The type of VAT return.")
/** @var VatType|null */
public ?VatType $vatType=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['year'])) $this->year = $o['year'];
if (isset($o['vatType'])) $this->vatType = JsonConverters::from('VatType', $o['vatType']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->year)) $o['year'] = $this->year;
if (isset($this->vatType)) $o['vatType'] = JsonConverters::to('VatType', $this->vatType);
return empty($o) ? new class(){} : $o;
}
}
/** @description A synchronous service to retrieve keys for the identification of VAT properties. */
// @Api(Description="A synchronous service to retrieve keys for the identification of VAT properties.")
class GetDefinitionKeys extends GetDefinitionKeysBase implements JsonSerializable
{
/**
* @param int $year
* @param VatType|null $vatType
*/
public function __construct(
int $year=0,
?VatType $vatType=null
) {
parent::__construct($year,$vatType);
}
/** @throws Exception */
public function fromMap($o): void {
parent::fromMap($o);
if (isset($o['year'])) $this->year = $o['year'];
if (isset($o['vatType'])) $this->vatType = JsonConverters::from('VatType', $o['vatType']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = parent::jsonSerialize();
if (isset($this->year)) $o['year'] = $this->year;
if (isset($this->vatType)) $o['vatType'] = JsonConverters::to('VatType', $this->vatType);
return empty($o) ? new class(){} : $o;
}
}
To override the Content-type in your clients, use the HTTP Accept Header, append the .other suffix or ?format=other
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
GET /GetDefinitionKeys HTTP/1.1 Host: taxfiling.staging.pwc.de Accept: text/jsonl
HTTP/1.1 200 OK Content-Type: text/jsonl Content-Length: length [{"name":"String","description":"String","type":"String","mandatory":"String"}]