Booster.Microservices

<back to all web services

RetrieveWarrantyCardRequest

Requires Authentication
The following routes are available for this service:
GET/warranty/v1/card/{cardId}
<?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};


/**
 * @template TResponse
 */
class BaseRequest implements IRequest, JsonSerializable
{
    public array $genericArgs = [];
    public static function create(array $genericArgs=[]): BaseRequest {
        $to = new BaseRequest();
        $to->genericArgs = $genericArgs;
        return $to;
    }

    public function __construct(
        /** @var string|null */
        public mixed $sid=null,
        /** @var string|null */
        public mixed $app=null,
        /** @var string|null */
        public mixed $_os=null,
        /** @var string|null */
        public mixed $_appVersion=null,
        /** @var string|null */
        public mixed $_searchMethod=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['sid'])) $this->sid = $o['sid'];
        if (isset($o['app'])) $this->app = $o['app'];
        if (isset($o['_os'])) $this->_os = $o['_os'];
        if (isset($o['_appVersion'])) $this->_appVersion = $o['_appVersion'];
        if (isset($o['_searchMethod'])) $this->_searchMethod = $o['_searchMethod'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->sid)) $o['sid'] = $this->sid;
        if (isset($this->app)) $o['app'] = $this->app;
        if (isset($this->_os)) $o['_os'] = $this->_os;
        if (isset($this->_appVersion)) $o['_appVersion'] = $this->_appVersion;
        if (isset($this->_searchMethod)) $o['_searchMethod'] = $this->_searchMethod;
        return empty($o) ? new class(){} : $o;
    }
}

class BaseResponse implements IRespose, JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $_xmlns=null,
        /** @var string|null */
        public ?string $_type=null,
        /** @var string|null */
        public ?string $_source=null,
        /** @var string|null */
        public ?string $_tstamp=null,
        /** @var string|null */
        public ?string $_user=null,
        /** @var string|null */
        public ?string $_env=null,
        /** @var string|null */
        public ?string $_uri=null,
        /** @var string|null */
        public ?string $_query=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['_xmlns'])) $this->_xmlns = $o['_xmlns'];
        if (isset($o['_type'])) $this->_type = $o['_type'];
        if (isset($o['_source'])) $this->_source = $o['_source'];
        if (isset($o['_tstamp'])) $this->_tstamp = $o['_tstamp'];
        if (isset($o['_user'])) $this->_user = $o['_user'];
        if (isset($o['_env'])) $this->_env = $o['_env'];
        if (isset($o['_uri'])) $this->_uri = $o['_uri'];
        if (isset($o['_query'])) $this->_query = $o['_query'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->_xmlns)) $o['_xmlns'] = $this->_xmlns;
        if (isset($this->_type)) $o['_type'] = $this->_type;
        if (isset($this->_source)) $o['_source'] = $this->_source;
        if (isset($this->_tstamp)) $o['_tstamp'] = $this->_tstamp;
        if (isset($this->_user)) $o['_user'] = $this->_user;
        if (isset($this->_env)) $o['_env'] = $this->_env;
        if (isset($this->_uri)) $o['_uri'] = $this->_uri;
        if (isset($this->_query)) $o['_query'] = $this->_query;
        return empty($o) ? new class(){} : $o;
    }
}

class LookupInt implements ILookupInt, JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $object=null,
        /** @var int */
        public int $id=0
    ) {
    }

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

class Article implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $ref=null,
        /** @var string|null */
        public ?string $serial=null,
        /** @var string|null */
        public ?string $name=null,
        /** @var LookupInt|null */
        public ?LookupInt $site=null,
        /** @var string|null */
        public ?string $brand=null,
        /** @var bool|null */
        public ?bool $isConsignment=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['ref'])) $this->ref = $o['ref'];
        if (isset($o['serial'])) $this->serial = $o['serial'];
        if (isset($o['name'])) $this->name = $o['name'];
        if (isset($o['site'])) $this->site = JsonConverters::from('LookupInt', $o['site']);
        if (isset($o['brand'])) $this->brand = $o['brand'];
        if (isset($o['isConsignment'])) $this->isConsignment = $o['isConsignment'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->ref)) $o['ref'] = $this->ref;
        if (isset($this->serial)) $o['serial'] = $this->serial;
        if (isset($this->name)) $o['name'] = $this->name;
        if (isset($this->site)) $o['site'] = JsonConverters::to('LookupInt', $this->site);
        if (isset($this->brand)) $o['brand'] = $this->brand;
        if (isset($this->isConsignment)) $o['isConsignment'] = $this->isConsignment;
        return empty($o) ? new class(){} : $o;
    }
}

class Address implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $line1=null,
        /** @var string|null */
        public ?string $line2=null,
        /** @var string|null */
        public ?string $city=null,
        /** @var string|null */
        public ?string $zipCode=null,
        /** @var string|null */
        public ?string $countryCode=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['line1'])) $this->line1 = $o['line1'];
        if (isset($o['line2'])) $this->line2 = $o['line2'];
        if (isset($o['city'])) $this->city = $o['city'];
        if (isset($o['zipCode'])) $this->zipCode = $o['zipCode'];
        if (isset($o['countryCode'])) $this->countryCode = $o['countryCode'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->line1)) $o['line1'] = $this->line1;
        if (isset($this->line2)) $o['line2'] = $this->line2;
        if (isset($this->city)) $o['city'] = $this->city;
        if (isset($this->zipCode)) $o['zipCode'] = $this->zipCode;
        if (isset($this->countryCode)) $o['countryCode'] = $this->countryCode;
        return empty($o) ? new class(){} : $o;
    }
}

class Site implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $object=null,
        /** @var string|null */
        public ?string $id=null,
        /** @var string|null */
        public ?string $name=null,
        /** @var Address|null */
        public ?Address $address=null,
        /** @var bool|null */
        public ?bool $crmPrivacyPolicyMandatory=null,
        /** @var bool|null */
        public ?bool $crmAllowStoreDataAbroadVisible=null,
        /** @var bool|null */
        public ?bool $isTimeVallee=null,
        /** @var bool|null */
        public ?bool $crmPrivacyPolicyTimeValleeMandatory=null,
        /** @var bool|null */
        public ?bool $crmAllowStoreDataAbroadTimeValleeVisible=null,
        /** @var bool|null */
        public ?bool $allowToCreateEndCustomerOutsideChina=null,
        /** @var bool|null */
        public ?bool $displayFirstLastNameNotLatin=null,
        /** @var string|null */
        public ?string $languageTransliteration=null,
        /** @var bool|null */
        public ?bool $doNotDisplayPOSDataInDisclaimers=null,
        /** @var bool|null */
        public ?bool $crmFirstNameMandatory=null,
        /** @var bool|null */
        public ?bool $crmCityMandatory=null,
        /** @var bool|null */
        public ?bool $manageOwnStock=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['object'])) $this->object = $o['object'];
        if (isset($o['id'])) $this->id = $o['id'];
        if (isset($o['name'])) $this->name = $o['name'];
        if (isset($o['address'])) $this->address = JsonConverters::from('Address', $o['address']);
        if (isset($o['crmPrivacyPolicyMandatory'])) $this->crmPrivacyPolicyMandatory = $o['crmPrivacyPolicyMandatory'];
        if (isset($o['crmAllowStoreDataAbroadVisible'])) $this->crmAllowStoreDataAbroadVisible = $o['crmAllowStoreDataAbroadVisible'];
        if (isset($o['isTimeVallee'])) $this->isTimeVallee = $o['isTimeVallee'];
        if (isset($o['crmPrivacyPolicyTimeValleeMandatory'])) $this->crmPrivacyPolicyTimeValleeMandatory = $o['crmPrivacyPolicyTimeValleeMandatory'];
        if (isset($o['crmAllowStoreDataAbroadTimeValleeVisible'])) $this->crmAllowStoreDataAbroadTimeValleeVisible = $o['crmAllowStoreDataAbroadTimeValleeVisible'];
        if (isset($o['allowToCreateEndCustomerOutsideChina'])) $this->allowToCreateEndCustomerOutsideChina = $o['allowToCreateEndCustomerOutsideChina'];
        if (isset($o['displayFirstLastNameNotLatin'])) $this->displayFirstLastNameNotLatin = $o['displayFirstLastNameNotLatin'];
        if (isset($o['languageTransliteration'])) $this->languageTransliteration = $o['languageTransliteration'];
        if (isset($o['doNotDisplayPOSDataInDisclaimers'])) $this->doNotDisplayPOSDataInDisclaimers = $o['doNotDisplayPOSDataInDisclaimers'];
        if (isset($o['crmFirstNameMandatory'])) $this->crmFirstNameMandatory = $o['crmFirstNameMandatory'];
        if (isset($o['crmCityMandatory'])) $this->crmCityMandatory = $o['crmCityMandatory'];
        if (isset($o['manageOwnStock'])) $this->manageOwnStock = $o['manageOwnStock'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->object)) $o['object'] = $this->object;
        if (isset($this->id)) $o['id'] = $this->id;
        if (isset($this->name)) $o['name'] = $this->name;
        if (isset($this->address)) $o['address'] = JsonConverters::to('Address', $this->address);
        if (isset($this->crmPrivacyPolicyMandatory)) $o['crmPrivacyPolicyMandatory'] = $this->crmPrivacyPolicyMandatory;
        if (isset($this->crmAllowStoreDataAbroadVisible)) $o['crmAllowStoreDataAbroadVisible'] = $this->crmAllowStoreDataAbroadVisible;
        if (isset($this->isTimeVallee)) $o['isTimeVallee'] = $this->isTimeVallee;
        if (isset($this->crmPrivacyPolicyTimeValleeMandatory)) $o['crmPrivacyPolicyTimeValleeMandatory'] = $this->crmPrivacyPolicyTimeValleeMandatory;
        if (isset($this->crmAllowStoreDataAbroadTimeValleeVisible)) $o['crmAllowStoreDataAbroadTimeValleeVisible'] = $this->crmAllowStoreDataAbroadTimeValleeVisible;
        if (isset($this->allowToCreateEndCustomerOutsideChina)) $o['allowToCreateEndCustomerOutsideChina'] = $this->allowToCreateEndCustomerOutsideChina;
        if (isset($this->displayFirstLastNameNotLatin)) $o['displayFirstLastNameNotLatin'] = $this->displayFirstLastNameNotLatin;
        if (isset($this->languageTransliteration)) $o['languageTransliteration'] = $this->languageTransliteration;
        if (isset($this->doNotDisplayPOSDataInDisclaimers)) $o['doNotDisplayPOSDataInDisclaimers'] = $this->doNotDisplayPOSDataInDisclaimers;
        if (isset($this->crmFirstNameMandatory)) $o['crmFirstNameMandatory'] = $this->crmFirstNameMandatory;
        if (isset($this->crmCityMandatory)) $o['crmCityMandatory'] = $this->crmCityMandatory;
        if (isset($this->manageOwnStock)) $o['manageOwnStock'] = $this->manageOwnStock;
        return empty($o) ? new class(){} : $o;
    }
}

class Warranty implements JsonSerializable
{
    public function __construct(
        /** @var array<Article>|null */
        public ?array $article=null,
        /** @var string|null */
        public ?string $warrantyId=null,
        /** @var string|null */
        public ?string $createdBy=null,
        /** @var string|null */
        public ?string $createdAt=null,
        /** @var string|null */
        public ?string $issuedBy=null,
        /** @var string|null */
        public ?string $selloutId=null,
        /** @var string|null */
        public ?string $activationDate=null,
        /** @var string|null */
        public ?string $pin=null,
        /** @var string|null */
        public ?string $promoterTypeId=null,
        /** @var string|null */
        public ?string $promoterTypeDs=null,
        /** @var Site|null */
        public ?Site $site=null,
        /** @var bool|null */
        public ?bool $crmEnabled=null,
        /** @var bool|null */
        public ?bool $canBeExtended=null,
        /** @var bool|null */
        public ?bool $canBeRetriggered=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['article'])) $this->article = JsonConverters::fromArray('Article', $o['article']);
        if (isset($o['warrantyId'])) $this->warrantyId = $o['warrantyId'];
        if (isset($o['createdBy'])) $this->createdBy = $o['createdBy'];
        if (isset($o['createdAt'])) $this->createdAt = $o['createdAt'];
        if (isset($o['issuedBy'])) $this->issuedBy = $o['issuedBy'];
        if (isset($o['selloutId'])) $this->selloutId = $o['selloutId'];
        if (isset($o['activationDate'])) $this->activationDate = $o['activationDate'];
        if (isset($o['pin'])) $this->pin = $o['pin'];
        if (isset($o['promoterTypeId'])) $this->promoterTypeId = $o['promoterTypeId'];
        if (isset($o['promoterTypeDs'])) $this->promoterTypeDs = $o['promoterTypeDs'];
        if (isset($o['site'])) $this->site = JsonConverters::from('Site', $o['site']);
        if (isset($o['crmEnabled'])) $this->crmEnabled = $o['crmEnabled'];
        if (isset($o['canBeExtended'])) $this->canBeExtended = $o['canBeExtended'];
        if (isset($o['canBeRetriggered'])) $this->canBeRetriggered = $o['canBeRetriggered'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->article)) $o['article'] = JsonConverters::toArray('Article', $this->article);
        if (isset($this->warrantyId)) $o['warrantyId'] = $this->warrantyId;
        if (isset($this->createdBy)) $o['createdBy'] = $this->createdBy;
        if (isset($this->createdAt)) $o['createdAt'] = $this->createdAt;
        if (isset($this->issuedBy)) $o['issuedBy'] = $this->issuedBy;
        if (isset($this->selloutId)) $o['selloutId'] = $this->selloutId;
        if (isset($this->activationDate)) $o['activationDate'] = $this->activationDate;
        if (isset($this->pin)) $o['pin'] = $this->pin;
        if (isset($this->promoterTypeId)) $o['promoterTypeId'] = $this->promoterTypeId;
        if (isset($this->promoterTypeDs)) $o['promoterTypeDs'] = $this->promoterTypeDs;
        if (isset($this->site)) $o['site'] = JsonConverters::to('Site', $this->site);
        if (isset($this->crmEnabled)) $o['crmEnabled'] = $this->crmEnabled;
        if (isset($this->canBeExtended)) $o['canBeExtended'] = $this->canBeExtended;
        if (isset($this->canBeRetriggered)) $o['canBeRetriggered'] = $this->canBeRetriggered;
        return empty($o) ? new class(){} : $o;
    }
}

class RetrieveWarrantyCardResponse extends BaseResponse implements JsonSerializable
{
    /**
     * @param string|null $_xmlns
     * @param string|null $_type
     * @param string|null $_source
     * @param string|null $_tstamp
     * @param string|null $_user
     * @param string|null $_env
     * @param string|null $_uri
     * @param string|null $_query
     */
    public function __construct(
        ?string $_xmlns=null,
        ?string $_type=null,
        ?string $_source=null,
        ?string $_tstamp=null,
        ?string $_user=null,
        ?string $_env=null,
        ?string $_uri=null,
        ?string $_query=null,
        /** @var Warranty|null */
        public ?Warranty $warranty=null
    ) {
        parent::__construct($_xmlns,$_type,$_source,$_tstamp,$_user,$_env,$_uri,$_query);
    }

    /** @throws Exception */
    public function fromMap($o): void {
        parent::fromMap($o);
        if (isset($o['warranty'])) $this->warranty = JsonConverters::from('Warranty', $o['warranty']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = parent::jsonSerialize();
        if (isset($this->warranty)) $o['warranty'] = JsonConverters::to('Warranty', $this->warranty);
        return empty($o) ? new class(){} : $o;
    }
}

/**
 * @template BaseRequest of RetrieveWarrantyCardResponse
 */
class RetrieveWarrantyCardRequest extends BaseRequest implements JsonSerializable
{
    /**
     * @param string|null $sid
     * @param string|null $app
     * @param string|null $_os
     * @param string|null $_appVersion
     * @param string|null $_searchMethod
     */
    public function __construct(
        ?string $sid=null,
        ?string $app=null,
        ?string $_os=null,
        ?string $_appVersion=null,
        ?string $_searchMethod=null,
        /** @var string|null */
        public ?string $cardId=null
    ) {
        parent::__construct($sid,$app,$_os,$_appVersion,$_searchMethod);
    }

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

PHP RetrieveWarrantyCardRequest DTOs

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

HTTP + XML

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

GET /warranty/v1/card/{cardId} HTTP/1.1 
Host: qp-microservices-booster.richemont.com 
Accept: application/xml
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

<RetrieveWarrantyCardResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Booster.Microservices.ServiceModel.Sale">
  <_env xmlns="http://schemas.datacontract.org/2004/07/Booster.Microservices.ServiceModel.Common">String</_env>
  <_query xmlns="http://schemas.datacontract.org/2004/07/Booster.Microservices.ServiceModel.Common">String</_query>
  <_source xmlns="http://schemas.datacontract.org/2004/07/Booster.Microservices.ServiceModel.Common">String</_source>
  <_tstamp xmlns="http://schemas.datacontract.org/2004/07/Booster.Microservices.ServiceModel.Common">String</_tstamp>
  <_type xmlns="http://schemas.datacontract.org/2004/07/Booster.Microservices.ServiceModel.Common">String</_type>
  <_uri xmlns="http://schemas.datacontract.org/2004/07/Booster.Microservices.ServiceModel.Common">String</_uri>
  <_user xmlns="http://schemas.datacontract.org/2004/07/Booster.Microservices.ServiceModel.Common">String</_user>
  <_xmlns xmlns="http://schemas.datacontract.org/2004/07/Booster.Microservices.ServiceModel.Common">String</_xmlns>
  <warranty>
    <activationDate>String</activationDate>
    <article>
      <Article>
        <brand>String</brand>
        <isConsignment>false</isConsignment>
        <name>String</name>
        <ref>String</ref>
        <serial>String</serial>
        <shortDesc>String</shortDesc>
        <warrantyStatusCode>String</warrantyStatusCode>
        <warrantyStatusDesc>String</warrantyStatusDesc>
        <warrantyStatusId>0</warrantyStatusId>
      </Article>
    </article>
    <canBeExtended>false</canBeExtended>
    <canBeRetriggered>false</canBeRetriggered>
    <createdAt>String</createdAt>
    <createdBy>String</createdBy>
    <crmEnabled>false</crmEnabled>
    <issuedBy>String</issuedBy>
    <pin>String</pin>
    <promoterTypeDs>String</promoterTypeDs>
    <promoterTypeId>String</promoterTypeId>
    <selloutId>String</selloutId>
    <site>
      <address>
        <city>String</city>
        <countryCode>String</countryCode>
        <line1>String</line1>
        <line2>String</line2>
        <zipCode>String</zipCode>
      </address>
      <allowToCreateEndCustomerOutsideChina>false</allowToCreateEndCustomerOutsideChina>
      <crmAllowStoreDataAbroadTimeValleeVisible>false</crmAllowStoreDataAbroadTimeValleeVisible>
      <crmAllowStoreDataAbroadVisible>false</crmAllowStoreDataAbroadVisible>
      <crmCityMandatory>false</crmCityMandatory>
      <crmFirstNameMandatory>false</crmFirstNameMandatory>
      <crmPrivacyPolicyMandatory>false</crmPrivacyPolicyMandatory>
      <crmPrivacyPolicyTimeValleeMandatory>false</crmPrivacyPolicyTimeValleeMandatory>
      <displayFirstLastNameNotLatin>false</displayFirstLastNameNotLatin>
      <doNotDisplayPOSDataInDisclaimers>false</doNotDisplayPOSDataInDisclaimers>
      <id>String</id>
      <isTimeVallee>false</isTimeVallee>
      <languageTransliteration>String</languageTransliteration>
      <manageOwnStock>false</manageOwnStock>
      <name>String</name>
      <object>String</object>
    </site>
    <warrantyId>String</warrantyId>
  </warranty>
</RetrieveWarrantyCardResponse>