CL$WS Host : D5239-staging-cl

<back to all web services

cr_casseRequest

The following routes are available for this service:
GET, POST/cr_casse/{id_controleur}/{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_retour implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $id_controleur=null,
        /** @var string|null */
        public ?string $id_tournee=null,
        /** @var string|null */
        public ?string $num_facture=null,
        /** @var string|null */
        public ?string $type_retour=null,
        /** @var string|null */
        public ?string $article_id=null,
        /** @var int */
        public int $article_absent=0,
        /** @var int */
        public int $quantite=0,
        /** @var int */
        public int $reintegrable=0,
        /** @var string|null */
        public ?string $commentaire=null,
        /** @var string|null */
        public ?string $date=null,
        /** @var string|null */
        public ?string $qte_uv=null,
        /** @var string|null */
        public ?string $qte_uc=null,
        /** @var string|null */
        public ?string $cdt_uc=null,
        /** @var float|null */
        public ?float $_qte_uv=null,
        /** @var float|null */
        public ?float $_qte_uc=null,
        /** @var float|null */
        public ?float $_cdt_uc=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['id_controleur'])) $this->id_controleur = $o['id_controleur'];
        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_retour'])) $this->type_retour = $o['type_retour'];
        if (isset($o['article_id'])) $this->article_id = $o['article_id'];
        if (isset($o['article_absent'])) $this->article_absent = $o['article_absent'];
        if (isset($o['quantite'])) $this->quantite = $o['quantite'];
        if (isset($o['reintegrable'])) $this->reintegrable = $o['reintegrable'];
        if (isset($o['commentaire'])) $this->commentaire = $o['commentaire'];
        if (isset($o['date'])) $this->date = $o['date'];
        if (isset($o['qte_uv'])) $this->qte_uv = $o['qte_uv'];
        if (isset($o['qte_uc'])) $this->qte_uc = $o['qte_uc'];
        if (isset($o['cdt_uc'])) $this->cdt_uc = $o['cdt_uc'];
        if (isset($o['_qte_uv'])) $this->_qte_uv = $o['_qte_uv'];
        if (isset($o['_qte_uc'])) $this->_qte_uc = $o['_qte_uc'];
        if (isset($o['_cdt_uc'])) $this->_cdt_uc = $o['_cdt_uc'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->id_controleur)) $o['id_controleur'] = $this->id_controleur;
        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_retour)) $o['type_retour'] = $this->type_retour;
        if (isset($this->article_id)) $o['article_id'] = $this->article_id;
        if (isset($this->article_absent)) $o['article_absent'] = $this->article_absent;
        if (isset($this->quantite)) $o['quantite'] = $this->quantite;
        if (isset($this->reintegrable)) $o['reintegrable'] = $this->reintegrable;
        if (isset($this->commentaire)) $o['commentaire'] = $this->commentaire;
        if (isset($this->date)) $o['date'] = $this->date;
        if (isset($this->qte_uv)) $o['qte_uv'] = $this->qte_uv;
        if (isset($this->qte_uc)) $o['qte_uc'] = $this->qte_uc;
        if (isset($this->cdt_uc)) $o['cdt_uc'] = $this->cdt_uc;
        if (isset($this->_qte_uv)) $o['_qte_uv'] = $this->_qte_uv;
        if (isset($this->_qte_uc)) $o['_qte_uc'] = $this->_qte_uc;
        if (isset($this->_cdt_uc)) $o['_cdt_uc'] = $this->_cdt_uc;
        return empty($o) ? new class(){} : $o;
    }
}

class cr_casseResponse implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $id_controleur=null,
        /** @var string|null */
        public ?string $id_tournee=null,
        /** @var array<_cr_retour>|null */
        public ?array $cr_casses=null
    ) {
    }

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

class cr_casseRequest implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $id_controleur=null,
        /** @var string|null */
        public ?string $id_tournee=null,
        /** @var array<_cr_retour>|null */
        public ?array $cr_casses=null
    ) {
    }

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

PHP cr_casseRequest 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 /cr_casse/{id_controleur}/{id_tournee} HTTP/1.1 
Host: freemotion-staging.milliet.paris 
Accept: application/json
Content-Type: application/json
Content-Length: length

{"id_controleur":"String","id_tournee":"String","cr_casses":[{"id_controleur":"String","id_tournee":"String","num_facture":"String","type_retour":"String","article_id":"String","article_absent":0,"quantite":0,"reintegrable":0,"commentaire":"String","date":"String","qte_uv":"String","qte_uc":"String","cdt_uc":"String"}]}
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length

{"id_controleur":"String","id_tournee":"String","cr_casses":[{"id_controleur":"String","id_tournee":"String","num_facture":"String","type_retour":"String","article_id":"String","article_absent":0,"quantite":0,"reintegrable":0,"commentaire":"String","date":"String","qte_uv":"String","qte_uc":"String","cdt_uc":"String"}]}