C# Client Library
A C# Client Library for the AnalyzeRe REST API
Loading...
Searching...
No Matches
DelayedPayment.cs
Go to the documentation of this file.
1using System;
2using System.Collections.Generic;
3using System.Runtime.Serialization;
4
6
7namespace AnalyzeRe.Layers
8{
35 {
37 public class Payment : APIType, IEquatable<Payment>
38 {
42 [DataMember(Order = 1)]
43 [NotNull]
44 public double? delay { get; set; }
45
49 [DataMember(Order = 2)]
50 [NotNull]
51 public double? amount { get; set; }
52
55 public Payment() { }
56
60 public Payment(double delayInDays, double amountAsFraction)
61 {
62 delay = delayInDays;
63 amount = amountAsFraction;
64 }
65
66 #region Equality Overrides
70 public bool Equals(Payment other) => ReferenceEquals(this, other) ||
71 other != null &&
72 delay.Equals(other.delay) &&
73 amount.Equals(other.amount);
74
78 public override bool Equals(object obj) =>
79 obj is Payment objPayment && Equals(objPayment);
80
83 public override int GetHashCode()
84 {
85 return new { delay, amount }.GetHashCode();
86 }
87 #endregion Equality Overrides
88 }
89
90 #region Public Properties
94 [DataMember(Order = 20)]
95 [NotEmpty, NotNull]
96 public List<Payment> payments { get; set; } = new List<Payment>();
97 #endregion Public Properties
98 }
99}
Base class used by all types and resources.
Definition APIType.cs:8
Describes a single payment, which consists of a delay and fracational amount.
double? delay
The payment delay (in days since the original occurrence date-time).
bool Equals(Payment other)
Determine if this Payment is equivalent to another.
override int GetHashCode()
Get the HashCode for this Payment.
Payment()
Instantiate a default Payment instance.
override bool Equals(object obj)
Determine if this Payment is equivalent to another.
Payment(double delayInDays, double amountAsFraction)
Instantiate a new Payment with the specified delay and amount.
double? amount
The payment amount (as a fraction of the original loss amount).
A "delayed payment" payment pattern models claims being paid in instalments at fixed delays after the...
List< Payment > payments
A list of payments to be generated for each occurrence. Each payment is described by a fractional Pay...
Abstract representation of a layer. This resource type cannot be instantiated instead derived resourc...