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

-- | Contains the types generated from the schema SetupAttemptPaymentMethodDetails
module StripeAPI.Types.SetupAttemptPaymentMethodDetails 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.Functor
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.SetupAttemptPaymentMethodDetailsBancontact
import {-# SOURCE #-} StripeAPI.Types.SetupAttemptPaymentMethodDetailsCard
import {-# SOURCE #-} StripeAPI.Types.SetupAttemptPaymentMethodDetailsCardPresent
import {-# SOURCE #-} StripeAPI.Types.SetupAttemptPaymentMethodDetailsIdeal
import {-# SOURCE #-} StripeAPI.Types.SetupAttemptPaymentMethodDetailsSofort
import qualified Prelude as GHC.Integer.Type
import qualified Prelude as GHC.Maybe

-- | Defines the object schema located at @components.schemas.setup_attempt_payment_method_details@ in the specification.
data SetupAttemptPaymentMethodDetails = SetupAttemptPaymentMethodDetails
  { -- | acss_debit:
    SetupAttemptPaymentMethodDetails
-> Maybe SetupAttemptPaymentMethodDetailsAcssDebit
setupAttemptPaymentMethodDetailsAcssDebit :: (GHC.Maybe.Maybe SetupAttemptPaymentMethodDetailsAcssDebit),
    -- | au_becs_debit:
    SetupAttemptPaymentMethodDetails
-> Maybe SetupAttemptPaymentMethodDetailsAcssDebit
setupAttemptPaymentMethodDetailsAuBecsDebit :: (GHC.Maybe.Maybe SetupAttemptPaymentMethodDetailsAuBecsDebit),
    -- | bacs_debit:
    SetupAttemptPaymentMethodDetails
-> Maybe SetupAttemptPaymentMethodDetailsAcssDebit
setupAttemptPaymentMethodDetailsBacsDebit :: (GHC.Maybe.Maybe SetupAttemptPaymentMethodDetailsBacsDebit),
    -- | bancontact:
    SetupAttemptPaymentMethodDetails
-> Maybe SetupAttemptPaymentMethodDetailsBancontact
setupAttemptPaymentMethodDetailsBancontact :: (GHC.Maybe.Maybe SetupAttemptPaymentMethodDetailsBancontact),
    -- | card:
    SetupAttemptPaymentMethodDetails
-> Maybe SetupAttemptPaymentMethodDetailsCard
setupAttemptPaymentMethodDetailsCard :: (GHC.Maybe.Maybe SetupAttemptPaymentMethodDetailsCard),
    -- | card_present:
    SetupAttemptPaymentMethodDetails
-> Maybe SetupAttemptPaymentMethodDetailsCardPresent
setupAttemptPaymentMethodDetailsCardPresent :: (GHC.Maybe.Maybe SetupAttemptPaymentMethodDetailsCardPresent),
    -- | ideal:
    SetupAttemptPaymentMethodDetails
-> Maybe SetupAttemptPaymentMethodDetailsIdeal
setupAttemptPaymentMethodDetailsIdeal :: (GHC.Maybe.Maybe SetupAttemptPaymentMethodDetailsIdeal),
    -- | sepa_debit:
    SetupAttemptPaymentMethodDetails
-> Maybe SetupAttemptPaymentMethodDetailsAcssDebit
setupAttemptPaymentMethodDetailsSepaDebit :: (GHC.Maybe.Maybe SetupAttemptPaymentMethodDetailsSepaDebit),
    -- | sofort:
    SetupAttemptPaymentMethodDetails
-> Maybe SetupAttemptPaymentMethodDetailsSofort
setupAttemptPaymentMethodDetailsSofort :: (GHC.Maybe.Maybe SetupAttemptPaymentMethodDetailsSofort),
    -- | type: The type of the payment method used in the SetupIntent (e.g., \`card\`). An additional hash is included on \`payment_method_details\` with a name matching this value. It contains confirmation-specific information for the payment method.
    --
    -- Constraints:
    --
    -- * Maximum length of 5000
    SetupAttemptPaymentMethodDetails -> Text
setupAttemptPaymentMethodDetailsType :: Data.Text.Internal.Text
  }
  deriving
    ( Int -> SetupAttemptPaymentMethodDetails -> ShowS
[SetupAttemptPaymentMethodDetails] -> ShowS
SetupAttemptPaymentMethodDetails -> String
(Int -> SetupAttemptPaymentMethodDetails -> ShowS)
-> (SetupAttemptPaymentMethodDetails -> String)
-> ([SetupAttemptPaymentMethodDetails] -> ShowS)
-> Show SetupAttemptPaymentMethodDetails
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SetupAttemptPaymentMethodDetails] -> ShowS
$cshowList :: [SetupAttemptPaymentMethodDetails] -> ShowS
show :: SetupAttemptPaymentMethodDetails -> String
$cshow :: SetupAttemptPaymentMethodDetails -> String
showsPrec :: Int -> SetupAttemptPaymentMethodDetails -> ShowS
$cshowsPrec :: Int -> SetupAttemptPaymentMethodDetails -> ShowS
GHC.Show.Show,
      SetupAttemptPaymentMethodDetails
-> SetupAttemptPaymentMethodDetails -> Bool
(SetupAttemptPaymentMethodDetails
 -> SetupAttemptPaymentMethodDetails -> Bool)
-> (SetupAttemptPaymentMethodDetails
    -> SetupAttemptPaymentMethodDetails -> Bool)
-> Eq SetupAttemptPaymentMethodDetails
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SetupAttemptPaymentMethodDetails
-> SetupAttemptPaymentMethodDetails -> Bool
$c/= :: SetupAttemptPaymentMethodDetails
-> SetupAttemptPaymentMethodDetails -> Bool
== :: SetupAttemptPaymentMethodDetails
-> SetupAttemptPaymentMethodDetails -> Bool
$c== :: SetupAttemptPaymentMethodDetails
-> SetupAttemptPaymentMethodDetails -> Bool
GHC.Classes.Eq
    )

instance Data.Aeson.Types.ToJSON.ToJSON SetupAttemptPaymentMethodDetails where
  toJSON :: SetupAttemptPaymentMethodDetails -> Value
toJSON SetupAttemptPaymentMethodDetails
obj = [Pair] -> Value
Data.Aeson.Types.Internal.object (Text
"acss_debit" Text -> Maybe SetupAttemptPaymentMethodDetailsAcssDebit -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= SetupAttemptPaymentMethodDetails
-> Maybe SetupAttemptPaymentMethodDetailsAcssDebit
setupAttemptPaymentMethodDetailsAcssDebit SetupAttemptPaymentMethodDetails
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"au_becs_debit" Text -> Maybe SetupAttemptPaymentMethodDetailsAcssDebit -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= SetupAttemptPaymentMethodDetails
-> Maybe SetupAttemptPaymentMethodDetailsAcssDebit
setupAttemptPaymentMethodDetailsAuBecsDebit SetupAttemptPaymentMethodDetails
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"bacs_debit" Text -> Maybe SetupAttemptPaymentMethodDetailsAcssDebit -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= SetupAttemptPaymentMethodDetails
-> Maybe SetupAttemptPaymentMethodDetailsAcssDebit
setupAttemptPaymentMethodDetailsBacsDebit SetupAttemptPaymentMethodDetails
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"bancontact" Text -> Maybe SetupAttemptPaymentMethodDetailsBancontact -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= SetupAttemptPaymentMethodDetails
-> Maybe SetupAttemptPaymentMethodDetailsBancontact
setupAttemptPaymentMethodDetailsBancontact SetupAttemptPaymentMethodDetails
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"card" Text -> Maybe SetupAttemptPaymentMethodDetailsCard -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= SetupAttemptPaymentMethodDetails
-> Maybe SetupAttemptPaymentMethodDetailsCard
setupAttemptPaymentMethodDetailsCard SetupAttemptPaymentMethodDetails
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"card_present" Text -> Maybe SetupAttemptPaymentMethodDetailsCardPresent -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= SetupAttemptPaymentMethodDetails
-> Maybe SetupAttemptPaymentMethodDetailsCardPresent
setupAttemptPaymentMethodDetailsCardPresent SetupAttemptPaymentMethodDetails
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"ideal" Text -> Maybe SetupAttemptPaymentMethodDetailsIdeal -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= SetupAttemptPaymentMethodDetails
-> Maybe SetupAttemptPaymentMethodDetailsIdeal
setupAttemptPaymentMethodDetailsIdeal SetupAttemptPaymentMethodDetails
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"sepa_debit" Text -> Maybe SetupAttemptPaymentMethodDetailsAcssDebit -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= SetupAttemptPaymentMethodDetails
-> Maybe SetupAttemptPaymentMethodDetailsAcssDebit
setupAttemptPaymentMethodDetailsSepaDebit SetupAttemptPaymentMethodDetails
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"sofort" Text -> Maybe SetupAttemptPaymentMethodDetailsSofort -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= SetupAttemptPaymentMethodDetails
-> Maybe SetupAttemptPaymentMethodDetailsSofort
setupAttemptPaymentMethodDetailsSofort SetupAttemptPaymentMethodDetails
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"type" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= SetupAttemptPaymentMethodDetails -> Text
setupAttemptPaymentMethodDetailsType SetupAttemptPaymentMethodDetails
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: [Pair]
forall a. Monoid a => a
GHC.Base.mempty)
  toEncoding :: SetupAttemptPaymentMethodDetails -> Encoding
toEncoding SetupAttemptPaymentMethodDetails
obj = Series -> Encoding
Data.Aeson.Encoding.Internal.pairs ((Text
"acss_debit" Text -> Maybe SetupAttemptPaymentMethodDetailsAcssDebit -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= SetupAttemptPaymentMethodDetails
-> Maybe SetupAttemptPaymentMethodDetailsAcssDebit
setupAttemptPaymentMethodDetailsAcssDebit SetupAttemptPaymentMethodDetails
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"au_becs_debit" Text -> Maybe SetupAttemptPaymentMethodDetailsAcssDebit -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= SetupAttemptPaymentMethodDetails
-> Maybe SetupAttemptPaymentMethodDetailsAcssDebit
setupAttemptPaymentMethodDetailsAuBecsDebit SetupAttemptPaymentMethodDetails
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"bacs_debit" Text -> Maybe SetupAttemptPaymentMethodDetailsAcssDebit -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= SetupAttemptPaymentMethodDetails
-> Maybe SetupAttemptPaymentMethodDetailsAcssDebit
setupAttemptPaymentMethodDetailsBacsDebit SetupAttemptPaymentMethodDetails
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"bancontact" Text -> Maybe SetupAttemptPaymentMethodDetailsBancontact -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= SetupAttemptPaymentMethodDetails
-> Maybe SetupAttemptPaymentMethodDetailsBancontact
setupAttemptPaymentMethodDetailsBancontact SetupAttemptPaymentMethodDetails
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"card" Text -> Maybe SetupAttemptPaymentMethodDetailsCard -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= SetupAttemptPaymentMethodDetails
-> Maybe SetupAttemptPaymentMethodDetailsCard
setupAttemptPaymentMethodDetailsCard SetupAttemptPaymentMethodDetails
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"card_present" Text -> Maybe SetupAttemptPaymentMethodDetailsCardPresent -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= SetupAttemptPaymentMethodDetails
-> Maybe SetupAttemptPaymentMethodDetailsCardPresent
setupAttemptPaymentMethodDetailsCardPresent SetupAttemptPaymentMethodDetails
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"ideal" Text -> Maybe SetupAttemptPaymentMethodDetailsIdeal -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= SetupAttemptPaymentMethodDetails
-> Maybe SetupAttemptPaymentMethodDetailsIdeal
setupAttemptPaymentMethodDetailsIdeal SetupAttemptPaymentMethodDetails
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"sepa_debit" Text -> Maybe SetupAttemptPaymentMethodDetailsAcssDebit -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= SetupAttemptPaymentMethodDetails
-> Maybe SetupAttemptPaymentMethodDetailsAcssDebit
setupAttemptPaymentMethodDetailsSepaDebit SetupAttemptPaymentMethodDetails
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"sofort" Text -> Maybe SetupAttemptPaymentMethodDetailsSofort -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= SetupAttemptPaymentMethodDetails
-> Maybe SetupAttemptPaymentMethodDetailsSofort
setupAttemptPaymentMethodDetailsSofort SetupAttemptPaymentMethodDetails
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> (Text
"type" Text -> Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= SetupAttemptPaymentMethodDetails -> Text
setupAttemptPaymentMethodDetailsType SetupAttemptPaymentMethodDetails
obj))))))))))

instance Data.Aeson.Types.FromJSON.FromJSON SetupAttemptPaymentMethodDetails where
  parseJSON :: Value -> Parser SetupAttemptPaymentMethodDetails
parseJSON = String
-> (SetupAttemptPaymentMethodDetailsAcssDebit
    -> Parser SetupAttemptPaymentMethodDetails)
-> Value
-> Parser SetupAttemptPaymentMethodDetails
forall a.
String
-> (SetupAttemptPaymentMethodDetailsAcssDebit -> Parser a)
-> Value
-> Parser a
Data.Aeson.Types.FromJSON.withObject String
"SetupAttemptPaymentMethodDetails" (\SetupAttemptPaymentMethodDetailsAcssDebit
obj -> ((((((((((Maybe SetupAttemptPaymentMethodDetailsAcssDebit
 -> Maybe SetupAttemptPaymentMethodDetailsAcssDebit
 -> Maybe SetupAttemptPaymentMethodDetailsAcssDebit
 -> Maybe SetupAttemptPaymentMethodDetailsBancontact
 -> Maybe SetupAttemptPaymentMethodDetailsCard
 -> Maybe SetupAttemptPaymentMethodDetailsCardPresent
 -> Maybe SetupAttemptPaymentMethodDetailsIdeal
 -> Maybe SetupAttemptPaymentMethodDetailsAcssDebit
 -> Maybe SetupAttemptPaymentMethodDetailsSofort
 -> Text
 -> SetupAttemptPaymentMethodDetails)
-> Parser
     (Maybe SetupAttemptPaymentMethodDetailsAcssDebit
      -> Maybe SetupAttemptPaymentMethodDetailsAcssDebit
      -> Maybe SetupAttemptPaymentMethodDetailsAcssDebit
      -> Maybe SetupAttemptPaymentMethodDetailsBancontact
      -> Maybe SetupAttemptPaymentMethodDetailsCard
      -> Maybe SetupAttemptPaymentMethodDetailsCardPresent
      -> Maybe SetupAttemptPaymentMethodDetailsIdeal
      -> Maybe SetupAttemptPaymentMethodDetailsAcssDebit
      -> Maybe SetupAttemptPaymentMethodDetailsSofort
      -> Text
      -> SetupAttemptPaymentMethodDetails)
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure Maybe SetupAttemptPaymentMethodDetailsAcssDebit
-> Maybe SetupAttemptPaymentMethodDetailsAcssDebit
-> Maybe SetupAttemptPaymentMethodDetailsAcssDebit
-> Maybe SetupAttemptPaymentMethodDetailsBancontact
-> Maybe SetupAttemptPaymentMethodDetailsCard
-> Maybe SetupAttemptPaymentMethodDetailsCardPresent
-> Maybe SetupAttemptPaymentMethodDetailsIdeal
-> Maybe SetupAttemptPaymentMethodDetailsAcssDebit
-> Maybe SetupAttemptPaymentMethodDetailsSofort
-> Text
-> SetupAttemptPaymentMethodDetails
SetupAttemptPaymentMethodDetails Parser
  (Maybe SetupAttemptPaymentMethodDetailsAcssDebit
   -> Maybe SetupAttemptPaymentMethodDetailsAcssDebit
   -> Maybe SetupAttemptPaymentMethodDetailsAcssDebit
   -> Maybe SetupAttemptPaymentMethodDetailsBancontact
   -> Maybe SetupAttemptPaymentMethodDetailsCard
   -> Maybe SetupAttemptPaymentMethodDetailsCardPresent
   -> Maybe SetupAttemptPaymentMethodDetailsIdeal
   -> Maybe SetupAttemptPaymentMethodDetailsAcssDebit
   -> Maybe SetupAttemptPaymentMethodDetailsSofort
   -> Text
   -> SetupAttemptPaymentMethodDetails)
-> Parser (Maybe SetupAttemptPaymentMethodDetailsAcssDebit)
-> Parser
     (Maybe SetupAttemptPaymentMethodDetailsAcssDebit
      -> Maybe SetupAttemptPaymentMethodDetailsAcssDebit
      -> Maybe SetupAttemptPaymentMethodDetailsBancontact
      -> Maybe SetupAttemptPaymentMethodDetailsCard
      -> Maybe SetupAttemptPaymentMethodDetailsCardPresent
      -> Maybe SetupAttemptPaymentMethodDetailsIdeal
      -> Maybe SetupAttemptPaymentMethodDetailsAcssDebit
      -> Maybe SetupAttemptPaymentMethodDetailsSofort
      -> Text
      -> SetupAttemptPaymentMethodDetails)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (SetupAttemptPaymentMethodDetailsAcssDebit
obj SetupAttemptPaymentMethodDetailsAcssDebit
-> Text -> Parser (Maybe SetupAttemptPaymentMethodDetailsAcssDebit)
forall a.
FromJSON a =>
SetupAttemptPaymentMethodDetailsAcssDebit
-> Text -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Text
"acss_debit")) Parser
  (Maybe SetupAttemptPaymentMethodDetailsAcssDebit
   -> Maybe SetupAttemptPaymentMethodDetailsAcssDebit
   -> Maybe SetupAttemptPaymentMethodDetailsBancontact
   -> Maybe SetupAttemptPaymentMethodDetailsCard
   -> Maybe SetupAttemptPaymentMethodDetailsCardPresent
   -> Maybe SetupAttemptPaymentMethodDetailsIdeal
   -> Maybe SetupAttemptPaymentMethodDetailsAcssDebit
   -> Maybe SetupAttemptPaymentMethodDetailsSofort
   -> Text
   -> SetupAttemptPaymentMethodDetails)
-> Parser (Maybe SetupAttemptPaymentMethodDetailsAcssDebit)
-> Parser
     (Maybe SetupAttemptPaymentMethodDetailsAcssDebit
      -> Maybe SetupAttemptPaymentMethodDetailsBancontact
      -> Maybe SetupAttemptPaymentMethodDetailsCard
      -> Maybe SetupAttemptPaymentMethodDetailsCardPresent
      -> Maybe SetupAttemptPaymentMethodDetailsIdeal
      -> Maybe SetupAttemptPaymentMethodDetailsAcssDebit
      -> Maybe SetupAttemptPaymentMethodDetailsSofort
      -> Text
      -> SetupAttemptPaymentMethodDetails)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (SetupAttemptPaymentMethodDetailsAcssDebit
obj SetupAttemptPaymentMethodDetailsAcssDebit
-> Text -> Parser (Maybe SetupAttemptPaymentMethodDetailsAcssDebit)
forall a.
FromJSON a =>
SetupAttemptPaymentMethodDetailsAcssDebit
-> Text -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Text
"au_becs_debit")) Parser
  (Maybe SetupAttemptPaymentMethodDetailsAcssDebit
   -> Maybe SetupAttemptPaymentMethodDetailsBancontact
   -> Maybe SetupAttemptPaymentMethodDetailsCard
   -> Maybe SetupAttemptPaymentMethodDetailsCardPresent
   -> Maybe SetupAttemptPaymentMethodDetailsIdeal
   -> Maybe SetupAttemptPaymentMethodDetailsAcssDebit
   -> Maybe SetupAttemptPaymentMethodDetailsSofort
   -> Text
   -> SetupAttemptPaymentMethodDetails)
-> Parser (Maybe SetupAttemptPaymentMethodDetailsAcssDebit)
-> Parser
     (Maybe SetupAttemptPaymentMethodDetailsBancontact
      -> Maybe SetupAttemptPaymentMethodDetailsCard
      -> Maybe SetupAttemptPaymentMethodDetailsCardPresent
      -> Maybe SetupAttemptPaymentMethodDetailsIdeal
      -> Maybe SetupAttemptPaymentMethodDetailsAcssDebit
      -> Maybe SetupAttemptPaymentMethodDetailsSofort
      -> Text
      -> SetupAttemptPaymentMethodDetails)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (SetupAttemptPaymentMethodDetailsAcssDebit
obj SetupAttemptPaymentMethodDetailsAcssDebit
-> Text -> Parser (Maybe SetupAttemptPaymentMethodDetailsAcssDebit)
forall a.
FromJSON a =>
SetupAttemptPaymentMethodDetailsAcssDebit
-> Text -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Text
"bacs_debit")) Parser
  (Maybe SetupAttemptPaymentMethodDetailsBancontact
   -> Maybe SetupAttemptPaymentMethodDetailsCard
   -> Maybe SetupAttemptPaymentMethodDetailsCardPresent
   -> Maybe SetupAttemptPaymentMethodDetailsIdeal
   -> Maybe SetupAttemptPaymentMethodDetailsAcssDebit
   -> Maybe SetupAttemptPaymentMethodDetailsSofort
   -> Text
   -> SetupAttemptPaymentMethodDetails)
-> Parser (Maybe SetupAttemptPaymentMethodDetailsBancontact)
-> Parser
     (Maybe SetupAttemptPaymentMethodDetailsCard
      -> Maybe SetupAttemptPaymentMethodDetailsCardPresent
      -> Maybe SetupAttemptPaymentMethodDetailsIdeal
      -> Maybe SetupAttemptPaymentMethodDetailsAcssDebit
      -> Maybe SetupAttemptPaymentMethodDetailsSofort
      -> Text
      -> SetupAttemptPaymentMethodDetails)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (SetupAttemptPaymentMethodDetailsAcssDebit
obj SetupAttemptPaymentMethodDetailsAcssDebit
-> Text
-> Parser (Maybe SetupAttemptPaymentMethodDetailsBancontact)
forall a.
FromJSON a =>
SetupAttemptPaymentMethodDetailsAcssDebit
-> Text -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Text
"bancontact")) Parser
  (Maybe SetupAttemptPaymentMethodDetailsCard
   -> Maybe SetupAttemptPaymentMethodDetailsCardPresent
   -> Maybe SetupAttemptPaymentMethodDetailsIdeal
   -> Maybe SetupAttemptPaymentMethodDetailsAcssDebit
   -> Maybe SetupAttemptPaymentMethodDetailsSofort
   -> Text
   -> SetupAttemptPaymentMethodDetails)
-> Parser (Maybe SetupAttemptPaymentMethodDetailsCard)
-> Parser
     (Maybe SetupAttemptPaymentMethodDetailsCardPresent
      -> Maybe SetupAttemptPaymentMethodDetailsIdeal
      -> Maybe SetupAttemptPaymentMethodDetailsAcssDebit
      -> Maybe SetupAttemptPaymentMethodDetailsSofort
      -> Text
      -> SetupAttemptPaymentMethodDetails)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (SetupAttemptPaymentMethodDetailsAcssDebit
obj SetupAttemptPaymentMethodDetailsAcssDebit
-> Text -> Parser (Maybe SetupAttemptPaymentMethodDetailsCard)
forall a.
FromJSON a =>
SetupAttemptPaymentMethodDetailsAcssDebit
-> Text -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Text
"card")) Parser
  (Maybe SetupAttemptPaymentMethodDetailsCardPresent
   -> Maybe SetupAttemptPaymentMethodDetailsIdeal
   -> Maybe SetupAttemptPaymentMethodDetailsAcssDebit
   -> Maybe SetupAttemptPaymentMethodDetailsSofort
   -> Text
   -> SetupAttemptPaymentMethodDetails)
-> Parser (Maybe SetupAttemptPaymentMethodDetailsCardPresent)
-> Parser
     (Maybe SetupAttemptPaymentMethodDetailsIdeal
      -> Maybe SetupAttemptPaymentMethodDetailsAcssDebit
      -> Maybe SetupAttemptPaymentMethodDetailsSofort
      -> Text
      -> SetupAttemptPaymentMethodDetails)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (SetupAttemptPaymentMethodDetailsAcssDebit
obj SetupAttemptPaymentMethodDetailsAcssDebit
-> Text
-> Parser (Maybe SetupAttemptPaymentMethodDetailsCardPresent)
forall a.
FromJSON a =>
SetupAttemptPaymentMethodDetailsAcssDebit
-> Text -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Text
"card_present")) Parser
  (Maybe SetupAttemptPaymentMethodDetailsIdeal
   -> Maybe SetupAttemptPaymentMethodDetailsAcssDebit
   -> Maybe SetupAttemptPaymentMethodDetailsSofort
   -> Text
   -> SetupAttemptPaymentMethodDetails)
-> Parser (Maybe SetupAttemptPaymentMethodDetailsIdeal)
-> Parser
     (Maybe SetupAttemptPaymentMethodDetailsAcssDebit
      -> Maybe SetupAttemptPaymentMethodDetailsSofort
      -> Text
      -> SetupAttemptPaymentMethodDetails)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (SetupAttemptPaymentMethodDetailsAcssDebit
obj SetupAttemptPaymentMethodDetailsAcssDebit
-> Text -> Parser (Maybe SetupAttemptPaymentMethodDetailsIdeal)
forall a.
FromJSON a =>
SetupAttemptPaymentMethodDetailsAcssDebit
-> Text -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Text
"ideal")) Parser
  (Maybe SetupAttemptPaymentMethodDetailsAcssDebit
   -> Maybe SetupAttemptPaymentMethodDetailsSofort
   -> Text
   -> SetupAttemptPaymentMethodDetails)
-> Parser (Maybe SetupAttemptPaymentMethodDetailsAcssDebit)
-> Parser
     (Maybe SetupAttemptPaymentMethodDetailsSofort
      -> Text -> SetupAttemptPaymentMethodDetails)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (SetupAttemptPaymentMethodDetailsAcssDebit
obj SetupAttemptPaymentMethodDetailsAcssDebit
-> Text -> Parser (Maybe SetupAttemptPaymentMethodDetailsAcssDebit)
forall a.
FromJSON a =>
SetupAttemptPaymentMethodDetailsAcssDebit
-> Text -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Text
"sepa_debit")) Parser
  (Maybe SetupAttemptPaymentMethodDetailsSofort
   -> Text -> SetupAttemptPaymentMethodDetails)
-> Parser (Maybe SetupAttemptPaymentMethodDetailsSofort)
-> Parser (Text -> SetupAttemptPaymentMethodDetails)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (SetupAttemptPaymentMethodDetailsAcssDebit
obj SetupAttemptPaymentMethodDetailsAcssDebit
-> Text -> Parser (Maybe SetupAttemptPaymentMethodDetailsSofort)
forall a.
FromJSON a =>
SetupAttemptPaymentMethodDetailsAcssDebit
-> Text -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Text
"sofort")) Parser (Text -> SetupAttemptPaymentMethodDetails)
-> Parser Text -> Parser SetupAttemptPaymentMethodDetails
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (SetupAttemptPaymentMethodDetailsAcssDebit
obj SetupAttemptPaymentMethodDetailsAcssDebit -> Text -> Parser Text
forall a.
FromJSON a =>
SetupAttemptPaymentMethodDetailsAcssDebit -> Text -> Parser a
Data.Aeson.Types.FromJSON..: Text
"type"))

-- | Create a new 'SetupAttemptPaymentMethodDetails' with all required fields.
mkSetupAttemptPaymentMethodDetails ::
  -- | 'setupAttemptPaymentMethodDetailsType'
  Data.Text.Internal.Text ->
  SetupAttemptPaymentMethodDetails
mkSetupAttemptPaymentMethodDetails :: Text -> SetupAttemptPaymentMethodDetails
mkSetupAttemptPaymentMethodDetails Text
setupAttemptPaymentMethodDetailsType =
  SetupAttemptPaymentMethodDetails :: Maybe SetupAttemptPaymentMethodDetailsAcssDebit
-> Maybe SetupAttemptPaymentMethodDetailsAcssDebit
-> Maybe SetupAttemptPaymentMethodDetailsAcssDebit
-> Maybe SetupAttemptPaymentMethodDetailsBancontact
-> Maybe SetupAttemptPaymentMethodDetailsCard
-> Maybe SetupAttemptPaymentMethodDetailsCardPresent
-> Maybe SetupAttemptPaymentMethodDetailsIdeal
-> Maybe SetupAttemptPaymentMethodDetailsAcssDebit
-> Maybe SetupAttemptPaymentMethodDetailsSofort
-> Text
-> SetupAttemptPaymentMethodDetails
SetupAttemptPaymentMethodDetails
    { setupAttemptPaymentMethodDetailsAcssDebit :: Maybe SetupAttemptPaymentMethodDetailsAcssDebit
setupAttemptPaymentMethodDetailsAcssDebit = Maybe SetupAttemptPaymentMethodDetailsAcssDebit
forall a. Maybe a
GHC.Maybe.Nothing,
      setupAttemptPaymentMethodDetailsAuBecsDebit :: Maybe SetupAttemptPaymentMethodDetailsAcssDebit
setupAttemptPaymentMethodDetailsAuBecsDebit = Maybe SetupAttemptPaymentMethodDetailsAcssDebit
forall a. Maybe a
GHC.Maybe.Nothing,
      setupAttemptPaymentMethodDetailsBacsDebit :: Maybe SetupAttemptPaymentMethodDetailsAcssDebit
setupAttemptPaymentMethodDetailsBacsDebit = Maybe SetupAttemptPaymentMethodDetailsAcssDebit
forall a. Maybe a
GHC.Maybe.Nothing,
      setupAttemptPaymentMethodDetailsBancontact :: Maybe SetupAttemptPaymentMethodDetailsBancontact
setupAttemptPaymentMethodDetailsBancontact = Maybe SetupAttemptPaymentMethodDetailsBancontact
forall a. Maybe a
GHC.Maybe.Nothing,
      setupAttemptPaymentMethodDetailsCard :: Maybe SetupAttemptPaymentMethodDetailsCard
setupAttemptPaymentMethodDetailsCard = Maybe SetupAttemptPaymentMethodDetailsCard
forall a. Maybe a
GHC.Maybe.Nothing,
      setupAttemptPaymentMethodDetailsCardPresent :: Maybe SetupAttemptPaymentMethodDetailsCardPresent
setupAttemptPaymentMethodDetailsCardPresent = Maybe SetupAttemptPaymentMethodDetailsCardPresent
forall a. Maybe a
GHC.Maybe.Nothing,
      setupAttemptPaymentMethodDetailsIdeal :: Maybe SetupAttemptPaymentMethodDetailsIdeal
setupAttemptPaymentMethodDetailsIdeal = Maybe SetupAttemptPaymentMethodDetailsIdeal
forall a. Maybe a
GHC.Maybe.Nothing,
      setupAttemptPaymentMethodDetailsSepaDebit :: Maybe SetupAttemptPaymentMethodDetailsAcssDebit
setupAttemptPaymentMethodDetailsSepaDebit = Maybe SetupAttemptPaymentMethodDetailsAcssDebit
forall a. Maybe a
GHC.Maybe.Nothing,
      setupAttemptPaymentMethodDetailsSofort :: Maybe SetupAttemptPaymentMethodDetailsSofort
setupAttemptPaymentMethodDetailsSofort = Maybe SetupAttemptPaymentMethodDetailsSofort
forall a. Maybe a
GHC.Maybe.Nothing,
      setupAttemptPaymentMethodDetailsType :: Text
setupAttemptPaymentMethodDetailsType = Text
setupAttemptPaymentMethodDetailsType
    }