Richemont.Booster2.PublicApi

<back to all web services

GetEquipment

Requires Authentication
The following routes are available for this service:
GET/equipment/{brand}/{posCode}/{serialNumber}Get the list of SAP equipment
<?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 EquipmentRepairDetail implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $equipmentNumber=null,
        /** @var string|null */
        public ?string $repairNumber=null,
        /** @var string|null */
        public ?string $itemCategory=null,
        /** @var string|null */
        public ?string $item=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['equipmentNumber'])) $this->equipmentNumber = $o['equipmentNumber'];
        if (isset($o['repairNumber'])) $this->repairNumber = $o['repairNumber'];
        if (isset($o['itemCategory'])) $this->itemCategory = $o['itemCategory'];
        if (isset($o['item'])) $this->item = $o['item'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->equipmentNumber)) $o['equipmentNumber'] = $this->equipmentNumber;
        if (isset($this->repairNumber)) $o['repairNumber'] = $this->repairNumber;
        if (isset($this->itemCategory)) $o['itemCategory'] = $this->itemCategory;
        if (isset($this->item)) $o['item'] = $this->item;
        return empty($o) ? new class(){} : $o;
    }
}

class EquipmentRepair implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $equipmentNumber=null,
        /** @var string|null */
        public ?string $repairNumber=null,
        /** @var string|null */
        public ?string $repairCloseDate=null,
        /** @var array<EquipmentRepairDetail>|null */
        public ?array $details=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['equipmentNumber'])) $this->equipmentNumber = $o['equipmentNumber'];
        if (isset($o['repairNumber'])) $this->repairNumber = $o['repairNumber'];
        if (isset($o['repairCloseDate'])) $this->repairCloseDate = $o['repairCloseDate'];
        if (isset($o['details'])) $this->details = JsonConverters::fromArray('EquipmentRepairDetail', $o['details']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->equipmentNumber)) $o['equipmentNumber'] = $this->equipmentNumber;
        if (isset($this->repairNumber)) $o['repairNumber'] = $this->repairNumber;
        if (isset($this->repairCloseDate)) $o['repairCloseDate'] = $this->repairCloseDate;
        if (isset($this->details)) $o['details'] = JsonConverters::toArray('EquipmentRepairDetail', $this->details);
        return empty($o) ? new class(){} : $o;
    }
}

class EquipmentStatus implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $equipmentNumber=null,
        /** @var string|null */
        public ?string $statusCode=null,
        /** @var string|null */
        public ?string $statusDescription=null,
        /** @var string|null */
        public ?string $statusTextCode=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['equipmentNumber'])) $this->equipmentNumber = $o['equipmentNumber'];
        if (isset($o['statusCode'])) $this->statusCode = $o['statusCode'];
        if (isset($o['statusDescription'])) $this->statusDescription = $o['statusDescription'];
        if (isset($o['statusTextCode'])) $this->statusTextCode = $o['statusTextCode'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->equipmentNumber)) $o['equipmentNumber'] = $this->equipmentNumber;
        if (isset($this->statusCode)) $o['statusCode'] = $this->statusCode;
        if (isset($this->statusDescription)) $o['statusDescription'] = $this->statusDescription;
        if (isset($this->statusTextCode)) $o['statusTextCode'] = $this->statusTextCode;
        return empty($o) ? new class(){} : $o;
    }
}

class EquipmentWarranty implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $equipmentNumber=null,
        /** @var string|null */
        public ?string $warrantyType=null,
        /** @var string|null */
        public ?string $warrantyStartDate=null,
        /** @var string|null */
        public ?string $warrantyEndDate=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['equipmentNumber'])) $this->equipmentNumber = $o['equipmentNumber'];
        if (isset($o['warrantyType'])) $this->warrantyType = $o['warrantyType'];
        if (isset($o['warrantyStartDate'])) $this->warrantyStartDate = $o['warrantyStartDate'];
        if (isset($o['warrantyEndDate'])) $this->warrantyEndDate = $o['warrantyEndDate'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->equipmentNumber)) $o['equipmentNumber'] = $this->equipmentNumber;
        if (isset($this->warrantyType)) $o['warrantyType'] = $this->warrantyType;
        if (isset($this->warrantyStartDate)) $o['warrantyStartDate'] = $this->warrantyStartDate;
        if (isset($this->warrantyEndDate)) $o['warrantyEndDate'] = $this->warrantyEndDate;
        return empty($o) ? new class(){} : $o;
    }
}

class EquipmentDetail implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $articleCode=null,
        /** @var string|null */
        public ?string $articleDescription=null,
        /** @var string|null */
        public ?string $cassFamily=null,
        /** @var string|null */
        public ?string $serialNumber=null,
        /** @var string|null */
        public ?string $equipmentNumber=null,
        /** @var string|null */
        public ?string $articleName=null,
        /** @var string|null */
        public ?string $lastRepairNumber=null,
        /** @var array<EquipmentRepair>|null */
        public ?array $repairs=null,
        /** @var array<EquipmentStatus>|null */
        public ?array $status=null,
        /** @var array<EquipmentWarranty>|null */
        public ?array $warranties=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['articleCode'])) $this->articleCode = $o['articleCode'];
        if (isset($o['articleDescription'])) $this->articleDescription = $o['articleDescription'];
        if (isset($o['cassFamily'])) $this->cassFamily = $o['cassFamily'];
        if (isset($o['serialNumber'])) $this->serialNumber = $o['serialNumber'];
        if (isset($o['equipmentNumber'])) $this->equipmentNumber = $o['equipmentNumber'];
        if (isset($o['articleName'])) $this->articleName = $o['articleName'];
        if (isset($o['lastRepairNumber'])) $this->lastRepairNumber = $o['lastRepairNumber'];
        if (isset($o['repairs'])) $this->repairs = JsonConverters::fromArray('EquipmentRepair', $o['repairs']);
        if (isset($o['status'])) $this->status = JsonConverters::fromArray('EquipmentStatus', $o['status']);
        if (isset($o['warranties'])) $this->warranties = JsonConverters::fromArray('EquipmentWarranty', $o['warranties']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->articleCode)) $o['articleCode'] = $this->articleCode;
        if (isset($this->articleDescription)) $o['articleDescription'] = $this->articleDescription;
        if (isset($this->cassFamily)) $o['cassFamily'] = $this->cassFamily;
        if (isset($this->serialNumber)) $o['serialNumber'] = $this->serialNumber;
        if (isset($this->equipmentNumber)) $o['equipmentNumber'] = $this->equipmentNumber;
        if (isset($this->articleName)) $o['articleName'] = $this->articleName;
        if (isset($this->lastRepairNumber)) $o['lastRepairNumber'] = $this->lastRepairNumber;
        if (isset($this->repairs)) $o['repairs'] = JsonConverters::toArray('EquipmentRepair', $this->repairs);
        if (isset($this->status)) $o['status'] = JsonConverters::toArray('EquipmentStatus', $this->status);
        if (isset($this->warranties)) $o['warranties'] = JsonConverters::toArray('EquipmentWarranty', $this->warranties);
        return empty($o) ? new class(){} : $o;
    }
}

class Equipment implements JsonSerializable
{
    public function __construct(
        /** @var bool|null */
        public ?bool $equipmentFound=null,
        /** @var array<EquipmentDetail>|null */
        public ?array $equipmentList=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['equipmentFound'])) $this->equipmentFound = $o['equipmentFound'];
        if (isset($o['equipmentList'])) $this->equipmentList = JsonConverters::fromArray('EquipmentDetail', $o['equipmentList']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->equipmentFound)) $o['equipmentFound'] = $this->equipmentFound;
        if (isset($this->equipmentList)) $o['equipmentList'] = JsonConverters::toArray('EquipmentDetail', $this->equipmentList);
        return empty($o) ? new class(){} : $o;
    }
}

class GetEquipmentResponse extends Equipment implements JsonSerializable
{
    /**
     * @param bool|null $equipmentFound
     * @param array<EquipmentDetail>|null $equipmentList
     */
    public function __construct(
        ?bool $equipmentFound=null,
        ?array $equipmentList=null
    ) {
        parent::__construct($equipmentFound,$equipmentList);
    }

    /** @throws Exception */
    public function fromMap($o): void {
        parent::fromMap($o);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = parent::jsonSerialize();
        return empty($o) ? new class(){} : $o;
    }
}

class GetEquipment implements JsonSerializable
{
    public function __construct(
        /** @description Brand trigram */
        // @ApiMember(Description="Brand trigram", IsRequired=true)
        /** @var string */
        public string $brand='',

        /** @description POS Legacy */
        // @ApiMember(Description="POS Legacy", IsRequired=true)
        /** @var string */
        public string $posCode='',

        /** @description SerialNumber */
        // @ApiMember(Description="SerialNumber", IsRequired=true)
        /** @var string */
        public string $serialNumber='',

        /** @description Reference like 'CRWSTA0030' */
        // @ApiMember(Description="Reference like 'CRWSTA0030'")
        /** @var string|null */
        public ?string $articleCode=null
    ) {
    }

    /** @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['serialNumber'])) $this->serialNumber = $o['serialNumber'];
        if (isset($o['articleCode'])) $this->articleCode = $o['articleCode'];
    }
    
    /** @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->serialNumber)) $o['serialNumber'] = $this->serialNumber;
        if (isset($this->articleCode)) $o['articleCode'] = $this->articleCode;
        return empty($o) ? new class(){} : $o;
    }
}

PHP GetEquipment DTOs

To override the Content-type in your clients, use the HTTP Accept Header, append the .jsv suffix or ?format=jsv

HTTP + JSV

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

GET /equipment/{brand}/{posCode}/{serialNumber} HTTP/1.1 
Host: dev-api-booster.richemont.com 
Accept: text/jsv
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length

{
	equipmentFound: False,
	equipmentList: 
	[
		{
			articleCode: String,
			articleDescription: String,
			cassFamily: String,
			serialNumber: String,
			equipmentNumber: String,
			articleName: String,
			lastRepairNumber: String,
			repairs: 
			[
				{
					equipmentNumber: String,
					repairNumber: String,
					repairCloseDate: String,
					details: 
					[
						{
							equipmentNumber: String,
							repairNumber: String,
							itemCategory: String,
							item: String
						}
					]
				}
			],
			status: 
			[
				{
					equipmentNumber: String,
					statusCode: String,
					statusDescription: String,
					statusTextCode: String
				}
			],
			warranties: 
			[
				{
					equipmentNumber: String,
					warrantyType: String,
					warrantyStartDate: String,
					warrantyEndDate: String
				}
			]
		}
	]
}