| GET | /security/pos | Get the list of pos groups where user is authorized |
|---|
<?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;
}
}
class PosBrand extends Scope implements JsonSerializable
{
/**
* @param string $scopeCode
* @param string $buCode
* @param string $brand
* @param string $description
*/
public function __construct(
string $scopeCode='',
string $buCode='',
string $brand='',
string $description='',
/** @description Pos code */
// @ApiMember(Description="Pos code", IsRequired=true)
/** @var string */
public string $posCode='',
/** @description Pos name */
// @ApiMember(Description="Pos name", IsRequired=true)
/** @var string */
public string $name='',
/** @description Pos city */
// @ApiMember(Description="Pos city", IsRequired=true)
/** @var string */
public string $city='',
/** @description Pos address */
// @ApiMember(Description="Pos address", IsRequired=true)
/** @var string */
public string $address='',
/** @description Pos country */
// @ApiMember(Description="Pos country", IsRequired=true)
/** @var string */
public string $country=''
) {
parent::__construct($scopeCode,$buCode,$brand,$description);
}
/** @throws Exception */
public function fromMap($o): void {
parent::fromMap($o);
if (isset($o['posCode'])) $this->posCode = $o['posCode'];
if (isset($o['name'])) $this->name = $o['name'];
if (isset($o['city'])) $this->city = $o['city'];
if (isset($o['address'])) $this->address = $o['address'];
if (isset($o['country'])) $this->country = $o['country'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = parent::jsonSerialize();
if (isset($this->posCode)) $o['posCode'] = $this->posCode;
if (isset($this->name)) $o['name'] = $this->name;
if (isset($this->city)) $o['city'] = $this->city;
if (isset($this->address)) $o['address'] = $this->address;
if (isset($this->country)) $o['country'] = $this->country;
return empty($o) ? new class(){} : $o;
}
}
class GetPosBrandResponse implements JsonSerializable
{
public function __construct(
/** @description Index of the result set returnedr */
// @ApiMember(Description="Index of the result set returnedr", IsRequired=true)
/** @var int */
public int $page=0,
/** @description Size of the result set returned */
// @ApiMember(Description="Size of the result set returned", IsRequired=true)
/** @var int */
public int $items=0,
/** @description Total amount of pages / result sets */
// @ApiMember(Description="Total amount of pages / result sets", IsRequired=true)
/** @var int */
public int $totalPages=0,
/** @description Total amount of results */
// @ApiMember(Description="Total amount of results", IsRequired=true)
/** @var int */
public int $totalResults=0,
/** @description List of Users */
// @ApiMember(Description="List of Users", IsRequired=true)
/** @var array<PosBrand>|null */
public ?array $elements=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['page'])) $this->page = $o['page'];
if (isset($o['items'])) $this->items = $o['items'];
if (isset($o['totalPages'])) $this->totalPages = $o['totalPages'];
if (isset($o['totalResults'])) $this->totalResults = $o['totalResults'];
if (isset($o['elements'])) $this->elements = JsonConverters::fromArray('PosBrand', $o['elements']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->page)) $o['page'] = $this->page;
if (isset($this->items)) $o['items'] = $this->items;
if (isset($this->totalPages)) $o['totalPages'] = $this->totalPages;
if (isset($this->totalResults)) $o['totalResults'] = $this->totalResults;
if (isset($this->elements)) $o['elements'] = JsonConverters::toArray('PosBrand', $this->elements);
return empty($o) ? new class(){} : $o;
}
}
class GetPosBrand implements IPagedRequest, JsonSerializable
{
public function __construct(
/** @description Brand Trigram */
// @ApiMember(Description="Brand Trigram", IsRequired=true)
/** @var string */
public string $brand='',
/** @description Mnemonic Code to Check */
// @ApiMember(Description="Mnemonic Code to Check")
/** @var string|null */
public ?string $mnemonicCode=null,
/** @description Business Unit Code */
// @ApiMember(Description="Business Unit Code")
/** @var string|null */
public ?string $buCode=null,
/** @description Index of the result set returned */
// @ApiMember(Description="Index of the result set returned", IsRequired=true)
/** @var int */
public int $page=0,
/** @description Size of the result set returned */
// @ApiMember(Description="Size of the result set returned", IsRequired=true)
/** @var int */
public int $items=0,
/** @description Omit precise record count - save on performance */
// @ApiMember(Description="Omit precise record count - save on performance")
/** @var bool|null */
public ?bool $noCount=null,
/** @description Sorting expression */
// @ApiMember(Description="Sorting expression")
/** @var string|null */
public ?string $sortBy=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['brand'])) $this->brand = $o['brand'];
if (isset($o['mnemonicCode'])) $this->mnemonicCode = $o['mnemonicCode'];
if (isset($o['buCode'])) $this->buCode = $o['buCode'];
if (isset($o['page'])) $this->page = $o['page'];
if (isset($o['items'])) $this->items = $o['items'];
if (isset($o['noCount'])) $this->noCount = $o['noCount'];
if (isset($o['sortBy'])) $this->sortBy = $o['sortBy'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->brand)) $o['brand'] = $this->brand;
if (isset($this->mnemonicCode)) $o['mnemonicCode'] = $this->mnemonicCode;
if (isset($this->buCode)) $o['buCode'] = $this->buCode;
if (isset($this->page)) $o['page'] = $this->page;
if (isset($this->items)) $o['items'] = $this->items;
if (isset($this->noCount)) $o['noCount'] = $this->noCount;
if (isset($this->sortBy)) $o['sortBy'] = $this->sortBy;
return empty($o) ? new class(){} : $o;
}
}
To override the Content-type in your clients, use the HTTP Accept Header, append the .xml suffix or ?format=xml
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
GET /security/pos HTTP/1.1 Host: dev-api-booster.richemont.com Accept: application/xml
HTTP/1.1 200 OK Content-Type: application/xml Content-Length: length <GetPosBrandResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Richemont.Booster2.PublicApi.Security.ServiceModel"> <elements i:nil="true" /> <items>0</items> <page>0</page> <totalPages>0</totalPages> <totalResults>0</totalResults> </GetPosBrandResponse>