| GET, POST | /cr_json_log/{id_controleur} |
|---|
<?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 cr_json_logResponse implements JsonSerializable
{
public function __construct(
/** @var string|null */
public ?string $id_controleur=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['id_controleur'])) $this->id_controleur = $o['id_controleur'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->id_controleur)) $o['id_controleur'] = $this->id_controleur;
return empty($o) ? new class(){} : $o;
}
}
class _json_log implements JsonSerializable
{
public function __construct(
/** @var string|null */
public ?string $id_controleur=null,
/** @var string|null */
public ?string $guid=null,
/** @var string|null */
public ?string $id_operateur=null,
/** @var string|null */
public ?string $type=null,
/** @var string|null */
public ?string $date_log=null,
/** @var string|null */
public ?string $date=null,
/** @var string|null */
public ?string $log=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['id_controleur'])) $this->id_controleur = $o['id_controleur'];
if (isset($o['guid'])) $this->guid = $o['guid'];
if (isset($o['id_operateur'])) $this->id_operateur = $o['id_operateur'];
if (isset($o['type'])) $this->type = $o['type'];
if (isset($o['date_log'])) $this->date_log = $o['date_log'];
if (isset($o['date'])) $this->date = $o['date'];
if (isset($o['log'])) $this->log = $o['log'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->id_controleur)) $o['id_controleur'] = $this->id_controleur;
if (isset($this->guid)) $o['guid'] = $this->guid;
if (isset($this->id_operateur)) $o['id_operateur'] = $this->id_operateur;
if (isset($this->type)) $o['type'] = $this->type;
if (isset($this->date_log)) $o['date_log'] = $this->date_log;
if (isset($this->date)) $o['date'] = $this->date;
if (isset($this->log)) $o['log'] = $this->log;
return empty($o) ? new class(){} : $o;
}
}
class cr_json_logRequest implements JsonSerializable
{
public function __construct(
/** @var string|null */
public ?string $id_controleur=null,
/** @var array<_json_log>|null */
public ?array $logs=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['id_controleur'])) $this->id_controleur = $o['id_controleur'];
if (isset($o['logs'])) $this->logs = JsonConverters::fromArray('_json_log', $o['logs']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->id_controleur)) $o['id_controleur'] = $this->id_controleur;
if (isset($this->logs)) $o['logs'] = JsonConverters::toArray('_json_log', $this->logs);
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.
POST /cr_json_log/{id_controleur} HTTP/1.1
Host: freemotion-staging.milliet.paris
Accept: application/json
Content-Type: application/json
Content-Length: length
{"id_controleur":"String","logs":[{"id_controleur":"String","guid":"String","id_operateur":"String","type":"String","date_log":"String","date":"String","log":"String"}]}
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length
{"id_controleur":"String"}