| POST | /api/riskstore/eventset/ingest | Ingest EventSet Request | Ingest EventSet Request |
|---|
import 'package:servicestack/servicestack.dart';
enum ProcessingStatus
{
New,
Processing,
Failed,
Successful,
}
class EventSetTelemetry implements IConvertible
{
int? eventSetId;
DateTime? startedDateTimeUtc;
DateTime? endedDateTimeUct;
int? eventLossCount;
EventSetTelemetry({this.eventSetId,this.startedDateTimeUtc,this.endedDateTimeUct,this.eventLossCount});
EventSetTelemetry.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
eventSetId = json['eventSetId'];
startedDateTimeUtc = JsonConverters.fromJson(json['startedDateTimeUtc'],'DateTime',context!);
endedDateTimeUct = JsonConverters.fromJson(json['endedDateTimeUct'],'DateTime',context!);
eventLossCount = json['eventLossCount'];
return this;
}
Map<String, dynamic> toJson() => {
'eventSetId': eventSetId,
'startedDateTimeUtc': JsonConverters.toJson(startedDateTimeUtc,'DateTime',context!),
'endedDateTimeUct': JsonConverters.toJson(endedDateTimeUct,'DateTime',context!),
'eventLossCount': eventLossCount
};
getTypeName() => "EventSetTelemetry";
TypeContext? context = _ctx;
}
class EventSet implements IConvertible
{
int? eventSetId;
ProcessingStatus? processingStatus;
String? sourceModelSystem;
String? sourceEventSetId;
String? modelId;
int? perspectiveId;
int? simulationCount;
String? programCalculationId;
String? description;
double? limit;
int? reinstatements;
String? eventSourceType;
String? eventSetOriginId;
String? eventSetOriginName;
String? eventSetOriginType;
String? sourceEventSetLossContainer;
String? sourceEventSetLossPath;
String? resolution;
String? resultsHash;
double? expectedLossAggregate;
double? expectedLossOccurrence;
double? probabilityOfAttachment;
double? probabilityOfExhaustion;
DateTime? approvedDateTimeUtc;
String? approvedBy;
int? eventSourceId;
DateTime? validFromUtc;
DateTime? validToUtc;
String? container;
String? blobName;
DateTime? updatedDateUtc;
bool? isArchived;
String? archivedLossDataBlobPath;
String? archivedLossDataHash;
EventSetTelemetry? eventSetTelemetry;
EventSet({this.eventSetId,this.processingStatus,this.sourceModelSystem,this.sourceEventSetId,this.modelId,this.perspectiveId,this.simulationCount,this.programCalculationId,this.description,this.limit,this.reinstatements,this.eventSourceType,this.eventSetOriginId,this.eventSetOriginName,this.eventSetOriginType,this.sourceEventSetLossContainer,this.sourceEventSetLossPath,this.resolution,this.resultsHash,this.expectedLossAggregate,this.expectedLossOccurrence,this.probabilityOfAttachment,this.probabilityOfExhaustion,this.approvedDateTimeUtc,this.approvedBy,this.eventSourceId,this.validFromUtc,this.validToUtc,this.container,this.blobName,this.updatedDateUtc,this.isArchived,this.archivedLossDataBlobPath,this.archivedLossDataHash,this.eventSetTelemetry});
EventSet.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
eventSetId = json['eventSetId'];
processingStatus = JsonConverters.fromJson(json['processingStatus'],'ProcessingStatus',context!);
sourceModelSystem = json['sourceModelSystem'];
sourceEventSetId = json['sourceEventSetId'];
modelId = json['modelId'];
perspectiveId = json['perspectiveId'];
simulationCount = json['simulationCount'];
programCalculationId = json['programCalculationId'];
description = json['description'];
limit = JsonConverters.toDouble(json['limit']);
reinstatements = json['reinstatements'];
eventSourceType = json['eventSourceType'];
eventSetOriginId = json['eventSetOriginId'];
eventSetOriginName = json['eventSetOriginName'];
eventSetOriginType = json['eventSetOriginType'];
sourceEventSetLossContainer = json['sourceEventSetLossContainer'];
sourceEventSetLossPath = json['sourceEventSetLossPath'];
resolution = json['resolution'];
resultsHash = json['resultsHash'];
expectedLossAggregate = JsonConverters.toDouble(json['expectedLossAggregate']);
expectedLossOccurrence = JsonConverters.toDouble(json['expectedLossOccurrence']);
probabilityOfAttachment = JsonConverters.toDouble(json['probabilityOfAttachment']);
probabilityOfExhaustion = JsonConverters.toDouble(json['probabilityOfExhaustion']);
approvedDateTimeUtc = JsonConverters.fromJson(json['approvedDateTimeUtc'],'DateTime',context!);
approvedBy = json['approvedBy'];
eventSourceId = json['eventSourceId'];
validFromUtc = JsonConverters.fromJson(json['validFromUtc'],'DateTime',context!);
validToUtc = JsonConverters.fromJson(json['validToUtc'],'DateTime',context!);
container = json['container'];
blobName = json['blobName'];
updatedDateUtc = JsonConverters.fromJson(json['updatedDateUtc'],'DateTime',context!);
isArchived = json['isArchived'];
archivedLossDataBlobPath = json['archivedLossDataBlobPath'];
archivedLossDataHash = json['archivedLossDataHash'];
eventSetTelemetry = JsonConverters.fromJson(json['eventSetTelemetry'],'EventSetTelemetry',context!);
return this;
}
Map<String, dynamic> toJson() => {
'eventSetId': eventSetId,
'processingStatus': JsonConverters.toJson(processingStatus,'ProcessingStatus',context!),
'sourceModelSystem': sourceModelSystem,
'sourceEventSetId': sourceEventSetId,
'modelId': modelId,
'perspectiveId': perspectiveId,
'simulationCount': simulationCount,
'programCalculationId': programCalculationId,
'description': description,
'limit': limit,
'reinstatements': reinstatements,
'eventSourceType': eventSourceType,
'eventSetOriginId': eventSetOriginId,
'eventSetOriginName': eventSetOriginName,
'eventSetOriginType': eventSetOriginType,
'sourceEventSetLossContainer': sourceEventSetLossContainer,
'sourceEventSetLossPath': sourceEventSetLossPath,
'resolution': resolution,
'resultsHash': resultsHash,
'expectedLossAggregate': expectedLossAggregate,
'expectedLossOccurrence': expectedLossOccurrence,
'probabilityOfAttachment': probabilityOfAttachment,
'probabilityOfExhaustion': probabilityOfExhaustion,
'approvedDateTimeUtc': JsonConverters.toJson(approvedDateTimeUtc,'DateTime',context!),
'approvedBy': approvedBy,
'eventSourceId': eventSourceId,
'validFromUtc': JsonConverters.toJson(validFromUtc,'DateTime',context!),
'validToUtc': JsonConverters.toJson(validToUtc,'DateTime',context!),
'container': container,
'blobName': blobName,
'updatedDateUtc': JsonConverters.toJson(updatedDateUtc,'DateTime',context!),
'isArchived': isArchived,
'archivedLossDataBlobPath': archivedLossDataBlobPath,
'archivedLossDataHash': archivedLossDataHash,
'eventSetTelemetry': JsonConverters.toJson(eventSetTelemetry,'EventSetTelemetry',context!)
};
getTypeName() => "EventSet";
TypeContext? context = _ctx;
}
class IngestEventSetRequest implements IPost, IConvertible
{
EventSet? eventSet;
IngestEventSetRequest({this.eventSet});
IngestEventSetRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
eventSet = JsonConverters.fromJson(json['eventSet'],'EventSet',context!);
return this;
}
Map<String, dynamic> toJson() => {
'eventSet': JsonConverters.toJson(eventSet,'EventSet',context!)
};
getTypeName() => "IngestEventSetRequest";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'riskstoreng_dev.nephila.com', types: <String, TypeInfo> {
'ProcessingStatus': TypeInfo(TypeOf.Enum, enumValues:ProcessingStatus.values),
'EventSetTelemetry': TypeInfo(TypeOf.Class, create:() => EventSetTelemetry()),
'EventSet': TypeInfo(TypeOf.Class, create:() => EventSet()),
'IngestEventSetRequest': TypeInfo(TypeOf.Class, create:() => IngestEventSetRequest()),
});
Dart IngestEventSetRequest DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .json suffix or ?format=json
To embed the response in a jsonp callback, append ?callback=myCallback
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /api/riskstore/eventset/ingest HTTP/1.1
Host: riskstoreng-dev.nephila.com
Accept: application/json
Content-Type: application/json
Content-Length: length
{"eventSet":{"eventSetId":0,"processingStatus":"New","sourceModelSystem":"String","sourceEventSetId":"String","modelId":"String","perspectiveId":0,"simulationCount":0,"programCalculationId":"String","description":"String","limit":0,"reinstatements":0,"eventSourceType":"String","eventSetOriginId":"String","eventSetOriginName":"String","eventSetOriginType":"String","sourceEventSetLossContainer":"String","sourceEventSetLossPath":"String","resolution":"String","resultsHash":"String","expectedLossAggregate":0,"expectedLossOccurrence":0,"probabilityOfAttachment":0,"probabilityOfExhaustion":0,"approvedDateTimeUtc":"0001-01-01T00:00:00.0000000Z","approvedBy":"String","eventSourceId":0,"validFromUtc":"0001-01-01T00:00:00.0000000Z","validToUtc":"0001-01-01T00:00:00.0000000Z","container":"String","blobName":"String","updatedDateUtc":"0001-01-01T00:00:00.0000000Z","isArchived":false,"archivedLossDataBlobPath":"String","archivedLossDataHash":"String","eventSetTelemetry":{"eventSetId":0,"startedDateTimeUtc":"0001-01-01T00:00:00.0000000Z","endedDateTimeUct":"0001-01-01T00:00:00.0000000Z","eventLossCount":0}}}