{-# LANGUAGE MultiWayIf #-}
  CHANGE WITH CAUTION : This is a generated code file generated by -OpenAPI-Code-Generator/Haskell-OpenAPI-Client-Code-Generator .
{-# LANGUAGE OverloadedStrings #-}

-- | Contains the types generated from the schema PaymentMethodDetailsIdeal
module StripeAPI.Types.PaymentMethodDetailsIdeal where

import qualified Control.Monad.Fail
import qualified Data.Aeson
import qualified Data.Aeson as Data.Aeson.Encoding.Internal
import qualified Data.Aeson as Data.Aeson.Types
import qualified Data.Aeson as Data.Aeson.Types.FromJSON
import qualified Data.Aeson as Data.Aeson.Types.Internal
import qualified Data.Aeson as Data.Aeson.Types.ToJSON
import qualified Data.ByteString.Char8
import qualified Data.ByteString.Char8 as Data.ByteString.Internal
import qualified Data.Foldable
import qualified Data.Functor
import qualified Data.Maybe
import qualified Data.Scientific
import qualified Data.Text
import qualified Data.Text.Internal
import qualified Data.Time.Calendar as Data.Time.Calendar.Days
import qualified Data.Time.LocalTime as Data.Time.LocalTime.Internal.ZonedTime
import qualified GHC.Base
import qualified GHC.Classes
import qualified GHC.Int
import qualified GHC.Show
import qualified GHC.Types
import qualified StripeAPI.Common
import StripeAPI.TypeAlias
import {-# SOURCE #-} StripeAPI.Types.Mandate
import {-# SOURCE #-} StripeAPI.Types.PaymentMethod
import qualified Prelude as GHC.Integer.Type
import qualified Prelude as GHC.Maybe

-- | Defines the object schema located at @components.schemas.payment_method_details_ideal@ in the specification.
data PaymentMethodDetailsIdeal = PaymentMethodDetailsIdeal
  | bank : The customer\ 's bank . Can be one of \`abn_amro\ ` , \`asn_bank\ ` ,   , \`handelsbanken\ ` , \`ing\ ` , \`knab\ ` , \`moneyou\ ` , \`rabobank\ ` , \`regiobank\ ` , \`revolut\ ` ,   , \`triodos_bank\ ` , or \`van_lanschot\ ` .
    paymentMethodDetailsIdealBank :: (GHC.Maybe.Maybe (StripeAPI.Common.Nullable PaymentMethodDetailsIdealBank'NonNullable)),
  | bic : The Bank Identifier Code of the customer\ 's bank .
    paymentMethodDetailsIdealBic :: (GHC.Maybe.Maybe (StripeAPI.Common.Nullable PaymentMethodDetailsIdealBic'NonNullable)),
    -- | generated_sepa_debit: The ID of the SEPA Direct Debit PaymentMethod which was generated by this Charge.
    paymentMethodDetailsIdealGeneratedSepaDebit :: (GHC.Maybe.Maybe (StripeAPI.Common.Nullable PaymentMethodDetailsIdealGeneratedSepaDebit'NonNullableVariants)),
    -- | generated_sepa_debit_mandate: The mandate for the SEPA Direct Debit PaymentMethod which was generated by this Charge.
    paymentMethodDetailsIdealGeneratedSepaDebitMandate :: (GHC.Maybe.Maybe (StripeAPI.Common.Nullable PaymentMethodDetailsIdealGeneratedSepaDebitMandate'NonNullableVariants)),
  | iban_last4 : Last four characters of the IBAN .
    --
    -- Constraints:
    --
  * Maximum length of 5000
    paymentMethodDetailsIdealIbanLast4 :: (GHC.Maybe.Maybe (StripeAPI.Common.Nullable Data.Text.Internal.Text)),
  | verified_name : Owner\ 's verified full name . Values are verified or provided by iDEAL directly
    -- (if supported) at the time of authorization or settlement. They cannot be set or mutated.
    --
    -- Constraints:
    --
  * Maximum length of 5000
    paymentMethodDetailsIdealVerifiedName :: (GHC.Maybe.Maybe (StripeAPI.Common.Nullable Data.Text.Internal.Text))
  }
  deriving
    ( GHC.Show.Show,
      GHC.Classes.Eq
    )

instance Data.Aeson.Types.ToJSON.ToJSON PaymentMethodDetailsIdeal where
  toJSON obj = Data.Aeson.Types.Internal.object (Data.Foldable.concat (Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("bank" Data.Aeson.Types.ToJSON..=)) (paymentMethodDetailsIdealBank obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("bic" Data.Aeson.Types.ToJSON..=)) (paymentMethodDetailsIdealBic obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("generated_sepa_debit" Data.Aeson.Types.ToJSON..=)) (paymentMethodDetailsIdealGeneratedSepaDebit obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("generated_sepa_debit_mandate" Data.Aeson.Types.ToJSON..=)) (paymentMethodDetailsIdealGeneratedSepaDebitMandate obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("iban_last4" Data.Aeson.Types.ToJSON..=)) (paymentMethodDetailsIdealIbanLast4 obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("verified_name" Data.Aeson.Types.ToJSON..=)) (paymentMethodDetailsIdealVerifiedName obj) : GHC.Base.mempty))
  toEncoding obj = Data.Aeson.Encoding.Internal.pairs (GHC.Base.mconcat (Data.Foldable.concat (Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("bank" Data.Aeson.Types.ToJSON..=)) (paymentMethodDetailsIdealBank obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("bic" Data.Aeson.Types.ToJSON..=)) (paymentMethodDetailsIdealBic obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("generated_sepa_debit" Data.Aeson.Types.ToJSON..=)) (paymentMethodDetailsIdealGeneratedSepaDebit obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("generated_sepa_debit_mandate" Data.Aeson.Types.ToJSON..=)) (paymentMethodDetailsIdealGeneratedSepaDebitMandate obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("iban_last4" Data.Aeson.Types.ToJSON..=)) (paymentMethodDetailsIdealIbanLast4 obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("verified_name" Data.Aeson.Types.ToJSON..=)) (paymentMethodDetailsIdealVerifiedName obj) : GHC.Base.mempty)))

instance Data.Aeson.Types.FromJSON.FromJSON PaymentMethodDetailsIdeal where
  parseJSON = Data.Aeson.Types.FromJSON.withObject "PaymentMethodDetailsIdeal" (\obj -> (((((GHC.Base.pure PaymentMethodDetailsIdeal GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "bank")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "bic")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "generated_sepa_debit")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "generated_sepa_debit_mandate")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "iban_last4")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "verified_name"))

-- | Create a new 'PaymentMethodDetailsIdeal' with all required fields.
mkPaymentMethodDetailsIdeal :: PaymentMethodDetailsIdeal
mkPaymentMethodDetailsIdeal =
  PaymentMethodDetailsIdeal
    { paymentMethodDetailsIdealBank = GHC.Maybe.Nothing,
      paymentMethodDetailsIdealBic = GHC.Maybe.Nothing,
      paymentMethodDetailsIdealGeneratedSepaDebit = GHC.Maybe.Nothing,
      paymentMethodDetailsIdealGeneratedSepaDebitMandate = GHC.Maybe.Nothing,
      paymentMethodDetailsIdealIbanLast4 = GHC.Maybe.Nothing,
      paymentMethodDetailsIdealVerifiedName = GHC.Maybe.Nothing
    }

-- | Defines the enum schema located at @components.schemas.payment_method_details_ideal.properties.bank@ in the specification.
--
  The customer\ 's bank . Can be one of \`abn_amro\ ` , \`asn_bank\ ` ,   , \`handelsbanken\ ` , \`ing\ ` , \`knab\ ` , \`moneyou\ ` , \`rabobank\ ` , \`regiobank\ ` , \`revolut\ ` ,   , \`triodos_bank\ ` , or \`van_lanschot\ ` .
data PaymentMethodDetailsIdealBank'NonNullable
  = -- | This case is used if the value encountered during decoding does not match any of the provided cases in the specification.
    PaymentMethodDetailsIdealBank'NonNullableOther Data.Aeson.Types.Internal.Value
  | -- | This constructor can be used to send values to the server which are not present in the specification yet.
    PaymentMethodDetailsIdealBank'NonNullableTyped Data.Text.Internal.Text
  | -- | Represents the JSON value @"abn_amro"@
    PaymentMethodDetailsIdealBank'NonNullableEnumAbnAmro
  | Represents the JSON value @"asn_bank"@
    PaymentMethodDetailsIdealBank'NonNullableEnumAsnBank
  | -- | Represents the JSON value @"bunq"@
    PaymentMethodDetailsIdealBank'NonNullableEnumBunq
  | -- | Represents the JSON value @"handelsbanken"@
    PaymentMethodDetailsIdealBank'NonNullableEnumHandelsbanken
  | -- | Represents the JSON value @"ing"@
    PaymentMethodDetailsIdealBank'NonNullableEnumIng
  | -- | Represents the JSON value @"knab"@
    PaymentMethodDetailsIdealBank'NonNullableEnumKnab
  | -- | Represents the JSON value @"moneyou"@
    PaymentMethodDetailsIdealBank'NonNullableEnumMoneyou
  | -- | Represents the JSON value @"rabobank"@
    PaymentMethodDetailsIdealBank'NonNullableEnumRabobank
  | -- | Represents the JSON value @"regiobank"@
    PaymentMethodDetailsIdealBank'NonNullableEnumRegiobank
  | -- | Represents the JSON value @"revolut"@
    PaymentMethodDetailsIdealBank'NonNullableEnumRevolut
  | Represents the JSON value @"sns_bank"@
    PaymentMethodDetailsIdealBank'NonNullableEnumSnsBank
  | Represents the JSON value @"triodos_bank"@
    PaymentMethodDetailsIdealBank'NonNullableEnumTriodosBank
  | -- | Represents the JSON value @"van_lanschot"@
    PaymentMethodDetailsIdealBank'NonNullableEnumVanLanschot
  deriving (GHC.Show.Show, GHC.Classes.Eq)

instance Data.Aeson.Types.ToJSON.ToJSON PaymentMethodDetailsIdealBank'NonNullable where
  toJSON (PaymentMethodDetailsIdealBank'NonNullableOther val) = val
  toJSON (PaymentMethodDetailsIdealBank'NonNullableTyped val) = Data.Aeson.Types.ToJSON.toJSON val
  toJSON (PaymentMethodDetailsIdealBank'NonNullableEnumAbnAmro) = "abn_amro"
  toJSON (PaymentMethodDetailsIdealBank'NonNullableEnumAsnBank) = "asn_bank"
  toJSON (PaymentMethodDetailsIdealBank'NonNullableEnumBunq) = "bunq"
  toJSON (PaymentMethodDetailsIdealBank'NonNullableEnumHandelsbanken) = "handelsbanken"
  toJSON (PaymentMethodDetailsIdealBank'NonNullableEnumIng) = "ing"
  toJSON (PaymentMethodDetailsIdealBank'NonNullableEnumKnab) = "knab"
  toJSON (PaymentMethodDetailsIdealBank'NonNullableEnumMoneyou) = "moneyou"
  toJSON (PaymentMethodDetailsIdealBank'NonNullableEnumRabobank) = "rabobank"
  toJSON (PaymentMethodDetailsIdealBank'NonNullableEnumRegiobank) = "regiobank"
  toJSON (PaymentMethodDetailsIdealBank'NonNullableEnumRevolut) = "revolut"
  toJSON (PaymentMethodDetailsIdealBank'NonNullableEnumSnsBank) = "sns_bank"
  toJSON (PaymentMethodDetailsIdealBank'NonNullableEnumTriodosBank) = "triodos_bank"
  toJSON (PaymentMethodDetailsIdealBank'NonNullableEnumVanLanschot) = "van_lanschot"

instance Data.Aeson.Types.FromJSON.FromJSON PaymentMethodDetailsIdealBank'NonNullable where
  parseJSON val =
    GHC.Base.pure
      ( if
            | val GHC.Classes.== "abn_amro" -> PaymentMethodDetailsIdealBank'NonNullableEnumAbnAmro
            | val GHC.Classes.== "asn_bank" -> PaymentMethodDetailsIdealBank'NonNullableEnumAsnBank
            | val GHC.Classes.== "bunq" -> PaymentMethodDetailsIdealBank'NonNullableEnumBunq
            | val GHC.Classes.== "handelsbanken" -> PaymentMethodDetailsIdealBank'NonNullableEnumHandelsbanken
            | val GHC.Classes.== "ing" -> PaymentMethodDetailsIdealBank'NonNullableEnumIng
            | val GHC.Classes.== "knab" -> PaymentMethodDetailsIdealBank'NonNullableEnumKnab
            | val GHC.Classes.== "moneyou" -> PaymentMethodDetailsIdealBank'NonNullableEnumMoneyou
            | val GHC.Classes.== "rabobank" -> PaymentMethodDetailsIdealBank'NonNullableEnumRabobank
            | val GHC.Classes.== "regiobank" -> PaymentMethodDetailsIdealBank'NonNullableEnumRegiobank
            | val GHC.Classes.== "revolut" -> PaymentMethodDetailsIdealBank'NonNullableEnumRevolut
            | val GHC.Classes.== "sns_bank" -> PaymentMethodDetailsIdealBank'NonNullableEnumSnsBank
            | val GHC.Classes.== "triodos_bank" -> PaymentMethodDetailsIdealBank'NonNullableEnumTriodosBank
            | val GHC.Classes.== "van_lanschot" -> PaymentMethodDetailsIdealBank'NonNullableEnumVanLanschot
            | GHC.Base.otherwise -> PaymentMethodDetailsIdealBank'NonNullableOther val
      )

-- | Defines the enum schema located at @components.schemas.payment_method_details_ideal.properties.bic@ in the specification.
--
  The Bank Identifier Code of the customer\ 's bank .
data PaymentMethodDetailsIdealBic'NonNullable
  = -- | This case is used if the value encountered during decoding does not match any of the provided cases in the specification.
    PaymentMethodDetailsIdealBic'NonNullableOther Data.Aeson.Types.Internal.Value
  | -- | This constructor can be used to send values to the server which are not present in the specification yet.
    PaymentMethodDetailsIdealBic'NonNullableTyped Data.Text.Internal.Text
  | -- | Represents the JSON value @"ABNANL2A"@
    PaymentMethodDetailsIdealBic'NonNullableEnumABNANL2A
  | -- | Represents the JSON value @"ASNBNL21"@
    PaymentMethodDetailsIdealBic'NonNullableEnumASNBNL21
  | -- | Represents the JSON value @"BUNQNL2A"@
    PaymentMethodDetailsIdealBic'NonNullableEnumBUNQNL2A
  | -- | Represents the JSON value @"FVLBNL22"@
    PaymentMethodDetailsIdealBic'NonNullableEnumFVLBNL22
  | -- | Represents the JSON value @"HANDNL2A"@
    PaymentMethodDetailsIdealBic'NonNullableEnumHANDNL2A
  | -- | Represents the JSON value @"INGBNL2A"@
    PaymentMethodDetailsIdealBic'NonNullableEnumINGBNL2A
  | Represents the JSON value @"KNABNL2H"@
    PaymentMethodDetailsIdealBic'NonNullableEnumKNABNL2H
  | Represents the JSON value @"MOYONL21"@
    PaymentMethodDetailsIdealBic'NonNullableEnumMOYONL21
  | -- | Represents the JSON value @"RABONL2U"@
    PaymentMethodDetailsIdealBic'NonNullableEnumRABONL2U
  | Represents the JSON value @"RBRBNL21"@
    PaymentMethodDetailsIdealBic'NonNullableEnumRBRBNL21
  | Represents the JSON value @"REVOLT21"@
    PaymentMethodDetailsIdealBic'NonNullableEnumREVOLT21
  | -- | Represents the JSON value @"SNSBNL2A"@
    PaymentMethodDetailsIdealBic'NonNullableEnumSNSBNL2A
  | -- | Represents the JSON value @"TRIONL2U"@
    PaymentMethodDetailsIdealBic'NonNullableEnumTRIONL2U
  deriving (GHC.Show.Show, GHC.Classes.Eq)

instance Data.Aeson.Types.ToJSON.ToJSON PaymentMethodDetailsIdealBic'NonNullable where
  toJSON (PaymentMethodDetailsIdealBic'NonNullableOther val) = val
  toJSON (PaymentMethodDetailsIdealBic'NonNullableTyped val) = Data.Aeson.Types.ToJSON.toJSON val
  toJSON (PaymentMethodDetailsIdealBic'NonNullableEnumABNANL2A) = "ABNANL2A"
  toJSON (PaymentMethodDetailsIdealBic'NonNullableEnumASNBNL21) = "ASNBNL21"
  toJSON (PaymentMethodDetailsIdealBic'NonNullableEnumBUNQNL2A) = "BUNQNL2A"
  toJSON (PaymentMethodDetailsIdealBic'NonNullableEnumFVLBNL22) = "FVLBNL22"
  toJSON (PaymentMethodDetailsIdealBic'NonNullableEnumHANDNL2A) = "HANDNL2A"
  toJSON (PaymentMethodDetailsIdealBic'NonNullableEnumINGBNL2A) = "INGBNL2A"
  toJSON (PaymentMethodDetailsIdealBic'NonNullableEnumKNABNL2H) = "KNABNL2H"
  toJSON (PaymentMethodDetailsIdealBic'NonNullableEnumMOYONL21) = "MOYONL21"
  toJSON (PaymentMethodDetailsIdealBic'NonNullableEnumRABONL2U) = "RABONL2U"
  toJSON (PaymentMethodDetailsIdealBic'NonNullableEnumRBRBNL21) = "RBRBNL21"
  toJSON (PaymentMethodDetailsIdealBic'NonNullableEnumREVOLT21) = "REVOLT21"
  toJSON (PaymentMethodDetailsIdealBic'NonNullableEnumSNSBNL2A) = "SNSBNL2A"
  toJSON (PaymentMethodDetailsIdealBic'NonNullableEnumTRIONL2U) = "TRIONL2U"

instance Data.Aeson.Types.FromJSON.FromJSON PaymentMethodDetailsIdealBic'NonNullable where
  parseJSON val =
    GHC.Base.pure
      ( if
            | val GHC.Classes.== "ABNANL2A" -> PaymentMethodDetailsIdealBic'NonNullableEnumABNANL2A
            | val GHC.Classes.== "ASNBNL21" -> PaymentMethodDetailsIdealBic'NonNullableEnumASNBNL21
            | val GHC.Classes.== "BUNQNL2A" -> PaymentMethodDetailsIdealBic'NonNullableEnumBUNQNL2A
            | val GHC.Classes.== "FVLBNL22" -> PaymentMethodDetailsIdealBic'NonNullableEnumFVLBNL22
            | val GHC.Classes.== "HANDNL2A" -> PaymentMethodDetailsIdealBic'NonNullableEnumHANDNL2A
            | val GHC.Classes.== "INGBNL2A" -> PaymentMethodDetailsIdealBic'NonNullableEnumINGBNL2A
            | val GHC.Classes.== "KNABNL2H" -> PaymentMethodDetailsIdealBic'NonNullableEnumKNABNL2H
            | val GHC.Classes.== "MOYONL21" -> PaymentMethodDetailsIdealBic'NonNullableEnumMOYONL21
            | val GHC.Classes.== "RABONL2U" -> PaymentMethodDetailsIdealBic'NonNullableEnumRABONL2U
            | val GHC.Classes.== "RBRBNL21" -> PaymentMethodDetailsIdealBic'NonNullableEnumRBRBNL21
            | val GHC.Classes.== "REVOLT21" -> PaymentMethodDetailsIdealBic'NonNullableEnumREVOLT21
            | val GHC.Classes.== "SNSBNL2A" -> PaymentMethodDetailsIdealBic'NonNullableEnumSNSBNL2A
            | val GHC.Classes.== "TRIONL2U" -> PaymentMethodDetailsIdealBic'NonNullableEnumTRIONL2U
            | GHC.Base.otherwise -> PaymentMethodDetailsIdealBic'NonNullableOther val
      )

  | Defines the oneOf schema located at @components.schemas.payment_method_details_ideal.properties.generated_sepa_debit.anyOf@ in the specification .
--
  The ID of the SEPA Direct Debit PaymentMethod which was generated by this Charge .
data PaymentMethodDetailsIdealGeneratedSepaDebit'NonNullableVariants
  = PaymentMethodDetailsIdealGeneratedSepaDebit'NonNullableText Data.Text.Internal.Text
  | PaymentMethodDetailsIdealGeneratedSepaDebit'NonNullablePaymentMethod PaymentMethod
  deriving (GHC.Show.Show, GHC.Classes.Eq)

instance Data.Aeson.Types.ToJSON.ToJSON PaymentMethodDetailsIdealGeneratedSepaDebit'NonNullableVariants where
  toJSON (PaymentMethodDetailsIdealGeneratedSepaDebit'NonNullableText a) = Data.Aeson.Types.ToJSON.toJSON a
  toJSON (PaymentMethodDetailsIdealGeneratedSepaDebit'NonNullablePaymentMethod a) = Data.Aeson.Types.ToJSON.toJSON a

instance Data.Aeson.Types.FromJSON.FromJSON PaymentMethodDetailsIdealGeneratedSepaDebit'NonNullableVariants where
  parseJSON val = case (PaymentMethodDetailsIdealGeneratedSepaDebit'NonNullableText Data.Functor.<$> Data.Aeson.Types.FromJSON.fromJSON val) GHC.Base.<|> ((PaymentMethodDetailsIdealGeneratedSepaDebit'NonNullablePaymentMethod Data.Functor.<$> Data.Aeson.Types.FromJSON.fromJSON val) GHC.Base.<|> Data.Aeson.Types.Internal.Error "No variant matched") of
    Data.Aeson.Types.Internal.Success a -> GHC.Base.pure a
    Data.Aeson.Types.Internal.Error a -> Control.Monad.Fail.fail a

  | Defines the oneOf schema located at @components.schemas.payment_method_details_ideal.properties.generated_sepa_debit_mandate.anyOf@ in the specification .
--
-- The mandate for the SEPA Direct Debit PaymentMethod which was generated by this Charge.
data PaymentMethodDetailsIdealGeneratedSepaDebitMandate'NonNullableVariants
  = PaymentMethodDetailsIdealGeneratedSepaDebitMandate'NonNullableText Data.Text.Internal.Text
  | PaymentMethodDetailsIdealGeneratedSepaDebitMandate'NonNullableMandate Mandate
  deriving (GHC.Show.Show, GHC.Classes.Eq)

instance Data.Aeson.Types.ToJSON.ToJSON PaymentMethodDetailsIdealGeneratedSepaDebitMandate'NonNullableVariants where
  toJSON (PaymentMethodDetailsIdealGeneratedSepaDebitMandate'NonNullableText a) = Data.Aeson.Types.ToJSON.toJSON a
  toJSON (PaymentMethodDetailsIdealGeneratedSepaDebitMandate'NonNullableMandate a) = Data.Aeson.Types.ToJSON.toJSON a

instance Data.Aeson.Types.FromJSON.FromJSON PaymentMethodDetailsIdealGeneratedSepaDebitMandate'NonNullableVariants where
  parseJSON val = case (PaymentMethodDetailsIdealGeneratedSepaDebitMandate'NonNullableText Data.Functor.<$> Data.Aeson.Types.FromJSON.fromJSON val) GHC.Base.<|> ((PaymentMethodDetailsIdealGeneratedSepaDebitMandate'NonNullableMandate Data.Functor.<$> Data.Aeson.Types.FromJSON.fromJSON val) GHC.Base.<|> Data.Aeson.Types.Internal.Error "No variant matched") of
    Data.Aeson.Types.Internal.Success a -> GHC.Base.pure a
    Data.Aeson.Types.Internal.Error a -> Control.Monad.Fail.fail a

# LANGUAGE MultiWayIf #
# LANGUAGE OverloadedStrings #
 | Contains the types generated from the schema PaymentMethodDetailsIdeal
# SOURCE #
# SOURCE #
 | Defines the object schema located at @components.schemas.payment_method_details_ideal@ in the specification.
 | generated_sepa_debit: The ID of the SEPA Direct Debit PaymentMethod which was generated by this Charge.
 | generated_sepa_debit_mandate: The mandate for the SEPA Direct Debit PaymentMethod which was generated by this Charge.

 Constraints:

 (if supported) at the time of authorization or settlement. They cannot be set or mutated.

 Constraints:

 | Create a new 'PaymentMethodDetailsIdeal' with all required fields.
 | Defines the enum schema located at @components.schemas.payment_method_details_ideal.properties.bank@ in the specification.

 | This case is used if the value encountered during decoding does not match any of the provided cases in the specification.
 | This constructor can be used to send values to the server which are not present in the specification yet.
 | Represents the JSON value @"abn_amro"@
 | Represents the JSON value @"bunq"@
 | Represents the JSON value @"handelsbanken"@
 | Represents the JSON value @"ing"@
 | Represents the JSON value @"knab"@
 | Represents the JSON value @"moneyou"@
 | Represents the JSON value @"rabobank"@
 | Represents the JSON value @"regiobank"@
 | Represents the JSON value @"revolut"@
 | Represents the JSON value @"van_lanschot"@
 | Defines the enum schema located at @components.schemas.payment_method_details_ideal.properties.bic@ in the specification.

 | This case is used if the value encountered during decoding does not match any of the provided cases in the specification.
 | This constructor can be used to send values to the server which are not present in the specification yet.
 | Represents the JSON value @"ABNANL2A"@
 | Represents the JSON value @"ASNBNL21"@
 | Represents the JSON value @"BUNQNL2A"@
 | Represents the JSON value @"FVLBNL22"@
 | Represents the JSON value @"HANDNL2A"@
 | Represents the JSON value @"INGBNL2A"@
 | Represents the JSON value @"RABONL2U"@
 | Represents the JSON value @"SNSBNL2A"@
 | Represents the JSON value @"TRIONL2U"@


 The mandate for the SEPA Direct Debit PaymentMethod which was generated by this Charge.
  CHANGE WITH CAUTION : This is a generated code file generated by -OpenAPI-Code-Generator/Haskell-OpenAPI-Client-Code-Generator .

module StripeAPI.Types.PaymentMethodDetailsIdeal where

import qualified Control.Monad.Fail
import qualified Data.Aeson
import qualified Data.Aeson as Data.Aeson.Encoding.Internal
import qualified Data.Aeson as Data.Aeson.Types
import qualified Data.Aeson as Data.Aeson.Types.FromJSON
import qualified Data.Aeson as Data.Aeson.Types.Internal
import qualified Data.Aeson as Data.Aeson.Types.ToJSON
import qualified Data.ByteString.Char8
import qualified Data.ByteString.Char8 as Data.ByteString.Internal
import qualified Data.Foldable
import qualified Data.Functor
import qualified Data.Maybe
import qualified Data.Scientific
import qualified Data.Text
import qualified Data.Text.Internal
import qualified Data.Time.Calendar as Data.Time.Calendar.Days
import qualified Data.Time.LocalTime as Data.Time.LocalTime.Internal.ZonedTime
import qualified GHC.Base
import qualified GHC.Classes
import qualified GHC.Int
import qualified GHC.Show
import qualified GHC.Types
import qualified StripeAPI.Common
import StripeAPI.TypeAlias
import qualified Prelude as GHC.Integer.Type
import qualified Prelude as GHC.Maybe

data PaymentMethodDetailsIdeal = PaymentMethodDetailsIdeal
  | bank : The customer\ 's bank . Can be one of \`abn_amro\ ` , \`asn_bank\ ` ,   , \`handelsbanken\ ` , \`ing\ ` , \`knab\ ` , \`moneyou\ ` , \`rabobank\ ` , \`regiobank\ ` , \`revolut\ ` ,   , \`triodos_bank\ ` , or \`van_lanschot\ ` .
    paymentMethodDetailsIdealBank :: (GHC.Maybe.Maybe (StripeAPI.Common.Nullable PaymentMethodDetailsIdealBank'NonNullable)),
  | bic : The Bank Identifier Code of the customer\ 's bank .
    paymentMethodDetailsIdealBic :: (GHC.Maybe.Maybe (StripeAPI.Common.Nullable PaymentMethodDetailsIdealBic'NonNullable)),
    paymentMethodDetailsIdealGeneratedSepaDebit :: (GHC.Maybe.Maybe (StripeAPI.Common.Nullable PaymentMethodDetailsIdealGeneratedSepaDebit'NonNullableVariants)),
    paymentMethodDetailsIdealGeneratedSepaDebitMandate :: (GHC.Maybe.Maybe (StripeAPI.Common.Nullable PaymentMethodDetailsIdealGeneratedSepaDebitMandate'NonNullableVariants)),
  | iban_last4 : Last four characters of the IBAN .
  * Maximum length of 5000
    paymentMethodDetailsIdealIbanLast4 :: (GHC.Maybe.Maybe (StripeAPI.Common.Nullable Data.Text.Internal.Text)),
  | verified_name : Owner\ 's verified full name . Values are verified or provided by iDEAL directly
  * Maximum length of 5000
    paymentMethodDetailsIdealVerifiedName :: (GHC.Maybe.Maybe (StripeAPI.Common.Nullable Data.Text.Internal.Text))
  }
  deriving
    ( GHC.Show.Show,
      GHC.Classes.Eq
    )

instance Data.Aeson.Types.ToJSON.ToJSON PaymentMethodDetailsIdeal where
  toJSON obj = Data.Aeson.Types.Internal.object (Data.Foldable.concat (Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("bank" Data.Aeson.Types.ToJSON..=)) (paymentMethodDetailsIdealBank obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("bic" Data.Aeson.Types.ToJSON..=)) (paymentMethodDetailsIdealBic obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("generated_sepa_debit" Data.Aeson.Types.ToJSON..=)) (paymentMethodDetailsIdealGeneratedSepaDebit obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("generated_sepa_debit_mandate" Data.Aeson.Types.ToJSON..=)) (paymentMethodDetailsIdealGeneratedSepaDebitMandate obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("iban_last4" Data.Aeson.Types.ToJSON..=)) (paymentMethodDetailsIdealIbanLast4 obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("verified_name" Data.Aeson.Types.ToJSON..=)) (paymentMethodDetailsIdealVerifiedName obj) : GHC.Base.mempty))
  toEncoding obj = Data.Aeson.Encoding.Internal.pairs (GHC.Base.mconcat (Data.Foldable.concat (Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("bank" Data.Aeson.Types.ToJSON..=)) (paymentMethodDetailsIdealBank obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("bic" Data.Aeson.Types.ToJSON..=)) (paymentMethodDetailsIdealBic obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("generated_sepa_debit" Data.Aeson.Types.ToJSON..=)) (paymentMethodDetailsIdealGeneratedSepaDebit obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("generated_sepa_debit_mandate" Data.Aeson.Types.ToJSON..=)) (paymentMethodDetailsIdealGeneratedSepaDebitMandate obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("iban_last4" Data.Aeson.Types.ToJSON..=)) (paymentMethodDetailsIdealIbanLast4 obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("verified_name" Data.Aeson.Types.ToJSON..=)) (paymentMethodDetailsIdealVerifiedName obj) : GHC.Base.mempty)))

instance Data.Aeson.Types.FromJSON.FromJSON PaymentMethodDetailsIdeal where
  parseJSON = Data.Aeson.Types.FromJSON.withObject "PaymentMethodDetailsIdeal" (\obj -> (((((GHC.Base.pure PaymentMethodDetailsIdeal GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "bank")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "bic")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "generated_sepa_debit")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "generated_sepa_debit_mandate")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "iban_last4")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "verified_name"))

mkPaymentMethodDetailsIdeal :: PaymentMethodDetailsIdeal
mkPaymentMethodDetailsIdeal =
  PaymentMethodDetailsIdeal
    { paymentMethodDetailsIdealBank = GHC.Maybe.Nothing,
      paymentMethodDetailsIdealBic = GHC.Maybe.Nothing,
      paymentMethodDetailsIdealGeneratedSepaDebit = GHC.Maybe.Nothing,
      paymentMethodDetailsIdealGeneratedSepaDebitMandate = GHC.Maybe.Nothing,
      paymentMethodDetailsIdealIbanLast4 = GHC.Maybe.Nothing,
      paymentMethodDetailsIdealVerifiedName = GHC.Maybe.Nothing
    }

  The customer\ 's bank . Can be one of \`abn_amro\ ` , \`asn_bank\ ` ,   , \`handelsbanken\ ` , \`ing\ ` , \`knab\ ` , \`moneyou\ ` , \`rabobank\ ` , \`regiobank\ ` , \`revolut\ ` ,   , \`triodos_bank\ ` , or \`van_lanschot\ ` .
data PaymentMethodDetailsIdealBank'NonNullable
    PaymentMethodDetailsIdealBank'NonNullableOther Data.Aeson.Types.Internal.Value
    PaymentMethodDetailsIdealBank'NonNullableTyped Data.Text.Internal.Text
    PaymentMethodDetailsIdealBank'NonNullableEnumAbnAmro
  | Represents the JSON value @"asn_bank"@
    PaymentMethodDetailsIdealBank'NonNullableEnumAsnBank
    PaymentMethodDetailsIdealBank'NonNullableEnumBunq
    PaymentMethodDetailsIdealBank'NonNullableEnumHandelsbanken
    PaymentMethodDetailsIdealBank'NonNullableEnumIng
    PaymentMethodDetailsIdealBank'NonNullableEnumKnab
    PaymentMethodDetailsIdealBank'NonNullableEnumMoneyou
    PaymentMethodDetailsIdealBank'NonNullableEnumRabobank
    PaymentMethodDetailsIdealBank'NonNullableEnumRegiobank
    PaymentMethodDetailsIdealBank'NonNullableEnumRevolut
  | Represents the JSON value @"sns_bank"@
    PaymentMethodDetailsIdealBank'NonNullableEnumSnsBank
  | Represents the JSON value @"triodos_bank"@
    PaymentMethodDetailsIdealBank'NonNullableEnumTriodosBank
    PaymentMethodDetailsIdealBank'NonNullableEnumVanLanschot
  deriving (GHC.Show.Show, GHC.Classes.Eq)

instance Data.Aeson.Types.ToJSON.ToJSON PaymentMethodDetailsIdealBank'NonNullable where
  toJSON (PaymentMethodDetailsIdealBank'NonNullableOther val) = val
  toJSON (PaymentMethodDetailsIdealBank'NonNullableTyped val) = Data.Aeson.Types.ToJSON.toJSON val
  toJSON (PaymentMethodDetailsIdealBank'NonNullableEnumAbnAmro) = "abn_amro"
  toJSON (PaymentMethodDetailsIdealBank'NonNullableEnumAsnBank) = "asn_bank"
  toJSON (PaymentMethodDetailsIdealBank'NonNullableEnumBunq) = "bunq"
  toJSON (PaymentMethodDetailsIdealBank'NonNullableEnumHandelsbanken) = "handelsbanken"
  toJSON (PaymentMethodDetailsIdealBank'NonNullableEnumIng) = "ing"
  toJSON (PaymentMethodDetailsIdealBank'NonNullableEnumKnab) = "knab"
  toJSON (PaymentMethodDetailsIdealBank'NonNullableEnumMoneyou) = "moneyou"
  toJSON (PaymentMethodDetailsIdealBank'NonNullableEnumRabobank) = "rabobank"
  toJSON (PaymentMethodDetailsIdealBank'NonNullableEnumRegiobank) = "regiobank"
  toJSON (PaymentMethodDetailsIdealBank'NonNullableEnumRevolut) = "revolut"
  toJSON (PaymentMethodDetailsIdealBank'NonNullableEnumSnsBank) = "sns_bank"
  toJSON (PaymentMethodDetailsIdealBank'NonNullableEnumTriodosBank) = "triodos_bank"
  toJSON (PaymentMethodDetailsIdealBank'NonNullableEnumVanLanschot) = "van_lanschot"

instance Data.Aeson.Types.FromJSON.FromJSON PaymentMethodDetailsIdealBank'NonNullable where
  parseJSON val =
    GHC.Base.pure
      ( if
            | val GHC.Classes.== "abn_amro" -> PaymentMethodDetailsIdealBank'NonNullableEnumAbnAmro
            | val GHC.Classes.== "asn_bank" -> PaymentMethodDetailsIdealBank'NonNullableEnumAsnBank
            | val GHC.Classes.== "bunq" -> PaymentMethodDetailsIdealBank'NonNullableEnumBunq
            | val GHC.Classes.== "handelsbanken" -> PaymentMethodDetailsIdealBank'NonNullableEnumHandelsbanken
            | val GHC.Classes.== "ing" -> PaymentMethodDetailsIdealBank'NonNullableEnumIng
            | val GHC.Classes.== "knab" -> PaymentMethodDetailsIdealBank'NonNullableEnumKnab
            | val GHC.Classes.== "moneyou" -> PaymentMethodDetailsIdealBank'NonNullableEnumMoneyou
            | val GHC.Classes.== "rabobank" -> PaymentMethodDetailsIdealBank'NonNullableEnumRabobank
            | val GHC.Classes.== "regiobank" -> PaymentMethodDetailsIdealBank'NonNullableEnumRegiobank
            | val GHC.Classes.== "revolut" -> PaymentMethodDetailsIdealBank'NonNullableEnumRevolut
            | val GHC.Classes.== "sns_bank" -> PaymentMethodDetailsIdealBank'NonNullableEnumSnsBank
            | val GHC.Classes.== "triodos_bank" -> PaymentMethodDetailsIdealBank'NonNullableEnumTriodosBank
            | val GHC.Classes.== "van_lanschot" -> PaymentMethodDetailsIdealBank'NonNullableEnumVanLanschot
            | GHC.Base.otherwise -> PaymentMethodDetailsIdealBank'NonNullableOther val
      )

  The Bank Identifier Code of the customer\ 's bank .
data PaymentMethodDetailsIdealBic'NonNullable
    PaymentMethodDetailsIdealBic'NonNullableOther Data.Aeson.Types.Internal.Value
    PaymentMethodDetailsIdealBic'NonNullableTyped Data.Text.Internal.Text
    PaymentMethodDetailsIdealBic'NonNullableEnumABNANL2A
    PaymentMethodDetailsIdealBic'NonNullableEnumASNBNL21
    PaymentMethodDetailsIdealBic'NonNullableEnumBUNQNL2A
    PaymentMethodDetailsIdealBic'NonNullableEnumFVLBNL22
    PaymentMethodDetailsIdealBic'NonNullableEnumHANDNL2A
    PaymentMethodDetailsIdealBic'NonNullableEnumINGBNL2A
  | Represents the JSON value @"KNABNL2H"@
    PaymentMethodDetailsIdealBic'NonNullableEnumKNABNL2H
  | Represents the JSON value @"MOYONL21"@
    PaymentMethodDetailsIdealBic'NonNullableEnumMOYONL21
    PaymentMethodDetailsIdealBic'NonNullableEnumRABONL2U
  | Represents the JSON value @"RBRBNL21"@
    PaymentMethodDetailsIdealBic'NonNullableEnumRBRBNL21
  | Represents the JSON value @"REVOLT21"@
    PaymentMethodDetailsIdealBic'NonNullableEnumREVOLT21
    PaymentMethodDetailsIdealBic'NonNullableEnumSNSBNL2A
    PaymentMethodDetailsIdealBic'NonNullableEnumTRIONL2U
  deriving (GHC.Show.Show, GHC.Classes.Eq)

instance Data.Aeson.Types.ToJSON.ToJSON PaymentMethodDetailsIdealBic'NonNullable where
  toJSON (PaymentMethodDetailsIdealBic'NonNullableOther val) = val
  toJSON (PaymentMethodDetailsIdealBic'NonNullableTyped val) = Data.Aeson.Types.ToJSON.toJSON val
  toJSON (PaymentMethodDetailsIdealBic'NonNullableEnumABNANL2A) = "ABNANL2A"
  toJSON (PaymentMethodDetailsIdealBic'NonNullableEnumASNBNL21) = "ASNBNL21"
  toJSON (PaymentMethodDetailsIdealBic'NonNullableEnumBUNQNL2A) = "BUNQNL2A"
  toJSON (PaymentMethodDetailsIdealBic'NonNullableEnumFVLBNL22) = "FVLBNL22"
  toJSON (PaymentMethodDetailsIdealBic'NonNullableEnumHANDNL2A) = "HANDNL2A"
  toJSON (PaymentMethodDetailsIdealBic'NonNullableEnumINGBNL2A) = "INGBNL2A"
  toJSON (PaymentMethodDetailsIdealBic'NonNullableEnumKNABNL2H) = "KNABNL2H"
  toJSON (PaymentMethodDetailsIdealBic'NonNullableEnumMOYONL21) = "MOYONL21"
  toJSON (PaymentMethodDetailsIdealBic'NonNullableEnumRABONL2U) = "RABONL2U"
  toJSON (PaymentMethodDetailsIdealBic'NonNullableEnumRBRBNL21) = "RBRBNL21"
  toJSON (PaymentMethodDetailsIdealBic'NonNullableEnumREVOLT21) = "REVOLT21"
  toJSON (PaymentMethodDetailsIdealBic'NonNullableEnumSNSBNL2A) = "SNSBNL2A"
  toJSON (PaymentMethodDetailsIdealBic'NonNullableEnumTRIONL2U) = "TRIONL2U"

instance Data.Aeson.Types.FromJSON.FromJSON PaymentMethodDetailsIdealBic'NonNullable where
  parseJSON val =
    GHC.Base.pure
      ( if
            | val GHC.Classes.== "ABNANL2A" -> PaymentMethodDetailsIdealBic'NonNullableEnumABNANL2A
            | val GHC.Classes.== "ASNBNL21" -> PaymentMethodDetailsIdealBic'NonNullableEnumASNBNL21
            | val GHC.Classes.== "BUNQNL2A" -> PaymentMethodDetailsIdealBic'NonNullableEnumBUNQNL2A
            | val GHC.Classes.== "FVLBNL22" -> PaymentMethodDetailsIdealBic'NonNullableEnumFVLBNL22
            | val GHC.Classes.== "HANDNL2A" -> PaymentMethodDetailsIdealBic'NonNullableEnumHANDNL2A
            | val GHC.Classes.== "INGBNL2A" -> PaymentMethodDetailsIdealBic'NonNullableEnumINGBNL2A
            | val GHC.Classes.== "KNABNL2H" -> PaymentMethodDetailsIdealBic'NonNullableEnumKNABNL2H
            | val GHC.Classes.== "MOYONL21" -> PaymentMethodDetailsIdealBic'NonNullableEnumMOYONL21
            | val GHC.Classes.== "RABONL2U" -> PaymentMethodDetailsIdealBic'NonNullableEnumRABONL2U
            | val GHC.Classes.== "RBRBNL21" -> PaymentMethodDetailsIdealBic'NonNullableEnumRBRBNL21
            | val GHC.Classes.== "REVOLT21" -> PaymentMethodDetailsIdealBic'NonNullableEnumREVOLT21
            | val GHC.Classes.== "SNSBNL2A" -> PaymentMethodDetailsIdealBic'NonNullableEnumSNSBNL2A
            | val GHC.Classes.== "TRIONL2U" -> PaymentMethodDetailsIdealBic'NonNullableEnumTRIONL2U
            | GHC.Base.otherwise -> PaymentMethodDetailsIdealBic'NonNullableOther val
      )

  | Defines the oneOf schema located at @components.schemas.payment_method_details_ideal.properties.generated_sepa_debit.anyOf@ in the specification .
  The ID of the SEPA Direct Debit PaymentMethod which was generated by this Charge .
data PaymentMethodDetailsIdealGeneratedSepaDebit'NonNullableVariants
  = PaymentMethodDetailsIdealGeneratedSepaDebit'NonNullableText Data.Text.Internal.Text
  | PaymentMethodDetailsIdealGeneratedSepaDebit'NonNullablePaymentMethod PaymentMethod
  deriving (GHC.Show.Show, GHC.Classes.Eq)

instance Data.Aeson.Types.ToJSON.ToJSON PaymentMethodDetailsIdealGeneratedSepaDebit'NonNullableVariants where
  toJSON (PaymentMethodDetailsIdealGeneratedSepaDebit'NonNullableText a) = Data.Aeson.Types.ToJSON.toJSON a
  toJSON (PaymentMethodDetailsIdealGeneratedSepaDebit'NonNullablePaymentMethod a) = Data.Aeson.Types.ToJSON.toJSON a

instance Data.Aeson.Types.FromJSON.FromJSON PaymentMethodDetailsIdealGeneratedSepaDebit'NonNullableVariants where
  parseJSON val = case (PaymentMethodDetailsIdealGeneratedSepaDebit'NonNullableText Data.Functor.<$> Data.Aeson.Types.FromJSON.fromJSON val) GHC.Base.<|> ((PaymentMethodDetailsIdealGeneratedSepaDebit'NonNullablePaymentMethod Data.Functor.<$> Data.Aeson.Types.FromJSON.fromJSON val) GHC.Base.<|> Data.Aeson.Types.Internal.Error "No variant matched") of
    Data.Aeson.Types.Internal.Success a -> GHC.Base.pure a
    Data.Aeson.Types.Internal.Error a -> Control.Monad.Fail.fail a

  | Defines the oneOf schema located at @components.schemas.payment_method_details_ideal.properties.generated_sepa_debit_mandate.anyOf@ in the specification .
data PaymentMethodDetailsIdealGeneratedSepaDebitMandate'NonNullableVariants
  = PaymentMethodDetailsIdealGeneratedSepaDebitMandate'NonNullableText Data.Text.Internal.Text
  | PaymentMethodDetailsIdealGeneratedSepaDebitMandate'NonNullableMandate Mandate
  deriving (GHC.Show.Show, GHC.Classes.Eq)

instance Data.Aeson.Types.ToJSON.ToJSON PaymentMethodDetailsIdealGeneratedSepaDebitMandate'NonNullableVariants where
  toJSON (PaymentMethodDetailsIdealGeneratedSepaDebitMandate'NonNullableText a) = Data.Aeson.Types.ToJSON.toJSON a
  toJSON (PaymentMethodDetailsIdealGeneratedSepaDebitMandate'NonNullableMandate a) = Data.Aeson.Types.ToJSON.toJSON a

instance Data.Aeson.Types.FromJSON.FromJSON PaymentMethodDetailsIdealGeneratedSepaDebitMandate'NonNullableVariants where
  parseJSON val = case (PaymentMethodDetailsIdealGeneratedSepaDebitMandate'NonNullableText Data.Functor.<$> Data.Aeson.Types.FromJSON.fromJSON val) GHC.Base.<|> ((PaymentMethodDetailsIdealGeneratedSepaDebitMandate'NonNullableMandate Data.Functor.<$> Data.Aeson.Types.FromJSON.fromJSON val) GHC.Base.<|> Data.Aeson.Types.Internal.Error "No variant matched") of
    Data.Aeson.Types.Internal.Success a -> GHC.Base.pure a
    Data.Aeson.Types.Internal.Error a -> Control.Monad.Fail.fail a
