| GET | /api/riskstore/eventset/metrics | Get event set metrics, 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 DealEventSetMetric implements JsonSerializable
{
public function __construct(
/** @var string|null */
public ?string $sourceModelSystem=null,
/** @var string|null */
public ?string $modelId=null,
/** @var string|null */
public ?string $sourceEventSetId=null,
/** @var int */
public int $eventSetId=0,
/** @var int */
public int $perspectiveId=0,
/** @var float|null */
public ?float $elAgg=null,
/** @var float|null */
public ?float $elOcc=null,
/** @var float|null */
public ?float $pAtt=null,
/** @var float|null */
public ?float $pExh=null,
/** @var string|null */
public ?string $sourceDealId=null,
/** @var string|null */
public ?string $sourceDealSystem=null,
/** @var DateTime */
public DateTime $approvedDateTimeUtc=new DateTime()
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['sourceModelSystem'])) $this->sourceModelSystem = $o['sourceModelSystem'];
if (isset($o['modelId'])) $this->modelId = $o['modelId'];
if (isset($o['sourceEventSetId'])) $this->sourceEventSetId = $o['sourceEventSetId'];
if (isset($o['eventSetId'])) $this->eventSetId = $o['eventSetId'];
if (isset($o['perspectiveId'])) $this->perspectiveId = $o['perspectiveId'];
if (isset($o['elAgg'])) $this->elAgg = $o['elAgg'];
if (isset($o['elOcc'])) $this->elOcc = $o['elOcc'];
if (isset($o['pAtt'])) $this->pAtt = $o['pAtt'];
if (isset($o['pExh'])) $this->pExh = $o['pExh'];
if (isset($o['sourceDealId'])) $this->sourceDealId = $o['sourceDealId'];
if (isset($o['sourceDealSystem'])) $this->sourceDealSystem = $o['sourceDealSystem'];
if (isset($o['approvedDateTimeUtc'])) $this->approvedDateTimeUtc = JsonConverters::from('DateTime', $o['approvedDateTimeUtc']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->sourceModelSystem)) $o['sourceModelSystem'] = $this->sourceModelSystem;
if (isset($this->modelId)) $o['modelId'] = $this->modelId;
if (isset($this->sourceEventSetId)) $o['sourceEventSetId'] = $this->sourceEventSetId;
if (isset($this->eventSetId)) $o['eventSetId'] = $this->eventSetId;
if (isset($this->perspectiveId)) $o['perspectiveId'] = $this->perspectiveId;
if (isset($this->elAgg)) $o['elAgg'] = $this->elAgg;
if (isset($this->elOcc)) $o['elOcc'] = $this->elOcc;
if (isset($this->pAtt)) $o['pAtt'] = $this->pAtt;
if (isset($this->pExh)) $o['pExh'] = $this->pExh;
if (isset($this->sourceDealId)) $o['sourceDealId'] = $this->sourceDealId;
if (isset($this->sourceDealSystem)) $o['sourceDealSystem'] = $this->sourceDealSystem;
if (isset($this->approvedDateTimeUtc)) $o['approvedDateTimeUtc'] = JsonConverters::to('DateTime', $this->approvedDateTimeUtc);
return empty($o) ? new class(){} : $o;
}
}
class GetEventSetMetricsResponse implements JsonSerializable
{
public function __construct(
/** @var array<DealEventSetMetric>|null */
public ?array $dealEventSetMetrics=null,
/** @var ResponseStatus|null */
public ?ResponseStatus $responseStatus=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['dealEventSetMetrics'])) $this->dealEventSetMetrics = JsonConverters::fromArray('DealEventSetMetric', $o['dealEventSetMetrics']);
if (isset($o['responseStatus'])) $this->responseStatus = JsonConverters::from('ResponseStatus', $o['responseStatus']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->dealEventSetMetrics)) $o['dealEventSetMetrics'] = JsonConverters::toArray('DealEventSetMetric', $this->dealEventSetMetrics);
if (isset($this->responseStatus)) $o['responseStatus'] = JsonConverters::to('ResponseStatus', $this->responseStatus);
return empty($o) ? new class(){} : $o;
}
}
class GetEventSetMetricsRequest implements IGet, JsonSerializable
{
public function __construct(
/** @description The analysis id to get the event set metrics for */
// @ApiMember(DataType="integer", Description="The analysis id to get the event set metrics for", Format="int64", IsRequired=true)
/** @var int */
public int $analysisId=0
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['analysisId'])) $this->analysisId = $o['analysisId'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->analysisId)) $o['analysisId'] = $this->analysisId;
return empty($o) ? new class(){} : $o;
}
}
PHP GetEventSetMetricsRequest DTOs
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 /api/riskstore/eventset/metrics HTTP/1.1 Host: riskstoreng-dev.nephila.com Accept: text/jsonl
HTTP/1.1 200 OK
Content-Type: text/jsonl
Content-Length: length
{"dealEventSetMetrics":[{"sourceModelSystem":"String","modelId":"String","sourceEventSetId":"String","eventSetId":0,"perspectiveId":0,"elAgg":0,"elOcc":0,"pAtt":0,"pExh":0,"sourceDealId":"String","sourceDealSystem":"String","approvedDateTimeUtc":"0001-01-01T00:00:00.0000000Z"}],"responseStatus":{"__type":"ServiceStack.ResponseStatus, ServiceStack.Interfaces","errorCode":"String","message":"String","stackTrace":"String","errors":[{"__type":"ServiceStack.ResponseError, ServiceStack.Interfaces","errorCode":"String","fieldName":"String","message":"String","meta":{"String":"String"}}],"meta":{"String":"String"}}}