C# Client Library
A C# Client Library for the AnalyzeRe REST API
Loading...
Searching...
No Matches
LossSet.cs
Go to the documentation of this file.
1using System;
2using System.Runtime.Serialization;
6
7// ReSharper disable once CheckNamespace (Type is common enough to be on root namespace)
8namespace AnalyzeRe
9{
13 {
16 {
18 public LossTypeDefault() : base(true) { }
19
21 public override object GetDefaultValue(object owner) =>
23 throw new ArgumentException("This attribute should only be used within LossSets.");
24
28 {
29 // By default, YLTLossSets are treated as Net
30 return lossSet is YLTLossSet ? LossType.LossNetOfAggregateTerms :
31 // Loaded loss sets inherit their default loss type from their source
32 lossSet is LoadedLossSet loaded && loaded.source.GetValue()
34 // All other loss sets default to Gross
35 LossType.LossGross;
36 }
37 }
38
39 #region APIResource Interface Members
41 public static readonly string CLASS_COLLECTION_NAME = "loss_sets";
44 public override string collection_name => CLASS_COLLECTION_NAME;
45 #endregion APIResource Interface Members
46
47 #region Public Properties
51 [DataMember(Order = 12)]
53 public LossType? loss_type { get; set; }
54
56 [DataMember(Order = 13)]
58 public LossSetProfile profile { get; set; }
59 #endregion Public Properties
60 }
61}
Describes a collection of resources which can be listed.
Stored resource that is polymorphic (has more than one sub-type).
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...
Attribute used to define the default value for the loss_type property.
Definition LossSet.cs:16
LossTypeDefault()
Attribute used to define the default value for the loss_type property.
Definition LossSet.cs:18
static LossType GetDefaultLossTypeForLossSet(ILossSet lossSet)
Indicates what the default loss type would be for a given loss set.
Definition LossSet.cs:27
override object GetDefaultValue(object owner)
Returns the expected default value for the property based on the owner.The expected default value for...
Base class for all LossSet sub-types. A LossSet is a resource that generates sample (trial) losses wh...
Definition LossSet.cs:13
override string collection_name
The collection endpoint at which resources of this type reside on the server.
Definition LossSet.cs:44
LossSetProfile profile
A profile of this loss set, generated by the server after post.
Definition LossSet.cs:58
static readonly string CLASS_COLLECTION_NAME
The collection endpoint at which resources of this type reside on the server.
Definition LossSet.cs:41
LossType? loss_type
Indicates what types of losses are generated by this loss set. If not specified the server will defau...
Definition LossSet.cs:53
Representation of a Loaded loss set, whose losses are derived from an existing loss set and applies a...
A profile of this loss set, containing server generated meta data about its contents.
Representation of a loss set with an associated simulated yearly losses table.
Definition YLTLossSet.cs:11
Base Interface for all loss sets.
Definition ILossSet.cs:11
LossType
Indicates what types of losses are generated by this loss set.
Definition LossType.cs:5