Nephila RiskStore

<back to all web services

ProcessHotPathRollupOutputPersistenceRequest

Requires Authentication
<?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 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';
}

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';
}

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 ProcessHotPathRollupOutputPersistenceRequest implements JsonSerializable
{
    public function __construct(
        /** @var string */
        public string $id='',
        /** @var array<AnalysisResult>|null */
        public ?array $outputDetails=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['id'])) $this->id = $o['id'];
        if (isset($o['outputDetails'])) $this->outputDetails = JsonConverters::fromArray('AnalysisResult', $o['outputDetails']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->id)) $o['id'] = $this->id;
        if (isset($this->outputDetails)) $o['outputDetails'] = JsonConverters::toArray('AnalysisResult', $this->outputDetails);
        return empty($o) ? new class(){} : $o;
    }
}

PHP ProcessHotPathRollupOutputPersistenceRequest DTOs

To override the Content-type in your clients, use the HTTP Accept Header, append the .jsv suffix or ?format=jsv

HTTP + JSV

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

POST /jsv/oneway/ProcessHotPathRollupOutputPersistenceRequest HTTP/1.1 
Host: riskstoreng-dev.nephila.com 
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length

{
	id: 00000000000000000000000000000000,
	outputDetails: 
	[
		{
			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
		}
	]
}