| POST | /api/riskstore/eventset/deal-expected-loss | Get the deals expected losses by metarisk |
|---|
using System;
using System.IO;
using System.Collections;
using System.Collections.Generic;
using System.Runtime.Serialization;
using ServiceStack;
using ServiceStack.DataAnnotations;
using Nephila.RiskStore.ServiceModel.Requests;
using Nephila.RiskStore.ServiceModel.Types;
namespace Nephila.RiskStore.ServiceModel.Requests
{
public partial class GetDealExpectedLossRequest
: IPost
{
///<summary>
///The source deal system (IGN) to get the date for
///</summary>
[ApiMember(DataType="string", Description="The source deal system (IGN) to get the date for", IsRequired=true)]
public virtual string SourceDealSystem { get; set; }
///<summary>
///The as of date to query
///</summary>
[ApiMember(DataType="string", Description="The as of date to query", Format="date-time")]
public virtual DateTime? AsOf { get; set; }
///<summary>
///The metarisks to query for
///</summary>
[ApiMember(DataType="array", Description="The metarisks to query for", Format="int32", IsRequired=true)]
public virtual List<int> MetaRiskIds { get; set; } = [];
///<summary>
///The perspectives to query for
///</summary>
[ApiMember(DataType="array", Description="The perspectives to query for", Format="int32")]
public virtual List<int> PerspectiveIds { get; set; }
///<summary>
///The perspectives types to query for (0 - Vendor, 10 - Nephila 1.0, 16 - Nephila 2.0 etc...)
///</summary>
[ApiMember(DataType="array", Description="The perspectives types to query for (0 - Vendor, 10 - Nephila 1.0, 16 - Nephila 2.0 etc...)", Format="int32")]
public virtual List<int> PerspectiveTypeIds { get; set; }
///<summary>
///The source deal ids to query for
///</summary>
[ApiMember(DataType="array", Description="The source deal ids to query for", Format="int64", IsRequired=true)]
public virtual List<long> SourceDealIds { get; set; } = [];
}
public partial class GetDealExpectedLossResponse
{
public virtual List<DealExpectedLoss> DealExpectedLosses { get; set; }
public virtual ResponseStatus ResponseStatus { get; set; }
}
}
namespace Nephila.RiskStore.ServiceModel.Types
{
public partial class DealExpectedLoss
{
public virtual long SourceDealId { get; set; }
public virtual int PerspectiveId { get; set; }
public virtual int MetaRiskId { get; set; }
public virtual decimal ELAgg { get; set; }
public virtual decimal ELOcc { get; set; }
public virtual decimal PAtt { get; set; }
public virtual decimal PExh { get; set; }
}
}
C# GetDealExpectedLossRequest DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .jsv suffix or ?format=jsv
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/jsv
Content-Type: text/jsv
Content-Length: length
{
sourceDealSystem: String,
asOf: 0001-01-01,
metaRiskIds:
[
0
],
perspectiveIds:
[
0
],
perspectiveTypeIds:
[
0
],
sourceDealIds:
[
0
]
}
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length
{
dealExpectedLosses:
[
{
sourceDealId: 0,
perspectiveId: 0,
metaRiskId: 0,
elAgg: 0,
elOcc: 0,
pAtt: 0,
pExh: 0
}
],
responseStatus:
{
errorCode: String,
message: String,
stackTrace: String,
errors:
[
{
errorCode: String,
fieldName: String,
message: String,
meta:
{
String: String
}
}
],
meta:
{
String: String
}
}
}