| GET, POST | /cr_photo/{id_cr}/{id_tournee} |
|---|
<?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_photo implements JsonSerializable
{
public function __construct(
/** @var string|null */
public ?string $id_cr=null,
/** @var string|null */
public ?string $id_tournee=null,
/** @var string|null */
public ?string $num_facture=null,
/** @var int */
public int $type=0,
/** @var int */
public int $index=0,
/** @var string|null */
public ?string $path=null,
/** @var string|null */
public ?string $photo=null,
/** @var string|null */
public ?string $photo_light=null,
/** @var string|null */
public ?string $date=null,
/** @var float */
public float $latitude=0.0,
/** @var float */
public float $longitude=0.0
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['id_cr'])) $this->id_cr = $o['id_cr'];
if (isset($o['id_tournee'])) $this->id_tournee = $o['id_tournee'];
if (isset($o['num_facture'])) $this->num_facture = $o['num_facture'];
if (isset($o['type'])) $this->type = $o['type'];
if (isset($o['index'])) $this->index = $o['index'];
if (isset($o['path'])) $this->path = $o['path'];
if (isset($o['photo'])) $this->photo = $o['photo'];
if (isset($o['photo_light'])) $this->photo_light = $o['photo_light'];
if (isset($o['date'])) $this->date = $o['date'];
if (isset($o['latitude'])) $this->latitude = $o['latitude'];
if (isset($o['longitude'])) $this->longitude = $o['longitude'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->id_cr)) $o['id_cr'] = $this->id_cr;
if (isset($this->id_tournee)) $o['id_tournee'] = $this->id_tournee;
if (isset($this->num_facture)) $o['num_facture'] = $this->num_facture;
if (isset($this->type)) $o['type'] = $this->type;
if (isset($this->index)) $o['index'] = $this->index;
if (isset($this->path)) $o['path'] = $this->path;
if (isset($this->photo)) $o['photo'] = $this->photo;
if (isset($this->photo_light)) $o['photo_light'] = $this->photo_light;
if (isset($this->date)) $o['date'] = $this->date;
if (isset($this->latitude)) $o['latitude'] = $this->latitude;
if (isset($this->longitude)) $o['longitude'] = $this->longitude;
return empty($o) ? new class(){} : $o;
}
}
class cr_photoResponse implements JsonSerializable
{
public function __construct(
/** @var string|null */
public ?string $id_cr=null,
/** @var string|null */
public ?string $id_tournee=null,
/** @var array<_cr_photo>|null */
public ?array $multi_photos=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['id_cr'])) $this->id_cr = $o['id_cr'];
if (isset($o['id_tournee'])) $this->id_tournee = $o['id_tournee'];
if (isset($o['multi_photos'])) $this->multi_photos = JsonConverters::fromArray('_cr_photo', $o['multi_photos']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->id_cr)) $o['id_cr'] = $this->id_cr;
if (isset($this->id_tournee)) $o['id_tournee'] = $this->id_tournee;
if (isset($this->multi_photos)) $o['multi_photos'] = JsonConverters::toArray('_cr_photo', $this->multi_photos);
return empty($o) ? new class(){} : $o;
}
}
class cr_photoRequest implements JsonSerializable
{
public function __construct(
/** @var string|null */
public ?string $id_cr=null,
/** @var string|null */
public ?string $id_tournee=null,
/** @var array<_cr_photo>|null */
public ?array $multi_photos=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['id_cr'])) $this->id_cr = $o['id_cr'];
if (isset($o['id_tournee'])) $this->id_tournee = $o['id_tournee'];
if (isset($o['multi_photos'])) $this->multi_photos = JsonConverters::fromArray('_cr_photo', $o['multi_photos']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->id_cr)) $o['id_cr'] = $this->id_cr;
if (isset($this->id_tournee)) $o['id_tournee'] = $this->id_tournee;
if (isset($this->multi_photos)) $o['multi_photos'] = JsonConverters::toArray('_cr_photo', $this->multi_photos);
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_photo/{id_cr}/{id_tournee} HTTP/1.1
Host: freemotion-staging.milliet.paris
Accept: application/json
Content-Type: application/json
Content-Length: length
{"id_cr":"String","id_tournee":"String","multi_photos":[{"id_cr":"String","id_tournee":"String","num_facture":"String","type":0,"index":0,"path":"String","photo":"String","photo_light":"String","date":"String","latitude":0,"longitude":0}]}
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length
{"id_cr":"String","id_tournee":"String","multi_photos":[{"id_cr":"String","id_tournee":"String","num_facture":"String","type":0,"index":0,"path":"String","photo":"String","photo_light":"String","date":"String","latitude":0,"longitude":0}]}