| GET | /warranty/v1/site/{siteId}/brand/{brandTrigram}/GetSaleReps |
|---|
<?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 BaseResponse implements IRespose, JsonSerializable
{
public function __construct(
/** @var string|null */
public ?string $_xmlns=null,
/** @var string|null */
public ?string $_type=null,
/** @var string|null */
public ?string $_source=null,
/** @var string|null */
public ?string $_tstamp=null,
/** @var string|null */
public ?string $_user=null,
/** @var string|null */
public ?string $_env=null,
/** @var string|null */
public ?string $_uri=null,
/** @var string|null */
public ?string $_query=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['_xmlns'])) $this->_xmlns = $o['_xmlns'];
if (isset($o['_type'])) $this->_type = $o['_type'];
if (isset($o['_source'])) $this->_source = $o['_source'];
if (isset($o['_tstamp'])) $this->_tstamp = $o['_tstamp'];
if (isset($o['_user'])) $this->_user = $o['_user'];
if (isset($o['_env'])) $this->_env = $o['_env'];
if (isset($o['_uri'])) $this->_uri = $o['_uri'];
if (isset($o['_query'])) $this->_query = $o['_query'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->_xmlns)) $o['_xmlns'] = $this->_xmlns;
if (isset($this->_type)) $o['_type'] = $this->_type;
if (isset($this->_source)) $o['_source'] = $this->_source;
if (isset($this->_tstamp)) $o['_tstamp'] = $this->_tstamp;
if (isset($this->_user)) $o['_user'] = $this->_user;
if (isset($this->_env)) $o['_env'] = $this->_env;
if (isset($this->_uri)) $o['_uri'] = $this->_uri;
if (isset($this->_query)) $o['_query'] = $this->_query;
return empty($o) ? new class(){} : $o;
}
}
class User implements ILookupString, JsonSerializable
{
public function __construct(
/** @var string|null */
public ?string $object=null,
/** @var string|null */
public ?string $id=null,
/** @var string|null */
public ?string $brand=null,
/** @var string|null */
public ?string $displayName=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['object'])) $this->object = $o['object'];
if (isset($o['id'])) $this->id = $o['id'];
if (isset($o['brand'])) $this->brand = $o['brand'];
if (isset($o['displayName'])) $this->displayName = $o['displayName'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->object)) $o['object'] = $this->object;
if (isset($this->id)) $o['id'] = $this->id;
if (isset($this->brand)) $o['brand'] = $this->brand;
if (isset($this->displayName)) $o['displayName'] = $this->displayName;
return empty($o) ? new class(){} : $o;
}
}
class GetSaleRepsResponse extends BaseResponse implements JsonSerializable
{
/**
* @param string|null $_xmlns
* @param string|null $_type
* @param string|null $_source
* @param string|null $_tstamp
* @param string|null $_user
* @param string|null $_env
* @param string|null $_uri
* @param string|null $_query
*/
public function __construct(
?string $_xmlns=null,
?string $_type=null,
?string $_source=null,
?string $_tstamp=null,
?string $_user=null,
?string $_env=null,
?string $_uri=null,
?string $_query=null,
/** @var ResponseStatus|null */
public ?ResponseStatus $ResponseStatus=null,
/** @var array<User>|null */
public ?array $staff=null
) {
parent::__construct($_xmlns,$_type,$_source,$_tstamp,$_user,$_env,$_uri,$_query);
}
/** @throws Exception */
public function fromMap($o): void {
parent::fromMap($o);
if (isset($o['ResponseStatus'])) $this->ResponseStatus = JsonConverters::from('ResponseStatus', $o['ResponseStatus']);
if (isset($o['staff'])) $this->staff = JsonConverters::fromArray('User', $o['staff']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = parent::jsonSerialize();
if (isset($this->ResponseStatus)) $o['ResponseStatus'] = JsonConverters::to('ResponseStatus', $this->ResponseStatus);
if (isset($this->staff)) $o['staff'] = JsonConverters::toArray('User', $this->staff);
return empty($o) ? new class(){} : $o;
}
}
/**
* @template BaseRequest of GetSaleRepsResponse
*/
class GetSaleRepsRequest 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 int */
public int $siteId=0,
/** @var string|null */
public ?string $brandTrigram=null,
/** @var string|null */
public ?string $customerId=null
) {
parent::__construct($sid,$app,$_os,$_appVersion,$_searchMethod);
}
/** @throws Exception */
public function fromMap($o): void {
parent::fromMap($o);
if (isset($o['siteId'])) $this->siteId = $o['siteId'];
if (isset($o['brandTrigram'])) $this->brandTrigram = $o['brandTrigram'];
if (isset($o['customerId'])) $this->customerId = $o['customerId'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = parent::jsonSerialize();
if (isset($this->siteId)) $o['siteId'] = $this->siteId;
if (isset($this->brandTrigram)) $o['brandTrigram'] = $this->brandTrigram;
if (isset($this->customerId)) $o['customerId'] = $this->customerId;
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 /warranty/v1/site/{siteId}/brand/{brandTrigram}/GetSaleReps HTTP/1.1
Host: qp-microservices-booster.richemont.com
Accept: application/xml
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length
<GetSaleRepsResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Booster.Microservices.ServiceModel.Pos">
<_env xmlns="http://schemas.datacontract.org/2004/07/Booster.Microservices.ServiceModel.Common">String</_env>
<_query xmlns="http://schemas.datacontract.org/2004/07/Booster.Microservices.ServiceModel.Common">String</_query>
<_source xmlns="http://schemas.datacontract.org/2004/07/Booster.Microservices.ServiceModel.Common">String</_source>
<_tstamp xmlns="http://schemas.datacontract.org/2004/07/Booster.Microservices.ServiceModel.Common">String</_tstamp>
<_type xmlns="http://schemas.datacontract.org/2004/07/Booster.Microservices.ServiceModel.Common">String</_type>
<_uri xmlns="http://schemas.datacontract.org/2004/07/Booster.Microservices.ServiceModel.Common">String</_uri>
<_user xmlns="http://schemas.datacontract.org/2004/07/Booster.Microservices.ServiceModel.Common">String</_user>
<_xmlns xmlns="http://schemas.datacontract.org/2004/07/Booster.Microservices.ServiceModel.Common">String</_xmlns>
<ResponseStatus xmlns:d2p1="http://schemas.servicestack.net/types">
<d2p1:ErrorCode>String</d2p1:ErrorCode>
<d2p1:Message>String</d2p1:Message>
<d2p1:StackTrace>String</d2p1:StackTrace>
<d2p1:Errors>
<d2p1:ResponseError>
<d2p1:ErrorCode>String</d2p1:ErrorCode>
<d2p1:FieldName>String</d2p1:FieldName>
<d2p1:Message>String</d2p1:Message>
<d2p1:Meta xmlns:d5p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d5p1:KeyValueOfstringstring>
<d5p1:Key>String</d5p1:Key>
<d5p1:Value>String</d5p1:Value>
</d5p1:KeyValueOfstringstring>
</d2p1:Meta>
</d2p1:ResponseError>
</d2p1:Errors>
<d2p1:Meta xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d3p1:KeyValueOfstringstring>
<d3p1:Key>String</d3p1:Key>
<d3p1:Value>String</d3p1:Value>
</d3p1:KeyValueOfstringstring>
</d2p1:Meta>
</ResponseStatus>
<staff>
<User>
<brand>String</brand>
<displayName>String</displayName>
<id>String</id>
<object>String</object>
</User>
</staff>
</GetSaleRepsResponse>