<?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};
class DurchschnittNutzer implements JsonSerializable
{
public function __construct(
/** @var int */
public int $ID=0,
/** @var string|null */
public ?string $Kategorie=null,
/** @var int */
public int $Anzahl=0,
/** @var float */
public float $Durchschnittswert=0.0,
/** @var DateTime */
public DateTime $Zuletzt=new DateTime()
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['ID'])) $this->ID = $o['ID'];
if (isset($o['Kategorie'])) $this->Kategorie = $o['Kategorie'];
if (isset($o['Anzahl'])) $this->Anzahl = $o['Anzahl'];
if (isset($o['Durchschnittswert'])) $this->Durchschnittswert = $o['Durchschnittswert'];
if (isset($o['Zuletzt'])) $this->Zuletzt = JsonConverters::from('DateTime', $o['Zuletzt']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->ID)) $o['ID'] = $this->ID;
if (isset($this->Kategorie)) $o['Kategorie'] = $this->Kategorie;
if (isset($this->Anzahl)) $o['Anzahl'] = $this->Anzahl;
if (isset($this->Durchschnittswert)) $o['Durchschnittswert'] = $this->Durchschnittswert;
if (isset($this->Zuletzt)) $o['Zuletzt'] = JsonConverters::to('DateTime', $this->Zuletzt);
return empty($o) ? new class(){} : $o;
}
}
class DurchschnittListeResponse implements JsonSerializable
{
public function __construct(
/** @var array<DurchschnittNutzer>|null */
public ?array $Liste=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['Liste'])) $this->Liste = JsonConverters::fromArray('DurchschnittNutzer', $o['Liste']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->Liste)) $o['Liste'] = JsonConverters::toArray('DurchschnittNutzer', $this->Liste);
return empty($o) ? new class(){} : $o;
}
}
class GetAlleDurchschnitt implements JsonSerializable
{
public function __construct(
/** @var DateTime */
public DateTime $Zuletzt=new DateTime()
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['Zuletzt'])) $this->Zuletzt = JsonConverters::from('DateTime', $o['Zuletzt']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->Zuletzt)) $o['Zuletzt'] = JsonConverters::to('DateTime', $this->Zuletzt);
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.
POST /xml/reply/GetAlleDurchschnitt HTTP/1.1
Host: 52.142.207.43
Accept: application/xml
Content-Type: application/xml
Content-Length: length
<ecUpdaterLicenseCommModel.GetAlleDurchschnitt xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/EndianUpdaterLicenser">
<Zuletzt>0001-01-01T00:00:00</Zuletzt>
</ecUpdaterLicenseCommModel.GetAlleDurchschnitt>
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length
<ecUpdaterLicenseCommModel.DurchschnittListeResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/EndianUpdaterLicenser">
<Liste>
<ecUpdaterLicenseCommModel.DurchschnittNutzer>
<Anzahl>0</Anzahl>
<Durchschnittswert>0</Durchschnittswert>
<ID>0</ID>
<Kategorie>String</Kategorie>
<Zuletzt>0001-01-01T00:00:00</Zuletzt>
</ecUpdaterLicenseCommModel.DurchschnittNutzer>
</Liste>
</ecUpdaterLicenseCommModel.DurchschnittListeResponse>