Richemont.Booster2.PublicApi

<back to all web services

GetPosChainTransferAvailable

Requires Authentication
The following routes are available for this service:
GET/posChain/{brand}/{posCode}/availableForTransferGet available POS within the same Chain where stock is transferable
<?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 Pos implements JsonSerializable
{
    public function __construct(
        /** @description POS Code */
        // @ApiMember(Description="POS Code", IsRequired=true)
        /** @var string */
        public string $posCode='',

        /** @description Name of the POS */
        // @ApiMember(Description="Name of the POS", IsRequired=true)
        /** @var string */
        public string $name='',

        /** @description City of the POS */
        // @ApiMember(Description="City of the POS", IsRequired=true)
        /** @var string */
        public string $city='',

        /** @description Address of the POS */
        // @ApiMember(Description="Address of the POS", IsRequired=true)
        /** @var string */
        public string $address='',

        /** @description Country of the POS */
        // @ApiMember(Description="Country of the POS", IsRequired=true)
        /** @var string */
        public string $country='',

        /** @description Brand of the POS */
        // @ApiMember(Description="Brand of the POS", IsRequired=true)
        /** @var string */
        public string $brand=''
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['posCode'])) $this->posCode = $o['posCode'];
        if (isset($o['name'])) $this->name = $o['name'];
        if (isset($o['city'])) $this->city = $o['city'];
        if (isset($o['address'])) $this->address = $o['address'];
        if (isset($o['country'])) $this->country = $o['country'];
        if (isset($o['brand'])) $this->brand = $o['brand'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->posCode)) $o['posCode'] = $this->posCode;
        if (isset($this->name)) $o['name'] = $this->name;
        if (isset($this->city)) $o['city'] = $this->city;
        if (isset($this->address)) $o['address'] = $this->address;
        if (isset($this->country)) $o['country'] = $this->country;
        if (isset($this->brand)) $o['brand'] = $this->brand;
        return empty($o) ? new class(){} : $o;
    }
}

/**
 * @template array of Pos
 */
class GetPosChainTransferAvailableResponse extends \ArrayObject implements JsonSerializable
{
    public function __construct(Pos ...$items) {
        parent::__construct($items, \ArrayObject::STD_PROP_LIST);
    }
    
    /** @throws \Exception */
    public function append($value): void {
        if ($value instanceof Pos)
            parent::append($value);
        else
            throw new \Exception("Can only append a Pos to " . __CLASS__);
    }
    
    /** @throws Exception */
    public function fromMap($o): void {
        foreach ($o as $item) {
            $el = new Pos();
            $el->fromMap($item);
            $this->append($el);
        }
    }
    
    /** @throws Exception */
    public function jsonSerialize(): array {
        return parent::getArrayCopy();
    }
}

class GetPosChainTransferAvailable implements JsonSerializable
{
    public function __construct(
        /** @description Brand */
        // @ApiMember(Description="Brand", IsRequired=true)
        /** @var string */
        public string $brand='',

        /** @description POS Legacy Code */
        // @ApiMember(Description="POS Legacy Code", IsRequired=true)
        /** @var string */
        public string $posCode=''
    ) {
    }

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

PHP GetPosChainTransferAvailable DTOs

To override the Content-type in your clients, use the HTTP Accept Header, append the .other suffix or ?format=other

HTTP + OTHER

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

GET /posChain/{brand}/{posCode}/availableForTransfer HTTP/1.1 
Host: dev-api-booster.richemont.com 
Accept: text/jsonl
HTTP/1.1 200 OK
Content-Type: text/jsonl
Content-Length: length

[]