C# Client Library
A C# Client Library for the AnalyzeRe REST API
LossSet.cs
Go to the documentation of this file.
1 using System.Runtime.Serialization;
2 using AnalyzeRe.APITypes;
4 using AnalyzeRe.LossSets;
5 
6 // ReSharper disable once CheckNamespace (Type is common enough to be on root namespace)
7 namespace AnalyzeRe
8 {
11  public abstract class LossSet : StoredAPIResource_Polymorphic
12  {
14  private class LossTypeDefault : ServerHasDefault
15  {
16  public LossTypeDefault() : base(true) { }
17 
18  public override object GetDefaultValue(object owner)
19  {
20  return owner is YLTLossSet ? LossType.LossNetOfAggregateTerms :
21  owner is LoadedLossSet loaded && loaded.source.GetValue()
22  is LossSet sourceLs ? sourceLs.loss_type ?? GetDefaultValue(sourceLs) :
23  LossType.LossGross;
24  }
25  }
26 
27  #region APIResource Interface Members
28  public static readonly string CLASS_COLLECTION_NAME = "loss_sets";
31  [IgnoreDataMember]
32  public override string collection_name => CLASS_COLLECTION_NAME;
33  #endregion APIResource Interface Members
34 
35  #region Public Properties
36  [DataMember(Order = 12)]
40  [LossTypeDefault]
41  public LossType? loss_type { get; set; }
42 
44  [DataMember(Order = 13)]
46  public LossSetProfile profile { get; set; }
47  #endregion Public Properties
48  }
49 }
A profile of this loss set, containing server generated meta data about its contents.
LossSetProfile profile
A profile of this loss set, generated by the server after post.
Definition: LossSet.cs:46
Stored resource that is polymorphic (has more than one sub-type).
LossType loss_type
Indicates what types of losses are generated by this loss set. If not specified the server will defau...
Definition: LossSet.cs:41
Representation of a loss set with an associated simulated yearly losses table.
Definition: YLTLossSet.cs:10
override string collection_name
The collection endpoint at which resources of this type reside on the server.
Definition: LossSet.cs:32
Specifies that a property is generated by the server and should not be specified on the client side d...
Indicates that the property, if left null, will have a default value generated and filled in by the s...
Representation of a Loaded loss set, whose losses are derived from an existing loss set and applies a...
Definition: LoadedLossSet.cs:8
static readonly string CLASS_COLLECTION_NAME
The collection endpoint at which resources of this type reside on the server.
Definition: LossSet.cs:29
IReference< LossSet > source
The layer whose losses are being forwarded by this loss set.
Base class for all LossSet sub-types. A LossSet is a resource that generates sample (trial) losses wh...
Definition: LossSet.cs:11
LossType
Indicates what types of losses are generated by this loss set.
Definition: LossType.cs:4