| GET | /equipment/{brand}/{posCode}/{articleCode}/{serialNumber}/eligibility | Get CPO Article Eligibility |
|---|
<?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 GetCPOArticleEligibilityResponse implements JsonSerializable
{
public function __construct(
/** @var bool|null */
public ?bool $canBeBoughtIn=null,
/** @var bool|null */
public ?bool $isInvalidSerialNumberReference=null,
/** @var bool|null */
public ?bool $isLostOrStolen=null,
/** @var bool|null */
public ?bool $existsInStock=null,
/** @var bool|null */
public ?bool $existsInCPOStock=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['canBeBoughtIn'])) $this->canBeBoughtIn = $o['canBeBoughtIn'];
if (isset($o['isInvalidSerialNumberReference'])) $this->isInvalidSerialNumberReference = $o['isInvalidSerialNumberReference'];
if (isset($o['isLostOrStolen'])) $this->isLostOrStolen = $o['isLostOrStolen'];
if (isset($o['existsInStock'])) $this->existsInStock = $o['existsInStock'];
if (isset($o['existsInCPOStock'])) $this->existsInCPOStock = $o['existsInCPOStock'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->canBeBoughtIn)) $o['canBeBoughtIn'] = $this->canBeBoughtIn;
if (isset($this->isInvalidSerialNumberReference)) $o['isInvalidSerialNumberReference'] = $this->isInvalidSerialNumberReference;
if (isset($this->isLostOrStolen)) $o['isLostOrStolen'] = $this->isLostOrStolen;
if (isset($this->existsInStock)) $o['existsInStock'] = $this->existsInStock;
if (isset($this->existsInCPOStock)) $o['existsInCPOStock'] = $this->existsInCPOStock;
return empty($o) ? new class(){} : $o;
}
}
class GetCPOArticleEligibility implements JsonSerializable
{
public function __construct(
/** @description Brand trigram (e.g. IWC) */
// @ApiMember(Description="Brand trigram (e.g. IWC)", IsRequired=true)
/** @var string */
public string $brand='',
/** @description POS Legacy Code (e.g. 102048) */
// @ApiMember(Description="POS Legacy Code (e.g. 102048)", IsRequired=true)
/** @var string */
public string $posCode='',
/** @description Article Reference Code (e.g. CRWSTA0030) */
// @ApiMember(Description="Article Reference Code (e.g. CRWSTA0030)", IsRequired=true)
/** @var string */
public string $articleCode='',
/** @description Serial Number */
// @ApiMember(Description="Serial Number", IsRequired=true)
/** @var string */
public string $serialNumber=''
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['brand'])) $this->brand = $o['brand'];
if (isset($o['posCode'])) $this->posCode = $o['posCode'];
if (isset($o['articleCode'])) $this->articleCode = $o['articleCode'];
if (isset($o['serialNumber'])) $this->serialNumber = $o['serialNumber'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->brand)) $o['brand'] = $this->brand;
if (isset($this->posCode)) $o['posCode'] = $this->posCode;
if (isset($this->articleCode)) $o['articleCode'] = $this->articleCode;
if (isset($this->serialNumber)) $o['serialNumber'] = $this->serialNumber;
return empty($o) ? new class(){} : $o;
}
}
PHP GetCPOArticleEligibility DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .jsv suffix or ?format=jsv
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
GET /equipment/{brand}/{posCode}/{articleCode}/{serialNumber}/eligibility HTTP/1.1
Host: dev-api-booster.richemont.com
Accept: text/jsv
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length
{
canBeBoughtIn: False,
isInvalidSerialNumberReference: False,
isLostOrStolen: False,
existsInStock: False,
existsInCPOStock: False
}