Nephila RiskStore

<back to all web services

SaveAnalysisResultsRequest

General
Requires Authentication
Requires any of the roles:Riskstore.Write, Riskstore.Admin
The following routes are available for this service:
POST/api/riskstore/rollup/save-rollup-resultsMark an existing analysis as final (save results), it will re-run it if expiredMark an existing analysis as final (save results), it will re-run it if expired
import 'package:servicestack/servicestack.dart';

enum ResultOutputLevel
{
    NotSet,
    PortfolioMetrics,
    Curve,
    YLT,
    TailIntensity,
    DealYlt,
    DealElt,
    DealEltWithIndustryLoss,
    PortfolioElt,
    PortfolioEltWithIndustryLoss,
    EventSetGeneration,
    PortfolioRaps,
    DealRaps,
    PortfolioSepyIndustryLoss,
    DealSepyIndustryLoss,
}

enum ProcessingStatus
{
    New,
    Processing,
    Failed,
    Successful,
}

class AnalysisPortfolioEventSetConfiguration implements IObjectWithId, IHasAnalysisId, IConvertible
{
    // @DataMember(Order=1)
    int? id;

    // @DataMember(Order=2)
    int? analysisId;

    // @DataMember(Order=3)
    int? analysisConfigurationId;

    // @DataMember(Order=4)
    String? portfolioName;

    // @DataMember(Order=5)
    String? modelId;

    // @DataMember(Order=6)
    String? rowIdentifier;

    AnalysisPortfolioEventSetConfiguration({this.id,this.analysisId,this.analysisConfigurationId,this.portfolioName,this.modelId,this.rowIdentifier});
    AnalysisPortfolioEventSetConfiguration.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        id = json['id'];
        analysisId = json['analysisId'];
        analysisConfigurationId = json['analysisConfigurationId'];
        portfolioName = json['portfolioName'];
        modelId = json['modelId'];
        rowIdentifier = json['rowIdentifier'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'id': id,
        'analysisId': analysisId,
        'analysisConfigurationId': analysisConfigurationId,
        'portfolioName': portfolioName,
        'modelId': modelId,
        'rowIdentifier': rowIdentifier
    };

    getTypeName() => "AnalysisPortfolioEventSetConfiguration";
    TypeContext? context = _ctx;
}

// @DataContract
class AnalysisConfiguration implements IObjectWithId, IHasAnalysisId, IConvertible
{
    // @DataMember(Order=1)
    int? id;

    // @DataMember(Order=2)
    int? analysisId;

    // @DataMember(Order=3)
    DateTime? windowStartDate;

    // @DataMember(Order=4)
    DateTime? windowEndDate;

    // @DataMember(Order=5)
    bool? standardEnabled;

    // @DataMember(Order=6)
    bool? runOffEnabled;

    // @DataMember(Order=7)
    bool? aggregateEnabled;

    // @DataMember(Order=8)
    bool? occurrenceEnabled;

    // @DataMember(Order=9)
    bool? nettEnabled;

    // @DataMember(Order=10)
    bool? grossEnabled;

    // @DataMember(Order=11)
    double? tailIntensityPercentageStart;

    // @DataMember(Order=12)
    double? tailIntensityPercentageEnd;

    // @DataMember(Order=13)
    int? metaRiskId;

    // @DataMember(Order=14)
    ResultOutputLevel? outputLevel;

    // @DataMember(Order=15)
    ProcessingStatus? processingStatus;

    // @DataMember(Order=16)
    double? eventLossFloorStartRange;

    // @DataMember(Order=17)
    double? eventLossFloorEndRange;

    // @DataMember(Order=18)
    List<AnalysisPortfolioEventSetConfiguration>? analysisPortfolioEventSetConfigurations;

    // @DataMember(Order=19)
    String? rowIdentifier;

    AnalysisConfiguration({this.id,this.analysisId,this.windowStartDate,this.windowEndDate,this.standardEnabled,this.runOffEnabled,this.aggregateEnabled,this.occurrenceEnabled,this.nettEnabled,this.grossEnabled,this.tailIntensityPercentageStart,this.tailIntensityPercentageEnd,this.metaRiskId,this.outputLevel,this.processingStatus,this.eventLossFloorStartRange,this.eventLossFloorEndRange,this.analysisPortfolioEventSetConfigurations,this.rowIdentifier});
    AnalysisConfiguration.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        id = json['id'];
        analysisId = json['analysisId'];
        windowStartDate = JsonConverters.fromJson(json['windowStartDate'],'DateTime',context!);
        windowEndDate = JsonConverters.fromJson(json['windowEndDate'],'DateTime',context!);
        standardEnabled = json['standardEnabled'];
        runOffEnabled = json['runOffEnabled'];
        aggregateEnabled = json['aggregateEnabled'];
        occurrenceEnabled = json['occurrenceEnabled'];
        nettEnabled = json['nettEnabled'];
        grossEnabled = json['grossEnabled'];
        tailIntensityPercentageStart = JsonConverters.toDouble(json['tailIntensityPercentageStart']);
        tailIntensityPercentageEnd = JsonConverters.toDouble(json['tailIntensityPercentageEnd']);
        metaRiskId = json['metaRiskId'];
        outputLevel = JsonConverters.fromJson(json['outputLevel'],'ResultOutputLevel',context!);
        processingStatus = JsonConverters.fromJson(json['processingStatus'],'ProcessingStatus',context!);
        eventLossFloorStartRange = JsonConverters.toDouble(json['eventLossFloorStartRange']);
        eventLossFloorEndRange = JsonConverters.toDouble(json['eventLossFloorEndRange']);
        analysisPortfolioEventSetConfigurations = JsonConverters.fromJson(json['analysisPortfolioEventSetConfigurations'],'List<AnalysisPortfolioEventSetConfiguration>',context!);
        rowIdentifier = json['rowIdentifier'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'id': id,
        'analysisId': analysisId,
        'windowStartDate': JsonConverters.toJson(windowStartDate,'DateTime',context!),
        'windowEndDate': JsonConverters.toJson(windowEndDate,'DateTime',context!),
        'standardEnabled': standardEnabled,
        'runOffEnabled': runOffEnabled,
        'aggregateEnabled': aggregateEnabled,
        'occurrenceEnabled': occurrenceEnabled,
        'nettEnabled': nettEnabled,
        'grossEnabled': grossEnabled,
        'tailIntensityPercentageStart': tailIntensityPercentageStart,
        'tailIntensityPercentageEnd': tailIntensityPercentageEnd,
        'metaRiskId': metaRiskId,
        'outputLevel': JsonConverters.toJson(outputLevel,'ResultOutputLevel',context!),
        'processingStatus': JsonConverters.toJson(processingStatus,'ProcessingStatus',context!),
        'eventLossFloorStartRange': eventLossFloorStartRange,
        'eventLossFloorEndRange': eventLossFloorEndRange,
        'analysisPortfolioEventSetConfigurations': JsonConverters.toJson(analysisPortfolioEventSetConfigurations,'List<AnalysisPortfolioEventSetConfiguration>',context!),
        'rowIdentifier': rowIdentifier
    };

    getTypeName() => "AnalysisConfiguration";
    TypeContext? context = _ctx;
}

enum TransactionType
{
    NotSet,
    S,
    B,
}

// @DataContract
class AnalysisPortfolioAllocation implements IObjectWithId, IConvertible
{
    // @DataMember(Order=1)
    int? id;

    // @DataMember(Order=2)
    int? analysisDealId;

    // @DataMember(Order=3)
    // @Validate(Validator="NotEmpty", Message="PortfolioName is mandatory")
    String? portfolioName;

    // @DataMember(Order=4)
    double? allocationPercentage;

    // @DataMember(Order=5)
    String? rowIdentifier;

    AnalysisPortfolioAllocation({this.id,this.analysisDealId,this.portfolioName,this.allocationPercentage,this.rowIdentifier});
    AnalysisPortfolioAllocation.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        id = json['id'];
        analysisDealId = json['analysisDealId'];
        portfolioName = json['portfolioName'];
        allocationPercentage = JsonConverters.toDouble(json['allocationPercentage']);
        rowIdentifier = json['rowIdentifier'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'id': id,
        'analysisDealId': analysisDealId,
        'portfolioName': portfolioName,
        'allocationPercentage': allocationPercentage,
        'rowIdentifier': rowIdentifier
    };

    getTypeName() => "AnalysisPortfolioAllocation";
    TypeContext? context = _ctx;
}

// @DataContract
class AnalysisDeal implements IObjectWithId, IHasAnalysisId, IConvertible
{
    // @DataMember(Order=1)
    int? id;

    // @DataMember(Order=2)
    int? analysisId;

    // @DataMember(Order=3)
    String? sourceDealId;

    // @DataMember(Order=4)
    String? dealRef;

    // @DataMember(Order=5)
    String? sourceDealSystem;

    // @DataMember(Order=6)
    int? eventSetId;

    // @DataMember(Order=7)
    double? rol;

    // @DataMember(Order=8)
    double? limit;

    // @DataMember(Order=9)
    DateTime? inceptionDate;

    // @DataMember(Order=10)
    DateTime? expiryDate;

    // @DataMember(Order=11)
    TransactionType? transactionType;

    // @DataMember(Order=12)
    List<AnalysisPortfolioAllocation>? allocations;

    // @DataMember(Order=13)
    int? perspectiveIdOverride;

    // @DataMember(Order=14)
    int? eventSetIdOverride;

    // @DataMember(Order=15)
    DateTime? modelAsOfDateOverride;

    // @DataMember(Order=16)
    String? sourceModelSystemOverride;

    // @DataMember(Order=17)
    String? sourceModelIdOverride;

    // @DataMember(Order=18)
    String? sourceEventSetIdOverride;

    // @DataMember(Order=19)
    String? eventSourceSystemOverride;

    // @DataMember(Order=20)
    String? rowIdentifier;

    AnalysisDeal({this.id,this.analysisId,this.sourceDealId,this.dealRef,this.sourceDealSystem,this.eventSetId,this.rol,this.limit,this.inceptionDate,this.expiryDate,this.transactionType,this.allocations,this.perspectiveIdOverride,this.eventSetIdOverride,this.modelAsOfDateOverride,this.sourceModelSystemOverride,this.sourceModelIdOverride,this.sourceEventSetIdOverride,this.eventSourceSystemOverride,this.rowIdentifier});
    AnalysisDeal.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        id = json['id'];
        analysisId = json['analysisId'];
        sourceDealId = json['sourceDealId'];
        dealRef = json['dealRef'];
        sourceDealSystem = json['sourceDealSystem'];
        eventSetId = json['eventSetId'];
        rol = JsonConverters.toDouble(json['rol']);
        limit = JsonConverters.toDouble(json['limit']);
        inceptionDate = JsonConverters.fromJson(json['inceptionDate'],'DateTime',context!);
        expiryDate = JsonConverters.fromJson(json['expiryDate'],'DateTime',context!);
        transactionType = JsonConverters.fromJson(json['transactionType'],'TransactionType',context!);
        allocations = JsonConverters.fromJson(json['allocations'],'List<AnalysisPortfolioAllocation>',context!);
        perspectiveIdOverride = json['perspectiveIdOverride'];
        eventSetIdOverride = json['eventSetIdOverride'];
        modelAsOfDateOverride = JsonConverters.fromJson(json['modelAsOfDateOverride'],'DateTime',context!);
        sourceModelSystemOverride = json['sourceModelSystemOverride'];
        sourceModelIdOverride = json['sourceModelIdOverride'];
        sourceEventSetIdOverride = json['sourceEventSetIdOverride'];
        eventSourceSystemOverride = json['eventSourceSystemOverride'];
        rowIdentifier = json['rowIdentifier'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'id': id,
        'analysisId': analysisId,
        'sourceDealId': sourceDealId,
        'dealRef': dealRef,
        'sourceDealSystem': sourceDealSystem,
        'eventSetId': eventSetId,
        'rol': rol,
        'limit': limit,
        'inceptionDate': JsonConverters.toJson(inceptionDate,'DateTime',context!),
        'expiryDate': JsonConverters.toJson(expiryDate,'DateTime',context!),
        'transactionType': JsonConverters.toJson(transactionType,'TransactionType',context!),
        'allocations': JsonConverters.toJson(allocations,'List<AnalysisPortfolioAllocation>',context!),
        'perspectiveIdOverride': perspectiveIdOverride,
        'eventSetIdOverride': eventSetIdOverride,
        'modelAsOfDateOverride': JsonConverters.toJson(modelAsOfDateOverride,'DateTime',context!),
        'sourceModelSystemOverride': sourceModelSystemOverride,
        'sourceModelIdOverride': sourceModelIdOverride,
        'sourceEventSetIdOverride': sourceEventSetIdOverride,
        'eventSourceSystemOverride': eventSourceSystemOverride,
        'rowIdentifier': rowIdentifier
    };

    getTypeName() => "AnalysisDeal";
    TypeContext? context = _ctx;
}

// @DataContract
class AnalysisEventIdFilter implements IObjectWithId, IHasAnalysisId, IConvertible
{
    // @DataMember(Order=1)
    int? id;

    // @DataMember(Order=2)
    int? analysisId;

    // @DataMember(Order=3)
    int? eventSourceId;

    // @DataMember(Order=4)
    int? eventId;

    // @DataMember(Order=5)
    String? rowIdentifier;

    AnalysisEventIdFilter({this.id,this.analysisId,this.eventSourceId,this.eventId,this.rowIdentifier});
    AnalysisEventIdFilter.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        id = json['id'];
        analysisId = json['analysisId'];
        eventSourceId = json['eventSourceId'];
        eventId = json['eventId'];
        rowIdentifier = json['rowIdentifier'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'id': id,
        'analysisId': analysisId,
        'eventSourceId': eventSourceId,
        'eventId': eventId,
        'rowIdentifier': rowIdentifier
    };

    getTypeName() => "AnalysisEventIdFilter";
    TypeContext? context = _ctx;
}

enum MessageType
{
    NotSet,
    Persistence,
    Archival,
}

// @DataContract
class MessageTracking implements IConvertible
{
    // @DataMember(Order=1)
    String? id;

    // @DataMember(Order=2)
    int? analysisId;

    // @DataMember(Order=3)
    ProcessingStatus? processingStatus;

    // @DataMember(Order=4)
    MessageType? messageType;

    // @DataMember(Order=5)
    DateTime? createdDateUtc;

    // @DataMember(Order=6)
    DateTime? updatedDateUtc;

    MessageTracking({this.id,this.analysisId,this.processingStatus,this.messageType,this.createdDateUtc,this.updatedDateUtc});
    MessageTracking.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        id = json['id'];
        analysisId = json['analysisId'];
        processingStatus = JsonConverters.fromJson(json['processingStatus'],'ProcessingStatus',context!);
        messageType = JsonConverters.fromJson(json['messageType'],'MessageType',context!);
        createdDateUtc = JsonConverters.fromJson(json['createdDateUtc'],'DateTime',context!);
        updatedDateUtc = JsonConverters.fromJson(json['updatedDateUtc'],'DateTime',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'id': id,
        'analysisId': analysisId,
        'processingStatus': JsonConverters.toJson(processingStatus,'ProcessingStatus',context!),
        'messageType': JsonConverters.toJson(messageType,'MessageType',context!),
        'createdDateUtc': JsonConverters.toJson(createdDateUtc,'DateTime',context!),
        'updatedDateUtc': JsonConverters.toJson(updatedDateUtc,'DateTime',context!)
    };

    getTypeName() => "MessageTracking";
    TypeContext? context = _ctx;
}

// @DataContract
class Analysis implements IObjectWithId, IConvertible
{
    // @DataMember(Order=1)
    int? id;

    // @DataMember(Order=2)
    String? name;

    // @DataMember(Order=3)
    DateTime? modelAsOfDate;

    // @DataMember(Order=4)
    int? perspectiveId;

    // @DataMember(Order=5)
    List<AnalysisConfiguration>? configurations;

    // @DataMember(Order=6)
    List<AnalysisDeal>? deals;

    // @DataMember(Order=7)
    List<AnalysisEventIdFilter>? eventIdFilters;

    // @DataMember(Order=8)
    String? createdBy;

    // @DataMember(Order=9)
    DateTime? createdDateUtc;

    // @DataMember(Order=10)
    DateTime? completedDateUtc;

    // @DataMember(Order=11)
    int? legacyAnalysisId;

    // @DataMember(Order=12)
    List<MessageTracking>? resultPersistenceTracking;

    // @DataMember(Order=13)
    ProcessingStatus? processingStatus;

    // @DataMember(Order=14)
    bool? saveResults;

    // @DataMember(Order=15)
    String? eventSourceSystem;

    // @DataMember(Order=16)
    DateTime? updatedDateUtc;

    // @DataMember(Order=17)
    bool? isExpired;

    // @DataMember(Order=18)
    String? rowIdentifier;

    // @DataMember(Order=19)
    String? errorMessage;

    /**
    * 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")
    bool? ignoreSimulationCountMismatch;

    // @DataMember(Order=21)
    // @ignore()
    ProcessingStatus? finalStatus;

    Analysis({this.id,this.name,this.modelAsOfDate,this.perspectiveId,this.configurations,this.deals,this.eventIdFilters,this.createdBy,this.createdDateUtc,this.completedDateUtc,this.legacyAnalysisId,this.resultPersistenceTracking,this.processingStatus,this.saveResults,this.eventSourceSystem,this.updatedDateUtc,this.isExpired,this.rowIdentifier,this.errorMessage,this.ignoreSimulationCountMismatch,this.finalStatus});
    Analysis.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        id = json['id'];
        name = json['name'];
        modelAsOfDate = JsonConverters.fromJson(json['modelAsOfDate'],'DateTime',context!);
        perspectiveId = json['perspectiveId'];
        configurations = JsonConverters.fromJson(json['configurations'],'List<AnalysisConfiguration>',context!);
        deals = JsonConverters.fromJson(json['deals'],'List<AnalysisDeal>',context!);
        eventIdFilters = JsonConverters.fromJson(json['eventIdFilters'],'List<AnalysisEventIdFilter>',context!);
        createdBy = json['createdBy'];
        createdDateUtc = JsonConverters.fromJson(json['createdDateUtc'],'DateTime',context!);
        completedDateUtc = JsonConverters.fromJson(json['completedDateUtc'],'DateTime',context!);
        legacyAnalysisId = json['legacyAnalysisId'];
        resultPersistenceTracking = JsonConverters.fromJson(json['resultPersistenceTracking'],'List<MessageTracking>',context!);
        processingStatus = JsonConverters.fromJson(json['processingStatus'],'ProcessingStatus',context!);
        saveResults = json['saveResults'];
        eventSourceSystem = json['eventSourceSystem'];
        updatedDateUtc = JsonConverters.fromJson(json['updatedDateUtc'],'DateTime',context!);
        isExpired = json['isExpired'];
        rowIdentifier = json['rowIdentifier'];
        errorMessage = json['errorMessage'];
        ignoreSimulationCountMismatch = json['ignoreSimulationCountMismatch'];
        finalStatus = JsonConverters.fromJson(json['finalStatus'],'ProcessingStatus',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'id': id,
        'name': name,
        'modelAsOfDate': JsonConverters.toJson(modelAsOfDate,'DateTime',context!),
        'perspectiveId': perspectiveId,
        'configurations': JsonConverters.toJson(configurations,'List<AnalysisConfiguration>',context!),
        'deals': JsonConverters.toJson(deals,'List<AnalysisDeal>',context!),
        'eventIdFilters': JsonConverters.toJson(eventIdFilters,'List<AnalysisEventIdFilter>',context!),
        'createdBy': createdBy,
        'createdDateUtc': JsonConverters.toJson(createdDateUtc,'DateTime',context!),
        'completedDateUtc': JsonConverters.toJson(completedDateUtc,'DateTime',context!),
        'legacyAnalysisId': legacyAnalysisId,
        'resultPersistenceTracking': JsonConverters.toJson(resultPersistenceTracking,'List<MessageTracking>',context!),
        'processingStatus': JsonConverters.toJson(processingStatus,'ProcessingStatus',context!),
        'saveResults': saveResults,
        'eventSourceSystem': eventSourceSystem,
        'updatedDateUtc': JsonConverters.toJson(updatedDateUtc,'DateTime',context!),
        'isExpired': isExpired,
        'rowIdentifier': rowIdentifier,
        'errorMessage': errorMessage,
        'ignoreSimulationCountMismatch': ignoreSimulationCountMismatch,
        'finalStatus': JsonConverters.toJson(finalStatus,'ProcessingStatus',context!)
    };

    getTypeName() => "Analysis";
    TypeContext? context = _ctx;
}

enum AnalysisType
{
    NotSet,
    Standard,
    RunOff,
}

enum SimulationLossPerspective
{
    NotSet,
    Agg,
    Occ,
}

enum ReinsurancePremiumLossType
{
    NotSet,
    Net,
    Gross,
}

class AnalysisPortfolioMetric implements IHasAnalysisResultId, IConvertible
{
    AnalysisType? analysisType;
    SimulationLossPerspective? simulationLossPerspective;
    ReinsurancePremiumLossType? reinsurancePremiumLossType;
    String? metricDescription;
    String? portfolioName;
    double? metric;
    int? metaRiskId;
    int? simulation;
    int? analysisResultId;

    AnalysisPortfolioMetric({this.analysisType,this.simulationLossPerspective,this.reinsurancePremiumLossType,this.metricDescription,this.portfolioName,this.metric,this.metaRiskId,this.simulation,this.analysisResultId});
    AnalysisPortfolioMetric.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        analysisType = JsonConverters.fromJson(json['analysisType'],'AnalysisType',context!);
        simulationLossPerspective = JsonConverters.fromJson(json['simulationLossPerspective'],'SimulationLossPerspective',context!);
        reinsurancePremiumLossType = JsonConverters.fromJson(json['reinsurancePremiumLossType'],'ReinsurancePremiumLossType',context!);
        metricDescription = json['metricDescription'];
        portfolioName = json['portfolioName'];
        metric = JsonConverters.toDouble(json['metric']);
        metaRiskId = json['metaRiskId'];
        simulation = json['simulation'];
        analysisResultId = json['analysisResultId'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'analysisType': JsonConverters.toJson(analysisType,'AnalysisType',context!),
        'simulationLossPerspective': JsonConverters.toJson(simulationLossPerspective,'SimulationLossPerspective',context!),
        'reinsurancePremiumLossType': JsonConverters.toJson(reinsurancePremiumLossType,'ReinsurancePremiumLossType',context!),
        'metricDescription': metricDescription,
        'portfolioName': portfolioName,
        'metric': metric,
        'metaRiskId': metaRiskId,
        'simulation': simulation,
        'analysisResultId': analysisResultId
    };

    getTypeName() => "AnalysisPortfolioMetric";
    TypeContext? context = _ctx;
}

class AnalysisPortfolioEventSetResult implements IObjectWithId, IHasAnalysisId, IConvertible
{
    // @DataMember(Order=1)
    int? id;

    // @DataMember(Order=2)
    int? analysisId;

    // @DataMember(Order=3)
    int? analysisPortfolioEventSetConfigurationId;

    // @DataMember(Order=4)
    int? analysisResultId;

    // @DataMember(Order=5)
    String? portfolioName;

    // @DataMember(Order=6)
    String? rowIdentifier;

    AnalysisPortfolioEventSetResult({this.id,this.analysisId,this.analysisPortfolioEventSetConfigurationId,this.analysisResultId,this.portfolioName,this.rowIdentifier});
    AnalysisPortfolioEventSetResult.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        id = json['id'];
        analysisId = json['analysisId'];
        analysisPortfolioEventSetConfigurationId = json['analysisPortfolioEventSetConfigurationId'];
        analysisResultId = json['analysisResultId'];
        portfolioName = json['portfolioName'];
        rowIdentifier = json['rowIdentifier'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'id': id,
        'analysisId': analysisId,
        'analysisPortfolioEventSetConfigurationId': analysisPortfolioEventSetConfigurationId,
        'analysisResultId': analysisResultId,
        'portfolioName': portfolioName,
        'rowIdentifier': rowIdentifier
    };

    getTypeName() => "AnalysisPortfolioEventSetResult";
    TypeContext? context = _ctx;
}

// @DataContract
class AnalysisResult implements IObjectWithId, IConvertible
{
    // @DataMember(Order=1)
    int? id;

    // @DataMember(Order=2)
    int? analysisId;

    // @DataMember(Order=3)
    int? analysisConfigurationId;

    // @DataMember(Order=4)
    String? container;

    // @DataMember(Order=5)
    String? blobName;

    // @DataMember(Order=6)
    String? resultTableName;

    // @DataMember(Order=7)
    AnalysisType? analysisType;

    // @DataMember(Order=8)
    SimulationLossPerspective? simulationLossPerspective;

    // @DataMember(Order=9)
    ReinsurancePremiumLossType? reinsurancePremiumLossType;

    // @DataMember(Order=10)
    ResultOutputLevel? outputLevel;

    // @DataMember(Order=11)
    int? metaRiskId;

    // @DataMember(Order=12)
    List<AnalysisPortfolioEventSetResult>? analysisPortfolioEventSetResults;

    // @DataMember(Order=13)
    String? rowIdentifier;

    AnalysisResult({this.id,this.analysisId,this.analysisConfigurationId,this.container,this.blobName,this.resultTableName,this.analysisType,this.simulationLossPerspective,this.reinsurancePremiumLossType,this.outputLevel,this.metaRiskId,this.analysisPortfolioEventSetResults,this.rowIdentifier});
    AnalysisResult.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        id = json['id'];
        analysisId = json['analysisId'];
        analysisConfigurationId = json['analysisConfigurationId'];
        container = json['container'];
        blobName = json['blobName'];
        resultTableName = json['resultTableName'];
        analysisType = JsonConverters.fromJson(json['analysisType'],'AnalysisType',context!);
        simulationLossPerspective = JsonConverters.fromJson(json['simulationLossPerspective'],'SimulationLossPerspective',context!);
        reinsurancePremiumLossType = JsonConverters.fromJson(json['reinsurancePremiumLossType'],'ReinsurancePremiumLossType',context!);
        outputLevel = JsonConverters.fromJson(json['outputLevel'],'ResultOutputLevel',context!);
        metaRiskId = json['metaRiskId'];
        analysisPortfolioEventSetResults = JsonConverters.fromJson(json['analysisPortfolioEventSetResults'],'List<AnalysisPortfolioEventSetResult>',context!);
        rowIdentifier = json['rowIdentifier'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'id': id,
        'analysisId': analysisId,
        'analysisConfigurationId': analysisConfigurationId,
        'container': container,
        'blobName': blobName,
        'resultTableName': resultTableName,
        'analysisType': JsonConverters.toJson(analysisType,'AnalysisType',context!),
        'simulationLossPerspective': JsonConverters.toJson(simulationLossPerspective,'SimulationLossPerspective',context!),
        'reinsurancePremiumLossType': JsonConverters.toJson(reinsurancePremiumLossType,'ReinsurancePremiumLossType',context!),
        'outputLevel': JsonConverters.toJson(outputLevel,'ResultOutputLevel',context!),
        'metaRiskId': metaRiskId,
        'analysisPortfolioEventSetResults': JsonConverters.toJson(analysisPortfolioEventSetResults,'List<AnalysisPortfolioEventSetResult>',context!),
        'rowIdentifier': rowIdentifier
    };

    getTypeName() => "AnalysisResult";
    TypeContext? context = _ctx;
}

class RollupResponse implements IConvertible
{
    Analysis? analysis;
    List<AnalysisPortfolioMetric>? portfolioMetrics;
    List<AnalysisResult>? results;
    ResponseStatus? responseStatus;
    List<String>? unresolvedDealIds;
    List<ValueTuple<String,String>>? unlinkedDealIds;
    String? message;

    RollupResponse({this.analysis,this.portfolioMetrics,this.results,this.responseStatus,this.unresolvedDealIds,this.unlinkedDealIds,this.message});
    RollupResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        analysis = JsonConverters.fromJson(json['analysis'],'Analysis',context!);
        portfolioMetrics = JsonConverters.fromJson(json['portfolioMetrics'],'List<AnalysisPortfolioMetric>',context!);
        results = JsonConverters.fromJson(json['results'],'List<AnalysisResult>',context!);
        responseStatus = JsonConverters.fromJson(json['responseStatus'],'ResponseStatus',context!);
        unresolvedDealIds = JsonConverters.fromJson(json['unresolvedDealIds'],'List<String>',context!);
        unlinkedDealIds = JsonConverters.fromJson(json['unlinkedDealIds'],'List<ValueTuple<String,String>>',context!);
        message = json['message'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'analysis': JsonConverters.toJson(analysis,'Analysis',context!),
        'portfolioMetrics': JsonConverters.toJson(portfolioMetrics,'List<AnalysisPortfolioMetric>',context!),
        'results': JsonConverters.toJson(results,'List<AnalysisResult>',context!),
        'responseStatus': JsonConverters.toJson(responseStatus,'ResponseStatus',context!),
        'unresolvedDealIds': JsonConverters.toJson(unresolvedDealIds,'List<String>',context!),
        'unlinkedDealIds': JsonConverters.toJson(unlinkedDealIds,'List<ValueTuple<String,String>>',context!),
        'message': message
    };

    getTypeName() => "RollupResponse";
    TypeContext? context = _ctx;
}

class SaveAnalysisResultsRequest implements IPost, IConvertible
{
    /**
    * The analysis id to mark as final
    */
    // @ApiMember(DataType="integer", Description="The analysis id to mark as final", Format="int64", IsRequired=true)
    int? analysisId;

    SaveAnalysisResultsRequest({this.analysisId});
    SaveAnalysisResultsRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        analysisId = json['analysisId'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'analysisId': analysisId
    };

    getTypeName() => "SaveAnalysisResultsRequest";
    TypeContext? context = _ctx;
}

TypeContext _ctx = TypeContext(library: 'riskstoreng_dev.nephila.com', types: <String, TypeInfo> {
    'ResultOutputLevel': TypeInfo(TypeOf.Enum, enumValues:ResultOutputLevel.values),
    'ProcessingStatus': TypeInfo(TypeOf.Enum, enumValues:ProcessingStatus.values),
    'AnalysisPortfolioEventSetConfiguration': TypeInfo(TypeOf.Class, create:() => AnalysisPortfolioEventSetConfiguration()),
    'AnalysisConfiguration': TypeInfo(TypeOf.Class, create:() => AnalysisConfiguration()),
    'List<AnalysisPortfolioEventSetConfiguration>': TypeInfo(TypeOf.Class, create:() => <AnalysisPortfolioEventSetConfiguration>[]),
    'TransactionType': TypeInfo(TypeOf.Enum, enumValues:TransactionType.values),
    'AnalysisPortfolioAllocation': TypeInfo(TypeOf.Class, create:() => AnalysisPortfolioAllocation()),
    'AnalysisDeal': TypeInfo(TypeOf.Class, create:() => AnalysisDeal()),
    'List<AnalysisPortfolioAllocation>': TypeInfo(TypeOf.Class, create:() => <AnalysisPortfolioAllocation>[]),
    'AnalysisEventIdFilter': TypeInfo(TypeOf.Class, create:() => AnalysisEventIdFilter()),
    'MessageType': TypeInfo(TypeOf.Enum, enumValues:MessageType.values),
    'MessageTracking': TypeInfo(TypeOf.Class, create:() => MessageTracking()),
    'Analysis': TypeInfo(TypeOf.Class, create:() => Analysis()),
    'List<AnalysisConfiguration>': TypeInfo(TypeOf.Class, create:() => <AnalysisConfiguration>[]),
    'List<AnalysisDeal>': TypeInfo(TypeOf.Class, create:() => <AnalysisDeal>[]),
    'List<AnalysisEventIdFilter>': TypeInfo(TypeOf.Class, create:() => <AnalysisEventIdFilter>[]),
    'List<MessageTracking>': TypeInfo(TypeOf.Class, create:() => <MessageTracking>[]),
    'AnalysisType': TypeInfo(TypeOf.Enum, enumValues:AnalysisType.values),
    'SimulationLossPerspective': TypeInfo(TypeOf.Enum, enumValues:SimulationLossPerspective.values),
    'ReinsurancePremiumLossType': TypeInfo(TypeOf.Enum, enumValues:ReinsurancePremiumLossType.values),
    'AnalysisPortfolioMetric': TypeInfo(TypeOf.Class, create:() => AnalysisPortfolioMetric()),
    'AnalysisPortfolioEventSetResult': TypeInfo(TypeOf.Class, create:() => AnalysisPortfolioEventSetResult()),
    'AnalysisResult': TypeInfo(TypeOf.Class, create:() => AnalysisResult()),
    'List<AnalysisPortfolioEventSetResult>': TypeInfo(TypeOf.Class, create:() => <AnalysisPortfolioEventSetResult>[]),
    'RollupResponse': TypeInfo(TypeOf.Class, create:() => RollupResponse()),
    'List<AnalysisPortfolioMetric>': TypeInfo(TypeOf.Class, create:() => <AnalysisPortfolioMetric>[]),
    'List<AnalysisResult>': TypeInfo(TypeOf.Class, create:() => <AnalysisResult>[]),
    'List<ValueTuple<String,String>>': TypeInfo(TypeOf.Class, create:() => <ValueTuple<String,String>>[]),
    'ValueTuple<String,String>': TypeInfo(TypeOf.Class, create:() => ValueTuple<String,String>()),
    'SaveAnalysisResultsRequest': TypeInfo(TypeOf.Class, create:() => SaveAnalysisResultsRequest()),
});

Dart SaveAnalysisResultsRequest 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 /api/riskstore/rollup/save-rollup-results HTTP/1.1 
Host: riskstoreng-dev.nephila.com 
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length

{
	analysisId: 0
}
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length

{
	analysis: 
	{
		id: 0,
		name: String,
		modelAsOfDate: 0001-01-01,
		perspectiveId: 0,
		configurations: 
		[
			{
				id: 0,
				analysisId: 0,
				windowStartDate: 0001-01-01,
				windowEndDate: 0001-01-01,
				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-01,
				expiryDate: 0001-01-01,
				transactionType: NotSet,
				allocations: 
				[
					{
						id: 0,
						analysisDealId: 0,
						portfolioName: String,
						allocationPercentage: 0,
						rowIdentifier: 00000000000000000000000000000000
					}
				],
				perspectiveIdOverride: 0,
				eventSetIdOverride: 0,
				modelAsOfDateOverride: 0001-01-01,
				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-01,
		completedDateUtc: 0001-01-01,
		legacyAnalysisId: 0,
		resultPersistenceTracking: 
		[
			{
				id: 00000000000000000000000000000000,
				analysisId: 0,
				processingStatus: New,
				messageType: NotSet,
				createdDateUtc: 0001-01-01,
				updatedDateUtc: 0001-01-01
			}
		],
		processingStatus: New,
		saveResults: False,
		eventSourceSystem: String,
		updatedDateUtc: 0001-01-01,
		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: 
	{
		errorCode: String,
		message: String,
		stackTrace: String,
		errors: 
		[
			{
				errorCode: String,
				fieldName: String,
				message: String,
				meta: 
				{
					String: String
				}
			}
		],
		meta: 
		{
			String: String
		}
	},
	unresolvedDealIds: 
	[
		String
	],
	unlinkedDealIds: 
	[
		"(, )"
	],
	message: String
}