2using System.Collections.Generic;
4using System.Runtime.Serialization;
14#pragma warning disable IDE1006
21 #region Private Fields
27 #endregion Private Fields
29 #region Public Properties
56 #endregion Public Properties
58 #region Public Metrics Requests
92 #endregion Tail Metrics
94 #region Window Metrics
124 #endregion Window Metrics
164 #region Private Helper Methods
176 .AddQueryParameter(
"component_id", component.ref_id)
194 "LayerView or PortfolioView type. Supplied reference was of type: " +
198 #endregion Private Helper Methods
199 #endregion Co-Metrics
201 #region Exceedance Probability
215 new ExceedanceProbRequest(threshold),
options.GetParameters(),
timeout);
234 #endregion Exceedance Probability
236 #region Back Allocation
250 [
Obsolete(
"POST a BackAllocatedLayer structure instead.")]
255 new BackAllocationsRequest(),
258 #endregion Back Allocation
259 #endregion Public Metrics Requests
264 base.AfterMembersCloned(
_);
269 #region Helper Methods
275 if (values ==
null || values.Count == 0)
280 return values.Count == 1 ?
290 if (values ==
null || values.Count == 0)
295 return values.Count == 1 ?
299 #endregion Helper Methods
301 #region Request SubResources
304 internal class WindowMetricsRequest : ResourcePathBuilder
306 private const string SERVER_ENDPOINT_NAME =
"window_metrics";
307 protected override string base_path => SERVER_ENDPOINT_NAME;
316 internal class CoMetricsRequest : ResourcePathBuilder
318 private const string SERVER_ENDPOINT_NAME =
"window_co_metrics";
319 protected override string base_path => SERVER_ENDPOINT_NAME;
328 internal class ExceedanceProbRequest : ResourcePathBuilder
330 private const string SERVER_ENDPOINT_NAME =
"exceedance_probabilities";
331 protected override string base_path => SERVER_ENDPOINT_NAME;
333 public ExceedanceProbRequest(
double threshold) :
base(threshold) { }
340 internal class BackAllocationsRequest : ResourcePathBuilder
342 private const string SERVER_ENDPOINT_NAME =
"back_allocations";
343 protected override string base_path => SERVER_ENDPOINT_NAME;
345 #endregion Request SubResources
348 #region Deprecated Public Methods
359 [
Obsolete(
"Please provide a ProbabilityWindow rather than a double tail-probability. " +
360 "This legacy method was less flexible and only returned the co-tail-metrics.")]
378 [
Obsolete(
"Please provide a list of ProbabilityWindows rather than doubles. " +
379 "This legacy method was less flexible and only returned the co-tail-metrics.")]
386 #endregion Deprecated Public Methods
PortfolioView and LayerView abstract base class.
WindowMetrics window_metrics(ProbabilityWindow range, MetricsOptions options=null, int? timeout=null)
Returns the window metrics of this view for a given probability range.
List< ExceedanceProbability > exceedance_probability(IEnumerable< double > thresholds, ExceedanceProbabilityOptions options=null, int? timeout=null)
Returns the exceedance probability for this view for the given losses. That is, the probability the s...
ExceedanceProbability exceedance_probability(double threshold, ExceedanceProbabilityOptions options=null, int? timeout=null)
Returns the exceedance probability for this view for the given loss. That is, the probability the spe...
List< TailMetrics > tail_metrics(IEnumerable< double > probabilities, MetricsOptions options=null, int? timeout=null)
Returns the tail metrics of this view at multiple probabilities.
YLTSimulationResult ylt
Allows retrieval of the YLT (Year Loss Table) associated with this view once it has been simulated.
string ylt_id
The hash identifier for the simulation results of this view.
BackAllocations back_allocations(string source_id, int? timeout=null)
Returns a URL to the YELT of this view back-allocated to some component loss source.
string target_currency
The currency this view's YLTs are stored in, and the default currency results are returned in....
YELTSimulationResult yelt
Allows retrieval of the YELT (Year Event Loss Table) associated with this view once it has been simul...
List< WindowMetrics > window_metrics(IEnumerable< ProbabilityWindow > ranges, MetricsOptions options=null, int? timeout=null)
Returns the window metrics of this view for multiple probability ranges.
override void AfterMembersCloned(APIType _)
Invoked following construction if the current instance has been created using a member-wise clone of ...
TailMetrics tail_metrics(double probability, MetricsOptions options=null, int? timeout=null)
Returns the tail metrics of this view at a given probability.
CoMetrics co_metrics< T >(ProbabilityWindow range, IReference< T > component, CoMetricsOptions options=null, int? timeout=null)
Returns the co-metrics of this view for a given probability range.
IReference< AnalysisProfile > analysis_profile
The simulation's analysis profile.
Attribute used to define the default value assigned to the target_currency property by the server whe...
A pass-through to the yelt endpoint for configuring and downloading a per-trial simulation result fro...
A pass-through to the ylt endpoint for configuring and downloading a per-trial simulation result from...
Base class used by all resources.
Base class used by all types and resources.
Describes a collection of resources which can be listed.
Specifies that a property is generated by the server and should not be specified on the client side d...
The structure returned when requesting back-allocated metrics for a view.
Optional parameters which can be specified for co-metrics requests.
static new CoMetricsOptions Default
The default co-metrics request options used when none are specified.
The structure returned when requesting Co-Metrics for a view.
Optional parameters which can be specified for exceedance probability requests.
static new ExceedanceProbabilityOptions Default
The default exceedance probability request options used when none are specified.
The structure returned when requesting Exceedance Probability for a view.
Optional parameters which can be specified for all metrics requests.
static new MetricsOptions Default
The default metrics request options used when none are specified.
The structure returned when requesting Tail Metrics for a view.
The structure returned when requesting Window Metrics for a view, containing the core window distribu...
Represents the Analysis of a Portfolio.
A probability range used to dictate the set of ordered trial losses in a loss distribution that shoul...
static ProbabilityWindow Tail(double tail_probability)
Returns a window representing the tail probability range [0, tail_probability], such that all losses ...
Helper class which makes it easier to build a set of request parameters.
PortfolioView and LayerView interface.
Represents the Analysis of a Layer.