| GET | /authScopes | Get all scopes of logged 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 Scope implements JsonSerializable
{
public function __construct(
/** @description Scope Code - combination of BU / Brand */
// @ApiMember(Description="Scope Code - combination of BU / Brand", IsRequired=true)
/** @var string */
public string $scopeCode='',
/** @description Business Unit Code */
// @ApiMember(Description="Business Unit Code", IsRequired=true)
/** @var string */
public string $buCode='',
/** @description Brand Trigram */
// @ApiMember(Description="Brand Trigram", IsRequired=true)
/** @var string */
public string $brand='',
/** @description Description of the combination */
// @ApiMember(Description="Description of the combination", IsRequired=true)
/** @var string */
public string $description=''
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['scopeCode'])) $this->scopeCode = $o['scopeCode'];
if (isset($o['buCode'])) $this->buCode = $o['buCode'];
if (isset($o['brand'])) $this->brand = $o['brand'];
if (isset($o['description'])) $this->description = $o['description'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->scopeCode)) $o['scopeCode'] = $this->scopeCode;
if (isset($this->buCode)) $o['buCode'] = $this->buCode;
if (isset($this->brand)) $o['brand'] = $this->brand;
if (isset($this->description)) $o['description'] = $this->description;
return empty($o) ? new class(){} : $o;
}
}
/**
* @template array of Scope
*/
class GetUserScopeResponse extends \ArrayObject implements JsonSerializable
{
public function __construct(Scope ...$items) {
parent::__construct($items, \ArrayObject::STD_PROP_LIST);
}
/** @throws \Exception */
public function append($value): void {
if ($value instanceof Scope)
parent::append($value);
else
throw new \Exception("Can only append a Scope to " . __CLASS__);
}
/** @throws Exception */
public function fromMap($o): void {
foreach ($o as $item) {
$el = new Scope();
$el->fromMap($item);
$this->append($el);
}
}
/** @throws Exception */
public function jsonSerialize(): array {
return parent::getArrayCopy();
}
}
class GetUserScope implements JsonSerializable
{
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
return empty($o) ? new class(){} : $o;
}
}
To override the Content-type in your clients, use the HTTP Accept Header, append the .other suffix or ?format=other
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
GET /authScopes HTTP/1.1 Host: dev-api-booster.richemont.com Accept: text/jsonl
HTTP/1.1 200 OK Content-Type: text/jsonl Content-Length: length []