Skip to content

Added support for SessionAuthentication API #1140

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Adyen/Adyen.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<PackageReference Include="System.ComponentModel.Annotations" Version="5.0.0" />
<PackageReference Include="System.Net.Http" Version="4.3.4" />
<PackageReference Include="JsonSubTypes" Version="2.0.1" />
</ItemGroup>
<!-- .NET 4.5 references, compilation flags and build options -->
<ItemGroup Condition=" '$(TargetFramework)' == 'net461' ">
Expand Down
81 changes: 81 additions & 0 deletions Adyen/Model/SessionAuthentication/AbstractOpenAPISchema.cs
Original file line number Diff line number Diff line change
@@ -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
{
/// <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);
}
}
}
157 changes: 157 additions & 0 deletions Adyen/Model/SessionAuthentication/AccountHolderResource.cs
Original file line number Diff line number Diff line change
@@ -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
{
/// <summary>
/// AccountHolderResource
/// </summary>
[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<AccountHolderResource>, IValidatableObject
{
/// <summary>
/// Initializes a new instance of the <see cref="AccountHolderResource" /> class.
/// </summary>
[JsonConstructorAttribute]
protected AccountHolderResource() { }
/// <summary>
/// Initializes a new instance of the <see cref="AccountHolderResource" /> class.
/// </summary>
/// <param name="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. (required).</param>
/// <param name="type">type (default to &quot;AccountHolderResource&quot;).</param>
public AccountHolderResource(string accountHolderId = default(string), ResourceType? type = ResourceType.AccountHolder) : base(type)
{
this.AccountHolderId = accountHolderId;
}

/// <summary>
/// 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.
/// </summary>
/// <value>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.</value>
[DataMember(Name = "accountHolderId", IsRequired = false, EmitDefaultValue = false)]
public string AccountHolderId { 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 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();
}

/// <summary>
/// Returns the JSON string presentation of the object
/// </summary>
/// <returns>JSON string presentation of the object</returns>
public override 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 AccountHolderResource);
}

/// <summary>
/// Returns true if AccountHolderResource instances are equal
/// </summary>
/// <param name="input">Instance of AccountHolderResource to be compared</param>
/// <returns>Boolean</returns>
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))
);
}

/// <summary>
/// Gets the hash code
/// </summary>
/// <returns>Hash code</returns>
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;
}
}
/// <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)
{
return this.BaseValidate(validationContext);
}

/// <summary>
/// To validate all properties of the instance
/// </summary>
/// <param name="validationContext">Validation context</param>
/// <returns>Validation Result</returns>
protected IEnumerable<System.ComponentModel.DataAnnotations.ValidationResult> BaseValidate(ValidationContext validationContext)
{
foreach (var x in BaseValidate(validationContext))
{
yield return x;
}
yield break;
}
}

}
129 changes: 129 additions & 0 deletions Adyen/Model/SessionAuthentication/AccountHolderResourceAllOf.cs
Original file line number Diff line number Diff line change
@@ -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
{
/// <summary>
/// AccountHolderResourceAllOf
/// </summary>
[DataContract(Name = "AccountHolderResource_allOf")]
public partial class AccountHolderResourceAllOf : IEquatable<AccountHolderResourceAllOf>, IValidatableObject
{
/// <summary>
/// Initializes a new instance of the <see cref="AccountHolderResourceAllOf" /> class.
/// </summary>
/// <param name="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..</param>
public AccountHolderResourceAllOf(string accountHolderId = default(string))
{
this.AccountHolderId = accountHolderId;
}

/// <summary>
/// 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.
/// </summary>
/// <value>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.</value>
[DataMember(Name = "accountHolderId", EmitDefaultValue = false)]
public string AccountHolderId { 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 AccountHolderResourceAllOf {\n");
sb.Append(" AccountHolderId: ").Append(AccountHolderId).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 AccountHolderResourceAllOf);
}

/// <summary>
/// Returns true if AccountHolderResourceAllOf instances are equal
/// </summary>
/// <param name="input">Instance of AccountHolderResourceAllOf to be compared</param>
/// <returns>Boolean</returns>
public bool Equals(AccountHolderResourceAllOf input)
{
if (input == null)
{
return false;
}
return
(
this.AccountHolderId == input.AccountHolderId ||
(this.AccountHolderId != null &&
this.AccountHolderId.Equals(input.AccountHolderId))
);
}

/// <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.AccountHolderId != null)
{
hashCode = (hashCode * 59) + this.AccountHolderId.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;
}
}

}
Loading
Loading