Richemont.Booster2.PublicApi

<back to all web services

GetMyUser

Requires Authentication
The following routes are available for this service:
GET/meGet my currently logged in user
<?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 GetUserResponse implements JsonSerializable
{
    public function __construct(
        /** @description Unique Identifier of a User */
        // @ApiMember(Description="Unique Identifier of a User", IsRequired=true)
        /** @var string */
        public string $userId='',

        /** @description User's Email address */
        // @ApiMember(Description="User's Email address", IsRequired=true)
        /** @var string */
        public string $emailAddress='',

        /** @description First Name */
        // @ApiMember(Description="First Name", IsRequired=true)
        /** @var string */
        public string $firstName='',

        /** @description Last Name */
        // @ApiMember(Description="Last Name", IsRequired=true)
        /** @var string */
        public string $lastName='',

        /** @description User's Password Expiration Date */
        // @ApiMember(Description="User's Password Expiration Date")
        /** @var string|null */
        public ?string $passwordExpirationDate=null,

        /** @description If the User must change the password */
        // @ApiMember(Description="If the User must change the password", IsRequired=true)
        /** @var bool|null */
        public ?bool $passwordMustBeChanged=null,

        /** @description User Type of the User */
        // @ApiMember(Description="User Type of the User", IsRequired=true)
        /** @var string */
        public string $userType='',

        /** @description Culture ID of the User */
        // @ApiMember(Description="Culture ID of the User", IsRequired=true)
        /** @var string */
        public string $culture='',

        /** @description If the User account is locked */
        // @ApiMember(Description="If the User account is locked", IsRequired=true)
        /** @var bool|null */
        public ?bool $accountLocked=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['userId'])) $this->userId = $o['userId'];
        if (isset($o['emailAddress'])) $this->emailAddress = $o['emailAddress'];
        if (isset($o['firstName'])) $this->firstName = $o['firstName'];
        if (isset($o['lastName'])) $this->lastName = $o['lastName'];
        if (isset($o['passwordExpirationDate'])) $this->passwordExpirationDate = $o['passwordExpirationDate'];
        if (isset($o['passwordMustBeChanged'])) $this->passwordMustBeChanged = $o['passwordMustBeChanged'];
        if (isset($o['userType'])) $this->userType = $o['userType'];
        if (isset($o['culture'])) $this->culture = $o['culture'];
        if (isset($o['accountLocked'])) $this->accountLocked = $o['accountLocked'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->userId)) $o['userId'] = $this->userId;
        if (isset($this->emailAddress)) $o['emailAddress'] = $this->emailAddress;
        if (isset($this->firstName)) $o['firstName'] = $this->firstName;
        if (isset($this->lastName)) $o['lastName'] = $this->lastName;
        if (isset($this->passwordExpirationDate)) $o['passwordExpirationDate'] = $this->passwordExpirationDate;
        if (isset($this->passwordMustBeChanged)) $o['passwordMustBeChanged'] = $this->passwordMustBeChanged;
        if (isset($this->userType)) $o['userType'] = $this->userType;
        if (isset($this->culture)) $o['culture'] = $this->culture;
        if (isset($this->accountLocked)) $o['accountLocked'] = $this->accountLocked;
        return empty($o) ? new class(){} : $o;
    }
}

class GetMyUser implements JsonSerializable
{
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        return empty($o) ? new class(){} : $o;
    }
}

PHP GetMyUser 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 /me HTTP/1.1 
Host: dev-api-booster.richemont.com 
Accept: application/xml
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

<GetUserResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Richemont.Booster2.PublicApi.Security.ServiceModel">
  <accountLocked>false</accountLocked>
  <culture>String</culture>
  <emailAddress>String</emailAddress>
  <firstName>String</firstName>
  <lastName>String</lastName>
  <passwordExpirationDate>String</passwordExpirationDate>
  <passwordMustBeChanged>false</passwordMustBeChanged>
  <userId>00000000-0000-0000-0000-000000000000</userId>
  <userType>String</userType>
</GetUserResponse>