| GET | /api/v1/objekte/ |
|---|
<?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 CustomerObjekt implements JsonSerializable
{
public function __construct(
// @DataMember(Name="Guid")
/** @var string|null */
public ?string $Guid=null,
// @DataMember(Name="ZeitraumVon")
/** @var DateTime */
public DateTime $ZeitraumVon=new DateTime(),
// @DataMember(Name="ZeitraumBis")
/** @var DateTime|null */
public ?DateTime $ZeitraumBis=null,
// @DataMember(Name="IstKunde")
/** @var bool|null */
public ?bool $IstKunde=null,
// @DataMember(Name="IstEigentümer")
/** @var bool|null */
public ?bool $IstEigent_mer=null,
// @DataMember(Name="IstEigentümerPseudo")
/** @var bool|null */
public ?bool $IstEigent_merPseudo=null,
// @DataMember(Name="ObjektGuid")
/** @var string|null */
public ?string $ObjektGuid=null,
// @DataMember(Name="KundeGuid")
/** @var string|null */
public ?string $KundeGuid=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['Guid'])) $this->Guid = $o['Guid'];
if (isset($o['ZeitraumVon'])) $this->ZeitraumVon = JsonConverters::from('DateTime', $o['ZeitraumVon']);
if (isset($o['ZeitraumBis'])) $this->ZeitraumBis = JsonConverters::from('DateTime', $o['ZeitraumBis']);
if (isset($o['IstKunde'])) $this->IstKunde = $o['IstKunde'];
if (isset($o['IstEigent_mer'])) $this->IstEigent_mer = $o['IstEigent_mer'];
if (isset($o['IstEigent_merPseudo'])) $this->IstEigent_merPseudo = $o['IstEigent_merPseudo'];
if (isset($o['ObjektGuid'])) $this->ObjektGuid = $o['ObjektGuid'];
if (isset($o['KundeGuid'])) $this->KundeGuid = $o['KundeGuid'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->Guid)) $o['Guid'] = $this->Guid;
if (isset($this->ZeitraumVon)) $o['ZeitraumVon'] = JsonConverters::to('DateTime', $this->ZeitraumVon);
if (isset($this->ZeitraumBis)) $o['ZeitraumBis'] = JsonConverters::to('DateTime', $this->ZeitraumBis);
if (isset($this->IstKunde)) $o['IstKunde'] = $this->IstKunde;
if (isset($this->IstEigent_mer)) $o['IstEigent_mer'] = $this->IstEigent_mer;
if (isset($this->IstEigent_merPseudo)) $o['IstEigent_merPseudo'] = $this->IstEigent_merPseudo;
if (isset($this->ObjektGuid)) $o['ObjektGuid'] = $this->ObjektGuid;
if (isset($this->KundeGuid)) $o['KundeGuid'] = $this->KundeGuid;
return empty($o) ? new class(){} : $o;
}
}
class GetObjektListResponse implements JsonSerializable
{
public function __construct(
/** @var array<CustomerObjekt>|null */
public ?array $customerObjekteList=null,
/** @var ResponseStatus|null */
public ?ResponseStatus $responseStatus=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['customerObjekteList'])) $this->customerObjekteList = JsonConverters::fromArray('CustomerObjekt', $o['customerObjekteList']);
if (isset($o['responseStatus'])) $this->responseStatus = JsonConverters::from('ResponseStatus', $o['responseStatus']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->customerObjekteList)) $o['customerObjekteList'] = JsonConverters::toArray('CustomerObjekt', $this->customerObjekteList);
if (isset($this->responseStatus)) $o['responseStatus'] = JsonConverters::to('ResponseStatus', $this->responseStatus);
return empty($o) ? new class(){} : $o;
}
}
class GetObjektList 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,
/** @description Optional! Follow the format : /api/v1/objekte?filter[Customer]=* */
// @DataMember(Name="filter[Customer]")
// @ApiMember(Description="Optional! Follow the format : /api/v1/objekte?filter[Customer]=*", ParameterType="query")
/** @var string */
public string $filter_Customer_='',
/** @description Optional! Follow the format : /api/v1/objekte?filter[Number]=* */
// @DataMember(Name="filter[Number]")
// @ApiMember(Description="Optional! Follow the format : /api/v1/objekte?filter[Number]=*", ParameterType="query")
/** @var string|null */
public ?string $filter_Number_=null,
/** @description Optional! Follow the format : /api/v1/objekte?filter[Address]=* */
// @DataMember(Name="filter[Address]")
// @ApiMember(Description="Optional! Follow the format : /api/v1/objekte?filter[Address]=*", ParameterType="query")
/** @var string|null */
public ?string $filter_Address_=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['bearerToken'])) $this->bearerToken = $o['bearerToken'];
if (isset($o['include'])) $this->include = $o['include'];
if (isset($o['filter_Customer_'])) $this->filter_Customer_ = $o['filter_Customer_'];
if (isset($o['filter_Number_'])) $this->filter_Number_ = $o['filter_Number_'];
if (isset($o['filter_Address_'])) $this->filter_Address_ = $o['filter_Address_'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->bearerToken)) $o['bearerToken'] = $this->bearerToken;
if (isset($this->include)) $o['include'] = $this->include;
if (isset($this->filter_Customer_)) $o['filter_Customer_'] = $this->filter_Customer_;
if (isset($this->filter_Number_)) $o['filter_Number_'] = $this->filter_Number_;
if (isset($this->filter_Address_)) $o['filter_Address_'] = $this->filter_Address_;
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/objekte/ HTTP/1.1 Host: inea-servdesk.eras-online.de Accept: application/json
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length
{"responseStatus":{"errorCode":"String","message":"String","stackTrace":"String","errors":[{"errorCode":"String","fieldName":"String","message":"String","meta":{"String":"String"}}],"meta":{"String":"String"}}}