Nephila RiskStore

<back to all web services

GetDealExpectedLossRequest

EventSets
Requires Authentication
The following routes are available for this service:
POST/api/riskstore/eventset/deal-expected-lossGet the deals expected losses by metarisk
import 'package:servicestack/servicestack.dart';

class DealExpectedLoss implements IConvertible
{
    int? sourceDealId;
    int? perspectiveId;
    int? metaRiskId;
    double? elAgg;
    double? elOcc;
    double? pAtt;
    double? pExh;

    DealExpectedLoss({this.sourceDealId,this.perspectiveId,this.metaRiskId,this.elAgg,this.elOcc,this.pAtt,this.pExh});
    DealExpectedLoss.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        sourceDealId = json['sourceDealId'];
        perspectiveId = json['perspectiveId'];
        metaRiskId = json['metaRiskId'];
        elAgg = JsonConverters.toDouble(json['elAgg']);
        elOcc = JsonConverters.toDouble(json['elOcc']);
        pAtt = JsonConverters.toDouble(json['pAtt']);
        pExh = JsonConverters.toDouble(json['pExh']);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'sourceDealId': sourceDealId,
        'perspectiveId': perspectiveId,
        'metaRiskId': metaRiskId,
        'elAgg': elAgg,
        'elOcc': elOcc,
        'pAtt': pAtt,
        'pExh': pExh
    };

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

class GetDealExpectedLossResponse implements IConvertible
{
    List<DealExpectedLoss>? dealExpectedLosses;
    ResponseStatus? responseStatus;

    GetDealExpectedLossResponse({this.dealExpectedLosses,this.responseStatus});
    GetDealExpectedLossResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        dealExpectedLosses = JsonConverters.fromJson(json['dealExpectedLosses'],'List<DealExpectedLoss>',context!);
        responseStatus = JsonConverters.fromJson(json['responseStatus'],'ResponseStatus',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'dealExpectedLosses': JsonConverters.toJson(dealExpectedLosses,'List<DealExpectedLoss>',context!),
        'responseStatus': JsonConverters.toJson(responseStatus,'ResponseStatus',context!)
    };

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

class GetDealExpectedLossRequest implements IPost, IConvertible
{
    /**
    * The source deal system (IGN) to get the date for
    */
    // @ApiMember(DataType="string", Description="The source deal system (IGN) to get the date for", IsRequired=true)
    String? sourceDealSystem;

    /**
    * The as of date to query
    */
    // @ApiMember(DataType="string", Description="The as of date to query", Format="date-time")
    DateTime? asOf;

    /**
    * The metarisks to query for
    */
    // @ApiMember(DataType="array", Description="The metarisks to query for", Format="int32", IsRequired=true)
    List<int>? metaRiskIds = [];

    /**
    * The perspectives to query for
    */
    // @ApiMember(DataType="array", Description="The perspectives to query for", Format="int32")
    List<int>? perspectiveIds;

    /**
    * The perspectives types to query for (0 - Vendor, 10 - Nephila 1.0, 16 - Nephila 2.0 etc...)
    */
    // @ApiMember(DataType="array", Description="The perspectives types to query for (0 - Vendor, 10 - Nephila 1.0, 16 - Nephila 2.0 etc...)", Format="int32")
    List<int>? perspectiveTypeIds;

    /**
    * The source deal ids to query for
    */
    // @ApiMember(DataType="array", Description="The source deal ids to query for", Format="int64", IsRequired=true)
    List<int>? sourceDealIds = [];

    GetDealExpectedLossRequest({this.sourceDealSystem,this.asOf,this.metaRiskIds,this.perspectiveIds,this.perspectiveTypeIds,this.sourceDealIds});
    GetDealExpectedLossRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        sourceDealSystem = json['sourceDealSystem'];
        asOf = JsonConverters.fromJson(json['asOf'],'DateTime',context!);
        metaRiskIds = JsonConverters.fromJson(json['metaRiskIds'],'List<int>',context!);
        perspectiveIds = JsonConverters.fromJson(json['perspectiveIds'],'List<int>',context!);
        perspectiveTypeIds = JsonConverters.fromJson(json['perspectiveTypeIds'],'List<int>',context!);
        sourceDealIds = JsonConverters.fromJson(json['sourceDealIds'],'List<int>',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'sourceDealSystem': sourceDealSystem,
        'asOf': JsonConverters.toJson(asOf,'DateTime',context!),
        'metaRiskIds': JsonConverters.toJson(metaRiskIds,'List<int>',context!),
        'perspectiveIds': JsonConverters.toJson(perspectiveIds,'List<int>',context!),
        'perspectiveTypeIds': JsonConverters.toJson(perspectiveTypeIds,'List<int>',context!),
        'sourceDealIds': JsonConverters.toJson(sourceDealIds,'List<int>',context!)
    };

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

TypeContext _ctx = TypeContext(library: 'riskstoreng_dev.nephila.com', types: <String, TypeInfo> {
    'DealExpectedLoss': TypeInfo(TypeOf.Class, create:() => DealExpectedLoss()),
    'GetDealExpectedLossResponse': TypeInfo(TypeOf.Class, create:() => GetDealExpectedLossResponse()),
    'List<DealExpectedLoss>': TypeInfo(TypeOf.Class, create:() => <DealExpectedLoss>[]),
    'GetDealExpectedLossRequest': TypeInfo(TypeOf.Class, create:() => GetDealExpectedLossRequest()),
});

Dart GetDealExpectedLossRequest DTOs

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

HTTP + OTHER

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

POST /api/riskstore/eventset/deal-expected-loss HTTP/1.1 
Host: riskstoreng-dev.nephila.com 
Accept: text/jsonl
Content-Type: text/jsonl
Content-Length: length

{"sourceDealSystem":"String","asOf":"0001-01-01T00:00:00.0000000Z","metaRiskIds":[0],"perspectiveIds":[0],"perspectiveTypeIds":[0],"sourceDealIds":[0]}
HTTP/1.1 200 OK
Content-Type: text/jsonl
Content-Length: length

{"dealExpectedLosses":[{"sourceDealId":0,"perspectiveId":0,"metaRiskId":0,"elAgg":0,"elOcc":0,"pAtt":0,"pExh":0}],"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"}}}