| GET | /partner/warranty/equipment | Read CPO Sellout | Read CPO Sellout API |
|---|
<?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 ReadEquipmentWarrantyPartnerResponseItem implements JsonSerializable
{
public function __construct(
/** @description Product name */
// @ApiMember(Description="Product name")
/** @var string|null */
public ?string $productName=null,
/** @description Product description */
// @ApiMember(Description="Product description")
/** @var string|null */
public ?string $productDescription=null,
/** @description Product reference */
// @ApiMember(Description="Product reference")
/** @var string|null */
public ?string $reference=null,
/** @description Product serial number */
// @ApiMember(Description="Product serial number")
/** @var string|null */
public ?string $serialNumber=null,
/** @description Quantity */
// @ApiMember(Description="Quantity")
/** @var float|null */
public ?float $quantity=null,
/** @description Status */
// @ApiMember(Description="Status")
/** @var string|null */
public ?string $status=null,
/** @description Return reason */
// @ApiMember(Description="Return reason")
/** @var string|null */
public ?string $returnReason=null,
/** @description Additional notes */
// @ApiMember(Description="Additional notes")
/** @var string|null */
public ?string $additionalNotes=null,
/** @description Warranty end date */
// @ApiMember(Description="Warranty end date")
/** @var DateTime|null */
public ?DateTime $warrantyEndDate=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['productName'])) $this->productName = $o['productName'];
if (isset($o['productDescription'])) $this->productDescription = $o['productDescription'];
if (isset($o['reference'])) $this->reference = $o['reference'];
if (isset($o['serialNumber'])) $this->serialNumber = $o['serialNumber'];
if (isset($o['quantity'])) $this->quantity = $o['quantity'];
if (isset($o['status'])) $this->status = $o['status'];
if (isset($o['returnReason'])) $this->returnReason = $o['returnReason'];
if (isset($o['additionalNotes'])) $this->additionalNotes = $o['additionalNotes'];
if (isset($o['warrantyEndDate'])) $this->warrantyEndDate = JsonConverters::from('DateTime', $o['warrantyEndDate']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->productName)) $o['productName'] = $this->productName;
if (isset($this->productDescription)) $o['productDescription'] = $this->productDescription;
if (isset($this->reference)) $o['reference'] = $this->reference;
if (isset($this->serialNumber)) $o['serialNumber'] = $this->serialNumber;
if (isset($this->quantity)) $o['quantity'] = $this->quantity;
if (isset($this->status)) $o['status'] = $this->status;
if (isset($this->returnReason)) $o['returnReason'] = $this->returnReason;
if (isset($this->additionalNotes)) $o['additionalNotes'] = $this->additionalNotes;
if (isset($this->warrantyEndDate)) $o['warrantyEndDate'] = JsonConverters::to('DateTime', $this->warrantyEndDate);
return empty($o) ? new class(){} : $o;
}
}
class ReadEquipmentWarrantyPartnerResponse implements JsonSerializable
{
public function __construct(
/** @description Maison */
// @ApiMember(Description="Maison")
/** @var string|null */
public ?string $maison=null,
/** @description Cpo sellout id */
// @ApiMember(Description="Cpo sellout id")
/** @var string|null */
public ?string $cpoSelloutId=null,
/** @description pos */
// @ApiMember(Description="pos")
/** @var string|null */
public ?string $pos=null,
/** @description Sellout date */
// @ApiMember(Description="Sellout date")
/** @var DateTime|null */
public ?DateTime $selloutDate=null,
/** @description Sellout status */
// @ApiMember(Description="Sellout status")
/** @var string|null */
public ?string $selloutStatus=null,
/** @description Sold by */
// @ApiMember(Description="Sold by")
/** @var string|null */
public ?string $soldBy=null,
/** @description Cpo sellout items */
// @ApiMember(Description="Cpo sellout items")
/** @var array<ReadEquipmentWarrantyPartnerResponseItem>|null */
public ?array $readCpoSelloutResponseItems=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['maison'])) $this->maison = $o['maison'];
if (isset($o['cpoSelloutId'])) $this->cpoSelloutId = $o['cpoSelloutId'];
if (isset($o['pos'])) $this->pos = $o['pos'];
if (isset($o['selloutDate'])) $this->selloutDate = JsonConverters::from('DateTime', $o['selloutDate']);
if (isset($o['selloutStatus'])) $this->selloutStatus = $o['selloutStatus'];
if (isset($o['soldBy'])) $this->soldBy = $o['soldBy'];
if (isset($o['readCpoSelloutResponseItems'])) $this->readCpoSelloutResponseItems = JsonConverters::fromArray('ReadEquipmentWarrantyPartnerResponseItem', $o['readCpoSelloutResponseItems']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->maison)) $o['maison'] = $this->maison;
if (isset($this->cpoSelloutId)) $o['cpoSelloutId'] = $this->cpoSelloutId;
if (isset($this->pos)) $o['pos'] = $this->pos;
if (isset($this->selloutDate)) $o['selloutDate'] = JsonConverters::to('DateTime', $this->selloutDate);
if (isset($this->selloutStatus)) $o['selloutStatus'] = $this->selloutStatus;
if (isset($this->soldBy)) $o['soldBy'] = $this->soldBy;
if (isset($this->readCpoSelloutResponseItems)) $o['readCpoSelloutResponseItems'] = JsonConverters::toArray('ReadEquipmentWarrantyPartnerResponseItem', $this->readCpoSelloutResponseItems);
return empty($o) ? new class(){} : $o;
}
}
class ReadEquipmentWarrantyPartner implements JsonSerializable
{
public function __construct(
/** @description Brand Trigram, e.g. CAR, IWC */
// @ApiMember(Description="Brand Trigram, e.g. CAR, IWC", IsRequired=true)
/** @var string */
public string $brand='',
/** @description Richemont POS code, e.g. 102048 */
// @ApiMember(Description="Richemont POS code, e.g. 102048", IsRequired=true)
/** @var string */
public string $posCode='',
/** @description Cpo sellout Id, e.g a0RbW000000qIyXUAU */
// @ApiMember(Description="Cpo sellout Id, e.g a0RbW000000qIyXUAU", IsRequired=true)
/** @var string */
public string $cpoSelloutId=''
) {
}
/** @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['cpoSelloutId'])) $this->cpoSelloutId = $o['cpoSelloutId'];
}
/** @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->cpoSelloutId)) $o['cpoSelloutId'] = $this->cpoSelloutId;
return empty($o) ? new class(){} : $o;
}
}
PHP ReadEquipmentWarrantyPartner DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .xml suffix or ?format=xml
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
GET /partner/warranty/equipment HTTP/1.1 Host: dev-api-booster.richemont.com Accept: application/xml
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length
<ReadEquipmentWarrantyPartnerResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Richemont.Booster2.PublicApi.Sellout.ServiceModel">
<cpoSelloutId>String</cpoSelloutId>
<maison>String</maison>
<pos>String</pos>
<readCpoSelloutResponseItems>
<ReadEquipmentWarrantyPartnerResponseItem>
<additionalNotes>String</additionalNotes>
<productDescription>String</productDescription>
<productName>String</productName>
<quantity>0</quantity>
<reference>String</reference>
<returnReason>String</returnReason>
<serialNumber>String</serialNumber>
<status>String</status>
<warrantyEndDate>0001-01-01T00:00:00</warrantyEndDate>
</ReadEquipmentWarrantyPartnerResponseItem>
</readCpoSelloutResponseItems>
<selloutDate>0001-01-01T00:00:00</selloutDate>
<selloutStatus>String</selloutStatus>
<soldBy>String</soldBy>
</ReadEquipmentWarrantyPartnerResponse>