| GET | /users/{userId} | Get user if exists and is not disabled |
|---|
<?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 GetUser implements JsonSerializable
{
public function __construct(
/** @description User's UserID */
// @ApiMember(Description="User's UserID", IsRequired=true)
/** @var string */
public string $userId=''
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['userId'])) $this->userId = $o['userId'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->userId)) $o['userId'] = $this->userId;
return empty($o) ? new class(){} : $o;
}
}
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
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
GET /users/{userId} HTTP/1.1
Host: dev-api-booster.richemont.com
Accept: application/json
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length
{"userId":"00000000000000000000000000000000","emailAddress":"String","firstName":"String","lastName":"String","passwordExpirationDate":"String","passwordMustBeChanged":false,"userType":"String","culture":"String","accountLocked":false}