| GET | /stock/{brand}/slim | Get 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;
}
}
To override the Content-type in your clients, use the HTTP Accept Header, append the .csv suffix or ?format=csv
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: text/csv
HTTP/1.1 200 OK
Content-Type: text/csv
Content-Length: length
{"totalProductCount":0,"totalConsignmentCount":0,"elements":["String"]}