diff --git a/Adyen/Adyen.csproj b/Adyen/Adyen.csproj index cd5d54b59..4d4470e5e 100644 --- a/Adyen/Adyen.csproj +++ b/Adyen/Adyen.csproj @@ -41,6 +41,7 @@ + diff --git a/Adyen/Model/SessionAuthentication/AbstractOpenAPISchema.cs b/Adyen/Model/SessionAuthentication/AbstractOpenAPISchema.cs new file mode 100644 index 000000000..47f6fba90 --- /dev/null +++ b/Adyen/Model/SessionAuthentication/AbstractOpenAPISchema.cs @@ -0,0 +1,81 @@ +/* +* Session authentication API +* +* +* 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.SessionAuthentication +{ + /// + /// Abstract base class for oneOf, anyOf schemas in the OpenAPI specification + /// + public abstract partial class AbstractOpenAPISchema + { + /// + /// Custom JSON serializer + /// + 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 + } + } + }; + + /// + /// Gets or Sets the actual instance + /// + public abstract Object ActualInstance { get; set; } + + /// + /// Gets or Sets IsNullable to indicate whether the instance is nullable + /// + public bool IsNullable { get; protected set; } + + /// + /// Gets or Sets the schema type, which can be either `oneOf` or `anyOf` + /// + public string SchemaType { get; protected set; } + + /// + /// Converts the instance into JSON string. + /// + public abstract string ToJson(); + + // Check if the contains TypeEnum value + protected static bool ContainsValue(string type) where T : struct, IConvertible + { + // Search for type in .TypeEnum + List list = new List(); + var members = typeof(T).GetTypeInfo().DeclaredMembers; + foreach (var member in members) + { + var val = member?.GetCustomAttribute(false)?.Value; + if (!string.IsNullOrEmpty(val)) + { + list.Add(val); + } + } + + return list.Contains(type); + } + } +} diff --git a/Adyen/Model/SessionAuthentication/AccountHolderResource.cs b/Adyen/Model/SessionAuthentication/AccountHolderResource.cs new file mode 100644 index 000000000..de6bf1751 --- /dev/null +++ b/Adyen/Model/SessionAuthentication/AccountHolderResource.cs @@ -0,0 +1,157 @@ +/* +* Session authentication API +* +* +* 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 JsonSubTypes; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; + +namespace Adyen.Model.SessionAuthentication +{ + /// + /// AccountHolderResource + /// + [DataContract(Name = "AccountHolderResource")] + [JsonConverter(typeof(JsonSubtypes), "Type")] + [JsonSubtypes.KnownSubType(typeof(AccountHolderResource), "accountHolder")] + [JsonSubtypes.KnownSubType(typeof(BalanceAccountResource), "balanceAccount")] + [JsonSubtypes.KnownSubType(typeof(LegalEntityResource), "legalEntity")] + [JsonSubtypes.KnownSubType(typeof(MerchantAccountResource), "merchantAccount")] + [JsonSubtypes.KnownSubType(typeof(PaymentInstrumentResource), "paymentInstrument")] + public partial class AccountHolderResource : Resource, IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected AccountHolderResource() { } + /// + /// Initializes a new instance of the class. + /// + /// The unique identifier of the resource connected to the component. For [Platform Experience components](https://docs.adyen.com/platforms/build-user-dashboards), this is the account holder linked to the balance account shown in the component. (required). + /// type (default to "AccountHolderResource"). + public AccountHolderResource(string accountHolderId = default(string), ResourceType? type = ResourceType.AccountHolder) : base(type) + { + this.AccountHolderId = accountHolderId; + } + + /// + /// The unique identifier of the resource connected to the component. For [Platform Experience components](https://docs.adyen.com/platforms/build-user-dashboards), this is the account holder linked to the balance account shown in the component. + /// + /// The unique identifier of the resource connected to the component. For [Platform Experience components](https://docs.adyen.com/platforms/build-user-dashboards), this is the account holder linked to the balance account shown in the component. + [DataMember(Name = "accountHolderId", IsRequired = false, EmitDefaultValue = false)] + public string AccountHolderId { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class AccountHolderResource {\n"); + sb.Append(" ").Append(base.ToString().Replace("\n", "\n ")).Append("\n"); + sb.Append(" AccountHolderId: ").Append(AccountHolderId).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public override string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as AccountHolderResource); + } + + /// + /// Returns true if AccountHolderResource instances are equal + /// + /// Instance of AccountHolderResource to be compared + /// Boolean + public bool Equals(AccountHolderResource input) + { + if (input == null) + { + return false; + } + return base.Equals(input) && + ( + this.AccountHolderId == input.AccountHolderId || + (this.AccountHolderId != null && + this.AccountHolderId.Equals(input.AccountHolderId)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = base.GetHashCode(); + if (this.AccountHolderId != null) + { + hashCode = (hashCode * 59) + this.AccountHolderId.GetHashCode(); + } + return hashCode; + } + } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + return this.BaseValidate(validationContext); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + protected IEnumerable BaseValidate(ValidationContext validationContext) + { + foreach (var x in BaseValidate(validationContext)) + { + yield return x; + } + yield break; + } + } + +} diff --git a/Adyen/Model/SessionAuthentication/AccountHolderResourceAllOf.cs b/Adyen/Model/SessionAuthentication/AccountHolderResourceAllOf.cs new file mode 100644 index 000000000..8334fd35d --- /dev/null +++ b/Adyen/Model/SessionAuthentication/AccountHolderResourceAllOf.cs @@ -0,0 +1,129 @@ +/* +* Session authentication API +* +* +* 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.SessionAuthentication +{ + /// + /// AccountHolderResourceAllOf + /// + [DataContract(Name = "AccountHolderResource_allOf")] + public partial class AccountHolderResourceAllOf : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// The unique identifier of the resource connected to the component. For [Platform Experience components](https://docs.adyen.com/platforms/build-user-dashboards), this is the account holder linked to the balance account shown in the component.. + public AccountHolderResourceAllOf(string accountHolderId = default(string)) + { + this.AccountHolderId = accountHolderId; + } + + /// + /// The unique identifier of the resource connected to the component. For [Platform Experience components](https://docs.adyen.com/platforms/build-user-dashboards), this is the account holder linked to the balance account shown in the component. + /// + /// The unique identifier of the resource connected to the component. For [Platform Experience components](https://docs.adyen.com/platforms/build-user-dashboards), this is the account holder linked to the balance account shown in the component. + [DataMember(Name = "accountHolderId", EmitDefaultValue = false)] + public string AccountHolderId { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class AccountHolderResourceAllOf {\n"); + sb.Append(" AccountHolderId: ").Append(AccountHolderId).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as AccountHolderResourceAllOf); + } + + /// + /// Returns true if AccountHolderResourceAllOf instances are equal + /// + /// Instance of AccountHolderResourceAllOf to be compared + /// Boolean + public bool Equals(AccountHolderResourceAllOf input) + { + if (input == null) + { + return false; + } + return + ( + this.AccountHolderId == input.AccountHolderId || + (this.AccountHolderId != null && + this.AccountHolderId.Equals(input.AccountHolderId)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.AccountHolderId != null) + { + hashCode = (hashCode * 59) + this.AccountHolderId.GetHashCode(); + } + return hashCode; + } + } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/Adyen/Model/SessionAuthentication/AuthenticationSessionRequest.cs b/Adyen/Model/SessionAuthentication/AuthenticationSessionRequest.cs new file mode 100644 index 000000000..08c8bc481 --- /dev/null +++ b/Adyen/Model/SessionAuthentication/AuthenticationSessionRequest.cs @@ -0,0 +1,166 @@ +/* +* Session authentication API +* +* +* 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.SessionAuthentication +{ + /// + /// AuthenticationSessionRequest + /// + [DataContract(Name = "AuthenticationSessionRequest")] + public partial class AuthenticationSessionRequest : IEquatable, IValidatableObject + { + + /// + /// Gets or Sets Product + /// + [DataMember(Name = "product", IsRequired = false, EmitDefaultValue = false)] + public ProductType Product { get; set; } + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected AuthenticationSessionRequest() { } + /// + /// Initializes a new instance of the class. + /// + /// The URL where the component will appear. In your live environment, you must protect the URL with an SSL certificate and ensure that it starts with `https://`. (required). + /// policy (required). + /// product (required). + public AuthenticationSessionRequest(string allowOrigin = default(string), Policy policy = default(Policy), ProductType product = default(ProductType)) + { + this.AllowOrigin = allowOrigin; + this.Policy = policy; + this.Product = product; + } + + /// + /// The URL where the component will appear. In your live environment, you must protect the URL with an SSL certificate and ensure that it starts with `https://`. + /// + /// The URL where the component will appear. In your live environment, you must protect the URL with an SSL certificate and ensure that it starts with `https://`. + [DataMember(Name = "allowOrigin", IsRequired = false, EmitDefaultValue = false)] + public string AllowOrigin { get; set; } + + /// + /// Gets or Sets Policy + /// + [DataMember(Name = "policy", IsRequired = false, EmitDefaultValue = false)] + public Policy Policy { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class AuthenticationSessionRequest {\n"); + sb.Append(" AllowOrigin: ").Append(AllowOrigin).Append("\n"); + sb.Append(" Policy: ").Append(Policy).Append("\n"); + sb.Append(" Product: ").Append(Product).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as AuthenticationSessionRequest); + } + + /// + /// Returns true if AuthenticationSessionRequest instances are equal + /// + /// Instance of AuthenticationSessionRequest to be compared + /// Boolean + public bool Equals(AuthenticationSessionRequest input) + { + if (input == null) + { + return false; + } + return + ( + this.AllowOrigin == input.AllowOrigin || + (this.AllowOrigin != null && + this.AllowOrigin.Equals(input.AllowOrigin)) + ) && + ( + this.Policy == input.Policy || + (this.Policy != null && + this.Policy.Equals(input.Policy)) + ) && + ( + this.Product == input.Product || + this.Product.Equals(input.Product) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.AllowOrigin != null) + { + hashCode = (hashCode * 59) + this.AllowOrigin.GetHashCode(); + } + if (this.Policy != null) + { + hashCode = (hashCode * 59) + this.Policy.GetHashCode(); + } + hashCode = (hashCode * 59) + this.Product.GetHashCode(); + return hashCode; + } + } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/Adyen/Model/SessionAuthentication/AuthenticationSessionResponse.cs b/Adyen/Model/SessionAuthentication/AuthenticationSessionResponse.cs new file mode 100644 index 000000000..3c130ea93 --- /dev/null +++ b/Adyen/Model/SessionAuthentication/AuthenticationSessionResponse.cs @@ -0,0 +1,148 @@ +/* +* Session authentication API +* +* +* 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.SessionAuthentication +{ + /// + /// AuthenticationSessionResponse + /// + [DataContract(Name = "AuthenticationSessionResponse")] + public partial class AuthenticationSessionResponse : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// The unique identifier of the session.. + /// The session token created.. + public AuthenticationSessionResponse(string id = default(string), string token = default(string)) + { + this.Id = id; + this.Token = token; + } + + /// + /// The unique identifier of the session. + /// + /// The unique identifier of the session. + [DataMember(Name = "id", EmitDefaultValue = false)] + public string Id { get; set; } + + /// + /// The session token created. + /// + /// The session token created. + [DataMember(Name = "token", EmitDefaultValue = false)] + public string Token { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class AuthenticationSessionResponse {\n"); + sb.Append(" Id: ").Append(Id).Append("\n"); + sb.Append(" Token: ").Append(Token).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as AuthenticationSessionResponse); + } + + /// + /// Returns true if AuthenticationSessionResponse instances are equal + /// + /// Instance of AuthenticationSessionResponse to be compared + /// Boolean + public bool Equals(AuthenticationSessionResponse input) + { + if (input == null) + { + return false; + } + return + ( + this.Id == input.Id || + (this.Id != null && + this.Id.Equals(input.Id)) + ) && + ( + this.Token == input.Token || + (this.Token != null && + this.Token.Equals(input.Token)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.Id != null) + { + hashCode = (hashCode * 59) + this.Id.GetHashCode(); + } + if (this.Token != null) + { + hashCode = (hashCode * 59) + this.Token.GetHashCode(); + } + return hashCode; + } + } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/Adyen/Model/SessionAuthentication/BalanceAccountResource.cs b/Adyen/Model/SessionAuthentication/BalanceAccountResource.cs new file mode 100644 index 000000000..dd6e72ae6 --- /dev/null +++ b/Adyen/Model/SessionAuthentication/BalanceAccountResource.cs @@ -0,0 +1,156 @@ +/* +* Session authentication API +* +* +* 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 JsonSubTypes; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; + +namespace Adyen.Model.SessionAuthentication +{ + /// + /// BalanceAccountResource + /// + [DataContract(Name = "BalanceAccountResource")] + [JsonConverter(typeof(JsonSubtypes), "Type")] + [JsonSubtypes.KnownSubType(typeof(AccountHolderResource), "accountHolder")] + [JsonSubtypes.KnownSubType(typeof(BalanceAccountResource), "balanceAccount")] + [JsonSubtypes.KnownSubType(typeof(LegalEntityResource), "legalEntity")] + [JsonSubtypes.KnownSubType(typeof(MerchantAccountResource), "merchantAccount")] + [JsonSubtypes.KnownSubType(typeof(PaymentInstrumentResource), "paymentInstrument")] + public partial class BalanceAccountResource : Resource, IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected BalanceAccountResource() { } + /// + /// Initializes a new instance of the class. + /// + /// balanceAccountId (required). + /// type (default to "BalanceAccountResource"). + public BalanceAccountResource(string balanceAccountId = default(string), ResourceType? type = ResourceType.BalanceAccount) : base(type) + { + this.BalanceAccountId = balanceAccountId; + } + + /// + /// Gets or Sets BalanceAccountId + /// + [DataMember(Name = "balanceAccountId", IsRequired = false, EmitDefaultValue = false)] + public string BalanceAccountId { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class BalanceAccountResource {\n"); + sb.Append(" ").Append(base.ToString().Replace("\n", "\n ")).Append("\n"); + sb.Append(" BalanceAccountId: ").Append(BalanceAccountId).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public override string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as BalanceAccountResource); + } + + /// + /// Returns true if BalanceAccountResource instances are equal + /// + /// Instance of BalanceAccountResource to be compared + /// Boolean + public bool Equals(BalanceAccountResource input) + { + if (input == null) + { + return false; + } + return base.Equals(input) && + ( + this.BalanceAccountId == input.BalanceAccountId || + (this.BalanceAccountId != null && + this.BalanceAccountId.Equals(input.BalanceAccountId)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = base.GetHashCode(); + if (this.BalanceAccountId != null) + { + hashCode = (hashCode * 59) + this.BalanceAccountId.GetHashCode(); + } + return hashCode; + } + } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + return this.BaseValidate(validationContext); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + protected IEnumerable BaseValidate(ValidationContext validationContext) + { + foreach (var x in BaseValidate(validationContext)) + { + yield return x; + } + yield break; + } + } + +} diff --git a/Adyen/Model/SessionAuthentication/BalanceAccountResourceAllOf.cs b/Adyen/Model/SessionAuthentication/BalanceAccountResourceAllOf.cs new file mode 100644 index 000000000..f4f051202 --- /dev/null +++ b/Adyen/Model/SessionAuthentication/BalanceAccountResourceAllOf.cs @@ -0,0 +1,128 @@ +/* +* Session authentication API +* +* +* 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.SessionAuthentication +{ + /// + /// BalanceAccountResourceAllOf + /// + [DataContract(Name = "BalanceAccountResource_allOf")] + public partial class BalanceAccountResourceAllOf : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// balanceAccountId. + public BalanceAccountResourceAllOf(string balanceAccountId = default(string)) + { + this.BalanceAccountId = balanceAccountId; + } + + /// + /// Gets or Sets BalanceAccountId + /// + [DataMember(Name = "balanceAccountId", EmitDefaultValue = false)] + public string BalanceAccountId { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class BalanceAccountResourceAllOf {\n"); + sb.Append(" BalanceAccountId: ").Append(BalanceAccountId).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as BalanceAccountResourceAllOf); + } + + /// + /// Returns true if BalanceAccountResourceAllOf instances are equal + /// + /// Instance of BalanceAccountResourceAllOf to be compared + /// Boolean + public bool Equals(BalanceAccountResourceAllOf input) + { + if (input == null) + { + return false; + } + return + ( + this.BalanceAccountId == input.BalanceAccountId || + (this.BalanceAccountId != null && + this.BalanceAccountId.Equals(input.BalanceAccountId)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.BalanceAccountId != null) + { + hashCode = (hashCode * 59) + this.BalanceAccountId.GetHashCode(); + } + return hashCode; + } + } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/Adyen/Model/SessionAuthentication/DefaultErrorResponseEntity.cs b/Adyen/Model/SessionAuthentication/DefaultErrorResponseEntity.cs new file mode 100644 index 000000000..7326f80e1 --- /dev/null +++ b/Adyen/Model/SessionAuthentication/DefaultErrorResponseEntity.cs @@ -0,0 +1,259 @@ +/* +* Session authentication API +* +* +* 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.SessionAuthentication +{ + /// + /// Standardized error response following RFC-7807 format + /// + [DataContract(Name = "DefaultErrorResponseEntity")] + public partial class DefaultErrorResponseEntity : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// A human-readable explanation specific to this occurrence of the problem.. + /// Unique business error code.. + /// A URI that identifies the specific occurrence of the problem if applicable.. + /// Array of fields with validation errors when applicable.. + /// The unique reference for the request.. + /// The HTTP status code.. + /// A short, human-readable summary of the problem type.. + /// A URI that identifies the validation error type. It points to human-readable documentation for the problem type.. + public DefaultErrorResponseEntity(string detail = default(string), string errorCode = default(string), string instance = default(string), List invalidFields = default(List), string requestId = default(string), int? status = default(int?), string title = default(string), string type = default(string)) + { + this.Detail = detail; + this.ErrorCode = errorCode; + this.Instance = instance; + this.InvalidFields = invalidFields; + this.RequestId = requestId; + this.Status = status; + this.Title = title; + this.Type = type; + } + + /// + /// A human-readable explanation specific to this occurrence of the problem. + /// + /// A human-readable explanation specific to this occurrence of the problem. + [DataMember(Name = "detail", EmitDefaultValue = false)] + public string Detail { get; set; } + + /// + /// Unique business error code. + /// + /// Unique business error code. + [DataMember(Name = "errorCode", EmitDefaultValue = false)] + public string ErrorCode { get; set; } + + /// + /// A URI that identifies the specific occurrence of the problem if applicable. + /// + /// A URI that identifies the specific occurrence of the problem if applicable. + [DataMember(Name = "instance", EmitDefaultValue = false)] + public string Instance { get; set; } + + /// + /// Array of fields with validation errors when applicable. + /// + /// Array of fields with validation errors when applicable. + [DataMember(Name = "invalidFields", EmitDefaultValue = false)] + public List InvalidFields { get; set; } + + /// + /// The unique reference for the request. + /// + /// The unique reference for the request. + [DataMember(Name = "requestId", EmitDefaultValue = false)] + public string RequestId { get; set; } + + /// + /// The HTTP status code. + /// + /// The HTTP status code. + [DataMember(Name = "status", EmitDefaultValue = false)] + public int? Status { get; set; } + + /// + /// A short, human-readable summary of the problem type. + /// + /// A short, human-readable summary of the problem type. + [DataMember(Name = "title", EmitDefaultValue = false)] + public string Title { get; set; } + + /// + /// A URI that identifies the validation error type. It points to human-readable documentation for the problem type. + /// + /// A URI that identifies the validation error type. It points to human-readable documentation for the problem type. + [DataMember(Name = "type", EmitDefaultValue = false)] + public string Type { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class DefaultErrorResponseEntity {\n"); + sb.Append(" Detail: ").Append(Detail).Append("\n"); + sb.Append(" ErrorCode: ").Append(ErrorCode).Append("\n"); + sb.Append(" Instance: ").Append(Instance).Append("\n"); + sb.Append(" InvalidFields: ").Append(InvalidFields).Append("\n"); + sb.Append(" RequestId: ").Append(RequestId).Append("\n"); + sb.Append(" Status: ").Append(Status).Append("\n"); + sb.Append(" Title: ").Append(Title).Append("\n"); + sb.Append(" Type: ").Append(Type).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as DefaultErrorResponseEntity); + } + + /// + /// Returns true if DefaultErrorResponseEntity instances are equal + /// + /// Instance of DefaultErrorResponseEntity to be compared + /// Boolean + public bool Equals(DefaultErrorResponseEntity input) + { + if (input == null) + { + return false; + } + return + ( + this.Detail == input.Detail || + (this.Detail != null && + this.Detail.Equals(input.Detail)) + ) && + ( + this.ErrorCode == input.ErrorCode || + (this.ErrorCode != null && + this.ErrorCode.Equals(input.ErrorCode)) + ) && + ( + this.Instance == input.Instance || + (this.Instance != null && + this.Instance.Equals(input.Instance)) + ) && + ( + this.InvalidFields == input.InvalidFields || + this.InvalidFields != null && + input.InvalidFields != null && + this.InvalidFields.SequenceEqual(input.InvalidFields) + ) && + ( + this.RequestId == input.RequestId || + (this.RequestId != null && + this.RequestId.Equals(input.RequestId)) + ) && + ( + this.Status == input.Status || + this.Status.Equals(input.Status) + ) && + ( + this.Title == input.Title || + (this.Title != null && + this.Title.Equals(input.Title)) + ) && + ( + this.Type == input.Type || + (this.Type != null && + this.Type.Equals(input.Type)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.Detail != null) + { + hashCode = (hashCode * 59) + this.Detail.GetHashCode(); + } + if (this.ErrorCode != null) + { + hashCode = (hashCode * 59) + this.ErrorCode.GetHashCode(); + } + if (this.Instance != null) + { + hashCode = (hashCode * 59) + this.Instance.GetHashCode(); + } + if (this.InvalidFields != null) + { + hashCode = (hashCode * 59) + this.InvalidFields.GetHashCode(); + } + if (this.RequestId != null) + { + hashCode = (hashCode * 59) + this.RequestId.GetHashCode(); + } + hashCode = (hashCode * 59) + this.Status.GetHashCode(); + if (this.Title != null) + { + hashCode = (hashCode * 59) + this.Title.GetHashCode(); + } + if (this.Type != null) + { + hashCode = (hashCode * 59) + this.Type.GetHashCode(); + } + return hashCode; + } + } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/Adyen/Model/SessionAuthentication/InvalidField.cs b/Adyen/Model/SessionAuthentication/InvalidField.cs new file mode 100644 index 000000000..c5e5fc05d --- /dev/null +++ b/Adyen/Model/SessionAuthentication/InvalidField.cs @@ -0,0 +1,172 @@ +/* +* Session authentication API +* +* +* 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.SessionAuthentication +{ + /// + /// InvalidField + /// + [DataContract(Name = "InvalidField")] + public partial class InvalidField : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected InvalidField() { } + /// + /// Initializes a new instance of the class. + /// + /// The field that has an invalid value. (required). + /// The invalid value. (required). + /// Description of the validation error. (required). + public InvalidField(string name = default(string), string value = default(string), string message = default(string)) + { + this.Name = name; + this.Value = value; + this.Message = message; + } + + /// + /// The field that has an invalid value. + /// + /// The field that has an invalid value. + [DataMember(Name = "name", IsRequired = false, EmitDefaultValue = false)] + public string Name { get; set; } + + /// + /// The invalid value. + /// + /// The invalid value. + [DataMember(Name = "value", IsRequired = false, EmitDefaultValue = false)] + public string Value { get; set; } + + /// + /// Description of the validation error. + /// + /// Description of the validation error. + [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] + public string Message { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class InvalidField {\n"); + sb.Append(" Name: ").Append(Name).Append("\n"); + sb.Append(" Value: ").Append(Value).Append("\n"); + sb.Append(" Message: ").Append(Message).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as InvalidField); + } + + /// + /// Returns true if InvalidField instances are equal + /// + /// Instance of InvalidField to be compared + /// Boolean + public bool Equals(InvalidField input) + { + if (input == null) + { + return false; + } + return + ( + this.Name == input.Name || + (this.Name != null && + this.Name.Equals(input.Name)) + ) && + ( + this.Value == input.Value || + (this.Value != null && + this.Value.Equals(input.Value)) + ) && + ( + this.Message == input.Message || + (this.Message != null && + this.Message.Equals(input.Message)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.Name != null) + { + hashCode = (hashCode * 59) + this.Name.GetHashCode(); + } + if (this.Value != null) + { + hashCode = (hashCode * 59) + this.Value.GetHashCode(); + } + if (this.Message != null) + { + hashCode = (hashCode * 59) + this.Message.GetHashCode(); + } + return hashCode; + } + } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/Adyen/Model/SessionAuthentication/LegalEntityResource.cs b/Adyen/Model/SessionAuthentication/LegalEntityResource.cs new file mode 100644 index 000000000..5783aa235 --- /dev/null +++ b/Adyen/Model/SessionAuthentication/LegalEntityResource.cs @@ -0,0 +1,157 @@ +/* +* Session authentication API +* +* +* 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 JsonSubTypes; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; + +namespace Adyen.Model.SessionAuthentication +{ + /// + /// LegalEntityResource + /// + [DataContract(Name = "LegalEntityResource")] + [JsonConverter(typeof(JsonSubtypes), "Type")] + [JsonSubtypes.KnownSubType(typeof(AccountHolderResource), "accountHolder")] + [JsonSubtypes.KnownSubType(typeof(BalanceAccountResource), "balanceAccount")] + [JsonSubtypes.KnownSubType(typeof(LegalEntityResource), "legalEntity")] + [JsonSubtypes.KnownSubType(typeof(MerchantAccountResource), "merchantAccount")] + [JsonSubtypes.KnownSubType(typeof(PaymentInstrumentResource), "paymentInstrument")] + public partial class LegalEntityResource : Resource, IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected LegalEntityResource() { } + /// + /// Initializes a new instance of the class. + /// + /// The unique identifier of the resource connected to the component. For [Onboarding components](https://docs.adyen.com/platforms/onboard-users/components), this is the legal entity that has a contractual relationship with your platform and owns the [transfer instrument](https://docs.adyen.com/api-explorer/legalentity/latest/post/transferInstruments). For sole proprietorships, this is the legal entity of the individual owner. (required). + /// type (default to "LegalEntityResource"). + public LegalEntityResource(string legalEntityId = default(string), ResourceType? type = ResourceType.LegalEntity) : base(type) + { + this.LegalEntityId = legalEntityId; + } + + /// + /// The unique identifier of the resource connected to the component. For [Onboarding components](https://docs.adyen.com/platforms/onboard-users/components), this is the legal entity that has a contractual relationship with your platform and owns the [transfer instrument](https://docs.adyen.com/api-explorer/legalentity/latest/post/transferInstruments). For sole proprietorships, this is the legal entity of the individual owner. + /// + /// The unique identifier of the resource connected to the component. For [Onboarding components](https://docs.adyen.com/platforms/onboard-users/components), this is the legal entity that has a contractual relationship with your platform and owns the [transfer instrument](https://docs.adyen.com/api-explorer/legalentity/latest/post/transferInstruments). For sole proprietorships, this is the legal entity of the individual owner. + [DataMember(Name = "legalEntityId", IsRequired = false, EmitDefaultValue = false)] + public string LegalEntityId { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class LegalEntityResource {\n"); + sb.Append(" ").Append(base.ToString().Replace("\n", "\n ")).Append("\n"); + sb.Append(" LegalEntityId: ").Append(LegalEntityId).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public override string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as LegalEntityResource); + } + + /// + /// Returns true if LegalEntityResource instances are equal + /// + /// Instance of LegalEntityResource to be compared + /// Boolean + public bool Equals(LegalEntityResource input) + { + if (input == null) + { + return false; + } + return base.Equals(input) && + ( + this.LegalEntityId == input.LegalEntityId || + (this.LegalEntityId != null && + this.LegalEntityId.Equals(input.LegalEntityId)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = base.GetHashCode(); + if (this.LegalEntityId != null) + { + hashCode = (hashCode * 59) + this.LegalEntityId.GetHashCode(); + } + return hashCode; + } + } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + return this.BaseValidate(validationContext); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + protected IEnumerable BaseValidate(ValidationContext validationContext) + { + foreach (var x in BaseValidate(validationContext)) + { + yield return x; + } + yield break; + } + } + +} diff --git a/Adyen/Model/SessionAuthentication/LegalEntityResourceAllOf.cs b/Adyen/Model/SessionAuthentication/LegalEntityResourceAllOf.cs new file mode 100644 index 000000000..6d5cf8aab --- /dev/null +++ b/Adyen/Model/SessionAuthentication/LegalEntityResourceAllOf.cs @@ -0,0 +1,129 @@ +/* +* Session authentication API +* +* +* 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.SessionAuthentication +{ + /// + /// LegalEntityResourceAllOf + /// + [DataContract(Name = "LegalEntityResource_allOf")] + public partial class LegalEntityResourceAllOf : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// The unique identifier of the resource connected to the component. For [Onboarding components](https://docs.adyen.com/platforms/onboard-users/components), this is the legal entity that has a contractual relationship with your platform and owns the [transfer instrument](https://docs.adyen.com/api-explorer/legalentity/latest/post/transferInstruments). For sole proprietorships, this is the legal entity of the individual owner.. + public LegalEntityResourceAllOf(string legalEntityId = default(string)) + { + this.LegalEntityId = legalEntityId; + } + + /// + /// The unique identifier of the resource connected to the component. For [Onboarding components](https://docs.adyen.com/platforms/onboard-users/components), this is the legal entity that has a contractual relationship with your platform and owns the [transfer instrument](https://docs.adyen.com/api-explorer/legalentity/latest/post/transferInstruments). For sole proprietorships, this is the legal entity of the individual owner. + /// + /// The unique identifier of the resource connected to the component. For [Onboarding components](https://docs.adyen.com/platforms/onboard-users/components), this is the legal entity that has a contractual relationship with your platform and owns the [transfer instrument](https://docs.adyen.com/api-explorer/legalentity/latest/post/transferInstruments). For sole proprietorships, this is the legal entity of the individual owner. + [DataMember(Name = "legalEntityId", EmitDefaultValue = false)] + public string LegalEntityId { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class LegalEntityResourceAllOf {\n"); + sb.Append(" LegalEntityId: ").Append(LegalEntityId).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as LegalEntityResourceAllOf); + } + + /// + /// Returns true if LegalEntityResourceAllOf instances are equal + /// + /// Instance of LegalEntityResourceAllOf to be compared + /// Boolean + public bool Equals(LegalEntityResourceAllOf input) + { + if (input == null) + { + return false; + } + return + ( + this.LegalEntityId == input.LegalEntityId || + (this.LegalEntityId != null && + this.LegalEntityId.Equals(input.LegalEntityId)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.LegalEntityId != null) + { + hashCode = (hashCode * 59) + this.LegalEntityId.GetHashCode(); + } + return hashCode; + } + } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/Adyen/Model/SessionAuthentication/MerchantAccountResource.cs b/Adyen/Model/SessionAuthentication/MerchantAccountResource.cs new file mode 100644 index 000000000..f0a65fac6 --- /dev/null +++ b/Adyen/Model/SessionAuthentication/MerchantAccountResource.cs @@ -0,0 +1,151 @@ +/* +* Session authentication API +* +* +* 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 JsonSubTypes; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; + +namespace Adyen.Model.SessionAuthentication +{ + /// + /// MerchantAccountResource + /// + [DataContract(Name = "MerchantAccountResource")] + [JsonConverter(typeof(JsonSubtypes), "Type")] + [JsonSubtypes.KnownSubType(typeof(AccountHolderResource), "accountHolder")] + [JsonSubtypes.KnownSubType(typeof(BalanceAccountResource), "balanceAccount")] + [JsonSubtypes.KnownSubType(typeof(LegalEntityResource), "legalEntity")] + [JsonSubtypes.KnownSubType(typeof(MerchantAccountResource), "merchantAccount")] + [JsonSubtypes.KnownSubType(typeof(PaymentInstrumentResource), "paymentInstrument")] + public partial class MerchantAccountResource : Resource, IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// merchantAccountCode. + /// type (default to "MerchantAccountResource"). + public MerchantAccountResource(string merchantAccountCode = default(string), ResourceType? type = ResourceType.MerchantAccount) : base(type) + { + this.MerchantAccountCode = merchantAccountCode; + } + + /// + /// Gets or Sets MerchantAccountCode + /// + [DataMember(Name = "merchantAccountCode", EmitDefaultValue = false)] + public string MerchantAccountCode { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class MerchantAccountResource {\n"); + sb.Append(" ").Append(base.ToString().Replace("\n", "\n ")).Append("\n"); + sb.Append(" MerchantAccountCode: ").Append(MerchantAccountCode).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public override string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as MerchantAccountResource); + } + + /// + /// Returns true if MerchantAccountResource instances are equal + /// + /// Instance of MerchantAccountResource to be compared + /// Boolean + public bool Equals(MerchantAccountResource input) + { + if (input == null) + { + return false; + } + return base.Equals(input) && + ( + this.MerchantAccountCode == input.MerchantAccountCode || + (this.MerchantAccountCode != null && + this.MerchantAccountCode.Equals(input.MerchantAccountCode)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = base.GetHashCode(); + if (this.MerchantAccountCode != null) + { + hashCode = (hashCode * 59) + this.MerchantAccountCode.GetHashCode(); + } + return hashCode; + } + } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + return this.BaseValidate(validationContext); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + protected IEnumerable BaseValidate(ValidationContext validationContext) + { + foreach (var x in BaseValidate(validationContext)) + { + yield return x; + } + yield break; + } + } + +} diff --git a/Adyen/Model/SessionAuthentication/MerchantAccountResourceAllOf.cs b/Adyen/Model/SessionAuthentication/MerchantAccountResourceAllOf.cs new file mode 100644 index 000000000..8024e78ab --- /dev/null +++ b/Adyen/Model/SessionAuthentication/MerchantAccountResourceAllOf.cs @@ -0,0 +1,128 @@ +/* +* Session authentication API +* +* +* 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.SessionAuthentication +{ + /// + /// MerchantAccountResourceAllOf + /// + [DataContract(Name = "MerchantAccountResource_allOf")] + public partial class MerchantAccountResourceAllOf : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// merchantAccountCode. + public MerchantAccountResourceAllOf(string merchantAccountCode = default(string)) + { + this.MerchantAccountCode = merchantAccountCode; + } + + /// + /// Gets or Sets MerchantAccountCode + /// + [DataMember(Name = "merchantAccountCode", EmitDefaultValue = false)] + public string MerchantAccountCode { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class MerchantAccountResourceAllOf {\n"); + sb.Append(" MerchantAccountCode: ").Append(MerchantAccountCode).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as MerchantAccountResourceAllOf); + } + + /// + /// Returns true if MerchantAccountResourceAllOf instances are equal + /// + /// Instance of MerchantAccountResourceAllOf to be compared + /// Boolean + public bool Equals(MerchantAccountResourceAllOf input) + { + if (input == null) + { + return false; + } + return + ( + this.MerchantAccountCode == input.MerchantAccountCode || + (this.MerchantAccountCode != null && + this.MerchantAccountCode.Equals(input.MerchantAccountCode)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.MerchantAccountCode != null) + { + hashCode = (hashCode * 59) + this.MerchantAccountCode.GetHashCode(); + } + return hashCode; + } + } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/Adyen/Model/SessionAuthentication/PaymentInstrumentResource.cs b/Adyen/Model/SessionAuthentication/PaymentInstrumentResource.cs new file mode 100644 index 000000000..800d9803d --- /dev/null +++ b/Adyen/Model/SessionAuthentication/PaymentInstrumentResource.cs @@ -0,0 +1,156 @@ +/* +* Session authentication API +* +* +* 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 JsonSubTypes; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; + +namespace Adyen.Model.SessionAuthentication +{ + /// + /// PaymentInstrumentResource + /// + [DataContract(Name = "PaymentInstrumentResource")] + [JsonConverter(typeof(JsonSubtypes), "Type")] + [JsonSubtypes.KnownSubType(typeof(AccountHolderResource), "accountHolder")] + [JsonSubtypes.KnownSubType(typeof(BalanceAccountResource), "balanceAccount")] + [JsonSubtypes.KnownSubType(typeof(LegalEntityResource), "legalEntity")] + [JsonSubtypes.KnownSubType(typeof(MerchantAccountResource), "merchantAccount")] + [JsonSubtypes.KnownSubType(typeof(PaymentInstrumentResource), "paymentInstrument")] + public partial class PaymentInstrumentResource : Resource, IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected PaymentInstrumentResource() { } + /// + /// Initializes a new instance of the class. + /// + /// paymentInstrumentId (required). + /// type (default to "PaymentInstrumentResource"). + public PaymentInstrumentResource(string paymentInstrumentId = default(string), ResourceType? type = ResourceType.PaymentInstrument) : base(type) + { + this.PaymentInstrumentId = paymentInstrumentId; + } + + /// + /// Gets or Sets PaymentInstrumentId + /// + [DataMember(Name = "paymentInstrumentId", IsRequired = false, EmitDefaultValue = false)] + public string PaymentInstrumentId { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class PaymentInstrumentResource {\n"); + sb.Append(" ").Append(base.ToString().Replace("\n", "\n ")).Append("\n"); + sb.Append(" PaymentInstrumentId: ").Append(PaymentInstrumentId).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public override string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as PaymentInstrumentResource); + } + + /// + /// Returns true if PaymentInstrumentResource instances are equal + /// + /// Instance of PaymentInstrumentResource to be compared + /// Boolean + public bool Equals(PaymentInstrumentResource input) + { + if (input == null) + { + return false; + } + return base.Equals(input) && + ( + this.PaymentInstrumentId == input.PaymentInstrumentId || + (this.PaymentInstrumentId != null && + this.PaymentInstrumentId.Equals(input.PaymentInstrumentId)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = base.GetHashCode(); + if (this.PaymentInstrumentId != null) + { + hashCode = (hashCode * 59) + this.PaymentInstrumentId.GetHashCode(); + } + return hashCode; + } + } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + return this.BaseValidate(validationContext); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + protected IEnumerable BaseValidate(ValidationContext validationContext) + { + foreach (var x in BaseValidate(validationContext)) + { + yield return x; + } + yield break; + } + } + +} diff --git a/Adyen/Model/SessionAuthentication/PaymentInstrumentResourceAllOf.cs b/Adyen/Model/SessionAuthentication/PaymentInstrumentResourceAllOf.cs new file mode 100644 index 000000000..1302c0e68 --- /dev/null +++ b/Adyen/Model/SessionAuthentication/PaymentInstrumentResourceAllOf.cs @@ -0,0 +1,128 @@ +/* +* Session authentication API +* +* +* 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.SessionAuthentication +{ + /// + /// PaymentInstrumentResourceAllOf + /// + [DataContract(Name = "PaymentInstrumentResource_allOf")] + public partial class PaymentInstrumentResourceAllOf : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// paymentInstrumentId. + public PaymentInstrumentResourceAllOf(string paymentInstrumentId = default(string)) + { + this.PaymentInstrumentId = paymentInstrumentId; + } + + /// + /// Gets or Sets PaymentInstrumentId + /// + [DataMember(Name = "paymentInstrumentId", EmitDefaultValue = false)] + public string PaymentInstrumentId { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class PaymentInstrumentResourceAllOf {\n"); + sb.Append(" PaymentInstrumentId: ").Append(PaymentInstrumentId).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as PaymentInstrumentResourceAllOf); + } + + /// + /// Returns true if PaymentInstrumentResourceAllOf instances are equal + /// + /// Instance of PaymentInstrumentResourceAllOf to be compared + /// Boolean + public bool Equals(PaymentInstrumentResourceAllOf input) + { + if (input == null) + { + return false; + } + return + ( + this.PaymentInstrumentId == input.PaymentInstrumentId || + (this.PaymentInstrumentId != null && + this.PaymentInstrumentId.Equals(input.PaymentInstrumentId)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.PaymentInstrumentId != null) + { + hashCode = (hashCode * 59) + this.PaymentInstrumentId.GetHashCode(); + } + return hashCode; + } + } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/Adyen/Model/SessionAuthentication/Policy.cs b/Adyen/Model/SessionAuthentication/Policy.cs new file mode 100644 index 000000000..7769424c2 --- /dev/null +++ b/Adyen/Model/SessionAuthentication/Policy.cs @@ -0,0 +1,150 @@ +/* +* Session authentication API +* +* +* 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.SessionAuthentication +{ + /// + /// Policy + /// + [DataContract(Name = "Policy")] + public partial class Policy : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// An object containing the type and the unique identifier of the user of the component. For [Onboarding components](https://docs.adyen.com/platforms/onboard-users/components), this is the ID of the legal entity that has a contractual relationship with your platform. For sole proprietorships, use the ID of the legal entity of the individual owner. For [Platform Experience components](https://docs.adyen.com/platforms/build-user-dashboards), this is the ID of the account holder that is associated with the balance account shown in the component.. + /// The name of the role required to use the component.. + public Policy(List resources = default(List), List roles = default(List)) + { + this.Resources = resources; + this.Roles = roles; + } + + /// + /// An object containing the type and the unique identifier of the user of the component. For [Onboarding components](https://docs.adyen.com/platforms/onboard-users/components), this is the ID of the legal entity that has a contractual relationship with your platform. For sole proprietorships, use the ID of the legal entity of the individual owner. For [Platform Experience components](https://docs.adyen.com/platforms/build-user-dashboards), this is the ID of the account holder that is associated with the balance account shown in the component. + /// + /// An object containing the type and the unique identifier of the user of the component. For [Onboarding components](https://docs.adyen.com/platforms/onboard-users/components), this is the ID of the legal entity that has a contractual relationship with your platform. For sole proprietorships, use the ID of the legal entity of the individual owner. For [Platform Experience components](https://docs.adyen.com/platforms/build-user-dashboards), this is the ID of the account holder that is associated with the balance account shown in the component. + [DataMember(Name = "resources", EmitDefaultValue = false)] + public List Resources { get; set; } + + /// + /// The name of the role required to use the component. + /// + /// The name of the role required to use the component. + [DataMember(Name = "roles", EmitDefaultValue = false)] + public List Roles { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class Policy {\n"); + sb.Append(" Resources: ").Append(Resources).Append("\n"); + sb.Append(" Roles: ").Append(Roles).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as Policy); + } + + /// + /// Returns true if Policy instances are equal + /// + /// Instance of Policy to be compared + /// Boolean + public bool Equals(Policy input) + { + if (input == null) + { + return false; + } + return + ( + this.Resources == input.Resources || + this.Resources != null && + input.Resources != null && + this.Resources.SequenceEqual(input.Resources) + ) && + ( + this.Roles == input.Roles || + this.Roles != null && + input.Roles != null && + this.Roles.SequenceEqual(input.Roles) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.Resources != null) + { + hashCode = (hashCode * 59) + this.Resources.GetHashCode(); + } + if (this.Roles != null) + { + hashCode = (hashCode * 59) + this.Roles.GetHashCode(); + } + return hashCode; + } + } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/Adyen/Model/SessionAuthentication/ProductType.cs b/Adyen/Model/SessionAuthentication/ProductType.cs new file mode 100644 index 000000000..d636086a6 --- /dev/null +++ b/Adyen/Model/SessionAuthentication/ProductType.cs @@ -0,0 +1,49 @@ +/* +* Session authentication API +* +* +* 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.SessionAuthentication +{ + /// + /// Defines ProductType + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum ProductType + { + /// + /// Enum Onboarding for value: onboarding + /// + [EnumMember(Value = "onboarding")] + Onboarding = 1, + + /// + /// Enum Platform for value: platform + /// + [EnumMember(Value = "platform")] + Platform = 2 + + } + +} diff --git a/Adyen/Model/SessionAuthentication/Resource.cs b/Adyen/Model/SessionAuthentication/Resource.cs new file mode 100644 index 000000000..1f7510181 --- /dev/null +++ b/Adyen/Model/SessionAuthentication/Resource.cs @@ -0,0 +1,146 @@ +/* +* Session authentication API +* +* +* 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 JsonSubTypes; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; + +namespace Adyen.Model.SessionAuthentication +{ + /// + /// Resource + /// + [DataContract(Name = "Resource")] + [JsonConverter(typeof(JsonSubtypes), "Type")] + [JsonSubtypes.KnownSubType(typeof(AccountHolderResource), "AccountHolderResource")] + [JsonSubtypes.KnownSubType(typeof(BalanceAccountResource), "BalanceAccountResource")] + [JsonSubtypes.KnownSubType(typeof(LegalEntityResource), "LegalEntityResource")] + [JsonSubtypes.KnownSubType(typeof(MerchantAccountResource), "MerchantAccountResource")] + [JsonSubtypes.KnownSubType(typeof(PaymentInstrumentResource), "PaymentInstrumentResource")] + [JsonSubtypes.KnownSubType(typeof(AccountHolderResource), "accountHolder")] + [JsonSubtypes.KnownSubType(typeof(BalanceAccountResource), "balanceAccount")] + [JsonSubtypes.KnownSubType(typeof(LegalEntityResource), "legalEntity")] + [JsonSubtypes.KnownSubType(typeof(MerchantAccountResource), "merchantAccount")] + [JsonSubtypes.KnownSubType(typeof(PaymentInstrumentResource), "paymentInstrument")] + public partial class Resource : IEquatable, IValidatableObject + { + + /// + /// Gets or Sets Type + /// + [DataMember(Name = "type", EmitDefaultValue = false)] + public ResourceType? Type { get; set; } + /// + /// Initializes a new instance of the class. + /// + /// type. + public Resource(ResourceType? type = default(ResourceType?)) + { + this.Type = type; + } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class Resource {\n"); + sb.Append(" Type: ").Append(Type).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as Resource); + } + + /// + /// Returns true if Resource instances are equal + /// + /// Instance of Resource to be compared + /// Boolean + public bool Equals(Resource input) + { + if (input == null) + { + return false; + } + return + ( + this.Type == input.Type || + this.Type.Equals(input.Type) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + hashCode = (hashCode * 59) + this.Type.GetHashCode(); + return hashCode; + } + } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + return this.BaseValidate(validationContext); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + protected IEnumerable BaseValidate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/Adyen/Model/SessionAuthentication/ResourceType.cs b/Adyen/Model/SessionAuthentication/ResourceType.cs new file mode 100644 index 000000000..9db7c86a2 --- /dev/null +++ b/Adyen/Model/SessionAuthentication/ResourceType.cs @@ -0,0 +1,67 @@ +/* +* Session authentication API +* +* +* 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.SessionAuthentication +{ + /// + /// Defines ResourceType + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum ResourceType + { + /// + /// Enum LegalEntity for value: legalEntity + /// + [EnumMember(Value = "legalEntity")] + LegalEntity = 1, + + /// + /// Enum BalanceAccount for value: balanceAccount + /// + [EnumMember(Value = "balanceAccount")] + BalanceAccount = 2, + + /// + /// Enum AccountHolder for value: accountHolder + /// + [EnumMember(Value = "accountHolder")] + AccountHolder = 3, + + /// + /// Enum MerchantAccount for value: merchantAccount + /// + [EnumMember(Value = "merchantAccount")] + MerchantAccount = 4, + + /// + /// Enum PaymentInstrument for value: paymentInstrument + /// + [EnumMember(Value = "paymentInstrument")] + PaymentInstrument = 5 + + } + +} diff --git a/Adyen/Service/SessionAuthentication/SessionAuthenticationService.cs b/Adyen/Service/SessionAuthentication/SessionAuthenticationService.cs new file mode 100644 index 000000000..f91f9ed15 --- /dev/null +++ b/Adyen/Service/SessionAuthentication/SessionAuthenticationService.cs @@ -0,0 +1,70 @@ +/* +* Session authentication API +* +* +* 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.Net.Http; +using System.Threading; +using System.Threading.Tasks; +using Adyen.Model; +using Adyen.Model.SessionAuthentication; + +namespace Adyen.Service.SessionAuthentication +{ + /// + /// SessionAuthenticationService Interface + /// + public interface ISessionAuthenticationService + { + /// + /// Create a session token + /// + /// - + /// - Additional request options. + /// . + Model.SessionAuthentication.AuthenticationSessionResponse CreateAuthenticationSession(AuthenticationSessionRequest authenticationSessionRequest, RequestOptions requestOptions = default); + + /// + /// Create a session token + /// + /// - + /// - Additional request options. + /// A CancellationToken enables cooperative cancellation between threads, thread pool work items, or Task objects. + /// Task of . + Task CreateAuthenticationSessionAsync(AuthenticationSessionRequest authenticationSessionRequest, RequestOptions requestOptions = default, CancellationToken cancellationToken = default); + + } + + /// + /// Represents a collection of functions to interact with the SessionAuthenticationService API endpoints + /// + public class SessionAuthenticationService : AbstractService, ISessionAuthenticationService + { + private readonly string _baseUrl; + + public SessionAuthenticationService(Client client) : base(client) + { + _baseUrl = CreateBaseUrl("https://test.adyen.com/authe/api/v1"); + } + + public Model.SessionAuthentication.AuthenticationSessionResponse CreateAuthenticationSession(AuthenticationSessionRequest authenticationSessionRequest, RequestOptions requestOptions = default) + { + return CreateAuthenticationSessionAsync(authenticationSessionRequest, requestOptions).ConfigureAwait(false).GetAwaiter().GetResult(); + } + + public async Task CreateAuthenticationSessionAsync(AuthenticationSessionRequest authenticationSessionRequest, RequestOptions requestOptions = default, CancellationToken cancellationToken = default) + { + var endpoint = _baseUrl + "/sessions"; + var resource = new ServiceResource(this, endpoint); + return await resource.RequestAsync(authenticationSessionRequest.ToJson(), requestOptions, new HttpMethod("POST"), cancellationToken).ConfigureAwait(false); + } + } +} \ No newline at end of file