Booster.Microservices

<back to all web services

UserRequest

Requires Authentication
The following routes are available for this service:
GET/warranty/v1/user/{username*}
<?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 UserResponse implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $iss=null,
        /** @var array<string>|null */
        public ?array $aud=null,
        /** @var string|null */
        public ?string $sub=null,
        /** @var string|null */
        public ?string $email=null,
        /** @var string|null */
        public ?string $azp=null,
        /** @var array<string>|null */
        public ?array $locale=null,
        /** @var string|null */
        public ?string $exp=null,
        /** @var string|null */
        public ?string $iat=null,
        /** @var string|null */
        public ?string $time=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['iss'])) $this->iss = $o['iss'];
        if (isset($o['aud'])) $this->aud = JsonConverters::fromArray('string', $o['aud']);
        if (isset($o['sub'])) $this->sub = $o['sub'];
        if (isset($o['email'])) $this->email = $o['email'];
        if (isset($o['azp'])) $this->azp = $o['azp'];
        if (isset($o['locale'])) $this->locale = JsonConverters::fromArray('string', $o['locale']);
        if (isset($o['exp'])) $this->exp = $o['exp'];
        if (isset($o['iat'])) $this->iat = $o['iat'];
        if (isset($o['time'])) $this->time = $o['time'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->iss)) $o['iss'] = $this->iss;
        if (isset($this->aud)) $o['aud'] = JsonConverters::toArray('string', $this->aud);
        if (isset($this->sub)) $o['sub'] = $this->sub;
        if (isset($this->email)) $o['email'] = $this->email;
        if (isset($this->azp)) $o['azp'] = $this->azp;
        if (isset($this->locale)) $o['locale'] = JsonConverters::toArray('string', $this->locale);
        if (isset($this->exp)) $o['exp'] = $this->exp;
        if (isset($this->iat)) $o['iat'] = $this->iat;
        if (isset($this->time)) $o['time'] = $this->time;
        return empty($o) ? new class(){} : $o;
    }
}

class UserRequest implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $username=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['username'])) $this->username = $o['username'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->username)) $o['username'] = $this->username;
        return empty($o) ? new class(){} : $o;
    }
}

PHP UserRequest DTOs

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

HTTP + OTHER

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

GET /warranty/v1/user/{username*} HTTP/1.1 
Host: qp-microservices-booster.richemont.com 
Accept: text/jsonl
HTTP/1.1 200 OK
Content-Type: text/jsonl
Content-Length: length

{"iss":"String","aud":["String"],"sub":"String","email":"String","azp":"String","locale":["String"],"exp":"String","iat":"String","time":"String"}