Richemont.Booster2.PublicApi

<back to all web services

UpdateConsents

Requires Authentication
The following routes are available for this service:
PATCH/customer/{boosterCustomerId}/updateConsentsUpdate customer consentsUpdate 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;
    }
}

PHP UpdateConsents DTOs

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

To embed the response in a jsonp callback, append ?callback=myCallback

HTTP + JSON

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: application/json
Content-Type: application/json
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: application/json
Content-Length: length

{}