| PATCH | /warranty/equipment | Update Equipment Warranty | Update Equipment Warranty 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 UpdateEquipmentWarrantyResponse implements JsonSerializable
{
public function __construct(
/** @description Equipment number */
// @ApiMember(Description="Equipment number", IsRequired=true)
/** @var string */
public string $equipment='',
/** @description Warranty type */
// @ApiMember(Description="Warranty type", IsRequired=true)
/** @var string */
public string $warrantyType='',
/** @description Master warranty */
// @ApiMember(Description="Master warranty", IsRequired=true)
/** @var string */
public string $masterWarranty='',
/** @description Warranty start date */
// @ApiMember(Description="Warranty start date", IsRequired=true)
/** @var string */
public string $warrantyStartDate='',
/** @description Warranty end date */
// @ApiMember(Description="Warranty end date")
/** @var string|null */
public ?string $warrantyEndDate=null,
/** @description Warranty creation date */
// @ApiMember(Description="Warranty creation date", IsRequired=true)
/** @var string */
public string $warrantyCreationDate='',
/** @description Warranty creation time */
// @ApiMember(Description="Warranty creation time", IsRequired=true)
/** @var string */
public string $warrantyCreationTime='',
/** @description Object number (ERP) */
// @ApiMember(Description="Object number (ERP)", IsRequired=true)
/** @var string */
public string $objectNumber='',
/** @description Sales Force Sellout ID */
// @ApiMember(Description="Sales Force Sellout ID", IsRequired=true)
/** @var string */
public string $sfSelloutId=''
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['equipment'])) $this->equipment = $o['equipment'];
if (isset($o['warrantyType'])) $this->warrantyType = $o['warrantyType'];
if (isset($o['masterWarranty'])) $this->masterWarranty = $o['masterWarranty'];
if (isset($o['warrantyStartDate'])) $this->warrantyStartDate = $o['warrantyStartDate'];
if (isset($o['warrantyEndDate'])) $this->warrantyEndDate = $o['warrantyEndDate'];
if (isset($o['warrantyCreationDate'])) $this->warrantyCreationDate = $o['warrantyCreationDate'];
if (isset($o['warrantyCreationTime'])) $this->warrantyCreationTime = $o['warrantyCreationTime'];
if (isset($o['objectNumber'])) $this->objectNumber = $o['objectNumber'];
if (isset($o['sfSelloutId'])) $this->sfSelloutId = $o['sfSelloutId'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->equipment)) $o['equipment'] = $this->equipment;
if (isset($this->warrantyType)) $o['warrantyType'] = $this->warrantyType;
if (isset($this->masterWarranty)) $o['masterWarranty'] = $this->masterWarranty;
if (isset($this->warrantyStartDate)) $o['warrantyStartDate'] = $this->warrantyStartDate;
if (isset($this->warrantyEndDate)) $o['warrantyEndDate'] = $this->warrantyEndDate;
if (isset($this->warrantyCreationDate)) $o['warrantyCreationDate'] = $this->warrantyCreationDate;
if (isset($this->warrantyCreationTime)) $o['warrantyCreationTime'] = $this->warrantyCreationTime;
if (isset($this->objectNumber)) $o['objectNumber'] = $this->objectNumber;
if (isset($this->sfSelloutId)) $o['sfSelloutId'] = $this->sfSelloutId;
return empty($o) ? new class(){} : $o;
}
}
class UpdateEquipmentWarranty 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 POS code, e.g. 102048 */
// @ApiMember(Description="POS code, e.g. 102048", IsRequired=true)
/** @var string */
public string $posCode='',
/** @description Equipment number, e.g. 1234567890 */
// @ApiMember(Description="Equipment number, e.g. 1234567890", IsRequired=true)
/** @var string */
public string $equipmentNumber='',
/** @description Warranty type, e.g. 3 */
// @ApiMember(Description="Warranty type, e.g. 3", IsRequired=true)
/** @var string */
public string $warrantyType='',
/** @description Date of the warranty start date e.g. 2025-06-01 */
// @ApiMember(Description="Date of the warranty start date e.g. 2025-06-01", IsRequired=true)
/** @var DateTime */
public DateTime $warrantyStartDate=new DateTime()
) {
}
/** @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['equipmentNumber'])) $this->equipmentNumber = $o['equipmentNumber'];
if (isset($o['warrantyType'])) $this->warrantyType = $o['warrantyType'];
if (isset($o['warrantyStartDate'])) $this->warrantyStartDate = JsonConverters::from('DateTime', $o['warrantyStartDate']);
}
/** @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->equipmentNumber)) $o['equipmentNumber'] = $this->equipmentNumber;
if (isset($this->warrantyType)) $o['warrantyType'] = $this->warrantyType;
if (isset($this->warrantyStartDate)) $o['warrantyStartDate'] = JsonConverters::to('DateTime', $this->warrantyStartDate);
return empty($o) ? new class(){} : $o;
}
}
PHP UpdateEquipmentWarranty 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.
PATCH /warranty/equipment HTTP/1.1
Host: dev-api-booster.richemont.com
Accept: text/csv
Content-Type: text/csv
Content-Length: length
{"brand":"String","posCode":"String","equipmentNumber":"String","warrantyType":"String","warrantyStartDate":"\/Date(-62135596800000-0000)\/"}
HTTP/1.1 200 OK
Content-Type: text/csv
Content-Length: length
{"equipment":"String","warrantyType":"String","masterWarranty":"String","warrantyStartDate":"String","warrantyEndDate":"String","warrantyCreationDate":"String","warrantyCreationTime":"String","objectNumber":"String","sfSelloutId":"String"}