forked from Adyen/adyen-dotnet-api-library
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathChallengeInfo.cs
285 lines (260 loc) · 11.8 KB
/
ChallengeInfo.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
/*
* Authentication 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.AcsWebhooks
{
/// <summary>
/// ChallengeInfo
/// </summary>
[DataContract(Name = "ChallengeInfo")]
public partial class ChallengeInfo : IEquatable<ChallengeInfo>, IValidatableObject
{
/// <summary>
/// Indicator informing the Access Control Server (ACS) and the Directory Server (DS) that the authentication has been cancelled. For possible values, refer to [3D Secure API reference](https://docs.adyen.com/online-payments/3d-secure/api-reference#mpidata).
/// </summary>
/// <value>Indicator informing the Access Control Server (ACS) and the Directory Server (DS) that the authentication has been cancelled. For possible values, refer to [3D Secure API reference](https://docs.adyen.com/online-payments/3d-secure/api-reference#mpidata).</value>
[JsonConverter(typeof(StringEnumConverter))]
public enum ChallengeCancelEnum
{
/// <summary>
/// Enum _01 for value: 01
/// </summary>
[EnumMember(Value = "01")]
_01 = 1,
/// <summary>
/// Enum _02 for value: 02
/// </summary>
[EnumMember(Value = "02")]
_02 = 2,
/// <summary>
/// Enum _03 for value: 03
/// </summary>
[EnumMember(Value = "03")]
_03 = 3,
/// <summary>
/// Enum _04 for value: 04
/// </summary>
[EnumMember(Value = "04")]
_04 = 4,
/// <summary>
/// Enum _05 for value: 05
/// </summary>
[EnumMember(Value = "05")]
_05 = 5,
/// <summary>
/// Enum _06 for value: 06
/// </summary>
[EnumMember(Value = "06")]
_06 = 6,
/// <summary>
/// Enum _07 for value: 07
/// </summary>
[EnumMember(Value = "07")]
_07 = 7
}
/// <summary>
/// Indicator informing the Access Control Server (ACS) and the Directory Server (DS) that the authentication has been cancelled. For possible values, refer to [3D Secure API reference](https://docs.adyen.com/online-payments/3d-secure/api-reference#mpidata).
/// </summary>
/// <value>Indicator informing the Access Control Server (ACS) and the Directory Server (DS) that the authentication has been cancelled. For possible values, refer to [3D Secure API reference](https://docs.adyen.com/online-payments/3d-secure/api-reference#mpidata).</value>
[DataMember(Name = "challengeCancel", EmitDefaultValue = false)]
public ChallengeCancelEnum? ChallengeCancel { get; set; }
/// <summary>
/// The flow used in the challenge. Possible values: * **OTP_SMS**: one-time password (OTP) flow * **OOB**: out-of-band (OOB) flow
/// </summary>
/// <value>The flow used in the challenge. Possible values: * **OTP_SMS**: one-time password (OTP) flow * **OOB**: out-of-band (OOB) flow</value>
[JsonConverter(typeof(StringEnumConverter))]
public enum FlowEnum
{
/// <summary>
/// Enum OTPSMS for value: OTP_SMS
/// </summary>
[EnumMember(Value = "OTP_SMS")]
OTPSMS = 1,
/// <summary>
/// Enum OOB for value: OOB
/// </summary>
[EnumMember(Value = "OOB")]
OOB = 2
}
/// <summary>
/// The flow used in the challenge. Possible values: * **OTP_SMS**: one-time password (OTP) flow * **OOB**: out-of-band (OOB) flow
/// </summary>
/// <value>The flow used in the challenge. Possible values: * **OTP_SMS**: one-time password (OTP) flow * **OOB**: out-of-band (OOB) flow</value>
[DataMember(Name = "flow", IsRequired = false, EmitDefaultValue = false)]
public FlowEnum Flow { get; set; }
/// <summary>
/// Initializes a new instance of the <see cref="ChallengeInfo" /> class.
/// </summary>
[JsonConstructorAttribute]
protected ChallengeInfo() { }
/// <summary>
/// Initializes a new instance of the <see cref="ChallengeInfo" /> class.
/// </summary>
/// <param name="challengeCancel">Indicator informing the Access Control Server (ACS) and the Directory Server (DS) that the authentication has been cancelled. For possible values, refer to [3D Secure API reference](https://docs.adyen.com/online-payments/3d-secure/api-reference#mpidata)..</param>
/// <param name="flow">The flow used in the challenge. Possible values: * **OTP_SMS**: one-time password (OTP) flow * **OOB**: out-of-band (OOB) flow (required).</param>
/// <param name="lastInteraction">The last time of interaction with the challenge. (required).</param>
/// <param name="phoneNumber">The last four digits of the phone number used in the challenge..</param>
/// <param name="resends">The number of times the one-time password (OTP) was resent during the challenge..</param>
/// <param name="retries">The number of retries used in the challenge..</param>
public ChallengeInfo(ChallengeCancelEnum? challengeCancel = default(ChallengeCancelEnum?), FlowEnum flow = default(FlowEnum), DateTime lastInteraction = default(DateTime), string phoneNumber = default(string), int? resends = default(int?), int? retries = default(int?))
{
this.Flow = flow;
this.LastInteraction = lastInteraction;
this.ChallengeCancel = challengeCancel;
this.PhoneNumber = phoneNumber;
this.Resends = resends;
this.Retries = retries;
}
/// <summary>
/// The last time of interaction with the challenge.
/// </summary>
/// <value>The last time of interaction with the challenge.</value>
[DataMember(Name = "lastInteraction", IsRequired = false, EmitDefaultValue = false)]
public DateTime LastInteraction { get; set; }
/// <summary>
/// The last four digits of the phone number used in the challenge.
/// </summary>
/// <value>The last four digits of the phone number used in the challenge.</value>
[DataMember(Name = "phoneNumber", EmitDefaultValue = false)]
public string PhoneNumber { get; set; }
/// <summary>
/// The number of times the one-time password (OTP) was resent during the challenge.
/// </summary>
/// <value>The number of times the one-time password (OTP) was resent during the challenge.</value>
[DataMember(Name = "resends", EmitDefaultValue = false)]
public int? Resends { get; set; }
/// <summary>
/// The number of retries used in the challenge.
/// </summary>
/// <value>The number of retries used in the challenge.</value>
[DataMember(Name = "retries", EmitDefaultValue = false)]
public int? Retries { 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 ChallengeInfo {\n");
sb.Append(" ChallengeCancel: ").Append(ChallengeCancel).Append("\n");
sb.Append(" Flow: ").Append(Flow).Append("\n");
sb.Append(" LastInteraction: ").Append(LastInteraction).Append("\n");
sb.Append(" PhoneNumber: ").Append(PhoneNumber).Append("\n");
sb.Append(" Resends: ").Append(Resends).Append("\n");
sb.Append(" Retries: ").Append(Retries).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 ChallengeInfo);
}
/// <summary>
/// Returns true if ChallengeInfo instances are equal
/// </summary>
/// <param name="input">Instance of ChallengeInfo to be compared</param>
/// <returns>Boolean</returns>
public bool Equals(ChallengeInfo input)
{
if (input == null)
{
return false;
}
return
(
this.ChallengeCancel == input.ChallengeCancel ||
this.ChallengeCancel.Equals(input.ChallengeCancel)
) &&
(
this.Flow == input.Flow ||
this.Flow.Equals(input.Flow)
) &&
(
this.LastInteraction == input.LastInteraction ||
(this.LastInteraction != null &&
this.LastInteraction.Equals(input.LastInteraction))
) &&
(
this.PhoneNumber == input.PhoneNumber ||
(this.PhoneNumber != null &&
this.PhoneNumber.Equals(input.PhoneNumber))
) &&
(
this.Resends == input.Resends ||
this.Resends.Equals(input.Resends)
) &&
(
this.Retries == input.Retries ||
this.Retries.Equals(input.Retries)
);
}
/// <summary>
/// Gets the hash code
/// </summary>
/// <returns>Hash code</returns>
public override int GetHashCode()
{
unchecked // Overflow is fine, just wrap
{
int hashCode = 41;
hashCode = (hashCode * 59) + this.ChallengeCancel.GetHashCode();
hashCode = (hashCode * 59) + this.Flow.GetHashCode();
if (this.LastInteraction != null)
{
hashCode = (hashCode * 59) + this.LastInteraction.GetHashCode();
}
if (this.PhoneNumber != null)
{
hashCode = (hashCode * 59) + this.PhoneNumber.GetHashCode();
}
hashCode = (hashCode * 59) + this.Resends.GetHashCode();
hashCode = (hashCode * 59) + this.Retries.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)
{
yield break;
}
}
}