<?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};
// @ApiResponse(Description="Eros RMS and UI Data for synching to Framework")
class GetRmsUIDataResponse implements JsonSerializable
{
public function __construct(
/** @description Bin Row Version of the last update */
// @ApiMember(DataType="byte[]", Description="Bin Row Version of the last update", Name="BinRowVersion")
/** @var ByteArray|null */
public ?ByteArray $BinRowVersion=null,
/** @description XML string containing the Framework Data */
// @ApiMember(DataType="string", Description="XML string containing the Framework Data", Name="FrameworkData")
/** @var string|null */
public ?string $FrameworkData=null,
/** @var ResponseStatus|null */
public ?ResponseStatus $ResponseStatus=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['BinRowVersion'])) $this->BinRowVersion = JsonConverters::from('ByteArray', $o['BinRowVersion']);
if (isset($o['FrameworkData'])) $this->FrameworkData = $o['FrameworkData'];
if (isset($o['ResponseStatus'])) $this->ResponseStatus = JsonConverters::from('ResponseStatus', $o['ResponseStatus']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->BinRowVersion)) $o['BinRowVersion'] = JsonConverters::to('ByteArray', $this->BinRowVersion);
if (isset($this->FrameworkData)) $o['FrameworkData'] = $this->FrameworkData;
if (isset($this->ResponseStatus)) $o['ResponseStatus'] = JsonConverters::to('ResponseStatus', $this->ResponseStatus);
return empty($o) ? new class(){} : $o;
}
}
/** @description Retrieves Updated RMS and UI data to be saved to Framework */
// @Api(Description="Retrieves Updated RMS and UI data to be saved to Framework")
class GetRmsUIData implements ISubscription, JsonSerializable
{
public function __construct(
/** @description Bin Row Version of the last update */
// @ApiMember(DataType="byte[]", Description="Bin Row Version of the last update", Name="BinRowVersion")
/** @var ByteArray|null */
public ?ByteArray $BinRowVersion=null,
/** @description Suite Data Source Instance Id to determine which licensees data to retrieve. */
// @ApiMember(DataType="Guid", Description="Suite Data Source Instance Id to determine which licensees data to retrieve.", Name="SuiteDataSourceInstanceId")
/** @var string */
public string $SuiteDataSourceInstanceId='',
/** @var bool|null */
public ?bool $IgnoreValidation=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['BinRowVersion'])) $this->BinRowVersion = JsonConverters::from('ByteArray', $o['BinRowVersion']);
if (isset($o['SuiteDataSourceInstanceId'])) $this->SuiteDataSourceInstanceId = $o['SuiteDataSourceInstanceId'];
if (isset($o['IgnoreValidation'])) $this->IgnoreValidation = $o['IgnoreValidation'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->BinRowVersion)) $o['BinRowVersion'] = JsonConverters::to('ByteArray', $this->BinRowVersion);
if (isset($this->SuiteDataSourceInstanceId)) $o['SuiteDataSourceInstanceId'] = $this->SuiteDataSourceInstanceId;
if (isset($this->IgnoreValidation)) $o['IgnoreValidation'] = $this->IgnoreValidation;
return empty($o) ? new class(){} : $o;
}
}
To override the Content-type in your clients, use the HTTP Accept Header, append the .jsv suffix or ?format=jsv
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /jsv/reply/GetRmsUIData HTTP/1.1
Host: gatewayframeworkapi.pstpf.com.au
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length
{
BinRowVersion: AA==,
IgnoreValidation: True
}
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length
{
BinRowVersion: AA==,
FrameworkData: String,
ResponseStatus:
{
ErrorCode: String,
Message: String,
StackTrace: String,
Errors:
[
{
ErrorCode: String,
FieldName: String,
Message: String,
Meta:
{
String: String
}
}
],
Meta:
{
String: String
}
}
}