/*
Adyen Checkout API

API version: 71
*/

// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.

package checkout

import (
	"encoding/json"
	"fmt"
)

// CheckoutPaymentMethod - The type and required details of a payment method to use.
type CheckoutPaymentMethod struct {
	AchDetails                        *AchDetails
	AffirmDetails                     *AffirmDetails
	AfterpayDetails                   *AfterpayDetails
	AmazonPayDetails                  *AmazonPayDetails
	AncvDetails                       *AncvDetails
	AndroidPayDetails                 *AndroidPayDetails
	ApplePayDetails                   *ApplePayDetails
	BacsDirectDebitDetails            *BacsDirectDebitDetails
	BillDeskDetails                   *BillDeskDetails
	BlikDetails                       *BlikDetails
	CardDetails                       *CardDetails
	CashAppDetails                    *CashAppDetails
	CellulantDetails                  *CellulantDetails
	DokuDetails                       *DokuDetails
	DragonpayDetails                  *DragonpayDetails
	EBankingFinlandDetails            *EBankingFinlandDetails
	EcontextVoucherDetails            *EcontextVoucherDetails
	EftDetails                        *EftDetails
	FastlaneDetails                   *FastlaneDetails
	GenericIssuerPaymentMethodDetails *GenericIssuerPaymentMethodDetails
	GooglePayDetails                  *GooglePayDetails
	IdealDetails                      *IdealDetails
	KlarnaDetails                     *KlarnaDetails
	MasterpassDetails                 *MasterpassDetails
	MbwayDetails                      *MbwayDetails
	MobilePayDetails                  *MobilePayDetails
	MolPayDetails                     *MolPayDetails
	OpenInvoiceDetails                *OpenInvoiceDetails
	PayByBankAISDirectDebitDetails    *PayByBankAISDirectDebitDetails
	PayByBankDetails                  *PayByBankDetails
	PayPalDetails                     *PayPalDetails
	PayPayDetails                     *PayPayDetails
	PayToDetails                      *PayToDetails
	PayUUpiDetails                    *PayUUpiDetails
	PayWithGoogleDetails              *PayWithGoogleDetails
	PaymentDetails                    *PaymentDetails
	PixDetails                        *PixDetails
	PseDetails                        *PseDetails
	RakutenPayDetails                 *RakutenPayDetails
	RatepayDetails                    *RatepayDetails
	RivertyDetails                    *RivertyDetails
	SamsungPayDetails                 *SamsungPayDetails
	SepaDirectDebitDetails            *SepaDirectDebitDetails
	StoredPaymentMethodDetails        *StoredPaymentMethodDetails
	TwintDetails                      *TwintDetails
	UpiCollectDetails                 *UpiCollectDetails
	UpiIntentDetails                  *UpiIntentDetails
	VippsDetails                      *VippsDetails
	VisaCheckoutDetails               *VisaCheckoutDetails
	WeChatPayDetails                  *WeChatPayDetails
	WeChatPayMiniProgramDetails       *WeChatPayMiniProgramDetails
	ZipDetails                        *ZipDetails
}

// AchDetailsAsCheckoutPaymentMethod is a convenience function that returns AchDetails wrapped in CheckoutPaymentMethod
func AchDetailsAsCheckoutPaymentMethod(v *AchDetails) CheckoutPaymentMethod {
	return CheckoutPaymentMethod{
		AchDetails: v,
	}
}

// AffirmDetailsAsCheckoutPaymentMethod is a convenience function that returns AffirmDetails wrapped in CheckoutPaymentMethod
func AffirmDetailsAsCheckoutPaymentMethod(v *AffirmDetails) CheckoutPaymentMethod {
	return CheckoutPaymentMethod{
		AffirmDetails: v,
	}
}

// AfterpayDetailsAsCheckoutPaymentMethod is a convenience function that returns AfterpayDetails wrapped in CheckoutPaymentMethod
func AfterpayDetailsAsCheckoutPaymentMethod(v *AfterpayDetails) CheckoutPaymentMethod {
	return CheckoutPaymentMethod{
		AfterpayDetails: v,
	}
}

// AmazonPayDetailsAsCheckoutPaymentMethod is a convenience function that returns AmazonPayDetails wrapped in CheckoutPaymentMethod
func AmazonPayDetailsAsCheckoutPaymentMethod(v *AmazonPayDetails) CheckoutPaymentMethod {
	return CheckoutPaymentMethod{
		AmazonPayDetails: v,
	}
}

// AncvDetailsAsCheckoutPaymentMethod is a convenience function that returns AncvDetails wrapped in CheckoutPaymentMethod
func AncvDetailsAsCheckoutPaymentMethod(v *AncvDetails) CheckoutPaymentMethod {
	return CheckoutPaymentMethod{
		AncvDetails: v,
	}
}

// AndroidPayDetailsAsCheckoutPaymentMethod is a convenience function that returns AndroidPayDetails wrapped in CheckoutPaymentMethod
func AndroidPayDetailsAsCheckoutPaymentMethod(v *AndroidPayDetails) CheckoutPaymentMethod {
	return CheckoutPaymentMethod{
		AndroidPayDetails: v,
	}
}

// ApplePayDetailsAsCheckoutPaymentMethod is a convenience function that returns ApplePayDetails wrapped in CheckoutPaymentMethod
func ApplePayDetailsAsCheckoutPaymentMethod(v *ApplePayDetails) CheckoutPaymentMethod {
	return CheckoutPaymentMethod{
		ApplePayDetails: v,
	}
}

// BacsDirectDebitDetailsAsCheckoutPaymentMethod is a convenience function that returns BacsDirectDebitDetails wrapped in CheckoutPaymentMethod
func BacsDirectDebitDetailsAsCheckoutPaymentMethod(v *BacsDirectDebitDetails) CheckoutPaymentMethod {
	return CheckoutPaymentMethod{
		BacsDirectDebitDetails: v,
	}
}

// BillDeskDetailsAsCheckoutPaymentMethod is a convenience function that returns BillDeskDetails wrapped in CheckoutPaymentMethod
func BillDeskDetailsAsCheckoutPaymentMethod(v *BillDeskDetails) CheckoutPaymentMethod {
	return CheckoutPaymentMethod{
		BillDeskDetails: v,
	}
}

// BlikDetailsAsCheckoutPaymentMethod is a convenience function that returns BlikDetails wrapped in CheckoutPaymentMethod
func BlikDetailsAsCheckoutPaymentMethod(v *BlikDetails) CheckoutPaymentMethod {
	return CheckoutPaymentMethod{
		BlikDetails: v,
	}
}

// CardDetailsAsCheckoutPaymentMethod is a convenience function that returns CardDetails wrapped in CheckoutPaymentMethod
func CardDetailsAsCheckoutPaymentMethod(v *CardDetails) CheckoutPaymentMethod {
	return CheckoutPaymentMethod{
		CardDetails: v,
	}
}

// CashAppDetailsAsCheckoutPaymentMethod is a convenience function that returns CashAppDetails wrapped in CheckoutPaymentMethod
func CashAppDetailsAsCheckoutPaymentMethod(v *CashAppDetails) CheckoutPaymentMethod {
	return CheckoutPaymentMethod{
		CashAppDetails: v,
	}
}

// CellulantDetailsAsCheckoutPaymentMethod is a convenience function that returns CellulantDetails wrapped in CheckoutPaymentMethod
func CellulantDetailsAsCheckoutPaymentMethod(v *CellulantDetails) CheckoutPaymentMethod {
	return CheckoutPaymentMethod{
		CellulantDetails: v,
	}
}

// DokuDetailsAsCheckoutPaymentMethod is a convenience function that returns DokuDetails wrapped in CheckoutPaymentMethod
func DokuDetailsAsCheckoutPaymentMethod(v *DokuDetails) CheckoutPaymentMethod {
	return CheckoutPaymentMethod{
		DokuDetails: v,
	}
}

// DragonpayDetailsAsCheckoutPaymentMethod is a convenience function that returns DragonpayDetails wrapped in CheckoutPaymentMethod
func DragonpayDetailsAsCheckoutPaymentMethod(v *DragonpayDetails) CheckoutPaymentMethod {
	return CheckoutPaymentMethod{
		DragonpayDetails: v,
	}
}

// EBankingFinlandDetailsAsCheckoutPaymentMethod is a convenience function that returns EBankingFinlandDetails wrapped in CheckoutPaymentMethod
func EBankingFinlandDetailsAsCheckoutPaymentMethod(v *EBankingFinlandDetails) CheckoutPaymentMethod {
	return CheckoutPaymentMethod{
		EBankingFinlandDetails: v,
	}
}

// EcontextVoucherDetailsAsCheckoutPaymentMethod is a convenience function that returns EcontextVoucherDetails wrapped in CheckoutPaymentMethod
func EcontextVoucherDetailsAsCheckoutPaymentMethod(v *EcontextVoucherDetails) CheckoutPaymentMethod {
	return CheckoutPaymentMethod{
		EcontextVoucherDetails: v,
	}
}

// EftDetailsAsCheckoutPaymentMethod is a convenience function that returns EftDetails wrapped in CheckoutPaymentMethod
func EftDetailsAsCheckoutPaymentMethod(v *EftDetails) CheckoutPaymentMethod {
	return CheckoutPaymentMethod{
		EftDetails: v,
	}
}

// FastlaneDetailsAsCheckoutPaymentMethod is a convenience function that returns FastlaneDetails wrapped in CheckoutPaymentMethod
func FastlaneDetailsAsCheckoutPaymentMethod(v *FastlaneDetails) CheckoutPaymentMethod {
	return CheckoutPaymentMethod{
		FastlaneDetails: v,
	}
}

// GenericIssuerPaymentMethodDetailsAsCheckoutPaymentMethod is a convenience function that returns GenericIssuerPaymentMethodDetails wrapped in CheckoutPaymentMethod
func GenericIssuerPaymentMethodDetailsAsCheckoutPaymentMethod(v *GenericIssuerPaymentMethodDetails) CheckoutPaymentMethod {
	return CheckoutPaymentMethod{
		GenericIssuerPaymentMethodDetails: v,
	}
}

// GooglePayDetailsAsCheckoutPaymentMethod is a convenience function that returns GooglePayDetails wrapped in CheckoutPaymentMethod
func GooglePayDetailsAsCheckoutPaymentMethod(v *GooglePayDetails) CheckoutPaymentMethod {
	return CheckoutPaymentMethod{
		GooglePayDetails: v,
	}
}

// IdealDetailsAsCheckoutPaymentMethod is a convenience function that returns IdealDetails wrapped in CheckoutPaymentMethod
func IdealDetailsAsCheckoutPaymentMethod(v *IdealDetails) CheckoutPaymentMethod {
	return CheckoutPaymentMethod{
		IdealDetails: v,
	}
}

// KlarnaDetailsAsCheckoutPaymentMethod is a convenience function that returns KlarnaDetails wrapped in CheckoutPaymentMethod
func KlarnaDetailsAsCheckoutPaymentMethod(v *KlarnaDetails) CheckoutPaymentMethod {
	return CheckoutPaymentMethod{
		KlarnaDetails: v,
	}
}

// MasterpassDetailsAsCheckoutPaymentMethod is a convenience function that returns MasterpassDetails wrapped in CheckoutPaymentMethod
func MasterpassDetailsAsCheckoutPaymentMethod(v *MasterpassDetails) CheckoutPaymentMethod {
	return CheckoutPaymentMethod{
		MasterpassDetails: v,
	}
}

// MbwayDetailsAsCheckoutPaymentMethod is a convenience function that returns MbwayDetails wrapped in CheckoutPaymentMethod
func MbwayDetailsAsCheckoutPaymentMethod(v *MbwayDetails) CheckoutPaymentMethod {
	return CheckoutPaymentMethod{
		MbwayDetails: v,
	}
}

// MobilePayDetailsAsCheckoutPaymentMethod is a convenience function that returns MobilePayDetails wrapped in CheckoutPaymentMethod
func MobilePayDetailsAsCheckoutPaymentMethod(v *MobilePayDetails) CheckoutPaymentMethod {
	return CheckoutPaymentMethod{
		MobilePayDetails: v,
	}
}

// MolPayDetailsAsCheckoutPaymentMethod is a convenience function that returns MolPayDetails wrapped in CheckoutPaymentMethod
func MolPayDetailsAsCheckoutPaymentMethod(v *MolPayDetails) CheckoutPaymentMethod {
	return CheckoutPaymentMethod{
		MolPayDetails: v,
	}
}

// OpenInvoiceDetailsAsCheckoutPaymentMethod is a convenience function that returns OpenInvoiceDetails wrapped in CheckoutPaymentMethod
func OpenInvoiceDetailsAsCheckoutPaymentMethod(v *OpenInvoiceDetails) CheckoutPaymentMethod {
	return CheckoutPaymentMethod{
		OpenInvoiceDetails: v,
	}
}

// PayByBankAISDirectDebitDetailsAsCheckoutPaymentMethod is a convenience function that returns PayByBankAISDirectDebitDetails wrapped in CheckoutPaymentMethod
func PayByBankAISDirectDebitDetailsAsCheckoutPaymentMethod(v *PayByBankAISDirectDebitDetails) CheckoutPaymentMethod {
	return CheckoutPaymentMethod{
		PayByBankAISDirectDebitDetails: v,
	}
}

// PayByBankDetailsAsCheckoutPaymentMethod is a convenience function that returns PayByBankDetails wrapped in CheckoutPaymentMethod
func PayByBankDetailsAsCheckoutPaymentMethod(v *PayByBankDetails) CheckoutPaymentMethod {
	return CheckoutPaymentMethod{
		PayByBankDetails: v,
	}
}

// PayPalDetailsAsCheckoutPaymentMethod is a convenience function that returns PayPalDetails wrapped in CheckoutPaymentMethod
func PayPalDetailsAsCheckoutPaymentMethod(v *PayPalDetails) CheckoutPaymentMethod {
	return CheckoutPaymentMethod{
		PayPalDetails: v,
	}
}

// PayPayDetailsAsCheckoutPaymentMethod is a convenience function that returns PayPayDetails wrapped in CheckoutPaymentMethod
func PayPayDetailsAsCheckoutPaymentMethod(v *PayPayDetails) CheckoutPaymentMethod {
	return CheckoutPaymentMethod{
		PayPayDetails: v,
	}
}

// PayToDetailsAsCheckoutPaymentMethod is a convenience function that returns PayToDetails wrapped in CheckoutPaymentMethod
func PayToDetailsAsCheckoutPaymentMethod(v *PayToDetails) CheckoutPaymentMethod {
	return CheckoutPaymentMethod{
		PayToDetails: v,
	}
}

// PayUUpiDetailsAsCheckoutPaymentMethod is a convenience function that returns PayUUpiDetails wrapped in CheckoutPaymentMethod
func PayUUpiDetailsAsCheckoutPaymentMethod(v *PayUUpiDetails) CheckoutPaymentMethod {
	return CheckoutPaymentMethod{
		PayUUpiDetails: v,
	}
}

// PayWithGoogleDetailsAsCheckoutPaymentMethod is a convenience function that returns PayWithGoogleDetails wrapped in CheckoutPaymentMethod
func PayWithGoogleDetailsAsCheckoutPaymentMethod(v *PayWithGoogleDetails) CheckoutPaymentMethod {
	return CheckoutPaymentMethod{
		PayWithGoogleDetails: v,
	}
}

// PaymentDetailsAsCheckoutPaymentMethod is a convenience function that returns PaymentDetails wrapped in CheckoutPaymentMethod
func PaymentDetailsAsCheckoutPaymentMethod(v *PaymentDetails) CheckoutPaymentMethod {
	return CheckoutPaymentMethod{
		PaymentDetails: v,
	}
}

// PixDetailsAsCheckoutPaymentMethod is a convenience function that returns PixDetails wrapped in CheckoutPaymentMethod
func PixDetailsAsCheckoutPaymentMethod(v *PixDetails) CheckoutPaymentMethod {
	return CheckoutPaymentMethod{
		PixDetails: v,
	}
}

// PseDetailsAsCheckoutPaymentMethod is a convenience function that returns PseDetails wrapped in CheckoutPaymentMethod
func PseDetailsAsCheckoutPaymentMethod(v *PseDetails) CheckoutPaymentMethod {
	return CheckoutPaymentMethod{
		PseDetails: v,
	}
}

// RakutenPayDetailsAsCheckoutPaymentMethod is a convenience function that returns RakutenPayDetails wrapped in CheckoutPaymentMethod
func RakutenPayDetailsAsCheckoutPaymentMethod(v *RakutenPayDetails) CheckoutPaymentMethod {
	return CheckoutPaymentMethod{
		RakutenPayDetails: v,
	}
}

// RatepayDetailsAsCheckoutPaymentMethod is a convenience function that returns RatepayDetails wrapped in CheckoutPaymentMethod
func RatepayDetailsAsCheckoutPaymentMethod(v *RatepayDetails) CheckoutPaymentMethod {
	return CheckoutPaymentMethod{
		RatepayDetails: v,
	}
}

// RivertyDetailsAsCheckoutPaymentMethod is a convenience function that returns RivertyDetails wrapped in CheckoutPaymentMethod
func RivertyDetailsAsCheckoutPaymentMethod(v *RivertyDetails) CheckoutPaymentMethod {
	return CheckoutPaymentMethod{
		RivertyDetails: v,
	}
}

// SamsungPayDetailsAsCheckoutPaymentMethod is a convenience function that returns SamsungPayDetails wrapped in CheckoutPaymentMethod
func SamsungPayDetailsAsCheckoutPaymentMethod(v *SamsungPayDetails) CheckoutPaymentMethod {
	return CheckoutPaymentMethod{
		SamsungPayDetails: v,
	}
}

// SepaDirectDebitDetailsAsCheckoutPaymentMethod is a convenience function that returns SepaDirectDebitDetails wrapped in CheckoutPaymentMethod
func SepaDirectDebitDetailsAsCheckoutPaymentMethod(v *SepaDirectDebitDetails) CheckoutPaymentMethod {
	return CheckoutPaymentMethod{
		SepaDirectDebitDetails: v,
	}
}

// StoredPaymentMethodDetailsAsCheckoutPaymentMethod is a convenience function that returns StoredPaymentMethodDetails wrapped in CheckoutPaymentMethod
func StoredPaymentMethodDetailsAsCheckoutPaymentMethod(v *StoredPaymentMethodDetails) CheckoutPaymentMethod {
	return CheckoutPaymentMethod{
		StoredPaymentMethodDetails: v,
	}
}

// TwintDetailsAsCheckoutPaymentMethod is a convenience function that returns TwintDetails wrapped in CheckoutPaymentMethod
func TwintDetailsAsCheckoutPaymentMethod(v *TwintDetails) CheckoutPaymentMethod {
	return CheckoutPaymentMethod{
		TwintDetails: v,
	}
}

// UpiCollectDetailsAsCheckoutPaymentMethod is a convenience function that returns UpiCollectDetails wrapped in CheckoutPaymentMethod
func UpiCollectDetailsAsCheckoutPaymentMethod(v *UpiCollectDetails) CheckoutPaymentMethod {
	return CheckoutPaymentMethod{
		UpiCollectDetails: v,
	}
}

// UpiIntentDetailsAsCheckoutPaymentMethod is a convenience function that returns UpiIntentDetails wrapped in CheckoutPaymentMethod
func UpiIntentDetailsAsCheckoutPaymentMethod(v *UpiIntentDetails) CheckoutPaymentMethod {
	return CheckoutPaymentMethod{
		UpiIntentDetails: v,
	}
}

// VippsDetailsAsCheckoutPaymentMethod is a convenience function that returns VippsDetails wrapped in CheckoutPaymentMethod
func VippsDetailsAsCheckoutPaymentMethod(v *VippsDetails) CheckoutPaymentMethod {
	return CheckoutPaymentMethod{
		VippsDetails: v,
	}
}

// VisaCheckoutDetailsAsCheckoutPaymentMethod is a convenience function that returns VisaCheckoutDetails wrapped in CheckoutPaymentMethod
func VisaCheckoutDetailsAsCheckoutPaymentMethod(v *VisaCheckoutDetails) CheckoutPaymentMethod {
	return CheckoutPaymentMethod{
		VisaCheckoutDetails: v,
	}
}

// WeChatPayDetailsAsCheckoutPaymentMethod is a convenience function that returns WeChatPayDetails wrapped in CheckoutPaymentMethod
func WeChatPayDetailsAsCheckoutPaymentMethod(v *WeChatPayDetails) CheckoutPaymentMethod {
	return CheckoutPaymentMethod{
		WeChatPayDetails: v,
	}
}

// WeChatPayMiniProgramDetailsAsCheckoutPaymentMethod is a convenience function that returns WeChatPayMiniProgramDetails wrapped in CheckoutPaymentMethod
func WeChatPayMiniProgramDetailsAsCheckoutPaymentMethod(v *WeChatPayMiniProgramDetails) CheckoutPaymentMethod {
	return CheckoutPaymentMethod{
		WeChatPayMiniProgramDetails: v,
	}
}

// ZipDetailsAsCheckoutPaymentMethod is a convenience function that returns ZipDetails wrapped in CheckoutPaymentMethod
func ZipDetailsAsCheckoutPaymentMethod(v *ZipDetails) CheckoutPaymentMethod {
	return CheckoutPaymentMethod{
		ZipDetails: v,
	}
}

// Unmarshal JSON data into one of the pointers in the struct
func (dst *CheckoutPaymentMethod) UnmarshalJSON(data []byte) error {
	var err error
	match := 0
	// try to unmarshal data into AchDetails
	err = json.Unmarshal(data, &dst.AchDetails)
	if err == nil {
		jsonAchDetails, _ := json.Marshal(dst.AchDetails)
		if string(jsonAchDetails) == "{}" || !dst.AchDetails.isValidType() { // empty struct
			dst.AchDetails = nil
		} else {
			match++
		}
	} else {
		dst.AchDetails = nil
	}

	// try to unmarshal data into AffirmDetails
	err = json.Unmarshal(data, &dst.AffirmDetails)
	if err == nil {
		jsonAffirmDetails, _ := json.Marshal(dst.AffirmDetails)
		if string(jsonAffirmDetails) == "{}" || !dst.AffirmDetails.isValidType() { // empty struct
			dst.AffirmDetails = nil
		} else {
			match++
		}
	} else {
		dst.AffirmDetails = nil
	}

	// try to unmarshal data into AfterpayDetails
	err = json.Unmarshal(data, &dst.AfterpayDetails)
	if err == nil {
		jsonAfterpayDetails, _ := json.Marshal(dst.AfterpayDetails)
		if string(jsonAfterpayDetails) == "{}" || !dst.AfterpayDetails.isValidType() { // empty struct
			dst.AfterpayDetails = nil
		} else {
			match++
		}
	} else {
		dst.AfterpayDetails = nil
	}

	// try to unmarshal data into AmazonPayDetails
	err = json.Unmarshal(data, &dst.AmazonPayDetails)
	if err == nil {
		jsonAmazonPayDetails, _ := json.Marshal(dst.AmazonPayDetails)
		if string(jsonAmazonPayDetails) == "{}" || !dst.AmazonPayDetails.isValidType() { // empty struct
			dst.AmazonPayDetails = nil
		} else {
			match++
		}
	} else {
		dst.AmazonPayDetails = nil
	}

	// try to unmarshal data into AncvDetails
	err = json.Unmarshal(data, &dst.AncvDetails)
	if err == nil {
		jsonAncvDetails, _ := json.Marshal(dst.AncvDetails)
		if string(jsonAncvDetails) == "{}" || !dst.AncvDetails.isValidType() { // empty struct
			dst.AncvDetails = nil
		} else {
			match++
		}
	} else {
		dst.AncvDetails = nil
	}

	// try to unmarshal data into AndroidPayDetails
	err = json.Unmarshal(data, &dst.AndroidPayDetails)
	if err == nil {
		jsonAndroidPayDetails, _ := json.Marshal(dst.AndroidPayDetails)
		if string(jsonAndroidPayDetails) == "{}" || !dst.AndroidPayDetails.isValidType() { // empty struct
			dst.AndroidPayDetails = nil
		} else {
			match++
		}
	} else {
		dst.AndroidPayDetails = nil
	}

	// try to unmarshal data into ApplePayDetails
	err = json.Unmarshal(data, &dst.ApplePayDetails)
	if err == nil {
		jsonApplePayDetails, _ := json.Marshal(dst.ApplePayDetails)
		if string(jsonApplePayDetails) == "{}" || !dst.ApplePayDetails.isValidType() { // empty struct
			dst.ApplePayDetails = nil
		} else {
			match++
		}
	} else {
		dst.ApplePayDetails = nil
	}

	// try to unmarshal data into BacsDirectDebitDetails
	err = json.Unmarshal(data, &dst.BacsDirectDebitDetails)
	if err == nil {
		jsonBacsDirectDebitDetails, _ := json.Marshal(dst.BacsDirectDebitDetails)
		if string(jsonBacsDirectDebitDetails) == "{}" || !dst.BacsDirectDebitDetails.isValidType() { // empty struct
			dst.BacsDirectDebitDetails = nil
		} else {
			match++
		}
	} else {
		dst.BacsDirectDebitDetails = nil
	}

	// try to unmarshal data into BillDeskDetails
	err = json.Unmarshal(data, &dst.BillDeskDetails)
	if err == nil {
		jsonBillDeskDetails, _ := json.Marshal(dst.BillDeskDetails)
		if string(jsonBillDeskDetails) == "{}" || !dst.BillDeskDetails.isValidType() { // empty struct
			dst.BillDeskDetails = nil
		} else {
			match++
		}
	} else {
		dst.BillDeskDetails = nil
	}

	// try to unmarshal data into BlikDetails
	err = json.Unmarshal(data, &dst.BlikDetails)
	if err == nil {
		jsonBlikDetails, _ := json.Marshal(dst.BlikDetails)
		if string(jsonBlikDetails) == "{}" || !dst.BlikDetails.isValidType() { // empty struct
			dst.BlikDetails = nil
		} else {
			match++
		}
	} else {
		dst.BlikDetails = nil
	}

	// try to unmarshal data into CardDetails
	err = json.Unmarshal(data, &dst.CardDetails)
	if err == nil {
		jsonCardDetails, _ := json.Marshal(dst.CardDetails)
		if string(jsonCardDetails) == "{}" || !dst.CardDetails.isValidType() { // empty struct
			dst.CardDetails = nil
		} else {
			match++
		}
	} else {
		dst.CardDetails = nil
	}

	// try to unmarshal data into CashAppDetails
	err = json.Unmarshal(data, &dst.CashAppDetails)
	if err == nil {
		jsonCashAppDetails, _ := json.Marshal(dst.CashAppDetails)
		if string(jsonCashAppDetails) == "{}" || !dst.CashAppDetails.isValidType() { // empty struct
			dst.CashAppDetails = nil
		} else {
			match++
		}
	} else {
		dst.CashAppDetails = nil
	}

	// try to unmarshal data into CellulantDetails
	err = json.Unmarshal(data, &dst.CellulantDetails)
	if err == nil {
		jsonCellulantDetails, _ := json.Marshal(dst.CellulantDetails)
		if string(jsonCellulantDetails) == "{}" || !dst.CellulantDetails.isValidType() { // empty struct
			dst.CellulantDetails = nil
		} else {
			match++
		}
	} else {
		dst.CellulantDetails = nil
	}

	// try to unmarshal data into DokuDetails
	err = json.Unmarshal(data, &dst.DokuDetails)
	if err == nil {
		jsonDokuDetails, _ := json.Marshal(dst.DokuDetails)
		if string(jsonDokuDetails) == "{}" || !dst.DokuDetails.isValidType() { // empty struct
			dst.DokuDetails = nil
		} else {
			match++
		}
	} else {
		dst.DokuDetails = nil
	}

	// try to unmarshal data into DragonpayDetails
	err = json.Unmarshal(data, &dst.DragonpayDetails)
	if err == nil {
		jsonDragonpayDetails, _ := json.Marshal(dst.DragonpayDetails)
		if string(jsonDragonpayDetails) == "{}" || !dst.DragonpayDetails.isValidType() { // empty struct
			dst.DragonpayDetails = nil
		} else {
			match++
		}
	} else {
		dst.DragonpayDetails = nil
	}

	// try to unmarshal data into EBankingFinlandDetails
	err = json.Unmarshal(data, &dst.EBankingFinlandDetails)
	if err == nil {
		jsonEBankingFinlandDetails, _ := json.Marshal(dst.EBankingFinlandDetails)
		if string(jsonEBankingFinlandDetails) == "{}" || !dst.EBankingFinlandDetails.isValidType() { // empty struct
			dst.EBankingFinlandDetails = nil
		} else {
			match++
		}
	} else {
		dst.EBankingFinlandDetails = nil
	}

	// try to unmarshal data into EcontextVoucherDetails
	err = json.Unmarshal(data, &dst.EcontextVoucherDetails)
	if err == nil {
		jsonEcontextVoucherDetails, _ := json.Marshal(dst.EcontextVoucherDetails)
		if string(jsonEcontextVoucherDetails) == "{}" || !dst.EcontextVoucherDetails.isValidType() { // empty struct
			dst.EcontextVoucherDetails = nil
		} else {
			match++
		}
	} else {
		dst.EcontextVoucherDetails = nil
	}

	// try to unmarshal data into EftDetails
	err = json.Unmarshal(data, &dst.EftDetails)
	if err == nil {
		jsonEftDetails, _ := json.Marshal(dst.EftDetails)
		if string(jsonEftDetails) == "{}" || !dst.EftDetails.isValidType() { // empty struct
			dst.EftDetails = nil
		} else {
			match++
		}
	} else {
		dst.EftDetails = nil
	}

	// try to unmarshal data into FastlaneDetails
	err = json.Unmarshal(data, &dst.FastlaneDetails)
	if err == nil {
		jsonFastlaneDetails, _ := json.Marshal(dst.FastlaneDetails)
		if string(jsonFastlaneDetails) == "{}" || !dst.FastlaneDetails.isValidType() { // empty struct
			dst.FastlaneDetails = nil
		} else {
			match++
		}
	} else {
		dst.FastlaneDetails = nil
	}

	// try to unmarshal data into GenericIssuerPaymentMethodDetails
	err = json.Unmarshal(data, &dst.GenericIssuerPaymentMethodDetails)
	if err == nil {
		jsonGenericIssuerPaymentMethodDetails, _ := json.Marshal(dst.GenericIssuerPaymentMethodDetails)
		if string(jsonGenericIssuerPaymentMethodDetails) == "{}" || !dst.GenericIssuerPaymentMethodDetails.isValidType() { // empty struct
			dst.GenericIssuerPaymentMethodDetails = nil
		} else {
			match++
		}
	} else {
		dst.GenericIssuerPaymentMethodDetails = nil
	}

	// try to unmarshal data into GooglePayDetails
	err = json.Unmarshal(data, &dst.GooglePayDetails)
	if err == nil {
		jsonGooglePayDetails, _ := json.Marshal(dst.GooglePayDetails)
		if string(jsonGooglePayDetails) == "{}" || !dst.GooglePayDetails.isValidType() { // empty struct
			dst.GooglePayDetails = nil
		} else {
			match++
		}
	} else {
		dst.GooglePayDetails = nil
	}

	// try to unmarshal data into IdealDetails
	err = json.Unmarshal(data, &dst.IdealDetails)
	if err == nil {
		jsonIdealDetails, _ := json.Marshal(dst.IdealDetails)
		if string(jsonIdealDetails) == "{}" || !dst.IdealDetails.isValidType() { // empty struct
			dst.IdealDetails = nil
		} else {
			match++
		}
	} else {
		dst.IdealDetails = nil
	}

	// try to unmarshal data into KlarnaDetails
	err = json.Unmarshal(data, &dst.KlarnaDetails)
	if err == nil {
		jsonKlarnaDetails, _ := json.Marshal(dst.KlarnaDetails)
		if string(jsonKlarnaDetails) == "{}" || !dst.KlarnaDetails.isValidType() { // empty struct
			dst.KlarnaDetails = nil
		} else {
			match++
		}
	} else {
		dst.KlarnaDetails = nil
	}

	// try to unmarshal data into MasterpassDetails
	err = json.Unmarshal(data, &dst.MasterpassDetails)
	if err == nil {
		jsonMasterpassDetails, _ := json.Marshal(dst.MasterpassDetails)
		if string(jsonMasterpassDetails) == "{}" || !dst.MasterpassDetails.isValidType() { // empty struct
			dst.MasterpassDetails = nil
		} else {
			match++
		}
	} else {
		dst.MasterpassDetails = nil
	}

	// try to unmarshal data into MbwayDetails
	err = json.Unmarshal(data, &dst.MbwayDetails)
	if err == nil {
		jsonMbwayDetails, _ := json.Marshal(dst.MbwayDetails)
		if string(jsonMbwayDetails) == "{}" || !dst.MbwayDetails.isValidType() { // empty struct
			dst.MbwayDetails = nil
		} else {
			match++
		}
	} else {
		dst.MbwayDetails = nil
	}

	// try to unmarshal data into MobilePayDetails
	err = json.Unmarshal(data, &dst.MobilePayDetails)
	if err == nil {
		jsonMobilePayDetails, _ := json.Marshal(dst.MobilePayDetails)
		if string(jsonMobilePayDetails) == "{}" || !dst.MobilePayDetails.isValidType() { // empty struct
			dst.MobilePayDetails = nil
		} else {
			match++
		}
	} else {
		dst.MobilePayDetails = nil
	}

	// try to unmarshal data into MolPayDetails
	err = json.Unmarshal(data, &dst.MolPayDetails)
	if err == nil {
		jsonMolPayDetails, _ := json.Marshal(dst.MolPayDetails)
		if string(jsonMolPayDetails) == "{}" || !dst.MolPayDetails.isValidType() { // empty struct
			dst.MolPayDetails = nil
		} else {
			match++
		}
	} else {
		dst.MolPayDetails = nil
	}

	// try to unmarshal data into OpenInvoiceDetails
	err = json.Unmarshal(data, &dst.OpenInvoiceDetails)
	if err == nil {
		jsonOpenInvoiceDetails, _ := json.Marshal(dst.OpenInvoiceDetails)
		if string(jsonOpenInvoiceDetails) == "{}" || !dst.OpenInvoiceDetails.isValidType() { // empty struct
			dst.OpenInvoiceDetails = nil
		} else {
			match++
		}
	} else {
		dst.OpenInvoiceDetails = nil
	}

	// try to unmarshal data into PayByBankAISDirectDebitDetails
	err = json.Unmarshal(data, &dst.PayByBankAISDirectDebitDetails)
	if err == nil {
		jsonPayByBankAISDirectDebitDetails, _ := json.Marshal(dst.PayByBankAISDirectDebitDetails)
		if string(jsonPayByBankAISDirectDebitDetails) == "{}" || !dst.PayByBankAISDirectDebitDetails.isValidType() { // empty struct
			dst.PayByBankAISDirectDebitDetails = nil
		} else {
			match++
		}
	} else {
		dst.PayByBankAISDirectDebitDetails = nil
	}

	// try to unmarshal data into PayByBankDetails
	err = json.Unmarshal(data, &dst.PayByBankDetails)
	if err == nil {
		jsonPayByBankDetails, _ := json.Marshal(dst.PayByBankDetails)
		if string(jsonPayByBankDetails) == "{}" || !dst.PayByBankDetails.isValidType() { // empty struct
			dst.PayByBankDetails = nil
		} else {
			match++
		}
	} else {
		dst.PayByBankDetails = nil
	}

	// try to unmarshal data into PayPalDetails
	err = json.Unmarshal(data, &dst.PayPalDetails)
	if err == nil {
		jsonPayPalDetails, _ := json.Marshal(dst.PayPalDetails)
		if string(jsonPayPalDetails) == "{}" || !dst.PayPalDetails.isValidType() { // empty struct
			dst.PayPalDetails = nil
		} else {
			match++
		}
	} else {
		dst.PayPalDetails = nil
	}

	// try to unmarshal data into PayPayDetails
	err = json.Unmarshal(data, &dst.PayPayDetails)
	if err == nil {
		jsonPayPayDetails, _ := json.Marshal(dst.PayPayDetails)
		if string(jsonPayPayDetails) == "{}" || !dst.PayPayDetails.isValidType() { // empty struct
			dst.PayPayDetails = nil
		} else {
			match++
		}
	} else {
		dst.PayPayDetails = nil
	}

	// try to unmarshal data into PayToDetails
	err = json.Unmarshal(data, &dst.PayToDetails)
	if err == nil {
		jsonPayToDetails, _ := json.Marshal(dst.PayToDetails)
		if string(jsonPayToDetails) == "{}" || !dst.PayToDetails.isValidType() { // empty struct
			dst.PayToDetails = nil
		} else {
			match++
		}
	} else {
		dst.PayToDetails = nil
	}

	// try to unmarshal data into PayUUpiDetails
	err = json.Unmarshal(data, &dst.PayUUpiDetails)
	if err == nil {
		jsonPayUUpiDetails, _ := json.Marshal(dst.PayUUpiDetails)
		if string(jsonPayUUpiDetails) == "{}" || !dst.PayUUpiDetails.isValidType() { // empty struct
			dst.PayUUpiDetails = nil
		} else {
			match++
		}
	} else {
		dst.PayUUpiDetails = nil
	}

	// try to unmarshal data into PayWithGoogleDetails
	err = json.Unmarshal(data, &dst.PayWithGoogleDetails)
	if err == nil {
		jsonPayWithGoogleDetails, _ := json.Marshal(dst.PayWithGoogleDetails)
		if string(jsonPayWithGoogleDetails) == "{}" || !dst.PayWithGoogleDetails.isValidType() { // empty struct
			dst.PayWithGoogleDetails = nil
		} else {
			match++
		}
	} else {
		dst.PayWithGoogleDetails = nil
	}

	// try to unmarshal data into PaymentDetails
	err = json.Unmarshal(data, &dst.PaymentDetails)
	if err == nil {
		jsonPaymentDetails, _ := json.Marshal(dst.PaymentDetails)
		if string(jsonPaymentDetails) == "{}" || !dst.PaymentDetails.isValidType() { // empty struct
			dst.PaymentDetails = nil
		} else {
			match++
		}
	} else {
		dst.PaymentDetails = nil
	}

	// try to unmarshal data into PixDetails
	err = json.Unmarshal(data, &dst.PixDetails)
	if err == nil {
		jsonPixDetails, _ := json.Marshal(dst.PixDetails)
		if string(jsonPixDetails) == "{}" || !dst.PixDetails.isValidType() { // empty struct
			dst.PixDetails = nil
		} else {
			match++
		}
	} else {
		dst.PixDetails = nil
	}

	// try to unmarshal data into PseDetails
	err = json.Unmarshal(data, &dst.PseDetails)
	if err == nil {
		jsonPseDetails, _ := json.Marshal(dst.PseDetails)
		if string(jsonPseDetails) == "{}" || !dst.PseDetails.isValidType() { // empty struct
			dst.PseDetails = nil
		} else {
			match++
		}
	} else {
		dst.PseDetails = nil
	}

	// try to unmarshal data into RakutenPayDetails
	err = json.Unmarshal(data, &dst.RakutenPayDetails)
	if err == nil {
		jsonRakutenPayDetails, _ := json.Marshal(dst.RakutenPayDetails)
		if string(jsonRakutenPayDetails) == "{}" || !dst.RakutenPayDetails.isValidType() { // empty struct
			dst.RakutenPayDetails = nil
		} else {
			match++
		}
	} else {
		dst.RakutenPayDetails = nil
	}

	// try to unmarshal data into RatepayDetails
	err = json.Unmarshal(data, &dst.RatepayDetails)
	if err == nil {
		jsonRatepayDetails, _ := json.Marshal(dst.RatepayDetails)
		if string(jsonRatepayDetails) == "{}" || !dst.RatepayDetails.isValidType() { // empty struct
			dst.RatepayDetails = nil
		} else {
			match++
		}
	} else {
		dst.RatepayDetails = nil
	}

	// try to unmarshal data into RivertyDetails
	err = json.Unmarshal(data, &dst.RivertyDetails)
	if err == nil {
		jsonRivertyDetails, _ := json.Marshal(dst.RivertyDetails)
		if string(jsonRivertyDetails) == "{}" || !dst.RivertyDetails.isValidType() { // empty struct
			dst.RivertyDetails = nil
		} else {
			match++
		}
	} else {
		dst.RivertyDetails = nil
	}

	// try to unmarshal data into SamsungPayDetails
	err = json.Unmarshal(data, &dst.SamsungPayDetails)
	if err == nil {
		jsonSamsungPayDetails, _ := json.Marshal(dst.SamsungPayDetails)
		if string(jsonSamsungPayDetails) == "{}" || !dst.SamsungPayDetails.isValidType() { // empty struct
			dst.SamsungPayDetails = nil
		} else {
			match++
		}
	} else {
		dst.SamsungPayDetails = nil
	}

	// try to unmarshal data into SepaDirectDebitDetails
	err = json.Unmarshal(data, &dst.SepaDirectDebitDetails)
	if err == nil {
		jsonSepaDirectDebitDetails, _ := json.Marshal(dst.SepaDirectDebitDetails)
		if string(jsonSepaDirectDebitDetails) == "{}" || !dst.SepaDirectDebitDetails.isValidType() { // empty struct
			dst.SepaDirectDebitDetails = nil
		} else {
			match++
		}
	} else {
		dst.SepaDirectDebitDetails = nil
	}

	// try to unmarshal data into StoredPaymentMethodDetails
	err = json.Unmarshal(data, &dst.StoredPaymentMethodDetails)
	if err == nil {
		jsonStoredPaymentMethodDetails, _ := json.Marshal(dst.StoredPaymentMethodDetails)
		if string(jsonStoredPaymentMethodDetails) == "{}" || !dst.StoredPaymentMethodDetails.isValidType() { // empty struct
			dst.StoredPaymentMethodDetails = nil
		} else {
			match++
		}
	} else {
		dst.StoredPaymentMethodDetails = nil
	}

	// try to unmarshal data into TwintDetails
	err = json.Unmarshal(data, &dst.TwintDetails)
	if err == nil {
		jsonTwintDetails, _ := json.Marshal(dst.TwintDetails)
		if string(jsonTwintDetails) == "{}" || !dst.TwintDetails.isValidType() { // empty struct
			dst.TwintDetails = nil
		} else {
			match++
		}
	} else {
		dst.TwintDetails = nil
	}

	// try to unmarshal data into UpiCollectDetails
	err = json.Unmarshal(data, &dst.UpiCollectDetails)
	if err == nil {
		jsonUpiCollectDetails, _ := json.Marshal(dst.UpiCollectDetails)
		if string(jsonUpiCollectDetails) == "{}" || !dst.UpiCollectDetails.isValidType() { // empty struct
			dst.UpiCollectDetails = nil
		} else {
			match++
		}
	} else {
		dst.UpiCollectDetails = nil
	}

	// try to unmarshal data into UpiIntentDetails
	err = json.Unmarshal(data, &dst.UpiIntentDetails)
	if err == nil {
		jsonUpiIntentDetails, _ := json.Marshal(dst.UpiIntentDetails)
		if string(jsonUpiIntentDetails) == "{}" || !dst.UpiIntentDetails.isValidType() { // empty struct
			dst.UpiIntentDetails = nil
		} else {
			match++
		}
	} else {
		dst.UpiIntentDetails = nil
	}

	// try to unmarshal data into VippsDetails
	err = json.Unmarshal(data, &dst.VippsDetails)
	if err == nil {
		jsonVippsDetails, _ := json.Marshal(dst.VippsDetails)
		if string(jsonVippsDetails) == "{}" || !dst.VippsDetails.isValidType() { // empty struct
			dst.VippsDetails = nil
		} else {
			match++
		}
	} else {
		dst.VippsDetails = nil
	}

	// try to unmarshal data into VisaCheckoutDetails
	err = json.Unmarshal(data, &dst.VisaCheckoutDetails)
	if err == nil {
		jsonVisaCheckoutDetails, _ := json.Marshal(dst.VisaCheckoutDetails)
		if string(jsonVisaCheckoutDetails) == "{}" || !dst.VisaCheckoutDetails.isValidType() { // empty struct
			dst.VisaCheckoutDetails = nil
		} else {
			match++
		}
	} else {
		dst.VisaCheckoutDetails = nil
	}

	// try to unmarshal data into WeChatPayDetails
	err = json.Unmarshal(data, &dst.WeChatPayDetails)
	if err == nil {
		jsonWeChatPayDetails, _ := json.Marshal(dst.WeChatPayDetails)
		if string(jsonWeChatPayDetails) == "{}" || !dst.WeChatPayDetails.isValidType() { // empty struct
			dst.WeChatPayDetails = nil
		} else {
			match++
		}
	} else {
		dst.WeChatPayDetails = nil
	}

	// try to unmarshal data into WeChatPayMiniProgramDetails
	err = json.Unmarshal(data, &dst.WeChatPayMiniProgramDetails)
	if err == nil {
		jsonWeChatPayMiniProgramDetails, _ := json.Marshal(dst.WeChatPayMiniProgramDetails)
		if string(jsonWeChatPayMiniProgramDetails) == "{}" || !dst.WeChatPayMiniProgramDetails.isValidType() { // empty struct
			dst.WeChatPayMiniProgramDetails = nil
		} else {
			match++
		}
	} else {
		dst.WeChatPayMiniProgramDetails = nil
	}

	// try to unmarshal data into ZipDetails
	err = json.Unmarshal(data, &dst.ZipDetails)
	if err == nil {
		jsonZipDetails, _ := json.Marshal(dst.ZipDetails)
		if string(jsonZipDetails) == "{}" || !dst.ZipDetails.isValidType() { // empty struct
			dst.ZipDetails = nil
		} else {
			match++
		}
	} else {
		dst.ZipDetails = nil
	}

	if match > 1 { // more than 1 match
		// reset to nil
		dst.AchDetails = nil
		dst.AffirmDetails = nil
		dst.AfterpayDetails = nil
		dst.AmazonPayDetails = nil
		dst.AncvDetails = nil
		dst.AndroidPayDetails = nil
		dst.ApplePayDetails = nil
		dst.BacsDirectDebitDetails = nil
		dst.BillDeskDetails = nil
		dst.BlikDetails = nil
		dst.CardDetails = nil
		dst.CashAppDetails = nil
		dst.CellulantDetails = nil
		dst.DokuDetails = nil
		dst.DragonpayDetails = nil
		dst.EBankingFinlandDetails = nil
		dst.EcontextVoucherDetails = nil
		dst.EftDetails = nil
		dst.FastlaneDetails = nil
		dst.GenericIssuerPaymentMethodDetails = nil
		dst.GooglePayDetails = nil
		dst.IdealDetails = nil
		dst.KlarnaDetails = nil
		dst.MasterpassDetails = nil
		dst.MbwayDetails = nil
		dst.MobilePayDetails = nil
		dst.MolPayDetails = nil
		dst.OpenInvoiceDetails = nil
		dst.PayByBankAISDirectDebitDetails = nil
		dst.PayByBankDetails = nil
		dst.PayPalDetails = nil
		dst.PayPayDetails = nil
		dst.PayToDetails = nil
		dst.PayUUpiDetails = nil
		dst.PayWithGoogleDetails = nil
		dst.PaymentDetails = nil
		dst.PixDetails = nil
		dst.PseDetails = nil
		dst.RakutenPayDetails = nil
		dst.RatepayDetails = nil
		dst.RivertyDetails = nil
		dst.SamsungPayDetails = nil
		dst.SepaDirectDebitDetails = nil
		dst.StoredPaymentMethodDetails = nil
		dst.TwintDetails = nil
		dst.UpiCollectDetails = nil
		dst.UpiIntentDetails = nil
		dst.VippsDetails = nil
		dst.VisaCheckoutDetails = nil
		dst.WeChatPayDetails = nil
		dst.WeChatPayMiniProgramDetails = nil
		dst.ZipDetails = nil

		return fmt.Errorf("data matches more than one schema in oneOf(CheckoutPaymentMethod)")
	} else if match == 1 {
		return nil // exactly one match
	} else { // no match
		return fmt.Errorf("data failed to match schemas in oneOf(CheckoutPaymentMethod)")
	}
}

// Marshal data from the first non-nil pointers in the struct to JSON
func (src CheckoutPaymentMethod) MarshalJSON() ([]byte, error) {
	if src.AchDetails != nil {
		return json.Marshal(&src.AchDetails)
	}

	if src.AffirmDetails != nil {
		return json.Marshal(&src.AffirmDetails)
	}

	if src.AfterpayDetails != nil {
		return json.Marshal(&src.AfterpayDetails)
	}

	if src.AmazonPayDetails != nil {
		return json.Marshal(&src.AmazonPayDetails)
	}

	if src.AncvDetails != nil {
		return json.Marshal(&src.AncvDetails)
	}

	if src.AndroidPayDetails != nil {
		return json.Marshal(&src.AndroidPayDetails)
	}

	if src.ApplePayDetails != nil {
		return json.Marshal(&src.ApplePayDetails)
	}

	if src.BacsDirectDebitDetails != nil {
		return json.Marshal(&src.BacsDirectDebitDetails)
	}

	if src.BillDeskDetails != nil {
		return json.Marshal(&src.BillDeskDetails)
	}

	if src.BlikDetails != nil {
		return json.Marshal(&src.BlikDetails)
	}

	if src.CardDetails != nil {
		return json.Marshal(&src.CardDetails)
	}

	if src.CashAppDetails != nil {
		return json.Marshal(&src.CashAppDetails)
	}

	if src.CellulantDetails != nil {
		return json.Marshal(&src.CellulantDetails)
	}

	if src.DokuDetails != nil {
		return json.Marshal(&src.DokuDetails)
	}

	if src.DragonpayDetails != nil {
		return json.Marshal(&src.DragonpayDetails)
	}

	if src.EBankingFinlandDetails != nil {
		return json.Marshal(&src.EBankingFinlandDetails)
	}

	if src.EcontextVoucherDetails != nil {
		return json.Marshal(&src.EcontextVoucherDetails)
	}

	if src.EftDetails != nil {
		return json.Marshal(&src.EftDetails)
	}

	if src.FastlaneDetails != nil {
		return json.Marshal(&src.FastlaneDetails)
	}

	if src.GenericIssuerPaymentMethodDetails != nil {
		return json.Marshal(&src.GenericIssuerPaymentMethodDetails)
	}

	if src.GooglePayDetails != nil {
		return json.Marshal(&src.GooglePayDetails)
	}

	if src.IdealDetails != nil {
		return json.Marshal(&src.IdealDetails)
	}

	if src.KlarnaDetails != nil {
		return json.Marshal(&src.KlarnaDetails)
	}

	if src.MasterpassDetails != nil {
		return json.Marshal(&src.MasterpassDetails)
	}

	if src.MbwayDetails != nil {
		return json.Marshal(&src.MbwayDetails)
	}

	if src.MobilePayDetails != nil {
		return json.Marshal(&src.MobilePayDetails)
	}

	if src.MolPayDetails != nil {
		return json.Marshal(&src.MolPayDetails)
	}

	if src.OpenInvoiceDetails != nil {
		return json.Marshal(&src.OpenInvoiceDetails)
	}

	if src.PayByBankAISDirectDebitDetails != nil {
		return json.Marshal(&src.PayByBankAISDirectDebitDetails)
	}

	if src.PayByBankDetails != nil {
		return json.Marshal(&src.PayByBankDetails)
	}

	if src.PayPalDetails != nil {
		return json.Marshal(&src.PayPalDetails)
	}

	if src.PayPayDetails != nil {
		return json.Marshal(&src.PayPayDetails)
	}

	if src.PayToDetails != nil {
		return json.Marshal(&src.PayToDetails)
	}

	if src.PayUUpiDetails != nil {
		return json.Marshal(&src.PayUUpiDetails)
	}

	if src.PayWithGoogleDetails != nil {
		return json.Marshal(&src.PayWithGoogleDetails)
	}

	if src.PaymentDetails != nil {
		return json.Marshal(&src.PaymentDetails)
	}

	if src.PixDetails != nil {
		return json.Marshal(&src.PixDetails)
	}

	if src.PseDetails != nil {
		return json.Marshal(&src.PseDetails)
	}

	if src.RakutenPayDetails != nil {
		return json.Marshal(&src.RakutenPayDetails)
	}

	if src.RatepayDetails != nil {
		return json.Marshal(&src.RatepayDetails)
	}

	if src.RivertyDetails != nil {
		return json.Marshal(&src.RivertyDetails)
	}

	if src.SamsungPayDetails != nil {
		return json.Marshal(&src.SamsungPayDetails)
	}

	if src.SepaDirectDebitDetails != nil {
		return json.Marshal(&src.SepaDirectDebitDetails)
	}

	if src.StoredPaymentMethodDetails != nil {
		return json.Marshal(&src.StoredPaymentMethodDetails)
	}

	if src.TwintDetails != nil {
		return json.Marshal(&src.TwintDetails)
	}

	if src.UpiCollectDetails != nil {
		return json.Marshal(&src.UpiCollectDetails)
	}

	if src.UpiIntentDetails != nil {
		return json.Marshal(&src.UpiIntentDetails)
	}

	if src.VippsDetails != nil {
		return json.Marshal(&src.VippsDetails)
	}

	if src.VisaCheckoutDetails != nil {
		return json.Marshal(&src.VisaCheckoutDetails)
	}

	if src.WeChatPayDetails != nil {
		return json.Marshal(&src.WeChatPayDetails)
	}

	if src.WeChatPayMiniProgramDetails != nil {
		return json.Marshal(&src.WeChatPayMiniProgramDetails)
	}

	if src.ZipDetails != nil {
		return json.Marshal(&src.ZipDetails)
	}

	return nil, nil // no data in oneOf schemas
}

// Get the actual instance
func (obj *CheckoutPaymentMethod) GetActualInstance() interface{} {
	if obj == nil {
		return nil
	}
	if obj.AchDetails != nil {
		return obj.AchDetails
	}

	if obj.AffirmDetails != nil {
		return obj.AffirmDetails
	}

	if obj.AfterpayDetails != nil {
		return obj.AfterpayDetails
	}

	if obj.AmazonPayDetails != nil {
		return obj.AmazonPayDetails
	}

	if obj.AncvDetails != nil {
		return obj.AncvDetails
	}

	if obj.AndroidPayDetails != nil {
		return obj.AndroidPayDetails
	}

	if obj.ApplePayDetails != nil {
		return obj.ApplePayDetails
	}

	if obj.BacsDirectDebitDetails != nil {
		return obj.BacsDirectDebitDetails
	}

	if obj.BillDeskDetails != nil {
		return obj.BillDeskDetails
	}

	if obj.BlikDetails != nil {
		return obj.BlikDetails
	}

	if obj.CardDetails != nil {
		return obj.CardDetails
	}

	if obj.CashAppDetails != nil {
		return obj.CashAppDetails
	}

	if obj.CellulantDetails != nil {
		return obj.CellulantDetails
	}

	if obj.DokuDetails != nil {
		return obj.DokuDetails
	}

	if obj.DragonpayDetails != nil {
		return obj.DragonpayDetails
	}

	if obj.EBankingFinlandDetails != nil {
		return obj.EBankingFinlandDetails
	}

	if obj.EcontextVoucherDetails != nil {
		return obj.EcontextVoucherDetails
	}

	if obj.EftDetails != nil {
		return obj.EftDetails
	}

	if obj.FastlaneDetails != nil {
		return obj.FastlaneDetails
	}

	if obj.GenericIssuerPaymentMethodDetails != nil {
		return obj.GenericIssuerPaymentMethodDetails
	}

	if obj.GooglePayDetails != nil {
		return obj.GooglePayDetails
	}

	if obj.IdealDetails != nil {
		return obj.IdealDetails
	}

	if obj.KlarnaDetails != nil {
		return obj.KlarnaDetails
	}

	if obj.MasterpassDetails != nil {
		return obj.MasterpassDetails
	}

	if obj.MbwayDetails != nil {
		return obj.MbwayDetails
	}

	if obj.MobilePayDetails != nil {
		return obj.MobilePayDetails
	}

	if obj.MolPayDetails != nil {
		return obj.MolPayDetails
	}

	if obj.OpenInvoiceDetails != nil {
		return obj.OpenInvoiceDetails
	}

	if obj.PayByBankAISDirectDebitDetails != nil {
		return obj.PayByBankAISDirectDebitDetails
	}

	if obj.PayByBankDetails != nil {
		return obj.PayByBankDetails
	}

	if obj.PayPalDetails != nil {
		return obj.PayPalDetails
	}

	if obj.PayPayDetails != nil {
		return obj.PayPayDetails
	}

	if obj.PayToDetails != nil {
		return obj.PayToDetails
	}

	if obj.PayUUpiDetails != nil {
		return obj.PayUUpiDetails
	}

	if obj.PayWithGoogleDetails != nil {
		return obj.PayWithGoogleDetails
	}

	if obj.PaymentDetails != nil {
		return obj.PaymentDetails
	}

	if obj.PixDetails != nil {
		return obj.PixDetails
	}

	if obj.PseDetails != nil {
		return obj.PseDetails
	}

	if obj.RakutenPayDetails != nil {
		return obj.RakutenPayDetails
	}

	if obj.RatepayDetails != nil {
		return obj.RatepayDetails
	}

	if obj.RivertyDetails != nil {
		return obj.RivertyDetails
	}

	if obj.SamsungPayDetails != nil {
		return obj.SamsungPayDetails
	}

	if obj.SepaDirectDebitDetails != nil {
		return obj.SepaDirectDebitDetails
	}

	if obj.StoredPaymentMethodDetails != nil {
		return obj.StoredPaymentMethodDetails
	}

	if obj.TwintDetails != nil {
		return obj.TwintDetails
	}

	if obj.UpiCollectDetails != nil {
		return obj.UpiCollectDetails
	}

	if obj.UpiIntentDetails != nil {
		return obj.UpiIntentDetails
	}

	if obj.VippsDetails != nil {
		return obj.VippsDetails
	}

	if obj.VisaCheckoutDetails != nil {
		return obj.VisaCheckoutDetails
	}

	if obj.WeChatPayDetails != nil {
		return obj.WeChatPayDetails
	}

	if obj.WeChatPayMiniProgramDetails != nil {
		return obj.WeChatPayMiniProgramDetails
	}

	if obj.ZipDetails != nil {
		return obj.ZipDetails
	}

	// all schemas are nil
	return nil
}

type NullableCheckoutPaymentMethod struct {
	value *CheckoutPaymentMethod
	isSet bool
}

func (v NullableCheckoutPaymentMethod) Get() *CheckoutPaymentMethod {
	return v.value
}

func (v *NullableCheckoutPaymentMethod) Set(val *CheckoutPaymentMethod) {
	v.value = val
	v.isSet = true
}

func (v NullableCheckoutPaymentMethod) IsSet() bool {
	return v.isSet
}

func (v *NullableCheckoutPaymentMethod) Unset() {
	v.value = nil
	v.isSet = false
}

func NewNullableCheckoutPaymentMethod(val *CheckoutPaymentMethod) *NullableCheckoutPaymentMethod {
	return &NullableCheckoutPaymentMethod{value: val, isSet: true}
}

func (v NullableCheckoutPaymentMethod) MarshalJSON() ([]byte, error) {
	return json.Marshal(v.value)
}

func (v *NullableCheckoutPaymentMethod) UnmarshalJSON(src []byte) error {
	v.isSet = true
	return json.Unmarshal(src, &v.value)
}
