| GET | /api/v1/nutzer |
|---|
<?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 NutzerType : string
{
case Leerstand = 'Leerstand';
case Gewerblich = 'Gewerblich';
case Privat = 'Privat';
case AllgemeineNutzung = 'AllgemeineNutzung';
}
// @DataContract
class Nutzer implements JsonSerializable
{
public function __construct(
// @DataMember
/** @var string */
public string $guid='',
// @DataMember
/** @var string|null */
public ?string $name1=null,
// @DataMember
/** @var string|null */
public ?string $name2=null,
// @DataMember
/** @var string|null */
public ?string $name3=null,
// @DataMember
/** @var string|null */
public ?string $name4=null,
// @DataMember
// @ApiMember(IsRequired=true)
/** @var NutzerType|null */
public ?NutzerType $nutzerType=null,
// @DataMember
/** @var string|null */
public ?string $nutzeinheitNumberExternal=null,
// @DataMember
// @ApiMember(IsRequired=true)
/** @var int */
public int $nutzerInNutzeinheitSequence=0,
// @DataMember
// @ApiMember(IsRequired=true)
/** @var DateTime */
public DateTime $rangeFrom=new DateTime(),
// @DataMember
/** @var DateTime|null */
public ?DateTime $rangeTo=null,
// @DataMember
/** @var bool|null */
public ?bool $isDeleted=null,
// @DataMember
/** @var bool|null */
public ?bool $isCreatedByApp=null,
// @DataMember(Name="IstUvi")
/** @var string|null */
public ?string $IstUvi=null,
// @DataMember(Name="EigentuemerBewohnt")
/** @var string|null */
public ?string $EigentuemerBewohnt=null,
// @DataMember(Name="Email")
/** @var string|null */
public ?string $Email=null,
// @DataMember(Name="Mobil")
/** @var string|null */
public ?string $Mobil=null,
// @DataMember
/** @var string|null */
public ?string $title=null,
// @DataMember
// @ApiMember(IsRequired=true, ParameterType="body")
/** @var string */
public string $salutation=''
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['guid'])) $this->guid = $o['guid'];
if (isset($o['name1'])) $this->name1 = $o['name1'];
if (isset($o['name2'])) $this->name2 = $o['name2'];
if (isset($o['name3'])) $this->name3 = $o['name3'];
if (isset($o['name4'])) $this->name4 = $o['name4'];
if (isset($o['nutzerType'])) $this->nutzerType = JsonConverters::from('NutzerType', $o['nutzerType']);
if (isset($o['nutzeinheitNumberExternal'])) $this->nutzeinheitNumberExternal = $o['nutzeinheitNumberExternal'];
if (isset($o['nutzerInNutzeinheitSequence'])) $this->nutzerInNutzeinheitSequence = $o['nutzerInNutzeinheitSequence'];
if (isset($o['rangeFrom'])) $this->rangeFrom = JsonConverters::from('DateTime', $o['rangeFrom']);
if (isset($o['rangeTo'])) $this->rangeTo = JsonConverters::from('DateTime', $o['rangeTo']);
if (isset($o['isDeleted'])) $this->isDeleted = $o['isDeleted'];
if (isset($o['isCreatedByApp'])) $this->isCreatedByApp = $o['isCreatedByApp'];
if (isset($o['IstUvi'])) $this->IstUvi = $o['IstUvi'];
if (isset($o['EigentuemerBewohnt'])) $this->EigentuemerBewohnt = $o['EigentuemerBewohnt'];
if (isset($o['Email'])) $this->Email = $o['Email'];
if (isset($o['Mobil'])) $this->Mobil = $o['Mobil'];
if (isset($o['title'])) $this->title = $o['title'];
if (isset($o['salutation'])) $this->salutation = $o['salutation'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->guid)) $o['guid'] = $this->guid;
if (isset($this->name1)) $o['name1'] = $this->name1;
if (isset($this->name2)) $o['name2'] = $this->name2;
if (isset($this->name3)) $o['name3'] = $this->name3;
if (isset($this->name4)) $o['name4'] = $this->name4;
if (isset($this->nutzerType)) $o['nutzerType'] = JsonConverters::to('NutzerType', $this->nutzerType);
if (isset($this->nutzeinheitNumberExternal)) $o['nutzeinheitNumberExternal'] = $this->nutzeinheitNumberExternal;
if (isset($this->nutzerInNutzeinheitSequence)) $o['nutzerInNutzeinheitSequence'] = $this->nutzerInNutzeinheitSequence;
if (isset($this->rangeFrom)) $o['rangeFrom'] = JsonConverters::to('DateTime', $this->rangeFrom);
if (isset($this->rangeTo)) $o['rangeTo'] = JsonConverters::to('DateTime', $this->rangeTo);
if (isset($this->isDeleted)) $o['isDeleted'] = $this->isDeleted;
if (isset($this->isCreatedByApp)) $o['isCreatedByApp'] = $this->isCreatedByApp;
if (isset($this->IstUvi)) $o['IstUvi'] = $this->IstUvi;
if (isset($this->EigentuemerBewohnt)) $o['EigentuemerBewohnt'] = $this->EigentuemerBewohnt;
if (isset($this->Email)) $o['Email'] = $this->Email;
if (isset($this->Mobil)) $o['Mobil'] = $this->Mobil;
if (isset($this->title)) $o['title'] = $this->title;
if (isset($this->salutation)) $o['salutation'] = $this->salutation;
return empty($o) ? new class(){} : $o;
}
}
class GetNutzerListResponse implements JsonSerializable
{
public function __construct(
/** @var array<Nutzer>|null */
public ?array $nutzerList=null,
/** @var ResponseStatus|null */
public ?ResponseStatus $responseStatus=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['nutzerList'])) $this->nutzerList = JsonConverters::fromArray('Nutzer', $o['nutzerList']);
if (isset($o['responseStatus'])) $this->responseStatus = JsonConverters::from('ResponseStatus', $o['responseStatus']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->nutzerList)) $o['nutzerList'] = JsonConverters::toArray('Nutzer', $this->nutzerList);
if (isset($this->responseStatus)) $o['responseStatus'] = JsonConverters::to('ResponseStatus', $this->responseStatus);
return empty($o) ? new class(){} : $o;
}
}
class GetNutzerList implements IHasBearerToken, JsonSerializable
{
public function __construct(
// @ApiMember(IsRequired=true, ParameterType="query")
/** @var string */
public string $bearerToken=''
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['bearerToken'])) $this->bearerToken = $o['bearerToken'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
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 .other suffix or ?format=other
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
GET /api/v1/nutzer HTTP/1.1 Host: depolt-servdesk.eras-online.de Accept: text/jsonl
HTTP/1.1 200 OK
Content-Type: text/jsonl
Content-Length: length
{"responseStatus":{"errorCode":"String","message":"String","stackTrace":"String","errors":[{"errorCode":"String","fieldName":"String","message":"String","meta":{"String":"String"}}],"meta":{"String":"String"}}}