Richemont.Booster2.PublicApi

<back to all web services

GetStockSlim

Requires Authentication
The following routes are available for this service:
GET/stock/{brand}/slimGet slim Stock
<?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 GetStockSlimResponse implements JsonSerializable
{
    public function __construct(
        /** @description Total Product Count */
        // @ApiMember(Description="Total Product Count", IsRequired=true)
        /** @var int */
        public int $totalProductCount=0,

        /** @description Total Consignment Count */
        // @ApiMember(Description="Total Consignment Count", IsRequired=true)
        /** @var int */
        public int $totalConsignmentCount=0,

        /** @description Articles */
        // @ApiMember(Description="Articles", IsRequired=true)
        /** @var array<string>|null */
        public ?array $elements=null
    ) {
    }

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

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

        /** @description POS Legacy */
        // @ApiMember(Description="POS Legacy")
        /** @var array<string>|null */
        public ?array $posCodes=null,

        /** @description Article Codes */
        // @ApiMember(Description="Article Codes")
        /** @var array<string>|null */
        public ?array $articleCodes=null,

        /** @description Cluster Id */
        // @ApiMember(Description="Cluster Id")
        /** @var array<string>|null */
        public ?array $clusterIds=null,

        /** @description Include Extra Info */
        // @ApiMember(Description="Include Extra Info")
        /** @var bool|null */
        public ?bool $includeExtraInfo=null,

        /** @description Include Consignment NotAuthorized POS */
        // @ApiMember(Description="Include Consignment NotAuthorized POS")
        /** @var bool|null */
        public ?bool $includeConsignmentNotAuthorizedPOS=null,

        /** @description Item type, 'standard' OR 'consigned'. By default, all are coming */
        // @ApiMember(Description="Item type, 'standard' OR 'consigned'. By default, all are coming")
        /** @var string|null */
        public ?string $type=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['brand'])) $this->brand = $o['brand'];
        if (isset($o['posCodes'])) $this->posCodes = JsonConverters::fromArray('string', $o['posCodes']);
        if (isset($o['articleCodes'])) $this->articleCodes = JsonConverters::fromArray('string', $o['articleCodes']);
        if (isset($o['clusterIds'])) $this->clusterIds = JsonConverters::fromArray('string', $o['clusterIds']);
        if (isset($o['includeExtraInfo'])) $this->includeExtraInfo = $o['includeExtraInfo'];
        if (isset($o['includeConsignmentNotAuthorizedPOS'])) $this->includeConsignmentNotAuthorizedPOS = $o['includeConsignmentNotAuthorizedPOS'];
        if (isset($o['type'])) $this->type = $o['type'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->brand)) $o['brand'] = $this->brand;
        if (isset($this->posCodes)) $o['posCodes'] = JsonConverters::toArray('string', $this->posCodes);
        if (isset($this->articleCodes)) $o['articleCodes'] = JsonConverters::toArray('string', $this->articleCodes);
        if (isset($this->clusterIds)) $o['clusterIds'] = JsonConverters::toArray('string', $this->clusterIds);
        if (isset($this->includeExtraInfo)) $o['includeExtraInfo'] = $this->includeExtraInfo;
        if (isset($this->includeConsignmentNotAuthorizedPOS)) $o['includeConsignmentNotAuthorizedPOS'] = $this->includeConsignmentNotAuthorizedPOS;
        if (isset($this->type)) $o['type'] = $this->type;
        return empty($o) ? new class(){} : $o;
    }
}

PHP GetStockSlim DTOs

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

HTTP + XML

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

GET /stock/{brand}/slim HTTP/1.1 
Host: dev-api-booster.richemont.com 
Accept: application/xml
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

<GetStockSlimResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Richemont.Booster2.PublicApi.Stock.ServiceModel">
  <elements xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
    <d2p1:string>String</d2p1:string>
  </elements>
  <totalConsignmentCount>0</totalConsignmentCount>
  <totalProductCount>0</totalProductCount>
</GetStockSlimResponse>