CL$WS Host : D5239-staging-cl

<back to all web services

cl_alerte_tourneeRequest

The following routes are available for this service:
GET, POST/cl_alerte_tournee/{id_operateur}/{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 _alerte_tournee_ligne implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $id_operateur=null,
        /** @var string|null */
        public ?string $id_tournee=null,
        /** @var string|null */
        public ?string $id_evenement=null,
        /** @var string|null */
        public ?string $date=null,
        /** @var string|null */
        public ?string $num_facture=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['id_operateur'])) $this->id_operateur = $o['id_operateur'];
        if (isset($o['id_tournee'])) $this->id_tournee = $o['id_tournee'];
        if (isset($o['id_evenement'])) $this->id_evenement = $o['id_evenement'];
        if (isset($o['date'])) $this->date = $o['date'];
        if (isset($o['num_facture'])) $this->num_facture = $o['num_facture'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->id_operateur)) $o['id_operateur'] = $this->id_operateur;
        if (isset($this->id_tournee)) $o['id_tournee'] = $this->id_tournee;
        if (isset($this->id_evenement)) $o['id_evenement'] = $this->id_evenement;
        if (isset($this->date)) $o['date'] = $this->date;
        if (isset($this->num_facture)) $o['num_facture'] = $this->num_facture;
        return empty($o) ? new class(){} : $o;
    }
}

class _alerte_tournee implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $id_operateur=null,
        /** @var string|null */
        public ?string $id_tournee=null,
        /** @var string|null */
        public ?string $id_evenement=null,
        /** @var string|null */
        public ?string $date=null,
        /** @var float */
        public float $latitude=0.0,
        /** @var float */
        public float $longitude=0.0,
        /** @var float */
        public float $duree=0.0,
        /** @var array<_alerte_tournee_ligne>|null */
        public ?array $factures_non_livrees=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['id_operateur'])) $this->id_operateur = $o['id_operateur'];
        if (isset($o['id_tournee'])) $this->id_tournee = $o['id_tournee'];
        if (isset($o['id_evenement'])) $this->id_evenement = $o['id_evenement'];
        if (isset($o['date'])) $this->date = $o['date'];
        if (isset($o['latitude'])) $this->latitude = $o['latitude'];
        if (isset($o['longitude'])) $this->longitude = $o['longitude'];
        if (isset($o['duree'])) $this->duree = $o['duree'];
        if (isset($o['factures_non_livrees'])) $this->factures_non_livrees = JsonConverters::fromArray('_alerte_tournee_ligne', $o['factures_non_livrees']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->id_operateur)) $o['id_operateur'] = $this->id_operateur;
        if (isset($this->id_tournee)) $o['id_tournee'] = $this->id_tournee;
        if (isset($this->id_evenement)) $o['id_evenement'] = $this->id_evenement;
        if (isset($this->date)) $o['date'] = $this->date;
        if (isset($this->latitude)) $o['latitude'] = $this->latitude;
        if (isset($this->longitude)) $o['longitude'] = $this->longitude;
        if (isset($this->duree)) $o['duree'] = $this->duree;
        if (isset($this->factures_non_livrees)) $o['factures_non_livrees'] = JsonConverters::toArray('_alerte_tournee_ligne', $this->factures_non_livrees);
        return empty($o) ? new class(){} : $o;
    }
}

class cl_alerte_tourneeResponse implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $id_operateur=null,
        /** @var string|null */
        public ?string $id_tournee=null,
        /** @var array<_alerte_tournee>|null */
        public ?array $alertes_tournees=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['id_operateur'])) $this->id_operateur = $o['id_operateur'];
        if (isset($o['id_tournee'])) $this->id_tournee = $o['id_tournee'];
        if (isset($o['alertes_tournees'])) $this->alertes_tournees = JsonConverters::fromArray('_alerte_tournee', $o['alertes_tournees']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->id_operateur)) $o['id_operateur'] = $this->id_operateur;
        if (isset($this->id_tournee)) $o['id_tournee'] = $this->id_tournee;
        if (isset($this->alertes_tournees)) $o['alertes_tournees'] = JsonConverters::toArray('_alerte_tournee', $this->alertes_tournees);
        return empty($o) ? new class(){} : $o;
    }
}

class cl_alerte_tourneeRequest implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $id_operateur=null,
        /** @var string|null */
        public ?string $id_tournee=null,
        /** @var array<_alerte_tournee>|null */
        public ?array $alertes_tournees=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['id_operateur'])) $this->id_operateur = $o['id_operateur'];
        if (isset($o['id_tournee'])) $this->id_tournee = $o['id_tournee'];
        if (isset($o['alertes_tournees'])) $this->alertes_tournees = JsonConverters::fromArray('_alerte_tournee', $o['alertes_tournees']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->id_operateur)) $o['id_operateur'] = $this->id_operateur;
        if (isset($this->id_tournee)) $o['id_tournee'] = $this->id_tournee;
        if (isset($this->alertes_tournees)) $o['alertes_tournees'] = JsonConverters::toArray('_alerte_tournee', $this->alertes_tournees);
        return empty($o) ? new class(){} : $o;
    }
}

PHP cl_alerte_tourneeRequest DTOs

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

HTTP + JSON

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

POST /cl_alerte_tournee/{id_operateur}/{id_tournee} HTTP/1.1 
Host: freemotion-staging.milliet.paris 
Accept: application/json
Content-Type: application/json
Content-Length: length

{"id_operateur":"String","id_tournee":"String","alertes_tournees":[{"id_operateur":"String","id_tournee":"String","id_evenement":"String","date":"String","latitude":0,"longitude":0,"duree":0,"factures_non_livrees":[{"id_operateur":"String","id_tournee":"String","id_evenement":"String","date":"String","num_facture":"String"}]}]}
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length

{"id_operateur":"String","id_tournee":"String","alertes_tournees":[{"id_operateur":"String","id_tournee":"String","id_evenement":"String","date":"String","latitude":0,"longitude":0,"duree":0,"factures_non_livrees":[{"id_operateur":"String","id_tournee":"String","id_evenement":"String","date":"String","num_facture":"String"}]}]}