POST | /customer | Create customer | Create CRM customer |
---|
<?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 Email implements JsonSerializable
{
public function __construct(
/** @description Email */
// @ApiMember(Description="Email", IsRequired=true)
/** @var string */
public string $email='',
/** @description Main email */
// @ApiMember(Description="Main email", IsRequired=true)
/** @var bool|null */
public ?bool $isMainEmail=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['email'])) $this->email = $o['email'];
if (isset($o['isMainEmail'])) $this->isMainEmail = $o['isMainEmail'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->email)) $o['email'] = $this->email;
if (isset($this->isMainEmail)) $o['isMainEmail'] = $this->isMainEmail;
return empty($o) ? new class(){} : $o;
}
}
class Phone implements JsonSerializable
{
public function __construct(
/** @description Phone e.g. cn: 13888889999, jp: 352858088, kr: 023123456 */
// @ApiMember(Description="Phone e.g. cn: 13888889999, jp: 352858088, kr: 023123456", IsRequired=true)
/** @var string */
public string $phone='',
/** @description Prefix Country Id e.g. it, fr, az */
// @ApiMember(Description="Prefix Country Id e.g. it, fr, az", IsRequired=true)
/** @var string */
public string $countryPrefix='',
/** @description Phone type e.g. 'Home', 'Mobile', 'Work', 'Other', 'Secondary Address' */
// @ApiMember(Description="Phone type e.g. 'Home', 'Mobile', 'Work', 'Other', 'Secondary Address'")
/** @var string|null */
public ?string $phoneType=null,
/** @description Main Phone */
// @ApiMember(Description="Main Phone", IsRequired=true)
/** @var bool|null */
public ?bool $isMainPhone=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['phone'])) $this->phone = $o['phone'];
if (isset($o['countryPrefix'])) $this->countryPrefix = $o['countryPrefix'];
if (isset($o['phoneType'])) $this->phoneType = $o['phoneType'];
if (isset($o['isMainPhone'])) $this->isMainPhone = $o['isMainPhone'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->phone)) $o['phone'] = $this->phone;
if (isset($this->countryPrefix)) $o['countryPrefix'] = $this->countryPrefix;
if (isset($this->phoneType)) $o['phoneType'] = $this->phoneType;
if (isset($this->isMainPhone)) $o['isMainPhone'] = $this->isMainPhone;
return empty($o) ? new class(){} : $o;
}
}
class Address implements JsonSerializable
{
public function __construct(
/** @description Address type e.g. Home, Office, Shipping */
// @ApiMember(Description="Address type e.g. Home, Office, Shipping", IsRequired=true)
/** @var string */
public string $addressType='',
/** @description Country Id e.g. it, cn, az, gb, de */
// @ApiMember(Description="Country Id e.g. it, cn, az, gb, de", IsRequired=true)
/** @var string */
public string $countryId='',
/** @description House Number */
// @ApiMember(Description="House Number")
/** @var string|null */
public ?string $houseNumber=null,
/** @description Region/State */
// @ApiMember(Description="Region/State")
/** @var string|null */
public ?string $stateId=null,
/** @description City Name */
// @ApiMember(Description="City Name")
/** @var string|null */
public ?string $city=null,
/** @description Postal Code */
// @ApiMember(Description="Postal Code")
/** @var string|null */
public ?string $zipCode=null,
/** @description Street Name and Number */
// @ApiMember(Description="Street Name and Number")
/** @var string|null */
public ?string $street=null,
/** @description Street 2 */
// @ApiMember(Description="Street 2")
/** @var string|null */
public ?string $street2=null,
/** @description Street 3 */
// @ApiMember(Description="Street 3")
/** @var string|null */
public ?string $street3=null,
/** @description Street 4 */
// @ApiMember(Description="Street 4")
/** @var string|null */
public ?string $street4=null,
/** @description Street 5 */
// @ApiMember(Description="Street 5")
/** @var string|null */
public ?string $street5=null,
/** @description Main Address */
// @ApiMember(Description="Main Address", IsRequired=true)
/** @var bool|null */
public ?bool $isMainAddress=null,
/** @description Post Office Box */
// @ApiMember(Description="Post Office Box")
/** @var string|null */
public ?string $poBox=null,
/** @description Additional Information */
// @ApiMember(Description="Additional Information")
/** @var string|null */
public ?string $additionalInformation=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['addressType'])) $this->addressType = $o['addressType'];
if (isset($o['countryId'])) $this->countryId = $o['countryId'];
if (isset($o['houseNumber'])) $this->houseNumber = $o['houseNumber'];
if (isset($o['stateId'])) $this->stateId = $o['stateId'];
if (isset($o['city'])) $this->city = $o['city'];
if (isset($o['zipCode'])) $this->zipCode = $o['zipCode'];
if (isset($o['street'])) $this->street = $o['street'];
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['isMainAddress'])) $this->isMainAddress = $o['isMainAddress'];
if (isset($o['poBox'])) $this->poBox = $o['poBox'];
if (isset($o['additionalInformation'])) $this->additionalInformation = $o['additionalInformation'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->addressType)) $o['addressType'] = $this->addressType;
if (isset($this->countryId)) $o['countryId'] = $this->countryId;
if (isset($this->houseNumber)) $o['houseNumber'] = $this->houseNumber;
if (isset($this->stateId)) $o['stateId'] = $this->stateId;
if (isset($this->city)) $o['city'] = $this->city;
if (isset($this->zipCode)) $o['zipCode'] = $this->zipCode;
if (isset($this->street)) $o['street'] = $this->street;
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->isMainAddress)) $o['isMainAddress'] = $this->isMainAddress;
if (isset($this->poBox)) $o['poBox'] = $this->poBox;
if (isset($this->additionalInformation)) $o['additionalInformation'] = $this->additionalInformation;
return empty($o) ? new class(){} : $o;
}
}
class Event implements JsonSerializable
{
public function __construct(
/** @description Event type e.g. 'Birthday', 'Wedding', 'Anniversary', 'Barmitza', 'Other' */
// @ApiMember(Description="Event type e.g. 'Birthday', 'Wedding', 'Anniversary', 'Barmitza', 'Other'", IsRequired=true)
/** @var string */
public string $eventType='',
/** @description Event date e.g. '2021-01-20' */
// @ApiMember(Description="Event date e.g. '2021-01-20'", IsRequired=true)
/** @var DateTime */
public DateTime $eventDate=new DateTime(),
/** @description Event notes */
// @ApiMember(Description="Event notes")
/** @var string|null */
public ?string $eventNotes=null,
/** @description Event other name */
// @ApiMember(Description="Event other name")
/** @var string|null */
public ?string $eventOtherName=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['eventType'])) $this->eventType = $o['eventType'];
if (isset($o['eventDate'])) $this->eventDate = JsonConverters::from('DateTime', $o['eventDate']);
if (isset($o['eventNotes'])) $this->eventNotes = $o['eventNotes'];
if (isset($o['eventOtherName'])) $this->eventOtherName = $o['eventOtherName'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->eventType)) $o['eventType'] = $this->eventType;
if (isset($this->eventDate)) $o['eventDate'] = JsonConverters::to('DateTime', $this->eventDate);
if (isset($this->eventNotes)) $o['eventNotes'] = $this->eventNotes;
if (isset($this->eventOtherName)) $o['eventOtherName'] = $this->eventOtherName;
return empty($o) ? new class(){} : $o;
}
}
class Interest implements JsonSerializable
{
public function __construct(
/** @description Interest description */
// @ApiMember(Description="Interest description", IsRequired=true)
/** @var string */
public string $interest='',
/** @description SAP Interest ID, e.g. 'CA-1' */
// @ApiMember(Description="SAP Interest ID, e.g. 'CA-1'", IsRequired=true)
/** @var string */
public string $sapInterestId='',
/** @description Interest description translation */
// @ApiMember(Description="Interest description translation")
/** @var string|null */
public ?string $translation=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['interest'])) $this->interest = $o['interest'];
if (isset($o['sapInterestId'])) $this->sapInterestId = $o['sapInterestId'];
if (isset($o['translation'])) $this->translation = $o['translation'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->interest)) $o['interest'] = $this->interest;
if (isset($this->sapInterestId)) $o['sapInterestId'] = $this->sapInterestId;
if (isset($this->translation)) $o['translation'] = $this->translation;
return empty($o) ? new class(){} : $o;
}
}
class Hobby implements JsonSerializable
{
public function __construct(
/** @description Hobby description */
// @ApiMember(Description="Hobby description", IsRequired=true)
/** @var string */
public string $hobby='',
/** @description SAP Hobby ID, e.g. 'ART' */
// @ApiMember(Description="SAP Hobby ID, e.g. 'ART'", IsRequired=true)
/** @var string */
public string $sapHobbyId='',
/** @description Hobby description translation */
// @ApiMember(Description="Hobby description translation")
/** @var string|null */
public ?string $translation=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['hobby'])) $this->hobby = $o['hobby'];
if (isset($o['sapHobbyId'])) $this->sapHobbyId = $o['sapHobbyId'];
if (isset($o['translation'])) $this->translation = $o['translation'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->hobby)) $o['hobby'] = $this->hobby;
if (isset($this->sapHobbyId)) $o['sapHobbyId'] = $this->sapHobbyId;
if (isset($this->translation)) $o['translation'] = $this->translation;
return empty($o) ? new class(){} : $o;
}
}
class ProductCollection implements JsonSerializable
{
public function __construct(
/** @description Product Collection description */
// @ApiMember(Description="Product Collection description", IsRequired=true)
/** @var string */
public string $productCollection='',
/** @description SAP ProductCollection ID, e.g. 'CA-1' */
// @ApiMember(Description="SAP ProductCollection ID, e.g. 'CA-1'", IsRequired=true)
/** @var string */
public string $sapProductCollectionId='',
/** @description Product Collection description translation */
// @ApiMember(Description="Product Collection description translation", IsRequired=true)
/** @var string */
public string $translation=''
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['productCollection'])) $this->productCollection = $o['productCollection'];
if (isset($o['sapProductCollectionId'])) $this->sapProductCollectionId = $o['sapProductCollectionId'];
if (isset($o['translation'])) $this->translation = $o['translation'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->productCollection)) $o['productCollection'] = $this->productCollection;
if (isset($this->sapProductCollectionId)) $o['sapProductCollectionId'] = $this->sapProductCollectionId;
if (isset($this->translation)) $o['translation'] = $this->translation;
return empty($o) ? new class(){} : $o;
}
}
class Customer implements JsonSerializable
{
public function __construct(
/** @description Title e.g. 'Mr & Mrs', 'Mr.', 'Mrs.', 'Sama', 'Captain' - Mandatory only when customer type is 'PRIVATE' */
// @ApiMember(Description="Title e.g. 'Mr & Mrs', 'Mr.', 'Mrs.', 'Sama', 'Captain' - Mandatory only when customer type is 'PRIVATE'")
/** @var string|null */
public ?string $title=null,
/** @description First Name */
// @ApiMember(Description="First Name")
/** @var string|null */
public ?string $firstName=null,
/** @description Last Name - Mandatory only when customer type is 'PRIVATE' */
// @ApiMember(Description="Last Name - Mandatory only when customer type is 'PRIVATE'")
/** @var string|null */
public ?string $lastName=null,
/** @description First Name Not Latin */
// @ApiMember(Description="First Name Not Latin")
/** @var string|null */
public ?string $firstNameNotLatin=null,
/** @description Last Name Not Latin */
// @ApiMember(Description="Last Name Not Latin")
/** @var string|null */
public ?string $lastNameNotLatin=null,
/** @description Middle Name */
// @ApiMember(Description="Middle Name")
/** @var string|null */
public ?string $middleName=null,
/** @description Name Suffix */
// @ApiMember(Description="Name Suffix")
/** @var string|null */
public ?string $nameSuffix=null,
/** @description Can be Contacted by Maison e.g. true or false */
// @ApiMember(Description="Can be Contacted by Maison e.g. true or false", IsRequired=true)
/** @var bool|null */
public ?bool $canBeContactedByMaison=null,
/** @description Customer Type e.g. 'PRIVATE' or 'COMPANY' */
// @ApiMember(Description="Customer Type e.g. 'PRIVATE' or 'COMPANY'", IsRequired=true)
/** @var string */
public string $clientType='',
/** @description Company Name - Mandatory only when customer type is 'COMPANY' */
// @ApiMember(Description="Company Name - Mandatory only when customer type is 'COMPANY'")
/** @var string|null */
public ?string $companyName=null,
/** @description Language Id e.g. ita, chi, aze, eng, ger - Mandatory only when customer type is 'PRIVATE' */
// @ApiMember(Description="Language Id e.g. ita, chi, aze, eng, ger - Mandatory only when customer type is 'PRIVATE'")
/** @var string|null */
public ?string $languageId=null,
/** @description Gender e.g. M, F - Mandatory only when customer type is 'PRIVATE' */
// @ApiMember(Description="Gender e.g. M, F - Mandatory only when customer type is 'PRIVATE'")
/** @var string|null */
public ?string $gender=null,
/** @description Country Id e.g. it, cn, az, gb, de */
// @ApiMember(Description="Country Id e.g. it, cn, az, gb, de", IsRequired=true)
/** @var string */
public string $countryId='',
/** @description Birth Date e.g. '2020-12-30' */
// @ApiMember(Description="Birth Date e.g. '2020-12-30'")
/** @var DateTime|null */
public ?DateTime $birthDate=null,
/** @description Customer reference */
// @ApiMember(Description="Customer reference")
/** @var string|null */
public ?string $customerReference=null,
/** @description POS Code e.g. ES100:102048 */
// @ApiMember(Description="POS Code e.g. ES100:102048", IsRequired=true)
/** @var string */
public string $posCode='',
/** @description Brand e.g. CAR, MTB */
// @ApiMember(Description="Brand e.g. CAR, MTB", IsRequired=true)
/** @var string */
public string $brand='',
/** @description Wedding Date, e.g. '2020-01-18' */
// @ApiMember(Description="Wedding Date, e.g. '2020-01-18'")
/** @var DateTime|null */
public ?DateTime $weddingDate=null,
/** @description Preferred Contact Method e.g. 'Fax', 'Tel', 'EMail', 'Mail', 'Survey' */
// @ApiMember(Description="Preferred Contact Method e.g. 'Fax', 'Tel', 'EMail', 'Mail', 'Survey'")
/** @var string|null */
public ?string $preferredContactMethod=null,
/** @description Provide 'true' if you want to be contacted by email. Leave empty or 'false' if you do not. */
// @ApiMember(Description="Provide 'true' if you want to be contacted by email. Leave empty or 'false' if you do not.")
/** @var bool|null */
public ?bool $contactByEmailFlag=null,
/** @description Provide 'true' if you want to be contacted by mail. Leave empty or 'false' if you do not. */
// @ApiMember(Description="Provide 'true' if you want to be contacted by mail. Leave empty or 'false' if you do not.")
/** @var bool|null */
public ?bool $contactByMailFlag=null,
/** @description Provide 'true' if you want to be contacted by phone. Leave empty or 'false' if you do not. */
// @ApiMember(Description="Provide 'true' if you want to be contacted by phone. Leave empty or 'false' if you do not.")
/** @var bool|null */
public ?bool $contactByPhoneFlag=null,
/** @description Provide 'true' if you want to be contacted by SMS. Leave empty or 'false' if you do not. */
// @ApiMember(Description="Provide 'true' if you want to be contacted by SMS. Leave empty or 'false' if you do not.")
/** @var bool|null */
public ?bool $contactBySMSFlag=null,
/** @description Provide 'true' if you want to be contacted by social media. Leave empty or 'false' if you do not. */
// @ApiMember(Description="Provide 'true' if you want to be contacted by social media. Leave empty or 'false' if you do not.")
/** @var bool|null */
public ?bool $contactBySocialMediaFlag=null,
/** @description Sale Representative Email e.g. rauf.aliyev@richemont.com */
// @ApiMember(Description="Sale Representative Email e.g. rauf.aliyev@richemont.com")
/** @var string|null */
public ?string $saleRepresentativeEmail=null,
/** @description Consent for allowing Cross Border Data Transfer */
// @ApiMember(Description="Consent for allowing Cross Border Data Transfer")
/** @var bool|null */
public ?bool $allowStoreDataAbroad=null,
/** @description Consent for allowing Cross Border Data Transfer For TimeVallée */
// @ApiMember(Description="Consent for allowing Cross Border Data Transfer For TimeVallée")
/** @var bool|null */
public ?bool $tvAllowStoreDataAbroad=null,
/** @description Customer emails */
// @ApiMember(Description="Customer emails")
/** @var array<Email>|null */
public ?array $emails=null,
/** @description Customer phones */
// @ApiMember(Description="Customer phones")
/** @var array<Phone>|null */
public ?array $phones=null,
/** @description Customer addresses */
// @ApiMember(Description="Customer addresses")
/** @var array<Address>|null */
public ?array $addresses=null,
/** @description Customer events */
// @ApiMember(Description="Customer events")
/** @var array<Event>|null */
public ?array $events=null,
/** @description Customer interests */
// @ApiMember(Description="Customer interests")
/** @var array<Interest>|null */
public ?array $interests=null,
/** @description Customer hobbies */
// @ApiMember(Description="Customer hobbies")
/** @var array<Hobby>|null */
public ?array $hobbies=null,
/** @description Customer product collections */
// @ApiMember(Description="Customer product collections")
/** @var array<ProductCollection>|null */
public ?array $productCollections=null,
/** @description Provide 'true' if you allow data sharing consent. Leave empty or 'false' if you do not. */
// @ApiMember(Description="Provide 'true' if you allow data sharing consent. Leave empty or 'false' if you do not.")
/** @var bool|null */
public ?bool $dataSharingConsent=null,
/** @description Notes */
// @ApiMember(Description="Notes")
/** @var string|null */
public ?string $notes=null,
/** @description Reference Sale Representative Email */
// @ApiMember(Description="Reference Sale Representative Email")
/** @var string|null */
public ?string $referenceSaleRepresentativeEmail=null,
/** @description Registration Date */
// @ApiMember(Description="Registration Date")
/** @var DateTime|null */
public ?DateTime $registrationDate=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
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['middleName'])) $this->middleName = $o['middleName'];
if (isset($o['nameSuffix'])) $this->nameSuffix = $o['nameSuffix'];
if (isset($o['canBeContactedByMaison'])) $this->canBeContactedByMaison = $o['canBeContactedByMaison'];
if (isset($o['clientType'])) $this->clientType = $o['clientType'];
if (isset($o['companyName'])) $this->companyName = $o['companyName'];
if (isset($o['languageId'])) $this->languageId = $o['languageId'];
if (isset($o['gender'])) $this->gender = $o['gender'];
if (isset($o['countryId'])) $this->countryId = $o['countryId'];
if (isset($o['birthDate'])) $this->birthDate = JsonConverters::from('DateTime', $o['birthDate']);
if (isset($o['customerReference'])) $this->customerReference = $o['customerReference'];
if (isset($o['posCode'])) $this->posCode = $o['posCode'];
if (isset($o['brand'])) $this->brand = $o['brand'];
if (isset($o['weddingDate'])) $this->weddingDate = JsonConverters::from('DateTime', $o['weddingDate']);
if (isset($o['preferredContactMethod'])) $this->preferredContactMethod = $o['preferredContactMethod'];
if (isset($o['contactByEmailFlag'])) $this->contactByEmailFlag = $o['contactByEmailFlag'];
if (isset($o['contactByMailFlag'])) $this->contactByMailFlag = $o['contactByMailFlag'];
if (isset($o['contactByPhoneFlag'])) $this->contactByPhoneFlag = $o['contactByPhoneFlag'];
if (isset($o['contactBySMSFlag'])) $this->contactBySMSFlag = $o['contactBySMSFlag'];
if (isset($o['contactBySocialMediaFlag'])) $this->contactBySocialMediaFlag = $o['contactBySocialMediaFlag'];
if (isset($o['saleRepresentativeEmail'])) $this->saleRepresentativeEmail = $o['saleRepresentativeEmail'];
if (isset($o['allowStoreDataAbroad'])) $this->allowStoreDataAbroad = $o['allowStoreDataAbroad'];
if (isset($o['tvAllowStoreDataAbroad'])) $this->tvAllowStoreDataAbroad = $o['tvAllowStoreDataAbroad'];
if (isset($o['emails'])) $this->emails = JsonConverters::fromArray('Email', $o['emails']);
if (isset($o['phones'])) $this->phones = JsonConverters::fromArray('Phone', $o['phones']);
if (isset($o['addresses'])) $this->addresses = JsonConverters::fromArray('Address', $o['addresses']);
if (isset($o['events'])) $this->events = JsonConverters::fromArray('Event', $o['events']);
if (isset($o['interests'])) $this->interests = JsonConverters::fromArray('Interest', $o['interests']);
if (isset($o['hobbies'])) $this->hobbies = JsonConverters::fromArray('Hobby', $o['hobbies']);
if (isset($o['productCollections'])) $this->productCollections = JsonConverters::fromArray('ProductCollection', $o['productCollections']);
if (isset($o['dataSharingConsent'])) $this->dataSharingConsent = $o['dataSharingConsent'];
if (isset($o['notes'])) $this->notes = $o['notes'];
if (isset($o['referenceSaleRepresentativeEmail'])) $this->referenceSaleRepresentativeEmail = $o['referenceSaleRepresentativeEmail'];
if (isset($o['registrationDate'])) $this->registrationDate = JsonConverters::from('DateTime', $o['registrationDate']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
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->middleName)) $o['middleName'] = $this->middleName;
if (isset($this->nameSuffix)) $o['nameSuffix'] = $this->nameSuffix;
if (isset($this->canBeContactedByMaison)) $o['canBeContactedByMaison'] = $this->canBeContactedByMaison;
if (isset($this->clientType)) $o['clientType'] = $this->clientType;
if (isset($this->companyName)) $o['companyName'] = $this->companyName;
if (isset($this->languageId)) $o['languageId'] = $this->languageId;
if (isset($this->gender)) $o['gender'] = $this->gender;
if (isset($this->countryId)) $o['countryId'] = $this->countryId;
if (isset($this->birthDate)) $o['birthDate'] = JsonConverters::to('DateTime', $this->birthDate);
if (isset($this->customerReference)) $o['customerReference'] = $this->customerReference;
if (isset($this->posCode)) $o['posCode'] = $this->posCode;
if (isset($this->brand)) $o['brand'] = $this->brand;
if (isset($this->weddingDate)) $o['weddingDate'] = JsonConverters::to('DateTime', $this->weddingDate);
if (isset($this->preferredContactMethod)) $o['preferredContactMethod'] = $this->preferredContactMethod;
if (isset($this->contactByEmailFlag)) $o['contactByEmailFlag'] = $this->contactByEmailFlag;
if (isset($this->contactByMailFlag)) $o['contactByMailFlag'] = $this->contactByMailFlag;
if (isset($this->contactByPhoneFlag)) $o['contactByPhoneFlag'] = $this->contactByPhoneFlag;
if (isset($this->contactBySMSFlag)) $o['contactBySMSFlag'] = $this->contactBySMSFlag;
if (isset($this->contactBySocialMediaFlag)) $o['contactBySocialMediaFlag'] = $this->contactBySocialMediaFlag;
if (isset($this->saleRepresentativeEmail)) $o['saleRepresentativeEmail'] = $this->saleRepresentativeEmail;
if (isset($this->allowStoreDataAbroad)) $o['allowStoreDataAbroad'] = $this->allowStoreDataAbroad;
if (isset($this->tvAllowStoreDataAbroad)) $o['tvAllowStoreDataAbroad'] = $this->tvAllowStoreDataAbroad;
if (isset($this->emails)) $o['emails'] = JsonConverters::toArray('Email', $this->emails);
if (isset($this->phones)) $o['phones'] = JsonConverters::toArray('Phone', $this->phones);
if (isset($this->addresses)) $o['addresses'] = JsonConverters::toArray('Address', $this->addresses);
if (isset($this->events)) $o['events'] = JsonConverters::toArray('Event', $this->events);
if (isset($this->interests)) $o['interests'] = JsonConverters::toArray('Interest', $this->interests);
if (isset($this->hobbies)) $o['hobbies'] = JsonConverters::toArray('Hobby', $this->hobbies);
if (isset($this->productCollections)) $o['productCollections'] = JsonConverters::toArray('ProductCollection', $this->productCollections);
if (isset($this->dataSharingConsent)) $o['dataSharingConsent'] = $this->dataSharingConsent;
if (isset($this->notes)) $o['notes'] = $this->notes;
if (isset($this->referenceSaleRepresentativeEmail)) $o['referenceSaleRepresentativeEmail'] = $this->referenceSaleRepresentativeEmail;
if (isset($this->registrationDate)) $o['registrationDate'] = JsonConverters::to('DateTime', $this->registrationDate);
return empty($o) ? new class(){} : $o;
}
}
class CreateCustomerResponse implements JsonSerializable
{
public function __construct(
/** @description Booster Customer ID */
// @ApiMember(Description="Booster Customer ID", IsRequired=true)
/** @var int */
public int $boosterCustomerId=0
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['boosterCustomerId'])) $this->boosterCustomerId = $o['boosterCustomerId'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->boosterCustomerId)) $o['boosterCustomerId'] = $this->boosterCustomerId;
return empty($o) ? new class(){} : $o;
}
}
class CreateCustomer extends Customer implements JsonSerializable
{
/**
* @param string|null $title
* @param string|null $firstName
* @param string|null $lastName
* @param string|null $firstNameNotLatin
* @param string|null $lastNameNotLatin
* @param string|null $middleName
* @param string|null $nameSuffix
* @param bool|null $canBeContactedByMaison
* @param string $clientType
* @param string|null $companyName
* @param string|null $languageId
* @param string|null $gender
* @param string $countryId
* @param DateTime|null $birthDate
* @param string|null $customerReference
* @param string $posCode
* @param string $brand
* @param DateTime|null $weddingDate
* @param string|null $preferredContactMethod
* @param bool|null $contactByEmailFlag
* @param bool|null $contactByMailFlag
* @param bool|null $contactByPhoneFlag
* @param bool|null $contactBySMSFlag
* @param bool|null $contactBySocialMediaFlag
* @param string|null $saleRepresentativeEmail
* @param bool|null $allowStoreDataAbroad
* @param bool|null $tvAllowStoreDataAbroad
* @param array<Email>|null $emails
* @param array<Phone>|null $phones
* @param array<Address>|null $addresses
* @param array<Event>|null $events
* @param array<Interest>|null $interests
* @param array<Hobby>|null $hobbies
* @param array<ProductCollection>|null $productCollections
* @param bool|null $dataSharingConsent
* @param string|null $notes
* @param string|null $referenceSaleRepresentativeEmail
* @param DateTime|null $registrationDate
*/
public function __construct(
?string $title=null,
?string $firstName=null,
?string $lastName=null,
?string $firstNameNotLatin=null,
?string $lastNameNotLatin=null,
?string $middleName=null,
?string $nameSuffix=null,
?bool $canBeContactedByMaison=null,
string $clientType='',
?string $companyName=null,
?string $languageId=null,
?string $gender=null,
string $countryId='',
?DateTime $birthDate=null,
?string $customerReference=null,
string $posCode='',
string $brand='',
?DateTime $weddingDate=null,
?string $preferredContactMethod=null,
?bool $contactByEmailFlag=null,
?bool $contactByMailFlag=null,
?bool $contactByPhoneFlag=null,
?bool $contactBySMSFlag=null,
?bool $contactBySocialMediaFlag=null,
?string $saleRepresentativeEmail=null,
?bool $allowStoreDataAbroad=null,
?bool $tvAllowStoreDataAbroad=null,
?array $emails=null,
?array $phones=null,
?array $addresses=null,
?array $events=null,
?array $interests=null,
?array $hobbies=null,
?array $productCollections=null,
?bool $dataSharingConsent=null,
?string $notes=null,
?string $referenceSaleRepresentativeEmail=null,
?DateTime $registrationDate=null,
/** @description Privacy policy acceptance for data storage */
// @ApiMember(Description="Privacy policy acceptance for data storage", IsRequired=true)
/** @var bool|null */
public ?bool $privacyPolicyAcceptanceStorage=null,
/** @description Privacy policy acceptance of data storage for TimeVallée */
// @ApiMember(Description="Privacy policy acceptance of data storage for TimeVallée")
/** @var bool|null */
public ?bool $tvPrivacyPolicyAcceptanceStorage=null
) {
parent::__construct($title,$firstName,$lastName,$firstNameNotLatin,$lastNameNotLatin,$middleName,$nameSuffix,$canBeContactedByMaison,$clientType,$companyName,$languageId,$gender,$countryId,$birthDate,$customerReference,$posCode,$brand,$weddingDate,$preferredContactMethod,$contactByEmailFlag,$contactByMailFlag,$contactByPhoneFlag,$contactBySMSFlag,$contactBySocialMediaFlag,$saleRepresentativeEmail,$allowStoreDataAbroad,$tvAllowStoreDataAbroad,$emails,$phones,$addresses,$events,$interests,$hobbies,$productCollections,$dataSharingConsent,$notes,$referenceSaleRepresentativeEmail,$registrationDate);
}
/** @throws Exception */
public function fromMap($o): void {
parent::fromMap($o);
if (isset($o['privacyPolicyAcceptanceStorage'])) $this->privacyPolicyAcceptanceStorage = $o['privacyPolicyAcceptanceStorage'];
if (isset($o['tvPrivacyPolicyAcceptanceStorage'])) $this->tvPrivacyPolicyAcceptanceStorage = $o['tvPrivacyPolicyAcceptanceStorage'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = parent::jsonSerialize();
if (isset($this->privacyPolicyAcceptanceStorage)) $o['privacyPolicyAcceptanceStorage'] = $this->privacyPolicyAcceptanceStorage;
if (isset($this->tvPrivacyPolicyAcceptanceStorage)) $o['tvPrivacyPolicyAcceptanceStorage'] = $this->tvPrivacyPolicyAcceptanceStorage;
return empty($o) ? new class(){} : $o;
}
}
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.
POST /customer HTTP/1.1
Host: dev-api-booster.richemont.com
Accept: text/csv
Content-Type: text/csv
Content-Length: length
{"privacyPolicyAcceptanceStorage":false,"tvPrivacyPolicyAcceptanceStorage":false,"title":"String","firstName":"String","lastName":"String","firstNameNotLatin":"String","lastNameNotLatin":"String","middleName":"String","nameSuffix":"String","canBeContactedByMaison":false,"clientType":"String","companyName":"String","languageId":"String","gender":"String","countryId":"String","birthDate":"\/Date(-62135596800000-0000)\/","customerReference":"String","posCode":"String","brand":"String","weddingDate":"\/Date(-62135596800000-0000)\/","preferredContactMethod":"String","contactByEmailFlag":false,"contactByMailFlag":false,"contactByPhoneFlag":false,"contactBySMSFlag":false,"contactBySocialMediaFlag":false,"saleRepresentativeEmail":"String","allowStoreDataAbroad":false,"tvAllowStoreDataAbroad":false,"emails":[{"email":"String","isMainEmail":false}],"phones":[{"phone":"String","countryPrefix":"String","phoneType":"String","isMainPhone":false}],"addresses":[{"addressType":"String","countryId":"String","houseNumber":"String","stateId":"String","city":"String","zipCode":"String","street":"String","street2":"String","street3":"String","street4":"String","street5":"String","isMainAddress":false,"poBox":"String","additionalInformation":"String"}],"events":[{"eventType":"String","eventDate":"\/Date(-62135596800000-0000)\/","eventNotes":"String","eventOtherName":"String"}],"interests":[{"interest":"String","sapInterestId":"String","translation":"String"}],"hobbies":[{"hobby":"String","sapHobbyId":"String","translation":"String"}],"productCollections":[{"productCollection":"String","sapProductCollectionId":"String","translation":"String"}],"dataSharingConsent":false,"notes":"String","referenceSaleRepresentativeEmail":"String","registrationDate":"\/Date(-62135596800000-0000)\/"}
HTTP/1.1 200 OK Content-Type: text/csv Content-Length: length {"boosterCustomerId":0}