| PATCH | /customer/{boosterCustomerId}/updateConsents | Update customer consents | Update customer consents |
|---|
<?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 UpdateConsents implements JsonSerializable
{
public function __construct(
/** @description Booster customer Id */
// @ApiMember(Description="Booster customer Id")
/** @var int */
public int $boosterCustomerId=0,
/** @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 Provide 'true' if you want to be contacted at all. Leave empty or 'false' if you do not - if chosen false, all contactBy* will be set to false also */
// @ApiMember(Description="Provide 'true' if you want to be contacted at all. Leave empty or 'false' if you do not - if chosen false, all contactBy* will be set to false also")
/** @var bool|null */
public ?bool $privacyAcceptance=null,
/** @description Provide 'true' if you allow your data to be stored abroad. Leave empty or 'false' if you do not. */
// @ApiMember(Description="Provide 'true' if you allow your data to be stored abroad. Leave empty or 'false' if you do not.")
/** @var bool|null */
public ?bool $allowStoreDataAbroad=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['boosterCustomerId'])) $this->boosterCustomerId = $o['boosterCustomerId'];
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['privacyAcceptance'])) $this->privacyAcceptance = $o['privacyAcceptance'];
if (isset($o['allowStoreDataAbroad'])) $this->allowStoreDataAbroad = $o['allowStoreDataAbroad'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->boosterCustomerId)) $o['boosterCustomerId'] = $this->boosterCustomerId;
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->privacyAcceptance)) $o['privacyAcceptance'] = $this->privacyAcceptance;
if (isset($this->allowStoreDataAbroad)) $o['allowStoreDataAbroad'] = $this->allowStoreDataAbroad;
return empty($o) ? new class(){} : $o;
}
}
To override the Content-type in your clients, use the HTTP Accept Header, append the .jsv suffix or ?format=jsv
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
PATCH /customer/{boosterCustomerId}/updateConsents HTTP/1.1
Host: dev-api-booster.richemont.com
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length
{
boosterCustomerId: 0,
contactByEmailFlag: False,
contactByMailFlag: False,
contactByPhoneFlag: False,
contactBySMSFlag: False,
contactBySocialMediaFlag: False,
privacyAcceptance: False,
allowStoreDataAbroad: False
}
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length
{
}