| GET | /api/v1/nutzeinheiten |
|---|
<?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 Nutzeinheit implements JsonSerializable
{
public function __construct(
// @DataMember(Name="Guid")
/** @var string|null */
public ?string $Guid=null,
// @DataMember(Name="Nummer")
/** @var string|null */
public ?string $Nummer=null,
// @DataMember(Name="Lage")
/** @var string|null */
public ?string $Lage=null,
// @DataMember(Name="ObjektGuid")
/** @var string|null */
public ?string $ObjektGuid=null,
// @DataMember(Name="AdressGuid")
/** @var string|null */
public ?string $AdressGuid=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['Guid'])) $this->Guid = $o['Guid'];
if (isset($o['Nummer'])) $this->Nummer = $o['Nummer'];
if (isset($o['Lage'])) $this->Lage = $o['Lage'];
if (isset($o['ObjektGuid'])) $this->ObjektGuid = $o['ObjektGuid'];
if (isset($o['AdressGuid'])) $this->AdressGuid = $o['AdressGuid'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->Guid)) $o['Guid'] = $this->Guid;
if (isset($this->Nummer)) $o['Nummer'] = $this->Nummer;
if (isset($this->Lage)) $o['Lage'] = $this->Lage;
if (isset($this->ObjektGuid)) $o['ObjektGuid'] = $this->ObjektGuid;
if (isset($this->AdressGuid)) $o['AdressGuid'] = $this->AdressGuid;
return empty($o) ? new class(){} : $o;
}
}
class GetNutzeinheitListResponse implements JsonSerializable
{
public function __construct(
/** @var array<Nutzeinheit>|null */
public ?array $nutzeinheitList=null,
/** @var ResponseStatus|null */
public ?ResponseStatus $responseStatus=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['nutzeinheitList'])) $this->nutzeinheitList = JsonConverters::fromArray('Nutzeinheit', $o['nutzeinheitList']);
if (isset($o['responseStatus'])) $this->responseStatus = JsonConverters::from('ResponseStatus', $o['responseStatus']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->nutzeinheitList)) $o['nutzeinheitList'] = JsonConverters::toArray('Nutzeinheit', $this->nutzeinheitList);
if (isset($this->responseStatus)) $o['responseStatus'] = JsonConverters::to('ResponseStatus', $this->responseStatus);
return empty($o) ? new class(){} : $o;
}
}
class GetNutzeinheitList implements IHasBearerToken, JsonSerializable
{
public function __construct(
// @ApiMember(IsRequired=true, ParameterType="query")
/** @var string */
public string $bearerToken='',
// @ApiMember(ParameterType="query")
/** @var string|null */
public ?string $include=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['bearerToken'])) $this->bearerToken = $o['bearerToken'];
if (isset($o['include'])) $this->include = $o['include'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->bearerToken)) $o['bearerToken'] = $this->bearerToken;
if (isset($this->include)) $o['include'] = $this->include;
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/nutzeinheiten HTTP/1.1 Host: brendle-schneider-servdesk.eras-online.de Accept: application/xml
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length
<GetNutzeinheitListResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Eras2Web.Service.Desktop.Server.ServiceModel.Eras2WebExt.Get">
<NutzeinheitList xmlns:d2p1="http://schemas.datacontract.org/2004/07/Eras2Web.Service.Desktop.Server.ServiceModel.Eras2WebExt.Models" i:nil="true" />
<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>
</GetNutzeinheitListResponse>