Booster.Microservices

<back to all web services

CreateCustomerRequest

Requires Authentication
The following routes are available for this service:
POST/warranty/v1/createCustomer
<?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 CreateCustomerResponse 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 string|null */
        public ?string $customerId=null,
        /** @var int|null */
        public ?int $boosterCustomerId=null
    ) {
        parent::__construct($_xmlns,$_type,$_source,$_tstamp,$_user,$_env,$_uri,$_query);
    }

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

/**
 * @template BaseRequest of CreateCustomerResponse
 */
class CreateCustomerRequest 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 $customerRef=null,
        /** @var int */
        public int $title=0,
        /** @var string|null */
        public ?string $firstName=null,
        /** @var string|null */
        public ?string $lastName=null,
        /** @var string|null */
        public ?string $firstNameNotLatin=null,
        /** @var string|null */
        public ?string $lastNameNotLatin=null,
        /** @var DateTime|null */
        public ?DateTime $birthday=null,
        /** @var string|null */
        public ?string $email=null,
        /** @var bool|null */
        public ?bool $canBeContacted=null,
        /** @var string|null */
        public ?string $language=null,
        /** @var string|null */
        public ?string $nameSuffix=null,
        /** @var string|null */
        public ?string $gender=null,
        /** @var string|null */
        public ?string $middleName=null,
        /** @var string|null */
        public ?string $countryId=null,
        /** @var string|null */
        public ?string $phoneCountryId=null,
        /** @var string|null */
        public ?string $prefixCountryId=null,
        /** @var string|null */
        public ?string $phone=null,
        /** @var int */
        public int $posId=0,
        /** @var string|null */
        public ?string $brandTrigram=null,
        /** @var DateTime|null */
        public ?DateTime $weddingDate=null,
        /** @var string|null */
        public ?string $street=null,
        /** @var string|null */
        public ?string $houseNumber=null,
        /** @var string|null */
        public ?string $city=null,
        /** @var string|null */
        public ?string $postalCode=null,
        /** @var string|null */
        public ?string $region=null,
        /** @var string|null */
        public ?string $street2=null,
        /** @var string|null */
        public ?string $street3=null,
        /** @var string|null */
        public ?string $street4=null,
        /** @var string|null */
        public ?string $street5=null,
        /** @var string|null */
        public ?string $salePersonId=null,
        /** @var bool|null */
        public ?bool $privacyPolicyAcceptanceStorage=null,
        /** @var bool|null */
        public ?bool $allowStoreDataAbroad=null,
        /** @var bool|null */
        public ?bool $tvPrivacyPolicyAcceptanceStorage=null,
        /** @var bool|null */
        public ?bool $tvAllowStoreDataAbroad=null,
        /** @var bool|null */
        public ?bool $contactByMail=null,
        /** @var bool|null */
        public ?bool $contactByEmail=null,
        /** @var bool|null */
        public ?bool $contactByPhone=null,
        /** @var bool|null */
        public ?bool $contactBySMS=null,
        /** @var bool|null */
        public ?bool $contactBySocialMedia=null
    ) {
        parent::__construct($sid,$app,$_os,$_appVersion,$_searchMethod);
    }

    /** @throws Exception */
    public function fromMap($o): void {
        parent::fromMap($o);
        if (isset($o['customerRef'])) $this->customerRef = $o['customerRef'];
        if (isset($o['title'])) $this->title = $o['title'];
        if (isset($o['firstName'])) $this->firstName = $o['firstName'];
        if (isset($o['lastName'])) $this->lastName = $o['lastName'];
        if (isset($o['firstNameNotLatin'])) $this->firstNameNotLatin = $o['firstNameNotLatin'];
        if (isset($o['lastNameNotLatin'])) $this->lastNameNotLatin = $o['lastNameNotLatin'];
        if (isset($o['birthday'])) $this->birthday = JsonConverters::from('DateTime', $o['birthday']);
        if (isset($o['email'])) $this->email = $o['email'];
        if (isset($o['canBeContacted'])) $this->canBeContacted = $o['canBeContacted'];
        if (isset($o['language'])) $this->language = $o['language'];
        if (isset($o['nameSuffix'])) $this->nameSuffix = $o['nameSuffix'];
        if (isset($o['gender'])) $this->gender = $o['gender'];
        if (isset($o['middleName'])) $this->middleName = $o['middleName'];
        if (isset($o['countryId'])) $this->countryId = $o['countryId'];
        if (isset($o['phoneCountryId'])) $this->phoneCountryId = $o['phoneCountryId'];
        if (isset($o['prefixCountryId'])) $this->prefixCountryId = $o['prefixCountryId'];
        if (isset($o['phone'])) $this->phone = $o['phone'];
        if (isset($o['posId'])) $this->posId = $o['posId'];
        if (isset($o['brandTrigram'])) $this->brandTrigram = $o['brandTrigram'];
        if (isset($o['weddingDate'])) $this->weddingDate = JsonConverters::from('DateTime', $o['weddingDate']);
        if (isset($o['street'])) $this->street = $o['street'];
        if (isset($o['houseNumber'])) $this->houseNumber = $o['houseNumber'];
        if (isset($o['city'])) $this->city = $o['city'];
        if (isset($o['postalCode'])) $this->postalCode = $o['postalCode'];
        if (isset($o['region'])) $this->region = $o['region'];
        if (isset($o['street2'])) $this->street2 = $o['street2'];
        if (isset($o['street3'])) $this->street3 = $o['street3'];
        if (isset($o['street4'])) $this->street4 = $o['street4'];
        if (isset($o['street5'])) $this->street5 = $o['street5'];
        if (isset($o['salePersonId'])) $this->salePersonId = $o['salePersonId'];
        if (isset($o['privacyPolicyAcceptanceStorage'])) $this->privacyPolicyAcceptanceStorage = $o['privacyPolicyAcceptanceStorage'];
        if (isset($o['allowStoreDataAbroad'])) $this->allowStoreDataAbroad = $o['allowStoreDataAbroad'];
        if (isset($o['tvPrivacyPolicyAcceptanceStorage'])) $this->tvPrivacyPolicyAcceptanceStorage = $o['tvPrivacyPolicyAcceptanceStorage'];
        if (isset($o['tvAllowStoreDataAbroad'])) $this->tvAllowStoreDataAbroad = $o['tvAllowStoreDataAbroad'];
        if (isset($o['contactByMail'])) $this->contactByMail = $o['contactByMail'];
        if (isset($o['contactByEmail'])) $this->contactByEmail = $o['contactByEmail'];
        if (isset($o['contactByPhone'])) $this->contactByPhone = $o['contactByPhone'];
        if (isset($o['contactBySMS'])) $this->contactBySMS = $o['contactBySMS'];
        if (isset($o['contactBySocialMedia'])) $this->contactBySocialMedia = $o['contactBySocialMedia'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = parent::jsonSerialize();
        if (isset($this->customerRef)) $o['customerRef'] = $this->customerRef;
        if (isset($this->title)) $o['title'] = $this->title;
        if (isset($this->firstName)) $o['firstName'] = $this->firstName;
        if (isset($this->lastName)) $o['lastName'] = $this->lastName;
        if (isset($this->firstNameNotLatin)) $o['firstNameNotLatin'] = $this->firstNameNotLatin;
        if (isset($this->lastNameNotLatin)) $o['lastNameNotLatin'] = $this->lastNameNotLatin;
        if (isset($this->birthday)) $o['birthday'] = JsonConverters::to('DateTime', $this->birthday);
        if (isset($this->email)) $o['email'] = $this->email;
        if (isset($this->canBeContacted)) $o['canBeContacted'] = $this->canBeContacted;
        if (isset($this->language)) $o['language'] = $this->language;
        if (isset($this->nameSuffix)) $o['nameSuffix'] = $this->nameSuffix;
        if (isset($this->gender)) $o['gender'] = $this->gender;
        if (isset($this->middleName)) $o['middleName'] = $this->middleName;
        if (isset($this->countryId)) $o['countryId'] = $this->countryId;
        if (isset($this->phoneCountryId)) $o['phoneCountryId'] = $this->phoneCountryId;
        if (isset($this->prefixCountryId)) $o['prefixCountryId'] = $this->prefixCountryId;
        if (isset($this->phone)) $o['phone'] = $this->phone;
        if (isset($this->posId)) $o['posId'] = $this->posId;
        if (isset($this->brandTrigram)) $o['brandTrigram'] = $this->brandTrigram;
        if (isset($this->weddingDate)) $o['weddingDate'] = JsonConverters::to('DateTime', $this->weddingDate);
        if (isset($this->street)) $o['street'] = $this->street;
        if (isset($this->houseNumber)) $o['houseNumber'] = $this->houseNumber;
        if (isset($this->city)) $o['city'] = $this->city;
        if (isset($this->postalCode)) $o['postalCode'] = $this->postalCode;
        if (isset($this->region)) $o['region'] = $this->region;
        if (isset($this->street2)) $o['street2'] = $this->street2;
        if (isset($this->street3)) $o['street3'] = $this->street3;
        if (isset($this->street4)) $o['street4'] = $this->street4;
        if (isset($this->street5)) $o['street5'] = $this->street5;
        if (isset($this->salePersonId)) $o['salePersonId'] = $this->salePersonId;
        if (isset($this->privacyPolicyAcceptanceStorage)) $o['privacyPolicyAcceptanceStorage'] = $this->privacyPolicyAcceptanceStorage;
        if (isset($this->allowStoreDataAbroad)) $o['allowStoreDataAbroad'] = $this->allowStoreDataAbroad;
        if (isset($this->tvPrivacyPolicyAcceptanceStorage)) $o['tvPrivacyPolicyAcceptanceStorage'] = $this->tvPrivacyPolicyAcceptanceStorage;
        if (isset($this->tvAllowStoreDataAbroad)) $o['tvAllowStoreDataAbroad'] = $this->tvAllowStoreDataAbroad;
        if (isset($this->contactByMail)) $o['contactByMail'] = $this->contactByMail;
        if (isset($this->contactByEmail)) $o['contactByEmail'] = $this->contactByEmail;
        if (isset($this->contactByPhone)) $o['contactByPhone'] = $this->contactByPhone;
        if (isset($this->contactBySMS)) $o['contactBySMS'] = $this->contactBySMS;
        if (isset($this->contactBySocialMedia)) $o['contactBySocialMedia'] = $this->contactBySocialMedia;
        return empty($o) ? new class(){} : $o;
    }
}

PHP CreateCustomerRequest DTOs

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

HTTP + OTHER

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

POST /warranty/v1/createCustomer HTTP/1.1 
Host: qp-microservices-booster.richemont.com 
Accept: text/jsonl
Content-Type: text/jsonl
Content-Length: length

{"customerRef":"String","title":0,"firstName":"String","lastName":"String","firstNameNotLatin":"String","lastNameNotLatin":"String","birthday":"\/Date(-62135596800000-0000)\/","email":"String","canBeContacted":false,"language":"String","nameSuffix":"String","gender":"String","middleName":"String","countryId":"String","phoneCountryId":"String","prefixCountryId":"String","phone":"String","posId":0,"brandTrigram":"String","weddingDate":"\/Date(-62135596800000-0000)\/","street":"String","houseNumber":"String","city":"String","postalCode":"String","region":"String","street2":"String","street3":"String","street4":"String","street5":"String","salePersonId":"String","privacyPolicyAcceptanceStorage":false,"allowStoreDataAbroad":false,"tvPrivacyPolicyAcceptanceStorage":false,"tvAllowStoreDataAbroad":false,"contactByMail":false,"contactByEmail":false,"contactByPhone":false,"contactBySMS":false,"contactBySocialMedia":false,"sid":"String","app":"String","_os":"String","_appVersion":"String","_searchMethod":"String"}
HTTP/1.1 200 OK
Content-Type: text/jsonl
Content-Length: length

{"customerId":"00000000000000000000000000000000","boosterCustomerId":0,"_xmlns":"String","_type":"String","_source":"String","_tstamp":"String","_user":"String","_env":"String","_uri":"String","_query":"String"}