| GET | /api/v1/nutzer/{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};
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 GetNutzerResponse implements JsonSerializable
{
public function __construct(
/** @var Nutzer|null */
public ?Nutzer $nutzer=null,
/** @var ResponseStatus|null */
public ?ResponseStatus $responseStatus=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['nutzer'])) $this->nutzer = JsonConverters::from('Nutzer', $o['nutzer']);
if (isset($o['responseStatus'])) $this->responseStatus = JsonConverters::from('ResponseStatus', $o['responseStatus']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->nutzer)) $o['nutzer'] = JsonConverters::to('Nutzer', $this->nutzer);
if (isset($this->responseStatus)) $o['responseStatus'] = JsonConverters::to('ResponseStatus', $this->responseStatus);
return empty($o) ? new class(){} : $o;
}
}
class GetNutzer 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 .xml suffix or ?format=xml
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
GET /api/v1/nutzer/{Guid} HTTP/1.1
Host: beson-servdesk.eras-online.de
Accept: application/xml
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length
<GetNutzerResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Eras2Web.Service.Desktop.Server.ServiceModel.Eras2WebExt.Get">
<Nutzer xmlns:d2p1="http://schemas.datacontract.org/2004/07/Eras2Web.Service.Desktop.Server.ServiceModel.Eras2WebExt.Models">
<d2p1:EigentuemerBewohnt>String</d2p1:EigentuemerBewohnt>
<d2p1:Email>String</d2p1:Email>
<d2p1:Guid>00000000-0000-0000-0000-000000000000</d2p1:Guid>
<d2p1:IsCreatedByApp>false</d2p1:IsCreatedByApp>
<d2p1:IsDeleted>false</d2p1:IsDeleted>
<d2p1:IstUvi>String</d2p1:IstUvi>
<d2p1:Mobil>String</d2p1:Mobil>
<d2p1:Name1>String</d2p1:Name1>
<d2p1:Name2>String</d2p1:Name2>
<d2p1:Name3>String</d2p1:Name3>
<d2p1:Name4>String</d2p1:Name4>
<d2p1:NutzeinheitNumberExternal>String</d2p1:NutzeinheitNumberExternal>
<d2p1:NutzerInNutzeinheitSequence>0</d2p1:NutzerInNutzeinheitSequence>
<d2p1:NutzerType>Leerstand</d2p1:NutzerType>
<d2p1:RangeFrom>0001-01-01T00:00:00</d2p1:RangeFrom>
<d2p1:RangeTo>0001-01-01T00:00:00</d2p1:RangeTo>
<d2p1:Salutation>String</d2p1:Salutation>
<d2p1:Title>String</d2p1:Title>
</Nutzer>
<ResponseStatus xmlns:d2p1="http://schemas.servicestack.net/types">
<d2p1:ErrorCode>String</d2p1:ErrorCode>
<d2p1:Message>String</d2p1:Message>
<d2p1:StackTrace>String</d2p1:StackTrace>
<d2p1:Errors>
<d2p1:ResponseError>
<d2p1:ErrorCode>String</d2p1:ErrorCode>
<d2p1:FieldName>String</d2p1:FieldName>
<d2p1:Message>String</d2p1:Message>
<d2p1:Meta xmlns:d5p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d5p1:KeyValueOfstringstring>
<d5p1:Key>String</d5p1:Key>
<d5p1:Value>String</d5p1:Value>
</d5p1:KeyValueOfstringstring>
</d2p1:Meta>
</d2p1:ResponseError>
</d2p1:Errors>
<d2p1:Meta xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d3p1:KeyValueOfstringstring>
<d3p1:Key>String</d3p1:Key>
<d3p1:Value>String</d3p1:Value>
</d3p1:KeyValueOfstringstring>
</d2p1:Meta>
</ResponseStatus>
</GetNutzerResponse>