Skip to content

Commit

Permalink
false[adyen-sdk-automation] automated change (#1031)
Browse files Browse the repository at this point in the history
  • Loading branch information
AdyenAutomationBot authored Jul 4, 2024
1 parent 37458e6 commit 619512c
Show file tree
Hide file tree
Showing 3 changed files with 277 additions and 67 deletions.
35 changes: 34 additions & 1 deletion Adyen/Model/Checkout/CheckoutPaymentMethod.cs
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,18 @@ public CheckoutPaymentMethod(OpenInvoiceDetails actualInstance)
this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null.");
}

/// <summary>
/// Initializes a new instance of the <see cref="CheckoutPaymentMethod" /> class
/// with the <see cref="PayByBankDetails" /> class
/// </summary>
/// <param name="actualInstance">An instance of PayByBankDetails.</param>
public CheckoutPaymentMethod(PayByBankDetails actualInstance)
{
this.IsNullable = false;
this.SchemaType= "oneOf";
this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null.");
}

/// <summary>
/// Initializes a new instance of the <see cref="CheckoutPaymentMethod" /> class
/// with the <see cref="PayPalDetails" /> class
Expand Down Expand Up @@ -644,6 +656,10 @@ public override Object ActualInstance
{
this._actualInstance = value;
}
else if (value.GetType() == typeof(PayByBankDetails))
{
this._actualInstance = value;
}
else if (value.GetType() == typeof(PayPalDetails))
{
this._actualInstance = value;
Expand Down Expand Up @@ -706,7 +722,7 @@ public override Object ActualInstance
}
else
{
throw new ArgumentException("Invalid instance found. Must be the following types: AchDetails, AfterpayDetails, AmazonPayDetails, AncvDetails, AndroidPayDetails, ApplePayDetails, BacsDirectDebitDetails, BillDeskDetails, BlikDetails, CardDetails, CashAppDetails, CellulantDetails, DokuDetails, DotpayDetails, DragonpayDetails, EcontextVoucherDetails, GenericIssuerPaymentMethodDetails, GiropayDetails, GooglePayDetails, IdealDetails, KlarnaDetails, MasterpassDetails, MbwayDetails, MobilePayDetails, MolPayDetails, OpenInvoiceDetails, PayPalDetails, PayUUpiDetails, PayWithGoogleDetails, PaymentDetails, RatepayDetails, SamsungPayDetails, SepaDirectDebitDetails, StoredPaymentMethodDetails, UpiCollectDetails, UpiIntentDetails, VippsDetails, VisaCheckoutDetails, WeChatPayDetails, WeChatPayMiniProgramDetails, ZipDetails");
throw new ArgumentException("Invalid instance found. Must be the following types: AchDetails, AfterpayDetails, AmazonPayDetails, AncvDetails, AndroidPayDetails, ApplePayDetails, BacsDirectDebitDetails, BillDeskDetails, BlikDetails, CardDetails, CashAppDetails, CellulantDetails, DokuDetails, DotpayDetails, DragonpayDetails, EcontextVoucherDetails, GenericIssuerPaymentMethodDetails, GiropayDetails, GooglePayDetails, IdealDetails, KlarnaDetails, MasterpassDetails, MbwayDetails, MobilePayDetails, MolPayDetails, OpenInvoiceDetails, PayByBankDetails, PayPalDetails, PayUUpiDetails, PayWithGoogleDetails, PaymentDetails, RatepayDetails, SamsungPayDetails, SepaDirectDebitDetails, StoredPaymentMethodDetails, UpiCollectDetails, UpiIntentDetails, VippsDetails, VisaCheckoutDetails, WeChatPayDetails, WeChatPayMiniProgramDetails, ZipDetails");
}
}
}
Expand Down Expand Up @@ -971,6 +987,16 @@ public OpenInvoiceDetails GetOpenInvoiceDetails()
return (OpenInvoiceDetails)this.ActualInstance;
}

/// <summary>
/// Get the actual instance of `PayByBankDetails`. If the actual instance is not `PayByBankDetails`,
/// the InvalidClassException will be thrown
/// </summary>
/// <returns>An instance of PayByBankDetails</returns>
public PayByBankDetails GetPayByBankDetails()
{
return (PayByBankDetails)this.ActualInstance;
}

/// <summary>
/// Get the actual instance of `PayPalDetails`. If the actual instance is not `PayPalDetails`,
/// the InvalidClassException will be thrown
Expand Down Expand Up @@ -1349,6 +1375,13 @@ public static CheckoutPaymentMethod FromJson(string jsonString)
matchedTypes.Add("OpenInvoiceDetails");
match++;
}
// Check if the jsonString type enum matches the PayByBankDetails type enums
if (ContainsValue<PayByBankDetails.TypeEnum>(type))
{
newCheckoutPaymentMethod = new CheckoutPaymentMethod(JsonConvert.DeserializeObject<PayByBankDetails>(jsonString, CheckoutPaymentMethod.SerializerSettings));
matchedTypes.Add("PayByBankDetails");
match++;
}
// Check if the jsonString type enum matches the PayPalDetails type enums
if (ContainsValue<PayPalDetails.TypeEnum>(type))
{
Expand Down
183 changes: 183 additions & 0 deletions Adyen/Model/Checkout/PayByBankDetails.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,183 @@
/*
* Adyen Checkout API
*
*
* The version of the OpenAPI document: 71
*
* 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.Checkout
{
/// <summary>
/// PayByBankDetails
/// </summary>
[DataContract(Name = "PayByBankDetails")]
public partial class PayByBankDetails : IEquatable<PayByBankDetails>, IValidatableObject
{
/// <summary>
/// **paybybank**
/// </summary>
/// <value>**paybybank**</value>
[JsonConverter(typeof(StringEnumConverter))]
public enum TypeEnum
{
/// <summary>
/// Enum Paybybank for value: paybybank
/// </summary>
[EnumMember(Value = "paybybank")]
Paybybank = 1

}


/// <summary>
/// **paybybank**
/// </summary>
/// <value>**paybybank**</value>
[DataMember(Name = "type", IsRequired = false, EmitDefaultValue = false)]
public TypeEnum Type { get; set; }
/// <summary>
/// Initializes a new instance of the <see cref="PayByBankDetails" /> class.
/// </summary>
[JsonConstructorAttribute]
protected PayByBankDetails() { }
/// <summary>
/// Initializes a new instance of the <see cref="PayByBankDetails" /> class.
/// </summary>
/// <param name="checkoutAttemptId">The checkout attempt identifier..</param>
/// <param name="issuer">The PayByBank issuer value of the shopper&#39;s selected bank..</param>
/// <param name="type">**paybybank** (required) (default to TypeEnum.Paybybank).</param>
public PayByBankDetails(string checkoutAttemptId = default(string), string issuer = default(string), TypeEnum type = TypeEnum.Paybybank)
{
this.Type = type;
this.CheckoutAttemptId = checkoutAttemptId;
this.Issuer = issuer;
}

/// <summary>
/// The checkout attempt identifier.
/// </summary>
/// <value>The checkout attempt identifier.</value>
[DataMember(Name = "checkoutAttemptId", EmitDefaultValue = false)]
public string CheckoutAttemptId { get; set; }

/// <summary>
/// The PayByBank issuer value of the shopper&#39;s selected bank.
/// </summary>
/// <value>The PayByBank issuer value of the shopper&#39;s selected bank.</value>
[DataMember(Name = "issuer", EmitDefaultValue = false)]
public string Issuer { 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 PayByBankDetails {\n");
sb.Append(" CheckoutAttemptId: ").Append(CheckoutAttemptId).Append("\n");
sb.Append(" Issuer: ").Append(Issuer).Append("\n");
sb.Append(" Type: ").Append(Type).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 PayByBankDetails);
}

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

/// <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.CheckoutAttemptId != null)
{
hashCode = (hashCode * 59) + this.CheckoutAttemptId.GetHashCode();
}
if (this.Issuer != null)
{
hashCode = (hashCode * 59) + this.Issuer.GetHashCode();
}
hashCode = (hashCode * 59) + this.Type.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

0 comments on commit 619512c

Please sign in to comment.