forked from Adyen/adyen-dotnet-api-library
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAccountHolder.cs
405 lines (377 loc) · 23.9 KB
/
AccountHolder.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
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
/*
* 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>
/// AccountHolder
/// </summary>
[DataContract(Name = "AccountHolder")]
public partial class AccountHolder : IEquatable<AccountHolder>, IValidatableObject
{
/// <summary>
/// The status of the account holder. Possible values: * **Active**: The account holder is active. This is the default status when creating an account holder. * **Inactive (Deprecated)**: The account holder is temporarily inactive due to missing KYC details. You can set the account back to active by providing the missing KYC details. * **Suspended**: The account holder is permanently deactivated by Adyen. This action cannot be undone. * **Closed**: The account holder is permanently deactivated by you. This action cannot be undone.
/// </summary>
/// <value>The status of the account holder. Possible values: * **Active**: The account holder is active. This is the default status when creating an account holder. * **Inactive (Deprecated)**: The account holder is temporarily inactive due to missing KYC details. You can set the account back to active by providing the missing KYC details. * **Suspended**: The account holder is permanently deactivated by Adyen. This action cannot be undone. * **Closed**: The account holder is permanently deactivated by you. This action cannot be undone.</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 account holder. Possible values: * **Active**: The account holder is active. This is the default status when creating an account holder. * **Inactive (Deprecated)**: The account holder is temporarily inactive due to missing KYC details. You can set the account back to active by providing the missing KYC details. * **Suspended**: The account holder is permanently deactivated by Adyen. This action cannot be undone. * **Closed**: The account holder is permanently deactivated by you. This action cannot be undone.
/// </summary>
/// <value>The status of the account holder. Possible values: * **Active**: The account holder is active. This is the default status when creating an account holder. * **Inactive (Deprecated)**: The account holder is temporarily inactive due to missing KYC details. You can set the account back to active by providing the missing KYC details. * **Suspended**: The account holder is permanently deactivated by Adyen. This action cannot be undone. * **Closed**: The account holder is permanently deactivated by you. This action cannot be undone.</value>
[DataMember(Name = "status", EmitDefaultValue = false)]
public StatusEnum? Status { get; set; }
/// <summary>
/// Initializes a new instance of the <see cref="AccountHolder" /> class.
/// </summary>
[JsonConstructorAttribute]
protected AccountHolder() { }
/// <summary>
/// Initializes a new instance of the <see cref="AccountHolder" /> class.
/// </summary>
/// <param name="balancePlatform">The unique identifier of the [balance platform](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/get/balancePlatforms/{id}__queryParam_id) to which the account holder belongs. Required in the request if your API credentials can be used for multiple balance platforms..</param>
/// <param name="capabilities">Contains key-value pairs that specify the actions that an account holder can do in your platform. The key is a capability required for your integration. For example, **issueCard** for Issuing. The value is an object containing the settings for the capability..</param>
/// <param name="contactDetails">contactDetails.</param>
/// <param name="description">Your description for the account holder, maximum 300 characters..</param>
/// <param name="id">The unique identifier of the account holder. (required).</param>
/// <param name="legalEntityId">The unique identifier of the [legal entity](https://docs.adyen.com/api-explorer/legalentity/latest/post/legalEntities#responses-200-id) associated with the account holder. Adyen performs a verification process against the legal entity of the account holder. (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="migratedAccountHolderCode">The unique identifier of the migrated account holder in the classic integration..</param>
/// <param name="primaryBalanceAccount">The ID of the account holder's primary balance account. By default, this is set to the first balance account that you create for the account holder. To assign a different balance account, send a PATCH request..</param>
/// <param name="reference">Your reference for the account holder, maximum 150 characters..</param>
/// <param name="status">The status of the account holder. Possible values: * **Active**: The account holder is active. This is the default status when creating an account holder. * **Inactive (Deprecated)**: The account holder is temporarily inactive due to missing KYC details. You can set the account back to active by providing the missing KYC details. * **Suspended**: The account holder is permanently deactivated by Adyen. This action cannot be undone. * **Closed**: The account holder is permanently deactivated by you. This action cannot be undone..</param>
/// <param name="timeZone">The time zone of the account holder. For example, **Europe/Amsterdam**. Defaults to the time zone of the balance platform 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>
/// <param name="verificationDeadlines">List of verification deadlines and the capabilities that will be disallowed if verification errors are not resolved..</param>
public AccountHolder(string balancePlatform = default(string), Dictionary<string, AccountHolderCapability> capabilities = default(Dictionary<string, AccountHolderCapability>), ContactDetails contactDetails = default(ContactDetails), string description = default(string), string id = default(string), string legalEntityId = default(string), Dictionary<string, string> metadata = default(Dictionary<string, string>), string migratedAccountHolderCode = default(string), string primaryBalanceAccount = default(string), string reference = default(string), StatusEnum? status = default(StatusEnum?), string timeZone = default(string), List<VerificationDeadline> verificationDeadlines = default(List<VerificationDeadline>))
{
this.Id = id;
this.LegalEntityId = legalEntityId;
this.BalancePlatform = balancePlatform;
this.Capabilities = capabilities;
this.ContactDetails = contactDetails;
this.Description = description;
this.Metadata = metadata;
this.MigratedAccountHolderCode = migratedAccountHolderCode;
this.PrimaryBalanceAccount = primaryBalanceAccount;
this.Reference = reference;
this.Status = status;
this.TimeZone = timeZone;
this.VerificationDeadlines = verificationDeadlines;
}
/// <summary>
/// The unique identifier of the [balance platform](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/get/balancePlatforms/{id}__queryParam_id) to which the account holder belongs. Required in the request if your API credentials can be used for multiple balance platforms.
/// </summary>
/// <value>The unique identifier of the [balance platform](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/get/balancePlatforms/{id}__queryParam_id) to which the account holder belongs. Required in the request if your API credentials can be used for multiple balance platforms.</value>
[DataMember(Name = "balancePlatform", EmitDefaultValue = false)]
public string BalancePlatform { get; set; }
/// <summary>
/// Contains key-value pairs that specify the actions that an account holder can do in your platform. The key is a capability required for your integration. For example, **issueCard** for Issuing. The value is an object containing the settings for the capability.
/// </summary>
/// <value>Contains key-value pairs that specify the actions that an account holder can do in your platform. The key is a capability required for your integration. For example, **issueCard** for Issuing. The value is an object containing the settings for the capability.</value>
[DataMember(Name = "capabilities", EmitDefaultValue = false)]
public Dictionary<string, AccountHolderCapability> Capabilities { get; set; }
/// <summary>
/// Gets or Sets ContactDetails
/// </summary>
[DataMember(Name = "contactDetails", EmitDefaultValue = false)]
public ContactDetails ContactDetails { get; set; }
/// <summary>
/// Your description for the account holder, maximum 300 characters.
/// </summary>
/// <value>Your description for the account holder, maximum 300 characters.</value>
[DataMember(Name = "description", EmitDefaultValue = false)]
public string Description { get; set; }
/// <summary>
/// The unique identifier of the account holder.
/// </summary>
/// <value>The unique identifier of the account holder.</value>
[DataMember(Name = "id", IsRequired = false, EmitDefaultValue = false)]
public string Id { get; set; }
/// <summary>
/// The unique identifier of the [legal entity](https://docs.adyen.com/api-explorer/legalentity/latest/post/legalEntities#responses-200-id) associated with the account holder. Adyen performs a verification process against the legal entity of the account holder.
/// </summary>
/// <value>The unique identifier of the [legal entity](https://docs.adyen.com/api-explorer/legalentity/latest/post/legalEntities#responses-200-id) associated with the account holder. Adyen performs a verification process against the legal entity of the account holder.</value>
[DataMember(Name = "legalEntityId", IsRequired = false, EmitDefaultValue = false)]
public string LegalEntityId { 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 migrated account holder in the classic integration.
/// </summary>
/// <value>The unique identifier of the migrated account holder in the classic integration.</value>
[DataMember(Name = "migratedAccountHolderCode", EmitDefaultValue = false)]
public string MigratedAccountHolderCode { get; set; }
/// <summary>
/// The ID of the account holder's primary balance account. By default, this is set to the first balance account that you create for the account holder. To assign a different balance account, send a PATCH request.
/// </summary>
/// <value>The ID of the account holder's primary balance account. By default, this is set to the first balance account that you create for the account holder. To assign a different balance account, send a PATCH request.</value>
[DataMember(Name = "primaryBalanceAccount", EmitDefaultValue = false)]
public string PrimaryBalanceAccount { get; set; }
/// <summary>
/// Your reference for the account holder, maximum 150 characters.
/// </summary>
/// <value>Your reference for the account holder, maximum 150 characters.</value>
[DataMember(Name = "reference", EmitDefaultValue = false)]
public string Reference { get; set; }
/// <summary>
/// The time zone of the account holder. For example, **Europe/Amsterdam**. Defaults to the time zone of the balance platform 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 account holder. For example, **Europe/Amsterdam**. Defaults to the time zone of the balance platform 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>
/// List of verification deadlines and the capabilities that will be disallowed if verification errors are not resolved.
/// </summary>
/// <value>List of verification deadlines and the capabilities that will be disallowed if verification errors are not resolved.</value>
[DataMember(Name = "verificationDeadlines", EmitDefaultValue = false)]
public List<VerificationDeadline> VerificationDeadlines { 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 AccountHolder {\n");
sb.Append(" BalancePlatform: ").Append(BalancePlatform).Append("\n");
sb.Append(" Capabilities: ").Append(Capabilities).Append("\n");
sb.Append(" ContactDetails: ").Append(ContactDetails).Append("\n");
sb.Append(" Description: ").Append(Description).Append("\n");
sb.Append(" Id: ").Append(Id).Append("\n");
sb.Append(" LegalEntityId: ").Append(LegalEntityId).Append("\n");
sb.Append(" Metadata: ").Append(Metadata).Append("\n");
sb.Append(" MigratedAccountHolderCode: ").Append(MigratedAccountHolderCode).Append("\n");
sb.Append(" PrimaryBalanceAccount: ").Append(PrimaryBalanceAccount).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(" VerificationDeadlines: ").Append(VerificationDeadlines).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 AccountHolder);
}
/// <summary>
/// Returns true if AccountHolder instances are equal
/// </summary>
/// <param name="input">Instance of AccountHolder to be compared</param>
/// <returns>Boolean</returns>
public bool Equals(AccountHolder input)
{
if (input == null)
{
return false;
}
return
(
this.BalancePlatform == input.BalancePlatform ||
(this.BalancePlatform != null &&
this.BalancePlatform.Equals(input.BalancePlatform))
) &&
(
this.Capabilities == input.Capabilities ||
this.Capabilities != null &&
input.Capabilities != null &&
this.Capabilities.SequenceEqual(input.Capabilities)
) &&
(
this.ContactDetails == input.ContactDetails ||
(this.ContactDetails != null &&
this.ContactDetails.Equals(input.ContactDetails))
) &&
(
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.LegalEntityId == input.LegalEntityId ||
(this.LegalEntityId != null &&
this.LegalEntityId.Equals(input.LegalEntityId))
) &&
(
this.Metadata == input.Metadata ||
this.Metadata != null &&
input.Metadata != null &&
this.Metadata.SequenceEqual(input.Metadata)
) &&
(
this.MigratedAccountHolderCode == input.MigratedAccountHolderCode ||
(this.MigratedAccountHolderCode != null &&
this.MigratedAccountHolderCode.Equals(input.MigratedAccountHolderCode))
) &&
(
this.PrimaryBalanceAccount == input.PrimaryBalanceAccount ||
(this.PrimaryBalanceAccount != null &&
this.PrimaryBalanceAccount.Equals(input.PrimaryBalanceAccount))
) &&
(
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))
) &&
(
this.VerificationDeadlines == input.VerificationDeadlines ||
this.VerificationDeadlines != null &&
input.VerificationDeadlines != null &&
this.VerificationDeadlines.SequenceEqual(input.VerificationDeadlines)
);
}
/// <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.BalancePlatform != null)
{
hashCode = (hashCode * 59) + this.BalancePlatform.GetHashCode();
}
if (this.Capabilities != null)
{
hashCode = (hashCode * 59) + this.Capabilities.GetHashCode();
}
if (this.ContactDetails != null)
{
hashCode = (hashCode * 59) + this.ContactDetails.GetHashCode();
}
if (this.Description != null)
{
hashCode = (hashCode * 59) + this.Description.GetHashCode();
}
if (this.Id != null)
{
hashCode = (hashCode * 59) + this.Id.GetHashCode();
}
if (this.LegalEntityId != null)
{
hashCode = (hashCode * 59) + this.LegalEntityId.GetHashCode();
}
if (this.Metadata != null)
{
hashCode = (hashCode * 59) + this.Metadata.GetHashCode();
}
if (this.MigratedAccountHolderCode != null)
{
hashCode = (hashCode * 59) + this.MigratedAccountHolderCode.GetHashCode();
}
if (this.PrimaryBalanceAccount != null)
{
hashCode = (hashCode * 59) + this.PrimaryBalanceAccount.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();
}
if (this.VerificationDeadlines != null)
{
hashCode = (hashCode * 59) + this.VerificationDeadlines.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;
}
}
}