forked from Adyen/adyen-dotnet-api-library
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPersonalData.cs
179 lines (166 loc) · 6.95 KB
/
PersonalData.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
/*
* 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>
/// PersonalData
/// </summary>
[DataContract(Name = "PersonalData")]
public partial class PersonalData : IEquatable<PersonalData>, IValidatableObject
{
/// <summary>
/// Initializes a new instance of the <see cref="PersonalData" /> class.
/// </summary>
/// <param name="dateOfBirth">The date of birth of the person. The date should be in ISO-8601 format yyyy-mm-dd (e.g. 2000-01-31)..</param>
/// <param name="idNumber">An ID number of the person..</param>
/// <param name="nationality">The nationality of the person represented by a two-character country code. >The permitted country codes are defined in ISO-3166-1 alpha-2 (e.g. 'NL')..</param>
public PersonalData(string dateOfBirth = default(string), string idNumber = default(string), string nationality = default(string))
{
this.DateOfBirth = dateOfBirth;
this.IdNumber = idNumber;
this.Nationality = nationality;
}
/// <summary>
/// The date of birth of the person. The date should be in ISO-8601 format yyyy-mm-dd (e.g. 2000-01-31).
/// </summary>
/// <value>The date of birth of the person. The date should be in ISO-8601 format yyyy-mm-dd (e.g. 2000-01-31).</value>
[DataMember(Name = "dateOfBirth", EmitDefaultValue = false)]
public string DateOfBirth { get; set; }
/// <summary>
/// An ID number of the person.
/// </summary>
/// <value>An ID number of the person.</value>
[DataMember(Name = "idNumber", EmitDefaultValue = false)]
public string IdNumber { get; set; }
/// <summary>
/// The nationality of the person represented by a two-character country code. >The permitted country codes are defined in ISO-3166-1 alpha-2 (e.g. 'NL').
/// </summary>
/// <value>The nationality of the person represented by a two-character country code. >The permitted country codes are defined in ISO-3166-1 alpha-2 (e.g. 'NL').</value>
[DataMember(Name = "nationality", EmitDefaultValue = false)]
public string Nationality { 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 PersonalData {\n");
sb.Append(" DateOfBirth: ").Append(DateOfBirth).Append("\n");
sb.Append(" IdNumber: ").Append(IdNumber).Append("\n");
sb.Append(" Nationality: ").Append(Nationality).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 PersonalData);
}
/// <summary>
/// Returns true if PersonalData instances are equal
/// </summary>
/// <param name="input">Instance of PersonalData to be compared</param>
/// <returns>Boolean</returns>
public bool Equals(PersonalData input)
{
if (input == null)
{
return false;
}
return
(
this.DateOfBirth == input.DateOfBirth ||
(this.DateOfBirth != null &&
this.DateOfBirth.Equals(input.DateOfBirth))
) &&
(
this.IdNumber == input.IdNumber ||
(this.IdNumber != null &&
this.IdNumber.Equals(input.IdNumber))
) &&
(
this.Nationality == input.Nationality ||
(this.Nationality != null &&
this.Nationality.Equals(input.Nationality))
);
}
/// <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.DateOfBirth != null)
{
hashCode = (hashCode * 59) + this.DateOfBirth.GetHashCode();
}
if (this.IdNumber != null)
{
hashCode = (hashCode * 59) + this.IdNumber.GetHashCode();
}
if (this.Nationality != null)
{
hashCode = (hashCode * 59) + this.Nationality.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)
{
// Nationality (string) maxLength
if (this.Nationality != null && this.Nationality.Length > 2)
{
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Nationality, length must be less than 2.", new [] { "Nationality" });
}
// Nationality (string) minLength
if (this.Nationality != null && this.Nationality.Length < 2)
{
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Nationality, length must be greater than 2.", new [] { "Nationality" });
}
yield break;
}
}
}