| Requires any of the roles: | Riskstore.Write, Riskstore.Admin |
| POST | /api/riskstore/rollup/reprocess | Process an existing analysis that is not been run or failed to run | Process an existing analysis that is not been run or failed to run |
|---|
<?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};
enum ResultOutputLevel : string
{
case NotSet = 'NotSet';
case PortfolioMetrics = 'PortfolioMetrics';
case Curve = 'Curve';
case YLT = 'YLT';
case TailIntensity = 'TailIntensity';
case DealYlt = 'DealYlt';
case DealElt = 'DealElt';
case DealEltWithIndustryLoss = 'DealEltWithIndustryLoss';
case PortfolioElt = 'PortfolioElt';
case PortfolioEltWithIndustryLoss = 'PortfolioEltWithIndustryLoss';
case EventSetGeneration = 'EventSetGeneration';
case PortfolioRaps = 'PortfolioRaps';
case DealRaps = 'DealRaps';
case PortfolioSepyIndustryLoss = 'PortfolioSepyIndustryLoss';
case DealSepyIndustryLoss = 'DealSepyIndustryLoss';
}
enum ProcessingStatus : int
{
case New = 0;
case Processing = 1;
case Failed = 10;
case Successful = 20;
}
class AnalysisPortfolioEventSetConfiguration implements IObjectWithId, IHasAnalysisId, JsonSerializable
{
public function __construct(
// @DataMember(Order=1)
/** @var int */
public int $id=0,
// @DataMember(Order=2)
/** @var int */
public int $analysisId=0,
// @DataMember(Order=3)
/** @var int */
public int $analysisConfigurationId=0,
// @DataMember(Order=4)
/** @var string|null */
public ?string $portfolioName=null,
// @DataMember(Order=5)
/** @var string|null */
public ?string $modelId=null,
// @DataMember(Order=6)
/** @var string */
public string $rowIdentifier=''
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['id'])) $this->id = $o['id'];
if (isset($o['analysisId'])) $this->analysisId = $o['analysisId'];
if (isset($o['analysisConfigurationId'])) $this->analysisConfigurationId = $o['analysisConfigurationId'];
if (isset($o['portfolioName'])) $this->portfolioName = $o['portfolioName'];
if (isset($o['modelId'])) $this->modelId = $o['modelId'];
if (isset($o['rowIdentifier'])) $this->rowIdentifier = $o['rowIdentifier'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->id)) $o['id'] = $this->id;
if (isset($this->analysisId)) $o['analysisId'] = $this->analysisId;
if (isset($this->analysisConfigurationId)) $o['analysisConfigurationId'] = $this->analysisConfigurationId;
if (isset($this->portfolioName)) $o['portfolioName'] = $this->portfolioName;
if (isset($this->modelId)) $o['modelId'] = $this->modelId;
if (isset($this->rowIdentifier)) $o['rowIdentifier'] = $this->rowIdentifier;
return empty($o) ? new class(){} : $o;
}
}
// @DataContract
class AnalysisConfiguration implements IObjectWithId, IHasAnalysisId, JsonSerializable
{
public function __construct(
// @DataMember(Order=1)
/** @var int */
public int $id=0,
// @DataMember(Order=2)
/** @var int */
public int $analysisId=0,
// @DataMember(Order=3)
/** @var DateTime|null */
public ?DateTime $windowStartDate=null,
// @DataMember(Order=4)
/** @var DateTime|null */
public ?DateTime $windowEndDate=null,
// @DataMember(Order=5)
/** @var bool|null */
public ?bool $standardEnabled=null,
// @DataMember(Order=6)
/** @var bool|null */
public ?bool $runOffEnabled=null,
// @DataMember(Order=7)
/** @var bool|null */
public ?bool $aggregateEnabled=null,
// @DataMember(Order=8)
/** @var bool|null */
public ?bool $occurrenceEnabled=null,
// @DataMember(Order=9)
/** @var bool|null */
public ?bool $nettEnabled=null,
// @DataMember(Order=10)
/** @var bool|null */
public ?bool $grossEnabled=null,
// @DataMember(Order=11)
/** @var float|null */
public ?float $tailIntensityPercentageStart=null,
// @DataMember(Order=12)
/** @var float|null */
public ?float $tailIntensityPercentageEnd=null,
// @DataMember(Order=13)
/** @var int */
public int $metaRiskId=0,
// @DataMember(Order=14)
/** @var ResultOutputLevel|null */
public ?ResultOutputLevel $outputLevel=null,
// @DataMember(Order=15)
/** @var ProcessingStatus|null */
public ?ProcessingStatus $processingStatus=null,
// @DataMember(Order=16)
/** @var float|null */
public ?float $eventLossFloorStartRange=null,
// @DataMember(Order=17)
/** @var float|null */
public ?float $eventLossFloorEndRange=null,
// @DataMember(Order=18)
/** @var array<AnalysisPortfolioEventSetConfiguration>|null */
public ?array $analysisPortfolioEventSetConfigurations=null,
// @DataMember(Order=19)
/** @var string */
public string $rowIdentifier=''
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['id'])) $this->id = $o['id'];
if (isset($o['analysisId'])) $this->analysisId = $o['analysisId'];
if (isset($o['windowStartDate'])) $this->windowStartDate = JsonConverters::from('DateTime', $o['windowStartDate']);
if (isset($o['windowEndDate'])) $this->windowEndDate = JsonConverters::from('DateTime', $o['windowEndDate']);
if (isset($o['standardEnabled'])) $this->standardEnabled = $o['standardEnabled'];
if (isset($o['runOffEnabled'])) $this->runOffEnabled = $o['runOffEnabled'];
if (isset($o['aggregateEnabled'])) $this->aggregateEnabled = $o['aggregateEnabled'];
if (isset($o['occurrenceEnabled'])) $this->occurrenceEnabled = $o['occurrenceEnabled'];
if (isset($o['nettEnabled'])) $this->nettEnabled = $o['nettEnabled'];
if (isset($o['grossEnabled'])) $this->grossEnabled = $o['grossEnabled'];
if (isset($o['tailIntensityPercentageStart'])) $this->tailIntensityPercentageStart = $o['tailIntensityPercentageStart'];
if (isset($o['tailIntensityPercentageEnd'])) $this->tailIntensityPercentageEnd = $o['tailIntensityPercentageEnd'];
if (isset($o['metaRiskId'])) $this->metaRiskId = $o['metaRiskId'];
if (isset($o['outputLevel'])) $this->outputLevel = JsonConverters::from('ResultOutputLevel', $o['outputLevel']);
if (isset($o['processingStatus'])) $this->processingStatus = JsonConverters::from('ProcessingStatus', $o['processingStatus']);
if (isset($o['eventLossFloorStartRange'])) $this->eventLossFloorStartRange = $o['eventLossFloorStartRange'];
if (isset($o['eventLossFloorEndRange'])) $this->eventLossFloorEndRange = $o['eventLossFloorEndRange'];
if (isset($o['analysisPortfolioEventSetConfigurations'])) $this->analysisPortfolioEventSetConfigurations = JsonConverters::fromArray('AnalysisPortfolioEventSetConfiguration', $o['analysisPortfolioEventSetConfigurations']);
if (isset($o['rowIdentifier'])) $this->rowIdentifier = $o['rowIdentifier'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->id)) $o['id'] = $this->id;
if (isset($this->analysisId)) $o['analysisId'] = $this->analysisId;
if (isset($this->windowStartDate)) $o['windowStartDate'] = JsonConverters::to('DateTime', $this->windowStartDate);
if (isset($this->windowEndDate)) $o['windowEndDate'] = JsonConverters::to('DateTime', $this->windowEndDate);
if (isset($this->standardEnabled)) $o['standardEnabled'] = $this->standardEnabled;
if (isset($this->runOffEnabled)) $o['runOffEnabled'] = $this->runOffEnabled;
if (isset($this->aggregateEnabled)) $o['aggregateEnabled'] = $this->aggregateEnabled;
if (isset($this->occurrenceEnabled)) $o['occurrenceEnabled'] = $this->occurrenceEnabled;
if (isset($this->nettEnabled)) $o['nettEnabled'] = $this->nettEnabled;
if (isset($this->grossEnabled)) $o['grossEnabled'] = $this->grossEnabled;
if (isset($this->tailIntensityPercentageStart)) $o['tailIntensityPercentageStart'] = $this->tailIntensityPercentageStart;
if (isset($this->tailIntensityPercentageEnd)) $o['tailIntensityPercentageEnd'] = $this->tailIntensityPercentageEnd;
if (isset($this->metaRiskId)) $o['metaRiskId'] = $this->metaRiskId;
if (isset($this->outputLevel)) $o['outputLevel'] = JsonConverters::to('ResultOutputLevel', $this->outputLevel);
if (isset($this->processingStatus)) $o['processingStatus'] = JsonConverters::to('ProcessingStatus', $this->processingStatus);
if (isset($this->eventLossFloorStartRange)) $o['eventLossFloorStartRange'] = $this->eventLossFloorStartRange;
if (isset($this->eventLossFloorEndRange)) $o['eventLossFloorEndRange'] = $this->eventLossFloorEndRange;
if (isset($this->analysisPortfolioEventSetConfigurations)) $o['analysisPortfolioEventSetConfigurations'] = JsonConverters::toArray('AnalysisPortfolioEventSetConfiguration', $this->analysisPortfolioEventSetConfigurations);
if (isset($this->rowIdentifier)) $o['rowIdentifier'] = $this->rowIdentifier;
return empty($o) ? new class(){} : $o;
}
}
enum TransactionType : string
{
case NotSet = 'NotSet';
case S = 'S';
case B = 'B';
}
// @DataContract
class AnalysisPortfolioAllocation implements IObjectWithId, JsonSerializable
{
public function __construct(
// @DataMember(Order=1)
/** @var int */
public int $id=0,
// @DataMember(Order=2)
/** @var int */
public int $analysisDealId=0,
// @DataMember(Order=3)
// @Validate(Validator="NotEmpty", Message="PortfolioName is mandatory")
/** @var string */
public string $portfolioName='',
// @DataMember(Order=4)
/** @var float */
public float $allocationPercentage=0.0,
// @DataMember(Order=5)
/** @var string */
public string $rowIdentifier=''
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['id'])) $this->id = $o['id'];
if (isset($o['analysisDealId'])) $this->analysisDealId = $o['analysisDealId'];
if (isset($o['portfolioName'])) $this->portfolioName = $o['portfolioName'];
if (isset($o['allocationPercentage'])) $this->allocationPercentage = $o['allocationPercentage'];
if (isset($o['rowIdentifier'])) $this->rowIdentifier = $o['rowIdentifier'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->id)) $o['id'] = $this->id;
if (isset($this->analysisDealId)) $o['analysisDealId'] = $this->analysisDealId;
if (isset($this->portfolioName)) $o['portfolioName'] = $this->portfolioName;
if (isset($this->allocationPercentage)) $o['allocationPercentage'] = $this->allocationPercentage;
if (isset($this->rowIdentifier)) $o['rowIdentifier'] = $this->rowIdentifier;
return empty($o) ? new class(){} : $o;
}
}
// @DataContract
class AnalysisDeal implements IObjectWithId, IHasAnalysisId, JsonSerializable
{
public function __construct(
// @DataMember(Order=1)
/** @var int */
public int $id=0,
// @DataMember(Order=2)
/** @var int */
public int $analysisId=0,
// @DataMember(Order=3)
/** @var string|null */
public ?string $sourceDealId=null,
// @DataMember(Order=4)
/** @var string|null */
public ?string $dealRef=null,
// @DataMember(Order=5)
/** @var string|null */
public ?string $sourceDealSystem=null,
// @DataMember(Order=6)
/** @var int */
public int $eventSetId=0,
// @DataMember(Order=7)
/** @var float */
public float $rol=0.0,
// @DataMember(Order=8)
/** @var float */
public float $limit=0.0,
// @DataMember(Order=9)
/** @var DateTime */
public DateTime $inceptionDate=new DateTime(),
// @DataMember(Order=10)
/** @var DateTime */
public DateTime $expiryDate=new DateTime(),
// @DataMember(Order=11)
/** @var TransactionType|null */
public ?TransactionType $transactionType=null,
// @DataMember(Order=12)
/** @var array<AnalysisPortfolioAllocation>|null */
public ?array $allocations=null,
// @DataMember(Order=13)
/** @var int|null */
public ?int $perspectiveIdOverride=null,
// @DataMember(Order=14)
/** @var int|null */
public ?int $eventSetIdOverride=null,
// @DataMember(Order=15)
/** @var DateTime|null */
public ?DateTime $modelAsOfDateOverride=null,
// @DataMember(Order=16)
/** @var string|null */
public ?string $sourceModelSystemOverride=null,
// @DataMember(Order=17)
/** @var string|null */
public ?string $sourceModelIdOverride=null,
// @DataMember(Order=18)
/** @var string|null */
public ?string $sourceEventSetIdOverride=null,
// @DataMember(Order=19)
/** @var string|null */
public ?string $eventSourceSystemOverride=null,
// @DataMember(Order=20)
/** @var string */
public string $rowIdentifier=''
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['id'])) $this->id = $o['id'];
if (isset($o['analysisId'])) $this->analysisId = $o['analysisId'];
if (isset($o['sourceDealId'])) $this->sourceDealId = $o['sourceDealId'];
if (isset($o['dealRef'])) $this->dealRef = $o['dealRef'];
if (isset($o['sourceDealSystem'])) $this->sourceDealSystem = $o['sourceDealSystem'];
if (isset($o['eventSetId'])) $this->eventSetId = $o['eventSetId'];
if (isset($o['rol'])) $this->rol = $o['rol'];
if (isset($o['limit'])) $this->limit = $o['limit'];
if (isset($o['inceptionDate'])) $this->inceptionDate = JsonConverters::from('DateTime', $o['inceptionDate']);
if (isset($o['expiryDate'])) $this->expiryDate = JsonConverters::from('DateTime', $o['expiryDate']);
if (isset($o['transactionType'])) $this->transactionType = JsonConverters::from('TransactionType', $o['transactionType']);
if (isset($o['allocations'])) $this->allocations = JsonConverters::fromArray('AnalysisPortfolioAllocation', $o['allocations']);
if (isset($o['perspectiveIdOverride'])) $this->perspectiveIdOverride = $o['perspectiveIdOverride'];
if (isset($o['eventSetIdOverride'])) $this->eventSetIdOverride = $o['eventSetIdOverride'];
if (isset($o['modelAsOfDateOverride'])) $this->modelAsOfDateOverride = JsonConverters::from('DateTime', $o['modelAsOfDateOverride']);
if (isset($o['sourceModelSystemOverride'])) $this->sourceModelSystemOverride = $o['sourceModelSystemOverride'];
if (isset($o['sourceModelIdOverride'])) $this->sourceModelIdOverride = $o['sourceModelIdOverride'];
if (isset($o['sourceEventSetIdOverride'])) $this->sourceEventSetIdOverride = $o['sourceEventSetIdOverride'];
if (isset($o['eventSourceSystemOverride'])) $this->eventSourceSystemOverride = $o['eventSourceSystemOverride'];
if (isset($o['rowIdentifier'])) $this->rowIdentifier = $o['rowIdentifier'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->id)) $o['id'] = $this->id;
if (isset($this->analysisId)) $o['analysisId'] = $this->analysisId;
if (isset($this->sourceDealId)) $o['sourceDealId'] = $this->sourceDealId;
if (isset($this->dealRef)) $o['dealRef'] = $this->dealRef;
if (isset($this->sourceDealSystem)) $o['sourceDealSystem'] = $this->sourceDealSystem;
if (isset($this->eventSetId)) $o['eventSetId'] = $this->eventSetId;
if (isset($this->rol)) $o['rol'] = $this->rol;
if (isset($this->limit)) $o['limit'] = $this->limit;
if (isset($this->inceptionDate)) $o['inceptionDate'] = JsonConverters::to('DateTime', $this->inceptionDate);
if (isset($this->expiryDate)) $o['expiryDate'] = JsonConverters::to('DateTime', $this->expiryDate);
if (isset($this->transactionType)) $o['transactionType'] = JsonConverters::to('TransactionType', $this->transactionType);
if (isset($this->allocations)) $o['allocations'] = JsonConverters::toArray('AnalysisPortfolioAllocation', $this->allocations);
if (isset($this->perspectiveIdOverride)) $o['perspectiveIdOverride'] = $this->perspectiveIdOverride;
if (isset($this->eventSetIdOverride)) $o['eventSetIdOverride'] = $this->eventSetIdOverride;
if (isset($this->modelAsOfDateOverride)) $o['modelAsOfDateOverride'] = JsonConverters::to('DateTime', $this->modelAsOfDateOverride);
if (isset($this->sourceModelSystemOverride)) $o['sourceModelSystemOverride'] = $this->sourceModelSystemOverride;
if (isset($this->sourceModelIdOverride)) $o['sourceModelIdOverride'] = $this->sourceModelIdOverride;
if (isset($this->sourceEventSetIdOverride)) $o['sourceEventSetIdOverride'] = $this->sourceEventSetIdOverride;
if (isset($this->eventSourceSystemOverride)) $o['eventSourceSystemOverride'] = $this->eventSourceSystemOverride;
if (isset($this->rowIdentifier)) $o['rowIdentifier'] = $this->rowIdentifier;
return empty($o) ? new class(){} : $o;
}
}
// @DataContract
class AnalysisEventIdFilter implements IObjectWithId, IHasAnalysisId, JsonSerializable
{
public function __construct(
// @DataMember(Order=1)
/** @var int */
public int $id=0,
// @DataMember(Order=2)
/** @var int */
public int $analysisId=0,
// @DataMember(Order=3)
/** @var int */
public int $eventSourceId=0,
// @DataMember(Order=4)
/** @var int */
public int $eventId=0,
// @DataMember(Order=5)
/** @var string */
public string $rowIdentifier=''
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['id'])) $this->id = $o['id'];
if (isset($o['analysisId'])) $this->analysisId = $o['analysisId'];
if (isset($o['eventSourceId'])) $this->eventSourceId = $o['eventSourceId'];
if (isset($o['eventId'])) $this->eventId = $o['eventId'];
if (isset($o['rowIdentifier'])) $this->rowIdentifier = $o['rowIdentifier'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->id)) $o['id'] = $this->id;
if (isset($this->analysisId)) $o['analysisId'] = $this->analysisId;
if (isset($this->eventSourceId)) $o['eventSourceId'] = $this->eventSourceId;
if (isset($this->eventId)) $o['eventId'] = $this->eventId;
if (isset($this->rowIdentifier)) $o['rowIdentifier'] = $this->rowIdentifier;
return empty($o) ? new class(){} : $o;
}
}
enum MessageType : string
{
case NotSet = 'NotSet';
case Persistence = 'Persistence';
case Archival = 'Archival';
}
// @DataContract
class MessageTracking implements JsonSerializable
{
public function __construct(
// @DataMember(Order=1)
/** @var string */
public string $id='',
// @DataMember(Order=2)
/** @var int|null */
public ?int $analysisId=null,
// @DataMember(Order=3)
/** @var ProcessingStatus|null */
public ?ProcessingStatus $processingStatus=null,
// @DataMember(Order=4)
/** @var MessageType|null */
public ?MessageType $messageType=null,
// @DataMember(Order=5)
/** @var DateTime */
public DateTime $createdDateUtc=new DateTime(),
// @DataMember(Order=6)
/** @var DateTime */
public DateTime $updatedDateUtc=new DateTime()
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['id'])) $this->id = $o['id'];
if (isset($o['analysisId'])) $this->analysisId = $o['analysisId'];
if (isset($o['processingStatus'])) $this->processingStatus = JsonConverters::from('ProcessingStatus', $o['processingStatus']);
if (isset($o['messageType'])) $this->messageType = JsonConverters::from('MessageType', $o['messageType']);
if (isset($o['createdDateUtc'])) $this->createdDateUtc = JsonConverters::from('DateTime', $o['createdDateUtc']);
if (isset($o['updatedDateUtc'])) $this->updatedDateUtc = JsonConverters::from('DateTime', $o['updatedDateUtc']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->id)) $o['id'] = $this->id;
if (isset($this->analysisId)) $o['analysisId'] = $this->analysisId;
if (isset($this->processingStatus)) $o['processingStatus'] = JsonConverters::to('ProcessingStatus', $this->processingStatus);
if (isset($this->messageType)) $o['messageType'] = JsonConverters::to('MessageType', $this->messageType);
if (isset($this->createdDateUtc)) $o['createdDateUtc'] = JsonConverters::to('DateTime', $this->createdDateUtc);
if (isset($this->updatedDateUtc)) $o['updatedDateUtc'] = JsonConverters::to('DateTime', $this->updatedDateUtc);
return empty($o) ? new class(){} : $o;
}
}
// @DataContract
class Analysis implements IObjectWithId, JsonSerializable
{
public function __construct(
// @DataMember(Order=1)
/** @var int */
public int $id=0,
// @DataMember(Order=2)
/** @var string|null */
public ?string $name=null,
// @DataMember(Order=3)
/** @var DateTime|null */
public ?DateTime $modelAsOfDate=null,
// @DataMember(Order=4)
/** @var int */
public int $perspectiveId=0,
// @DataMember(Order=5)
/** @var array<AnalysisConfiguration>|null */
public ?array $configurations=null,
// @DataMember(Order=6)
/** @var array<AnalysisDeal>|null */
public ?array $deals=null,
// @DataMember(Order=7)
/** @var array<AnalysisEventIdFilter>|null */
public ?array $eventIdFilters=null,
// @DataMember(Order=8)
/** @var string|null */
public ?string $createdBy=null,
// @DataMember(Order=9)
/** @var DateTime */
public DateTime $createdDateUtc=new DateTime(),
// @DataMember(Order=10)
/** @var DateTime|null */
public ?DateTime $completedDateUtc=null,
// @DataMember(Order=11)
/** @var int|null */
public ?int $legacyAnalysisId=null,
// @DataMember(Order=12)
/** @var array<MessageTracking>|null */
public ?array $resultPersistenceTracking=null,
// @DataMember(Order=13)
/** @var ProcessingStatus|null */
public ?ProcessingStatus $processingStatus=null,
// @DataMember(Order=14)
/** @var bool|null */
public ?bool $saveResults=null,
// @DataMember(Order=15)
/** @var string|null */
public ?string $eventSourceSystem=null,
// @DataMember(Order=16)
/** @var DateTime */
public DateTime $updatedDateUtc=new DateTime(),
// @DataMember(Order=17)
/** @var bool|null */
public ?bool $isExpired=null,
// @DataMember(Order=18)
/** @var string */
public string $rowIdentifier='',
// @DataMember(Order=19)
/** @var string|null */
public ?string $errorMessage=null,
/** @description Take the minimum simulation count when we have different simulations between event sets */
// @DataMember(Order=20)
// @ApiMember(DataType="boolean", Description="Take the minimum simulation count when we have different simulations between event sets")
/** @var bool|null */
public ?bool $ignoreSimulationCountMismatch=null,
// @DataMember(Order=21)
// @Ignore()
/** @var ProcessingStatus|null */
public ?ProcessingStatus $finalStatus=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['id'])) $this->id = $o['id'];
if (isset($o['name'])) $this->name = $o['name'];
if (isset($o['modelAsOfDate'])) $this->modelAsOfDate = JsonConverters::from('DateTime', $o['modelAsOfDate']);
if (isset($o['perspectiveId'])) $this->perspectiveId = $o['perspectiveId'];
if (isset($o['configurations'])) $this->configurations = JsonConverters::fromArray('AnalysisConfiguration', $o['configurations']);
if (isset($o['deals'])) $this->deals = JsonConverters::fromArray('AnalysisDeal', $o['deals']);
if (isset($o['eventIdFilters'])) $this->eventIdFilters = JsonConverters::fromArray('AnalysisEventIdFilter', $o['eventIdFilters']);
if (isset($o['createdBy'])) $this->createdBy = $o['createdBy'];
if (isset($o['createdDateUtc'])) $this->createdDateUtc = JsonConverters::from('DateTime', $o['createdDateUtc']);
if (isset($o['completedDateUtc'])) $this->completedDateUtc = JsonConverters::from('DateTime', $o['completedDateUtc']);
if (isset($o['legacyAnalysisId'])) $this->legacyAnalysisId = $o['legacyAnalysisId'];
if (isset($o['resultPersistenceTracking'])) $this->resultPersistenceTracking = JsonConverters::fromArray('MessageTracking', $o['resultPersistenceTracking']);
if (isset($o['processingStatus'])) $this->processingStatus = JsonConverters::from('ProcessingStatus', $o['processingStatus']);
if (isset($o['saveResults'])) $this->saveResults = $o['saveResults'];
if (isset($o['eventSourceSystem'])) $this->eventSourceSystem = $o['eventSourceSystem'];
if (isset($o['updatedDateUtc'])) $this->updatedDateUtc = JsonConverters::from('DateTime', $o['updatedDateUtc']);
if (isset($o['isExpired'])) $this->isExpired = $o['isExpired'];
if (isset($o['rowIdentifier'])) $this->rowIdentifier = $o['rowIdentifier'];
if (isset($o['errorMessage'])) $this->errorMessage = $o['errorMessage'];
if (isset($o['ignoreSimulationCountMismatch'])) $this->ignoreSimulationCountMismatch = $o['ignoreSimulationCountMismatch'];
if (isset($o['finalStatus'])) $this->finalStatus = JsonConverters::from('ProcessingStatus', $o['finalStatus']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->id)) $o['id'] = $this->id;
if (isset($this->name)) $o['name'] = $this->name;
if (isset($this->modelAsOfDate)) $o['modelAsOfDate'] = JsonConverters::to('DateTime', $this->modelAsOfDate);
if (isset($this->perspectiveId)) $o['perspectiveId'] = $this->perspectiveId;
if (isset($this->configurations)) $o['configurations'] = JsonConverters::toArray('AnalysisConfiguration', $this->configurations);
if (isset($this->deals)) $o['deals'] = JsonConverters::toArray('AnalysisDeal', $this->deals);
if (isset($this->eventIdFilters)) $o['eventIdFilters'] = JsonConverters::toArray('AnalysisEventIdFilter', $this->eventIdFilters);
if (isset($this->createdBy)) $o['createdBy'] = $this->createdBy;
if (isset($this->createdDateUtc)) $o['createdDateUtc'] = JsonConverters::to('DateTime', $this->createdDateUtc);
if (isset($this->completedDateUtc)) $o['completedDateUtc'] = JsonConverters::to('DateTime', $this->completedDateUtc);
if (isset($this->legacyAnalysisId)) $o['legacyAnalysisId'] = $this->legacyAnalysisId;
if (isset($this->resultPersistenceTracking)) $o['resultPersistenceTracking'] = JsonConverters::toArray('MessageTracking', $this->resultPersistenceTracking);
if (isset($this->processingStatus)) $o['processingStatus'] = JsonConverters::to('ProcessingStatus', $this->processingStatus);
if (isset($this->saveResults)) $o['saveResults'] = $this->saveResults;
if (isset($this->eventSourceSystem)) $o['eventSourceSystem'] = $this->eventSourceSystem;
if (isset($this->updatedDateUtc)) $o['updatedDateUtc'] = JsonConverters::to('DateTime', $this->updatedDateUtc);
if (isset($this->isExpired)) $o['isExpired'] = $this->isExpired;
if (isset($this->rowIdentifier)) $o['rowIdentifier'] = $this->rowIdentifier;
if (isset($this->errorMessage)) $o['errorMessage'] = $this->errorMessage;
if (isset($this->ignoreSimulationCountMismatch)) $o['ignoreSimulationCountMismatch'] = $this->ignoreSimulationCountMismatch;
if (isset($this->finalStatus)) $o['finalStatus'] = JsonConverters::to('ProcessingStatus', $this->finalStatus);
return empty($o) ? new class(){} : $o;
}
}
enum AnalysisType : string
{
case NotSet = 'NotSet';
case Standard = 'Standard';
case RunOff = 'RunOff';
}
enum SimulationLossPerspective : string
{
case NotSet = 'NotSet';
case Agg = 'Agg';
case Occ = 'Occ';
}
enum ReinsurancePremiumLossType : string
{
case NotSet = 'NotSet';
case Net = 'Net';
case Gross = 'Gross';
}
class AnalysisPortfolioMetric implements IHasAnalysisResultId, JsonSerializable
{
public function __construct(
/** @var AnalysisType|null */
public ?AnalysisType $analysisType=null,
/** @var SimulationLossPerspective|null */
public ?SimulationLossPerspective $simulationLossPerspective=null,
/** @var ReinsurancePremiumLossType|null */
public ?ReinsurancePremiumLossType $reinsurancePremiumLossType=null,
/** @var string|null */
public ?string $metricDescription=null,
/** @var string|null */
public ?string $portfolioName=null,
/** @var float */
public float $metric=0.0,
/** @var int */
public int $metaRiskId=0,
/** @var int|null */
public ?int $simulation=null,
/** @var int */
public int $analysisResultId=0
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['analysisType'])) $this->analysisType = JsonConverters::from('AnalysisType', $o['analysisType']);
if (isset($o['simulationLossPerspective'])) $this->simulationLossPerspective = JsonConverters::from('SimulationLossPerspective', $o['simulationLossPerspective']);
if (isset($o['reinsurancePremiumLossType'])) $this->reinsurancePremiumLossType = JsonConverters::from('ReinsurancePremiumLossType', $o['reinsurancePremiumLossType']);
if (isset($o['metricDescription'])) $this->metricDescription = $o['metricDescription'];
if (isset($o['portfolioName'])) $this->portfolioName = $o['portfolioName'];
if (isset($o['metric'])) $this->metric = $o['metric'];
if (isset($o['metaRiskId'])) $this->metaRiskId = $o['metaRiskId'];
if (isset($o['simulation'])) $this->simulation = $o['simulation'];
if (isset($o['analysisResultId'])) $this->analysisResultId = $o['analysisResultId'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->analysisType)) $o['analysisType'] = JsonConverters::to('AnalysisType', $this->analysisType);
if (isset($this->simulationLossPerspective)) $o['simulationLossPerspective'] = JsonConverters::to('SimulationLossPerspective', $this->simulationLossPerspective);
if (isset($this->reinsurancePremiumLossType)) $o['reinsurancePremiumLossType'] = JsonConverters::to('ReinsurancePremiumLossType', $this->reinsurancePremiumLossType);
if (isset($this->metricDescription)) $o['metricDescription'] = $this->metricDescription;
if (isset($this->portfolioName)) $o['portfolioName'] = $this->portfolioName;
if (isset($this->metric)) $o['metric'] = $this->metric;
if (isset($this->metaRiskId)) $o['metaRiskId'] = $this->metaRiskId;
if (isset($this->simulation)) $o['simulation'] = $this->simulation;
if (isset($this->analysisResultId)) $o['analysisResultId'] = $this->analysisResultId;
return empty($o) ? new class(){} : $o;
}
}
class AnalysisPortfolioEventSetResult implements IObjectWithId, IHasAnalysisId, JsonSerializable
{
public function __construct(
// @DataMember(Order=1)
/** @var int */
public int $id=0,
// @DataMember(Order=2)
/** @var int */
public int $analysisId=0,
// @DataMember(Order=3)
/** @var int */
public int $analysisPortfolioEventSetConfigurationId=0,
// @DataMember(Order=4)
/** @var int */
public int $analysisResultId=0,
// @DataMember(Order=5)
/** @var string|null */
public ?string $portfolioName=null,
// @DataMember(Order=6)
/** @var string */
public string $rowIdentifier=''
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['id'])) $this->id = $o['id'];
if (isset($o['analysisId'])) $this->analysisId = $o['analysisId'];
if (isset($o['analysisPortfolioEventSetConfigurationId'])) $this->analysisPortfolioEventSetConfigurationId = $o['analysisPortfolioEventSetConfigurationId'];
if (isset($o['analysisResultId'])) $this->analysisResultId = $o['analysisResultId'];
if (isset($o['portfolioName'])) $this->portfolioName = $o['portfolioName'];
if (isset($o['rowIdentifier'])) $this->rowIdentifier = $o['rowIdentifier'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->id)) $o['id'] = $this->id;
if (isset($this->analysisId)) $o['analysisId'] = $this->analysisId;
if (isset($this->analysisPortfolioEventSetConfigurationId)) $o['analysisPortfolioEventSetConfigurationId'] = $this->analysisPortfolioEventSetConfigurationId;
if (isset($this->analysisResultId)) $o['analysisResultId'] = $this->analysisResultId;
if (isset($this->portfolioName)) $o['portfolioName'] = $this->portfolioName;
if (isset($this->rowIdentifier)) $o['rowIdentifier'] = $this->rowIdentifier;
return empty($o) ? new class(){} : $o;
}
}
// @DataContract
class AnalysisResult implements IObjectWithId, JsonSerializable
{
public function __construct(
// @DataMember(Order=1)
/** @var int */
public int $id=0,
// @DataMember(Order=2)
/** @var int */
public int $analysisId=0,
// @DataMember(Order=3)
/** @var int */
public int $analysisConfigurationId=0,
// @DataMember(Order=4)
/** @var string|null */
public ?string $container=null,
// @DataMember(Order=5)
/** @var string|null */
public ?string $blobName=null,
// @DataMember(Order=6)
/** @var string|null */
public ?string $resultTableName=null,
// @DataMember(Order=7)
/** @var AnalysisType|null */
public ?AnalysisType $analysisType=null,
// @DataMember(Order=8)
/** @var SimulationLossPerspective|null */
public ?SimulationLossPerspective $simulationLossPerspective=null,
// @DataMember(Order=9)
/** @var ReinsurancePremiumLossType|null */
public ?ReinsurancePremiumLossType $reinsurancePremiumLossType=null,
// @DataMember(Order=10)
/** @var ResultOutputLevel|null */
public ?ResultOutputLevel $outputLevel=null,
// @DataMember(Order=11)
/** @var int */
public int $metaRiskId=0,
// @DataMember(Order=12)
/** @var array<AnalysisPortfolioEventSetResult>|null */
public ?array $analysisPortfolioEventSetResults=null,
// @DataMember(Order=13)
/** @var string */
public string $rowIdentifier=''
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['id'])) $this->id = $o['id'];
if (isset($o['analysisId'])) $this->analysisId = $o['analysisId'];
if (isset($o['analysisConfigurationId'])) $this->analysisConfigurationId = $o['analysisConfigurationId'];
if (isset($o['container'])) $this->container = $o['container'];
if (isset($o['blobName'])) $this->blobName = $o['blobName'];
if (isset($o['resultTableName'])) $this->resultTableName = $o['resultTableName'];
if (isset($o['analysisType'])) $this->analysisType = JsonConverters::from('AnalysisType', $o['analysisType']);
if (isset($o['simulationLossPerspective'])) $this->simulationLossPerspective = JsonConverters::from('SimulationLossPerspective', $o['simulationLossPerspective']);
if (isset($o['reinsurancePremiumLossType'])) $this->reinsurancePremiumLossType = JsonConverters::from('ReinsurancePremiumLossType', $o['reinsurancePremiumLossType']);
if (isset($o['outputLevel'])) $this->outputLevel = JsonConverters::from('ResultOutputLevel', $o['outputLevel']);
if (isset($o['metaRiskId'])) $this->metaRiskId = $o['metaRiskId'];
if (isset($o['analysisPortfolioEventSetResults'])) $this->analysisPortfolioEventSetResults = JsonConverters::fromArray('AnalysisPortfolioEventSetResult', $o['analysisPortfolioEventSetResults']);
if (isset($o['rowIdentifier'])) $this->rowIdentifier = $o['rowIdentifier'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->id)) $o['id'] = $this->id;
if (isset($this->analysisId)) $o['analysisId'] = $this->analysisId;
if (isset($this->analysisConfigurationId)) $o['analysisConfigurationId'] = $this->analysisConfigurationId;
if (isset($this->container)) $o['container'] = $this->container;
if (isset($this->blobName)) $o['blobName'] = $this->blobName;
if (isset($this->resultTableName)) $o['resultTableName'] = $this->resultTableName;
if (isset($this->analysisType)) $o['analysisType'] = JsonConverters::to('AnalysisType', $this->analysisType);
if (isset($this->simulationLossPerspective)) $o['simulationLossPerspective'] = JsonConverters::to('SimulationLossPerspective', $this->simulationLossPerspective);
if (isset($this->reinsurancePremiumLossType)) $o['reinsurancePremiumLossType'] = JsonConverters::to('ReinsurancePremiumLossType', $this->reinsurancePremiumLossType);
if (isset($this->outputLevel)) $o['outputLevel'] = JsonConverters::to('ResultOutputLevel', $this->outputLevel);
if (isset($this->metaRiskId)) $o['metaRiskId'] = $this->metaRiskId;
if (isset($this->analysisPortfolioEventSetResults)) $o['analysisPortfolioEventSetResults'] = JsonConverters::toArray('AnalysisPortfolioEventSetResult', $this->analysisPortfolioEventSetResults);
if (isset($this->rowIdentifier)) $o['rowIdentifier'] = $this->rowIdentifier;
return empty($o) ? new class(){} : $o;
}
}
class RollupResponse implements JsonSerializable
{
public function __construct(
/** @var Analysis|null */
public ?Analysis $analysis=null,
/** @var array<AnalysisPortfolioMetric>|null */
public ?array $portfolioMetrics=null,
/** @var array<AnalysisResult>|null */
public ?array $results=null,
/** @var ResponseStatus|null */
public ?ResponseStatus $responseStatus=null,
/** @var array<string>|null */
public ?array $unresolvedDealIds=null,
/** @var array<ValueTuple<string,string>>|null */
public ?array $unlinkedDealIds=null,
/** @var string|null */
public ?string $message=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['analysis'])) $this->analysis = JsonConverters::from('Analysis', $o['analysis']);
if (isset($o['portfolioMetrics'])) $this->portfolioMetrics = JsonConverters::fromArray('AnalysisPortfolioMetric', $o['portfolioMetrics']);
if (isset($o['results'])) $this->results = JsonConverters::fromArray('AnalysisResult', $o['results']);
if (isset($o['responseStatus'])) $this->responseStatus = JsonConverters::from('ResponseStatus', $o['responseStatus']);
if (isset($o['unresolvedDealIds'])) $this->unresolvedDealIds = JsonConverters::fromArray('string', $o['unresolvedDealIds']);
if (isset($o['unlinkedDealIds'])) $this->unlinkedDealIds = JsonConverters::fromArray('ValueTuple<String,String>', $o['unlinkedDealIds']);
if (isset($o['message'])) $this->message = $o['message'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->analysis)) $o['analysis'] = JsonConverters::to('Analysis', $this->analysis);
if (isset($this->portfolioMetrics)) $o['portfolioMetrics'] = JsonConverters::toArray('AnalysisPortfolioMetric', $this->portfolioMetrics);
if (isset($this->results)) $o['results'] = JsonConverters::toArray('AnalysisResult', $this->results);
if (isset($this->responseStatus)) $o['responseStatus'] = JsonConverters::to('ResponseStatus', $this->responseStatus);
if (isset($this->unresolvedDealIds)) $o['unresolvedDealIds'] = JsonConverters::toArray('string', $this->unresolvedDealIds);
if (isset($this->unlinkedDealIds)) $o['unlinkedDealIds'] = JsonConverters::toArray('ValueTuple<String,String>', $this->unlinkedDealIds);
if (isset($this->message)) $o['message'] = $this->message;
return empty($o) ? new class(){} : $o;
}
}
class ReProcessAnalysisRequest implements IPost, JsonSerializable
{
public function __construct(
/** @description The analysis id to run */
// @ApiMember(DataType="integer", Description="The analysis id to run", Format="int64", IsRequired=true)
/** @var int */
public int $analysisId=0,
/** @description Pass true when the analysis is still in processing state and you know it will not finish */
// @ApiMember(DataType="boolean", Description="Pass true when the analysis is still in processing state and you know it will not finish")
/** @var bool|null */
public ?bool $forceRerunWhenProcessing=null,
/** @description Pass true to make sure the analysis results are not removed */
// @ApiMember(DataType="boolean", Description="Pass true to make sure the analysis results are not removed")
/** @var bool|null */
public ?bool $permanentlySaveResults=null,
/** @description Take the minimum simulation count when we have different simulations between event sets */
// @ApiMember(DataType="boolean", Description="Take the minimum simulation count when we have different simulations between event sets")
/** @var bool|null */
public ?bool $ignoreSimulationCountMismatch=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['analysisId'])) $this->analysisId = $o['analysisId'];
if (isset($o['forceRerunWhenProcessing'])) $this->forceRerunWhenProcessing = $o['forceRerunWhenProcessing'];
if (isset($o['permanentlySaveResults'])) $this->permanentlySaveResults = $o['permanentlySaveResults'];
if (isset($o['ignoreSimulationCountMismatch'])) $this->ignoreSimulationCountMismatch = $o['ignoreSimulationCountMismatch'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->analysisId)) $o['analysisId'] = $this->analysisId;
if (isset($this->forceRerunWhenProcessing)) $o['forceRerunWhenProcessing'] = $this->forceRerunWhenProcessing;
if (isset($this->permanentlySaveResults)) $o['permanentlySaveResults'] = $this->permanentlySaveResults;
if (isset($this->ignoreSimulationCountMismatch)) $o['ignoreSimulationCountMismatch'] = $this->ignoreSimulationCountMismatch;
return empty($o) ? new class(){} : $o;
}
}
PHP ReProcessAnalysisRequest DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .csv suffix or ?format=csv
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /api/riskstore/rollup/reprocess HTTP/1.1
Host: riskstoreng-dev.nephila.com
Accept: text/csv
Content-Type: text/csv
Content-Length: length
{"analysisId":0,"forceRerunWhenProcessing":false,"permanentlySaveResults":false,"ignoreSimulationCountMismatch":false}
HTTP/1.1 200 OK
Content-Type: text/csv
Content-Length: length
{"analysis":{"id":0,"name":"String","modelAsOfDate":"0001-01-01T00:00:00.0000000Z","perspectiveId":0,"configurations":[{"id":0,"analysisId":0,"windowStartDate":"0001-01-01T00:00:00.0000000Z","windowEndDate":"0001-01-01T00:00:00.0000000Z","standardEnabled":false,"runOffEnabled":false,"aggregateEnabled":false,"occurrenceEnabled":false,"nettEnabled":false,"grossEnabled":false,"tailIntensityPercentageStart":0,"tailIntensityPercentageEnd":0,"metaRiskId":0,"outputLevel":"NotSet","processingStatus":"New","eventLossFloorStartRange":0,"eventLossFloorEndRange":0,"analysisPortfolioEventSetConfigurations":[{"id":0,"analysisId":0,"analysisConfigurationId":0,"portfolioName":"String","modelId":"String","rowIdentifier":"00000000000000000000000000000000"}],"rowIdentifier":"00000000000000000000000000000000"}],"deals":[{"id":0,"analysisId":0,"sourceDealId":"String","dealRef":"String","sourceDealSystem":"String","eventSetId":0,"rol":0,"limit":0,"inceptionDate":"0001-01-01T00:00:00.0000000Z","expiryDate":"0001-01-01T00:00:00.0000000Z","transactionType":"NotSet","allocations":[{"id":0,"analysisDealId":0,"portfolioName":"String","allocationPercentage":0,"rowIdentifier":"00000000000000000000000000000000"}],"perspectiveIdOverride":0,"eventSetIdOverride":0,"modelAsOfDateOverride":"0001-01-01T00:00:00.0000000Z","sourceModelSystemOverride":"String","sourceModelIdOverride":"String","sourceEventSetIdOverride":"String","eventSourceSystemOverride":"String","rowIdentifier":"00000000000000000000000000000000"}],"eventIdFilters":[{"id":0,"analysisId":0,"eventSourceId":0,"eventId":0,"rowIdentifier":"00000000000000000000000000000000"}],"createdBy":"String","createdDateUtc":"0001-01-01T00:00:00.0000000Z","completedDateUtc":"0001-01-01T00:00:00.0000000Z","legacyAnalysisId":0,"resultPersistenceTracking":[{"id":"00000000000000000000000000000000","analysisId":0,"processingStatus":"New","messageType":"NotSet","createdDateUtc":"0001-01-01T00:00:00.0000000Z","updatedDateUtc":"0001-01-01T00:00:00.0000000Z"}],"processingStatus":"New","saveResults":false,"eventSourceSystem":"String","updatedDateUtc":"0001-01-01T00:00:00.0000000Z","isExpired":false,"rowIdentifier":"00000000000000000000000000000000","errorMessage":"String","ignoreSimulationCountMismatch":false,"finalStatus":"New"},"portfolioMetrics":[{"analysisType":"NotSet","simulationLossPerspective":"NotSet","reinsurancePremiumLossType":"NotSet","metricDescription":"String","portfolioName":"String","metric":0,"metaRiskId":0,"simulation":0,"analysisResultId":0}],"results":[{"id":0,"analysisId":0,"analysisConfigurationId":0,"container":"String","blobName":"String","resultTableName":"String","analysisType":"NotSet","simulationLossPerspective":"NotSet","reinsurancePremiumLossType":"NotSet","outputLevel":"NotSet","metaRiskId":0,"analysisPortfolioEventSetResults":[{"id":0,"analysisId":0,"analysisPortfolioEventSetConfigurationId":0,"analysisResultId":0,"portfolioName":"String","rowIdentifier":"00000000000000000000000000000000"}],"rowIdentifier":"00000000000000000000000000000000"}],"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"}},"unresolvedDealIds":["String"],"unlinkedDealIds":["(, )"],"message":"String"}