forked from Adyen/adyen-dotnet-api-library
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBalanceAccount.cs
386 lines (359 loc) · 19.6 KB
/
BalanceAccount.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
/*
* Configuration webhooks
*
*
* The version of the OpenAPI document: 1
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.IO;
using System.Runtime.Serialization;
using System.Text;
using System.Text.RegularExpressions;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using Newtonsoft.Json.Linq;
using System.ComponentModel.DataAnnotations;
using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter;
namespace Adyen.Model.ConfigurationWebhooks
{
/// <summary>
/// BalanceAccount
/// </summary>
[DataContract(Name = "BalanceAccount")]
public partial class BalanceAccount : IEquatable<BalanceAccount>, IValidatableObject
{
/// <summary>
/// The status of the balance account, set to **Active** by default.
/// </summary>
/// <value>The status of the balance account, set to **Active** by default. </value>
[JsonConverter(typeof(StringEnumConverter))]
public enum StatusEnum
{
/// <summary>
/// Enum Active for value: Active
/// </summary>
[EnumMember(Value = "Active")]
Active = 1,
/// <summary>
/// Enum Closed for value: Closed
/// </summary>
[EnumMember(Value = "Closed")]
Closed = 2,
/// <summary>
/// Enum Inactive for value: Inactive
/// </summary>
[EnumMember(Value = "Inactive")]
Inactive = 3,
/// <summary>
/// Enum Suspended for value: Suspended
/// </summary>
[EnumMember(Value = "Suspended")]
Suspended = 4
}
/// <summary>
/// The status of the balance account, set to **Active** by default.
/// </summary>
/// <value>The status of the balance account, set to **Active** by default. </value>
[DataMember(Name = "status", EmitDefaultValue = false)]
public StatusEnum? Status { get; set; }
/// <summary>
/// Initializes a new instance of the <see cref="BalanceAccount" /> class.
/// </summary>
[JsonConstructorAttribute]
protected BalanceAccount() { }
/// <summary>
/// Initializes a new instance of the <see cref="BalanceAccount" /> class.
/// </summary>
/// <param name="accountHolderId">The unique identifier of the [account holder](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/post/accountHolders__resParam_id) associated with the balance account. (required).</param>
/// <param name="balances">List of balances with the amount and currency..</param>
/// <param name="defaultCurrencyCode">The default three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes) of the balance account. The default value is **EUR**. > After a balance account is created, you cannot change its default currency..</param>
/// <param name="description">A human-readable description of the balance account, maximum 300 characters. You can use this parameter to distinguish between multiple balance accounts under an account holder..</param>
/// <param name="id">The unique identifier of the balance account. (required).</param>
/// <param name="metadata">A set of key and value pairs for general use. The keys do not have specific names and may be used for storing miscellaneous data as desired. > Note that during an update of metadata, the omission of existing key-value pairs will result in the deletion of those key-value pairs..</param>
/// <param name="migratedAccountCode">The unique identifier of the account of the migrated account holder in the classic integration..</param>
/// <param name="paymentInstruments">List of [payment instruments](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/post/paymentInstruments) associated with the balance account..</param>
/// <param name="platformPaymentConfiguration">platformPaymentConfiguration.</param>
/// <param name="reference">Your reference for the balance account, maximum 150 characters..</param>
/// <param name="status">The status of the balance account, set to **Active** by default. .</param>
/// <param name="timeZone">The time zone of the balance account. For example, **Europe/Amsterdam**. Defaults to the time zone of the account holder if no time zone is set. For possible values, see the [list of time zone codes](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones)..</param>
public BalanceAccount(string accountHolderId = default(string), List<Balance> balances = default(List<Balance>), string defaultCurrencyCode = default(string), string description = default(string), string id = default(string), Dictionary<string, string> metadata = default(Dictionary<string, string>), string migratedAccountCode = default(string), List<PaymentInstrumentReference> paymentInstruments = default(List<PaymentInstrumentReference>), PlatformPaymentConfiguration platformPaymentConfiguration = default(PlatformPaymentConfiguration), string reference = default(string), StatusEnum? status = default(StatusEnum?), string timeZone = default(string))
{
this.AccountHolderId = accountHolderId;
this.Id = id;
this.Balances = balances;
this.DefaultCurrencyCode = defaultCurrencyCode;
this.Description = description;
this.Metadata = metadata;
this.MigratedAccountCode = migratedAccountCode;
this.PaymentInstruments = paymentInstruments;
this.PlatformPaymentConfiguration = platformPaymentConfiguration;
this.Reference = reference;
this.Status = status;
this.TimeZone = timeZone;
}
/// <summary>
/// The unique identifier of the [account holder](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/post/accountHolders__resParam_id) associated with the balance account.
/// </summary>
/// <value>The unique identifier of the [account holder](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/post/accountHolders__resParam_id) associated with the balance account.</value>
[DataMember(Name = "accountHolderId", IsRequired = false, EmitDefaultValue = false)]
public string AccountHolderId { get; set; }
/// <summary>
/// List of balances with the amount and currency.
/// </summary>
/// <value>List of balances with the amount and currency.</value>
[DataMember(Name = "balances", EmitDefaultValue = false)]
public List<Balance> Balances { get; set; }
/// <summary>
/// The default three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes) of the balance account. The default value is **EUR**. > After a balance account is created, you cannot change its default currency.
/// </summary>
/// <value>The default three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes) of the balance account. The default value is **EUR**. > After a balance account is created, you cannot change its default currency.</value>
[DataMember(Name = "defaultCurrencyCode", EmitDefaultValue = false)]
public string DefaultCurrencyCode { get; set; }
/// <summary>
/// A human-readable description of the balance account, maximum 300 characters. You can use this parameter to distinguish between multiple balance accounts under an account holder.
/// </summary>
/// <value>A human-readable description of the balance account, maximum 300 characters. You can use this parameter to distinguish between multiple balance accounts under an account holder.</value>
[DataMember(Name = "description", EmitDefaultValue = false)]
public string Description { get; set; }
/// <summary>
/// The unique identifier of the balance account.
/// </summary>
/// <value>The unique identifier of the balance account.</value>
[DataMember(Name = "id", IsRequired = false, EmitDefaultValue = false)]
public string Id { get; set; }
/// <summary>
/// A set of key and value pairs for general use. The keys do not have specific names and may be used for storing miscellaneous data as desired. > Note that during an update of metadata, the omission of existing key-value pairs will result in the deletion of those key-value pairs.
/// </summary>
/// <value>A set of key and value pairs for general use. The keys do not have specific names and may be used for storing miscellaneous data as desired. > Note that during an update of metadata, the omission of existing key-value pairs will result in the deletion of those key-value pairs.</value>
[DataMember(Name = "metadata", EmitDefaultValue = false)]
public Dictionary<string, string> Metadata { get; set; }
/// <summary>
/// The unique identifier of the account of the migrated account holder in the classic integration.
/// </summary>
/// <value>The unique identifier of the account of the migrated account holder in the classic integration.</value>
[DataMember(Name = "migratedAccountCode", EmitDefaultValue = false)]
public string MigratedAccountCode { get; set; }
/// <summary>
/// List of [payment instruments](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/post/paymentInstruments) associated with the balance account.
/// </summary>
/// <value>List of [payment instruments](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/post/paymentInstruments) associated with the balance account.</value>
[DataMember(Name = "paymentInstruments", EmitDefaultValue = false)]
public List<PaymentInstrumentReference> PaymentInstruments { get; set; }
/// <summary>
/// Gets or Sets PlatformPaymentConfiguration
/// </summary>
[DataMember(Name = "platformPaymentConfiguration", EmitDefaultValue = false)]
public PlatformPaymentConfiguration PlatformPaymentConfiguration { get; set; }
/// <summary>
/// Your reference for the balance account, maximum 150 characters.
/// </summary>
/// <value>Your reference for the balance account, maximum 150 characters.</value>
[DataMember(Name = "reference", EmitDefaultValue = false)]
public string Reference { get; set; }
/// <summary>
/// The time zone of the balance account. For example, **Europe/Amsterdam**. Defaults to the time zone of the account holder if no time zone is set. For possible values, see the [list of time zone codes](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones).
/// </summary>
/// <value>The time zone of the balance account. For example, **Europe/Amsterdam**. Defaults to the time zone of the account holder if no time zone is set. For possible values, see the [list of time zone codes](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones).</value>
[DataMember(Name = "timeZone", EmitDefaultValue = false)]
public string TimeZone { get; set; }
/// <summary>
/// Returns the string presentation of the object
/// </summary>
/// <returns>String presentation of the object</returns>
public override string ToString()
{
StringBuilder sb = new StringBuilder();
sb.Append("class BalanceAccount {\n");
sb.Append(" AccountHolderId: ").Append(AccountHolderId).Append("\n");
sb.Append(" Balances: ").Append(Balances).Append("\n");
sb.Append(" DefaultCurrencyCode: ").Append(DefaultCurrencyCode).Append("\n");
sb.Append(" Description: ").Append(Description).Append("\n");
sb.Append(" Id: ").Append(Id).Append("\n");
sb.Append(" Metadata: ").Append(Metadata).Append("\n");
sb.Append(" MigratedAccountCode: ").Append(MigratedAccountCode).Append("\n");
sb.Append(" PaymentInstruments: ").Append(PaymentInstruments).Append("\n");
sb.Append(" PlatformPaymentConfiguration: ").Append(PlatformPaymentConfiguration).Append("\n");
sb.Append(" Reference: ").Append(Reference).Append("\n");
sb.Append(" Status: ").Append(Status).Append("\n");
sb.Append(" TimeZone: ").Append(TimeZone).Append("\n");
sb.Append("}\n");
return sb.ToString();
}
/// <summary>
/// Returns the JSON string presentation of the object
/// </summary>
/// <returns>JSON string presentation of the object</returns>
public virtual string ToJson()
{
return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented);
}
/// <summary>
/// Returns true if objects are equal
/// </summary>
/// <param name="input">Object to be compared</param>
/// <returns>Boolean</returns>
public override bool Equals(object input)
{
return this.Equals(input as BalanceAccount);
}
/// <summary>
/// Returns true if BalanceAccount instances are equal
/// </summary>
/// <param name="input">Instance of BalanceAccount to be compared</param>
/// <returns>Boolean</returns>
public bool Equals(BalanceAccount input)
{
if (input == null)
{
return false;
}
return
(
this.AccountHolderId == input.AccountHolderId ||
(this.AccountHolderId != null &&
this.AccountHolderId.Equals(input.AccountHolderId))
) &&
(
this.Balances == input.Balances ||
this.Balances != null &&
input.Balances != null &&
this.Balances.SequenceEqual(input.Balances)
) &&
(
this.DefaultCurrencyCode == input.DefaultCurrencyCode ||
(this.DefaultCurrencyCode != null &&
this.DefaultCurrencyCode.Equals(input.DefaultCurrencyCode))
) &&
(
this.Description == input.Description ||
(this.Description != null &&
this.Description.Equals(input.Description))
) &&
(
this.Id == input.Id ||
(this.Id != null &&
this.Id.Equals(input.Id))
) &&
(
this.Metadata == input.Metadata ||
this.Metadata != null &&
input.Metadata != null &&
this.Metadata.SequenceEqual(input.Metadata)
) &&
(
this.MigratedAccountCode == input.MigratedAccountCode ||
(this.MigratedAccountCode != null &&
this.MigratedAccountCode.Equals(input.MigratedAccountCode))
) &&
(
this.PaymentInstruments == input.PaymentInstruments ||
this.PaymentInstruments != null &&
input.PaymentInstruments != null &&
this.PaymentInstruments.SequenceEqual(input.PaymentInstruments)
) &&
(
this.PlatformPaymentConfiguration == input.PlatformPaymentConfiguration ||
(this.PlatformPaymentConfiguration != null &&
this.PlatformPaymentConfiguration.Equals(input.PlatformPaymentConfiguration))
) &&
(
this.Reference == input.Reference ||
(this.Reference != null &&
this.Reference.Equals(input.Reference))
) &&
(
this.Status == input.Status ||
this.Status.Equals(input.Status)
) &&
(
this.TimeZone == input.TimeZone ||
(this.TimeZone != null &&
this.TimeZone.Equals(input.TimeZone))
);
}
/// <summary>
/// Gets the hash code
/// </summary>
/// <returns>Hash code</returns>
public override int GetHashCode()
{
unchecked // Overflow is fine, just wrap
{
int hashCode = 41;
if (this.AccountHolderId != null)
{
hashCode = (hashCode * 59) + this.AccountHolderId.GetHashCode();
}
if (this.Balances != null)
{
hashCode = (hashCode * 59) + this.Balances.GetHashCode();
}
if (this.DefaultCurrencyCode != null)
{
hashCode = (hashCode * 59) + this.DefaultCurrencyCode.GetHashCode();
}
if (this.Description != null)
{
hashCode = (hashCode * 59) + this.Description.GetHashCode();
}
if (this.Id != null)
{
hashCode = (hashCode * 59) + this.Id.GetHashCode();
}
if (this.Metadata != null)
{
hashCode = (hashCode * 59) + this.Metadata.GetHashCode();
}
if (this.MigratedAccountCode != null)
{
hashCode = (hashCode * 59) + this.MigratedAccountCode.GetHashCode();
}
if (this.PaymentInstruments != null)
{
hashCode = (hashCode * 59) + this.PaymentInstruments.GetHashCode();
}
if (this.PlatformPaymentConfiguration != null)
{
hashCode = (hashCode * 59) + this.PlatformPaymentConfiguration.GetHashCode();
}
if (this.Reference != null)
{
hashCode = (hashCode * 59) + this.Reference.GetHashCode();
}
hashCode = (hashCode * 59) + this.Status.GetHashCode();
if (this.TimeZone != null)
{
hashCode = (hashCode * 59) + this.TimeZone.GetHashCode();
}
return hashCode;
}
}
/// <summary>
/// To validate all properties of the instance
/// </summary>
/// <param name="validationContext">Validation context</param>
/// <returns>Validation Result</returns>
public IEnumerable<System.ComponentModel.DataAnnotations.ValidationResult> Validate(ValidationContext validationContext)
{
// Description (string) maxLength
if (this.Description != null && this.Description.Length > 300)
{
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Description, length must be less than 300.", new [] { "Description" });
}
// Reference (string) maxLength
if (this.Reference != null && this.Reference.Length > 150)
{
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Reference, length must be less than 150.", new [] { "Reference" });
}
yield break;
}
}
}