| GET | /serialnumber/{articleCode}/{serialNumber} | Get a serial number with details |
|---|
<?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 Service implements JsonSerializable
{
public function __construct(
/** @description Language Code */
// @ApiMember(Description="Language Code")
/** @var string|null */
public ?string $languageCode=null,
/** @description Service */
// @ApiMember(Description="Service")
/** @var string|null */
public ?string $service=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['languageCode'])) $this->languageCode = $o['languageCode'];
if (isset($o['service'])) $this->service = $o['service'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->languageCode)) $o['languageCode'] = $this->languageCode;
if (isset($this->service)) $o['service'] = $this->service;
return empty($o) ? new class(){} : $o;
}
}
class GetSerialNumberDetailsResponse implements JsonSerializable
{
public function __construct(
/** @description Brand */
// @ApiMember(Description="Brand")
/** @var string|null */
public ?string $brand=null,
/** @description Article code */
// @ApiMember(Description="Article code", IsRequired=true)
/** @var string */
public string $articleCode='',
/** @description Serial Number */
// @ApiMember(Description="Serial Number", IsRequired=true)
/** @var string */
public string $serialNumber='',
/** @description Article Description */
// @ApiMember(Description="Article Description")
/** @var string|null */
public ?string $articleDescription=null,
/** @description Warranty Start Date */
// @ApiMember(Description="Warranty Start Date")
/** @var string|null */
public ?string $warrantyStartDate=null,
/** @description Warranty End Date */
// @ApiMember(Description="Warranty End Date")
/** @var string|null */
public ?string $warrantyEndDate=null,
/** @description Last Repair Date */
// @ApiMember(Description="Last Repair Date")
/** @var string|null */
public ?string $lastRepairDate=null,
/** @description Sell In Date */
// @ApiMember(Description="Sell In Date")
/** @var string|null */
public ?string $sellInDate=null,
/** @description Last Repair Site */
// @ApiMember(Description="Last Repair Site")
/** @var string|null */
public ?string $lastRepairSite=null,
/** @description Services */
// @ApiMember(Description="Services")
/** @var array<Service>|null */
public ?array $services=null,
/** @description Enquirus lost or stolen */
// @ApiMember(Description="Enquirus lost or stolen")
/** @var bool|null */
public ?bool $lostOrStolenStatus=null,
/** @description Warranty CPO Start Date */
// @ApiMember(Description="Warranty CPO Start Date")
/** @var string|null */
public ?string $warrantyResaleStartDate=null,
/** @description Warranty CPO End Date */
// @ApiMember(Description="Warranty CPO End Date")
/** @var string|null */
public ?string $warrantyResaleEndDate=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['brand'])) $this->brand = $o['brand'];
if (isset($o['articleCode'])) $this->articleCode = $o['articleCode'];
if (isset($o['serialNumber'])) $this->serialNumber = $o['serialNumber'];
if (isset($o['articleDescription'])) $this->articleDescription = $o['articleDescription'];
if (isset($o['warrantyStartDate'])) $this->warrantyStartDate = $o['warrantyStartDate'];
if (isset($o['warrantyEndDate'])) $this->warrantyEndDate = $o['warrantyEndDate'];
if (isset($o['lastRepairDate'])) $this->lastRepairDate = $o['lastRepairDate'];
if (isset($o['sellInDate'])) $this->sellInDate = $o['sellInDate'];
if (isset($o['lastRepairSite'])) $this->lastRepairSite = $o['lastRepairSite'];
if (isset($o['services'])) $this->services = JsonConverters::fromArray('Service', $o['services']);
if (isset($o['lostOrStolenStatus'])) $this->lostOrStolenStatus = $o['lostOrStolenStatus'];
if (isset($o['warrantyResaleStartDate'])) $this->warrantyResaleStartDate = $o['warrantyResaleStartDate'];
if (isset($o['warrantyResaleEndDate'])) $this->warrantyResaleEndDate = $o['warrantyResaleEndDate'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->brand)) $o['brand'] = $this->brand;
if (isset($this->articleCode)) $o['articleCode'] = $this->articleCode;
if (isset($this->serialNumber)) $o['serialNumber'] = $this->serialNumber;
if (isset($this->articleDescription)) $o['articleDescription'] = $this->articleDescription;
if (isset($this->warrantyStartDate)) $o['warrantyStartDate'] = $this->warrantyStartDate;
if (isset($this->warrantyEndDate)) $o['warrantyEndDate'] = $this->warrantyEndDate;
if (isset($this->lastRepairDate)) $o['lastRepairDate'] = $this->lastRepairDate;
if (isset($this->sellInDate)) $o['sellInDate'] = $this->sellInDate;
if (isset($this->lastRepairSite)) $o['lastRepairSite'] = $this->lastRepairSite;
if (isset($this->services)) $o['services'] = JsonConverters::toArray('Service', $this->services);
if (isset($this->lostOrStolenStatus)) $o['lostOrStolenStatus'] = $this->lostOrStolenStatus;
if (isset($this->warrantyResaleStartDate)) $o['warrantyResaleStartDate'] = $this->warrantyResaleStartDate;
if (isset($this->warrantyResaleEndDate)) $o['warrantyResaleEndDate'] = $this->warrantyResaleEndDate;
return empty($o) ? new class(){} : $o;
}
}
class GetSerialNumberDetails implements JsonSerializable
{
public function __construct(
/** @description Article Code */
// @ApiMember(Description="Article Code", IsRequired=true)
/** @var string */
public string $articleCode='',
/** @description Serial Number */
// @ApiMember(Description="Serial Number", IsRequired=true)
/** @var string */
public string $serialNumber='',
/** @description POS Code e.g. ES100:102048 */
// @ApiMember(Description="POS Code e.g. ES100:102048")
/** @var string|null */
public ?string $posCode=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['articleCode'])) $this->articleCode = $o['articleCode'];
if (isset($o['serialNumber'])) $this->serialNumber = $o['serialNumber'];
if (isset($o['posCode'])) $this->posCode = $o['posCode'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->articleCode)) $o['articleCode'] = $this->articleCode;
if (isset($this->serialNumber)) $o['serialNumber'] = $this->serialNumber;
if (isset($this->posCode)) $o['posCode'] = $this->posCode;
return empty($o) ? new class(){} : $o;
}
}
PHP GetSerialNumberDetails DTOs
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 /serialnumber/{articleCode}/{serialNumber} HTTP/1.1
Host: dev-api-booster.richemont.com
Accept: text/csv
HTTP/1.1 200 OK
Content-Type: text/csv
Content-Length: length
{"brand":"String","articleCode":"String","serialNumber":"String","articleDescription":"String","warrantyStartDate":"String","warrantyEndDate":"String","lastRepairDate":"String","sellInDate":"String","lastRepairSite":"String","services":[{"languageCode":"String","service":"String"}],"lostOrStolenStatus":false,"warrantyResaleStartDate":"String","warrantyResaleEndDate":"String"}