| GET | /api/riskstore/eventsource-perspective | Get event source and their perspectives, used by the Excel Add-On |
|---|
<?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 EventSourcePerspective implements JsonSerializable
{
public function __construct(
/** @var int */
public int $eventSourceId=0,
/** @var string|null */
public ?string $eventSourceSystem=null,
/** @var string|null */
public ?string $eventSourceVersion=null,
/** @var int */
public int $perspectiveId=0,
/** @var string|null */
public ?string $perspectiveName=null,
/** @var bool|null */
public ?bool $isActive=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['eventSourceId'])) $this->eventSourceId = $o['eventSourceId'];
if (isset($o['eventSourceSystem'])) $this->eventSourceSystem = $o['eventSourceSystem'];
if (isset($o['eventSourceVersion'])) $this->eventSourceVersion = $o['eventSourceVersion'];
if (isset($o['perspectiveId'])) $this->perspectiveId = $o['perspectiveId'];
if (isset($o['perspectiveName'])) $this->perspectiveName = $o['perspectiveName'];
if (isset($o['isActive'])) $this->isActive = $o['isActive'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->eventSourceId)) $o['eventSourceId'] = $this->eventSourceId;
if (isset($this->eventSourceSystem)) $o['eventSourceSystem'] = $this->eventSourceSystem;
if (isset($this->eventSourceVersion)) $o['eventSourceVersion'] = $this->eventSourceVersion;
if (isset($this->perspectiveId)) $o['perspectiveId'] = $this->perspectiveId;
if (isset($this->perspectiveName)) $o['perspectiveName'] = $this->perspectiveName;
if (isset($this->isActive)) $o['isActive'] = $this->isActive;
return empty($o) ? new class(){} : $o;
}
}
class GetEventSourcePerspectiveResponse implements JsonSerializable
{
public function __construct(
/** @var array<EventSourcePerspective>|null */
public ?array $eventSourcePerspectives=null,
/** @var ResponseStatus|null */
public ?ResponseStatus $responseStatus=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['eventSourcePerspectives'])) $this->eventSourcePerspectives = JsonConverters::fromArray('EventSourcePerspective', $o['eventSourcePerspectives']);
if (isset($o['responseStatus'])) $this->responseStatus = JsonConverters::from('ResponseStatus', $o['responseStatus']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->eventSourcePerspectives)) $o['eventSourcePerspectives'] = JsonConverters::toArray('EventSourcePerspective', $this->eventSourcePerspectives);
if (isset($this->responseStatus)) $o['responseStatus'] = JsonConverters::to('ResponseStatus', $this->responseStatus);
return empty($o) ? new class(){} : $o;
}
}
class GetEventSourcePerspectiveRequest implements IGet, JsonSerializable
{
public function __construct(
/** @description Flag to indicate if to return only active perspectives (false) or all (true) */
// @ApiMember(DataType="boolean", Description="Flag to indicate if to return only active perspectives (false) or all (true)", IsRequired=true)
/** @var bool|null */
public ?bool $includeInactive=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['includeInactive'])) $this->includeInactive = $o['includeInactive'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->includeInactive)) $o['includeInactive'] = $this->includeInactive;
return empty($o) ? new class(){} : $o;
}
}
PHP GetEventSourcePerspectiveRequest DTOs
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.
GET /api/riskstore/eventsource-perspective HTTP/1.1 Host: riskstoreng-dev.nephila.com Accept: text/jsv
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length
{
eventSourcePerspectives:
[
{
eventSourceId: 0,
eventSourceSystem: String,
eventSourceVersion: String,
perspectiveId: 0,
perspectiveName: String,
isActive: False
}
],
responseStatus:
{
errorCode: String,
message: String,
stackTrace: String,
errors:
[
{
errorCode: String,
fieldName: String,
message: String,
meta:
{
String: String
}
}
],
meta:
{
String: String
}
}
}