| GET | /warranty/v1/promotertypes/{promoterTypeId*} |
|---|
<?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};
/**
* @template TResponse
*/
class BaseRequest implements IRequest, JsonSerializable
{
public array $genericArgs = [];
public static function create(array $genericArgs=[]): BaseRequest {
$to = new BaseRequest();
$to->genericArgs = $genericArgs;
return $to;
}
public function __construct(
/** @var string|null */
public mixed $sid=null,
/** @var string|null */
public mixed $app=null,
/** @var string|null */
public mixed $_os=null,
/** @var string|null */
public mixed $_appVersion=null,
/** @var string|null */
public mixed $_searchMethod=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['sid'])) $this->sid = $o['sid'];
if (isset($o['app'])) $this->app = $o['app'];
if (isset($o['_os'])) $this->_os = $o['_os'];
if (isset($o['_appVersion'])) $this->_appVersion = $o['_appVersion'];
if (isset($o['_searchMethod'])) $this->_searchMethod = $o['_searchMethod'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->sid)) $o['sid'] = $this->sid;
if (isset($this->app)) $o['app'] = $this->app;
if (isset($this->_os)) $o['_os'] = $this->_os;
if (isset($this->_appVersion)) $o['_appVersion'] = $this->_appVersion;
if (isset($this->_searchMethod)) $o['_searchMethod'] = $this->_searchMethod;
return empty($o) ? new class(){} : $o;
}
}
class PromoterType implements JsonSerializable
{
public function __construct(
/** @var string|null */
public ?string $promoterTypeId=null,
/** @var string|null */
public ?string $description=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['promoterTypeId'])) $this->promoterTypeId = $o['promoterTypeId'];
if (isset($o['description'])) $this->description = $o['description'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->promoterTypeId)) $o['promoterTypeId'] = $this->promoterTypeId;
if (isset($this->description)) $o['description'] = $this->description;
return empty($o) ? new class(){} : $o;
}
}
class GetPromoterTypesResponse implements JsonSerializable
{
public function __construct(
/** @var array<PromoterType>|null */
public ?array $promoterTypes=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['promoterTypes'])) $this->promoterTypes = JsonConverters::fromArray('PromoterType', $o['promoterTypes']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->promoterTypes)) $o['promoterTypes'] = JsonConverters::toArray('PromoterType', $this->promoterTypes);
return empty($o) ? new class(){} : $o;
}
}
/**
* @template BaseRequest of GetPromoterTypesResponse
*/
class GetPromoterTypes extends BaseRequest implements JsonSerializable
{
/**
* @param string|null $sid
* @param string|null $app
* @param string|null $_os
* @param string|null $_appVersion
* @param string|null $_searchMethod
*/
public function __construct(
?string $sid=null,
?string $app=null,
?string $_os=null,
?string $_appVersion=null,
?string $_searchMethod=null,
/** @var string|null */
public ?string $promoterTypeId=null
) {
parent::__construct($sid,$app,$_os,$_appVersion,$_searchMethod);
}
/** @throws Exception */
public function fromMap($o): void {
parent::fromMap($o);
if (isset($o['promoterTypeId'])) $this->promoterTypeId = $o['promoterTypeId'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = parent::jsonSerialize();
if (isset($this->promoterTypeId)) $o['promoterTypeId'] = $this->promoterTypeId;
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 /warranty/v1/promotertypes/{promoterTypeId*} HTTP/1.1
Host: qp-microservices-booster.richemont.com
Accept: text/jsonl
HTTP/1.1 200 OK
Content-Type: text/jsonl
Content-Length: length
{"promoterTypes":[{"promoterTypeId":"String","description":"String"}]}