-
Notifications
You must be signed in to change notification settings - Fork 115
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
false[adyen-sdk-automation] automated change
- Loading branch information
1 parent
e0fb60c
commit d1c7bcc
Showing
8 changed files
with
1,049 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
81 changes: 81 additions & 0 deletions
81
Adyen/Model/NegativeBalanceWarningWebhooks/AbstractOpenAPISchema.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
/* | ||
* Negative balance compensation warning | ||
* | ||
* | ||
* 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.Generic; | ||
using System.Reflection; | ||
using System.Runtime.Serialization; | ||
using Newtonsoft.Json; | ||
using Newtonsoft.Json.Serialization; | ||
|
||
namespace Adyen.Model.NegativeBalanceWarningWebhooks | ||
{ | ||
/// <summary> | ||
/// Abstract base class for oneOf, anyOf schemas in the OpenAPI specification | ||
/// </summary> | ||
public abstract partial class AbstractOpenAPISchema | ||
{ | ||
/// <summary> | ||
/// Custom JSON serializer | ||
/// </summary> | ||
static public readonly JsonSerializerSettings SerializerSettings = new JsonSerializerSettings | ||
{ | ||
// OpenAPI generated types generally hide default constructors. | ||
ConstructorHandling = ConstructorHandling.AllowNonPublicDefaultConstructor, | ||
MissingMemberHandling = MissingMemberHandling.Ignore, | ||
ContractResolver = new DefaultContractResolver | ||
{ | ||
NamingStrategy = new CamelCaseNamingStrategy | ||
{ | ||
OverrideSpecifiedNames = false | ||
} | ||
} | ||
}; | ||
|
||
/// <summary> | ||
/// Gets or Sets the actual instance | ||
/// </summary> | ||
public abstract Object ActualInstance { get; set; } | ||
|
||
/// <summary> | ||
/// Gets or Sets IsNullable to indicate whether the instance is nullable | ||
/// </summary> | ||
public bool IsNullable { get; protected set; } | ||
|
||
/// <summary> | ||
/// Gets or Sets the schema type, which can be either `oneOf` or `anyOf` | ||
/// </summary> | ||
public string SchemaType { get; protected set; } | ||
|
||
/// <summary> | ||
/// Converts the instance into JSON string. | ||
/// </summary> | ||
public abstract string ToJson(); | ||
|
||
// Check if the <T> contains TypeEnum value | ||
protected static bool ContainsValue<T>(string type) where T : struct, IConvertible | ||
{ | ||
// Search for type in <T>.TypeEnum | ||
List<string> list = new List<string>(); | ||
var members = typeof(T).GetTypeInfo().DeclaredMembers; | ||
foreach (var member in members) | ||
{ | ||
var val = member?.GetCustomAttribute<EnumMemberAttribute>(false)?.Value; | ||
if (!string.IsNullOrEmpty(val)) | ||
{ | ||
list.Add(val); | ||
} | ||
} | ||
|
||
return list.Contains(type); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,161 @@ | ||
/* | ||
* Negative balance compensation warning | ||
* | ||
* | ||
* 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.NegativeBalanceWarningWebhooks | ||
{ | ||
/// <summary> | ||
/// Amount | ||
/// </summary> | ||
[DataContract(Name = "Amount")] | ||
public partial class Amount : IEquatable<Amount>, IValidatableObject | ||
{ | ||
/// <summary> | ||
/// Initializes a new instance of the <see cref="Amount" /> class. | ||
/// </summary> | ||
[JsonConstructorAttribute] | ||
protected Amount() { } | ||
/// <summary> | ||
/// Initializes a new instance of the <see cref="Amount" /> class. | ||
/// </summary> | ||
/// <param name="currency">The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes#currency-codes). (required).</param> | ||
/// <param name="value">The amount of the transaction, in [minor units](https://docs.adyen.com/development-resources/currency-codes#minor-units). (required).</param> | ||
public Amount(string currency = default(string), long? value = default(long?)) | ||
{ | ||
this.Currency = currency; | ||
this.Value = value; | ||
} | ||
|
||
/// <summary> | ||
/// The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes#currency-codes). | ||
/// </summary> | ||
/// <value>The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes#currency-codes).</value> | ||
[DataMember(Name = "currency", IsRequired = false, EmitDefaultValue = false)] | ||
public string Currency { get; set; } | ||
|
||
/// <summary> | ||
/// The amount of the transaction, in [minor units](https://docs.adyen.com/development-resources/currency-codes#minor-units). | ||
/// </summary> | ||
/// <value>The amount of the transaction, in [minor units](https://docs.adyen.com/development-resources/currency-codes#minor-units).</value> | ||
[DataMember(Name = "value", IsRequired = false, EmitDefaultValue = false)] | ||
public long? Value { 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 Amount {\n"); | ||
sb.Append(" Currency: ").Append(Currency).Append("\n"); | ||
sb.Append(" Value: ").Append(Value).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 Amount); | ||
} | ||
|
||
/// <summary> | ||
/// Returns true if Amount instances are equal | ||
/// </summary> | ||
/// <param name="input">Instance of Amount to be compared</param> | ||
/// <returns>Boolean</returns> | ||
public bool Equals(Amount input) | ||
{ | ||
if (input == null) | ||
{ | ||
return false; | ||
} | ||
return | ||
( | ||
this.Currency == input.Currency || | ||
(this.Currency != null && | ||
this.Currency.Equals(input.Currency)) | ||
) && | ||
( | ||
this.Value == input.Value || | ||
this.Value.Equals(input.Value) | ||
); | ||
} | ||
|
||
/// <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.Currency != null) | ||
{ | ||
hashCode = (hashCode * 59) + this.Currency.GetHashCode(); | ||
} | ||
hashCode = (hashCode * 59) + this.Value.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) | ||
{ | ||
// Currency (string) maxLength | ||
if (this.Currency != null && this.Currency.Length > 3) | ||
{ | ||
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Currency, length must be less than 3.", new [] { "Currency" }); | ||
} | ||
|
||
// Currency (string) minLength | ||
if (this.Currency != null && this.Currency.Length < 3) | ||
{ | ||
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Currency, length must be greater than 3.", new [] { "Currency" }); | ||
} | ||
|
||
yield break; | ||
} | ||
} | ||
|
||
} |
Oops, something went wrong.