C# Client Library
A C# Client Library for the AnalyzeRe REST API
Loading...
Searching...
No Matches
SurplusShare.cs
Go to the documentation of this file.
1using System;
2using System.Runtime.Serialization;
4
5namespace AnalyzeRe.Layers
6{
9 {
10 #region Interface Implementation
13 [IgnoreDataMember]
14 MonetaryUnit ILayer_WithOccurrenceTerms.limit
15 {
16 get => sums_insured;
17 set => sums_insured = value;
18 }
19
22 [IgnoreDataMember]
23 MonetaryUnit ILayer_WithOccurrenceTerms.attachment
24 {
25 get => retained_line;
26 set => retained_line = value;
27 }
28 #endregion Interface Implementation
29
30 #region Public Properties
32 [DataMember(Order = 20)]
33 [NotNull]
34 // TODO: Bug ARE-5107 requires the GreaterThan attribute to be present.
35 [GreaterThan(Double.MinValue, true)]
36 [PropertyAlias(new[] { "limit", "occurrence limit", "occ limit", "event limit" })]
37 public MonetaryUnit sums_insured { get; set; }
38
42 [DataMember(Order = 21)]
43 [NotNull]
44 [GreaterThan(0, true)]
45 [PropertyAlias(new[] { "attachment", "retention", "deductible" })]
46 public MonetaryUnit retained_line { get; set; }
47
50 [DataMember(Order = 22)]
51 [GreaterThan(0, true)]
52 public double number_of_lines { get; set; }
53
54 #region participation
58 [DataMember(Name = "participation")]
59 private double? server_set_participation { get; set; }
60
67 [IgnoreDataMember, ServerGenerated]
68 [PropertyAlias(new[] { "participation", "share" })]
70 {
71 get
72 {
73 if (server_set_participation.HasValue)
74 return server_set_participation.Value;
75
76 // If these aren't specified, cannot compute the participation.
77 if (retained_line == null || sums_insured == null || sums_insured.value == 0d)
78 return Double.NaN;
79 // TODO: Conversion required if sums_insured.currency != retained_line.currency
81 throw new NotSupportedException("Participation cannot be computed client-side " +
82 "because the sums_insured and retained_line have different currencies. " +
83 "Please POST this resource to receive the server-computed participation.");
84
85 return Math.Max(0, Math.Min(Math.Abs(sums_insured.value) - retained_line.value,
88 }
89 }
90
98 [IgnoreDataMember, ServerGenerated, InternalMember]
99 public override double participation
100 {
102 set => throw new NotSupportedException("SurplusShare participation is automatically " +
103 "determined via the sums_insured, retained_line, and number_of_lines properties.");
104 }
105 #endregion participation
106 #endregion Public Properties
107 }
108}
Specifies one or more aliases to be used as synonyms for the property's name.
Specifies that a property is generated by the server and should not be specified on the client side d...
Abstract representation of a layer. This resource type cannot be instantiated instead derived resourc...
Representation of a Surplus Share contract.
MonetaryUnit sums_insured
The maximum amount to be covered by the Surplus Share per event occurrence.
double computed_participation
The calculated participation based on the sum insured.
override double participation
The calculated participation based on the sum insured. This inherited property has had its setter ove...
MonetaryUnit retained_line
The amount (of the sums_insured) that the primary or cedant will retain on a pro-rated basis....
double number_of_lines
The multiplier on the retained_line that determines the maximum amount of risk the reinsurer can take...
Representation of a monetary value with a currency.
string currency
3-letter currency code based on ISO 4217 (see: https://en.wikipedia.org/wiki/ISO_4217)
double value
The value of the monetary unit.
Abstract representation of a layer that has occurrence terms.