{-# 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 SetupAttemptPaymentMethodDetailsSofort
module StripeAPI.Types.SetupAttemptPaymentMethodDetailsSofort 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.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.setup_attempt_payment_method_details_sofort@ in the specification.
data SetupAttemptPaymentMethodDetailsSofort = SetupAttemptPaymentMethodDetailsSofort
  { -- | bank_code: Bank code of bank associated with the bank account.
    --
    -- Constraints:
    --
    -- * Maximum length of 5000
    SetupAttemptPaymentMethodDetailsSofort -> Maybe Text
setupAttemptPaymentMethodDetailsSofortBankCode :: (GHC.Maybe.Maybe Data.Text.Internal.Text),
    -- | bank_name: Name of the bank associated with the bank account.
    --
    -- Constraints:
    --
    -- * Maximum length of 5000
    SetupAttemptPaymentMethodDetailsSofort -> Maybe Text
setupAttemptPaymentMethodDetailsSofortBankName :: (GHC.Maybe.Maybe Data.Text.Internal.Text),
    -- | bic: Bank Identifier Code of the bank associated with the bank account.
    --
    -- Constraints:
    --
    -- * Maximum length of 5000
    SetupAttemptPaymentMethodDetailsSofort -> Maybe Text
setupAttemptPaymentMethodDetailsSofortBic :: (GHC.Maybe.Maybe Data.Text.Internal.Text),
    -- | generated_sepa_debit: The ID of the SEPA Direct Debit PaymentMethod which was generated by this SetupAttempt.
    SetupAttemptPaymentMethodDetailsSofort
-> Maybe
     SetupAttemptPaymentMethodDetailsSofortGeneratedSepaDebit'Variants
setupAttemptPaymentMethodDetailsSofortGeneratedSepaDebit :: (GHC.Maybe.Maybe SetupAttemptPaymentMethodDetailsSofortGeneratedSepaDebit'Variants),
    -- | generated_sepa_debit_mandate: The mandate for the SEPA Direct Debit PaymentMethod which was generated by this SetupAttempt.
    SetupAttemptPaymentMethodDetailsSofort
-> Maybe
     SetupAttemptPaymentMethodDetailsSofortGeneratedSepaDebitMandate'Variants
setupAttemptPaymentMethodDetailsSofortGeneratedSepaDebitMandate :: (GHC.Maybe.Maybe SetupAttemptPaymentMethodDetailsSofortGeneratedSepaDebitMandate'Variants),
    -- | iban_last4: Last four characters of the IBAN.
    --
    -- Constraints:
    --
    -- * Maximum length of 5000
    SetupAttemptPaymentMethodDetailsSofort -> Maybe Text
setupAttemptPaymentMethodDetailsSofortIbanLast4 :: (GHC.Maybe.Maybe Data.Text.Internal.Text),
    -- | preferred_language: Preferred language of the Sofort authorization page that the customer is redirected to.
    -- Can be one of \`en\`, \`de\`, \`fr\`, or \`nl\`
    SetupAttemptPaymentMethodDetailsSofort
-> Maybe SetupAttemptPaymentMethodDetailsSofortPreferredLanguage'
setupAttemptPaymentMethodDetailsSofortPreferredLanguage :: (GHC.Maybe.Maybe SetupAttemptPaymentMethodDetailsSofortPreferredLanguage'),
    -- | verified_name: Owner\'s verified full name. Values are verified or provided by Sofort directly
    -- (if supported) at the time of authorization or settlement. They cannot be set or mutated.
    --
    -- Constraints:
    --
    -- * Maximum length of 5000
    SetupAttemptPaymentMethodDetailsSofort -> Maybe Text
setupAttemptPaymentMethodDetailsSofortVerifiedName :: (GHC.Maybe.Maybe Data.Text.Internal.Text)
  }
  deriving
    ( Int -> SetupAttemptPaymentMethodDetailsSofort -> ShowS
[SetupAttemptPaymentMethodDetailsSofort] -> ShowS
SetupAttemptPaymentMethodDetailsSofort -> String
(Int -> SetupAttemptPaymentMethodDetailsSofort -> ShowS)
-> (SetupAttemptPaymentMethodDetailsSofort -> String)
-> ([SetupAttemptPaymentMethodDetailsSofort] -> ShowS)
-> Show SetupAttemptPaymentMethodDetailsSofort
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SetupAttemptPaymentMethodDetailsSofort] -> ShowS
$cshowList :: [SetupAttemptPaymentMethodDetailsSofort] -> ShowS
show :: SetupAttemptPaymentMethodDetailsSofort -> String
$cshow :: SetupAttemptPaymentMethodDetailsSofort -> String
showsPrec :: Int -> SetupAttemptPaymentMethodDetailsSofort -> ShowS
$cshowsPrec :: Int -> SetupAttemptPaymentMethodDetailsSofort -> ShowS
GHC.Show.Show,
      SetupAttemptPaymentMethodDetailsSofort
-> SetupAttemptPaymentMethodDetailsSofort -> Bool
(SetupAttemptPaymentMethodDetailsSofort
 -> SetupAttemptPaymentMethodDetailsSofort -> Bool)
-> (SetupAttemptPaymentMethodDetailsSofort
    -> SetupAttemptPaymentMethodDetailsSofort -> Bool)
-> Eq SetupAttemptPaymentMethodDetailsSofort
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SetupAttemptPaymentMethodDetailsSofort
-> SetupAttemptPaymentMethodDetailsSofort -> Bool
$c/= :: SetupAttemptPaymentMethodDetailsSofort
-> SetupAttemptPaymentMethodDetailsSofort -> Bool
== :: SetupAttemptPaymentMethodDetailsSofort
-> SetupAttemptPaymentMethodDetailsSofort -> Bool
$c== :: SetupAttemptPaymentMethodDetailsSofort
-> SetupAttemptPaymentMethodDetailsSofort -> Bool
GHC.Classes.Eq
    )

instance Data.Aeson.Types.ToJSON.ToJSON SetupAttemptPaymentMethodDetailsSofort where
  toJSON :: SetupAttemptPaymentMethodDetailsSofort -> Value
toJSON SetupAttemptPaymentMethodDetailsSofort
obj = [Pair] -> Value
Data.Aeson.Types.Internal.object (Text
"bank_code" Text -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= SetupAttemptPaymentMethodDetailsSofort -> Maybe Text
setupAttemptPaymentMethodDetailsSofortBankCode SetupAttemptPaymentMethodDetailsSofort
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"bank_name" Text -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= SetupAttemptPaymentMethodDetailsSofort -> Maybe Text
setupAttemptPaymentMethodDetailsSofortBankName SetupAttemptPaymentMethodDetailsSofort
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"bic" Text -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= SetupAttemptPaymentMethodDetailsSofort -> Maybe Text
setupAttemptPaymentMethodDetailsSofortBic SetupAttemptPaymentMethodDetailsSofort
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"generated_sepa_debit" Text
-> Maybe
     SetupAttemptPaymentMethodDetailsSofortGeneratedSepaDebit'Variants
-> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= SetupAttemptPaymentMethodDetailsSofort
-> Maybe
     SetupAttemptPaymentMethodDetailsSofortGeneratedSepaDebit'Variants
setupAttemptPaymentMethodDetailsSofortGeneratedSepaDebit SetupAttemptPaymentMethodDetailsSofort
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"generated_sepa_debit_mandate" Text
-> Maybe
     SetupAttemptPaymentMethodDetailsSofortGeneratedSepaDebitMandate'Variants
-> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= SetupAttemptPaymentMethodDetailsSofort
-> Maybe
     SetupAttemptPaymentMethodDetailsSofortGeneratedSepaDebitMandate'Variants
setupAttemptPaymentMethodDetailsSofortGeneratedSepaDebitMandate SetupAttemptPaymentMethodDetailsSofort
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"iban_last4" Text -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= SetupAttemptPaymentMethodDetailsSofort -> Maybe Text
setupAttemptPaymentMethodDetailsSofortIbanLast4 SetupAttemptPaymentMethodDetailsSofort
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"preferred_language" Text
-> Maybe SetupAttemptPaymentMethodDetailsSofortPreferredLanguage'
-> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= SetupAttemptPaymentMethodDetailsSofort
-> Maybe SetupAttemptPaymentMethodDetailsSofortPreferredLanguage'
setupAttemptPaymentMethodDetailsSofortPreferredLanguage SetupAttemptPaymentMethodDetailsSofort
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"verified_name" Text -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= SetupAttemptPaymentMethodDetailsSofort -> Maybe Text
setupAttemptPaymentMethodDetailsSofortVerifiedName SetupAttemptPaymentMethodDetailsSofort
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: [Pair]
forall a. Monoid a => a
GHC.Base.mempty)
  toEncoding :: SetupAttemptPaymentMethodDetailsSofort -> Encoding
toEncoding SetupAttemptPaymentMethodDetailsSofort
obj = Series -> Encoding
Data.Aeson.Encoding.Internal.pairs ((Text
"bank_code" Text -> Maybe Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= SetupAttemptPaymentMethodDetailsSofort -> Maybe Text
setupAttemptPaymentMethodDetailsSofortBankCode SetupAttemptPaymentMethodDetailsSofort
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"bank_name" Text -> Maybe Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= SetupAttemptPaymentMethodDetailsSofort -> Maybe Text
setupAttemptPaymentMethodDetailsSofortBankName SetupAttemptPaymentMethodDetailsSofort
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"bic" Text -> Maybe Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= SetupAttemptPaymentMethodDetailsSofort -> Maybe Text
setupAttemptPaymentMethodDetailsSofortBic SetupAttemptPaymentMethodDetailsSofort
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"generated_sepa_debit" Text
-> Maybe
     SetupAttemptPaymentMethodDetailsSofortGeneratedSepaDebit'Variants
-> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= SetupAttemptPaymentMethodDetailsSofort
-> Maybe
     SetupAttemptPaymentMethodDetailsSofortGeneratedSepaDebit'Variants
setupAttemptPaymentMethodDetailsSofortGeneratedSepaDebit SetupAttemptPaymentMethodDetailsSofort
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"generated_sepa_debit_mandate" Text
-> Maybe
     SetupAttemptPaymentMethodDetailsSofortGeneratedSepaDebitMandate'Variants
-> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= SetupAttemptPaymentMethodDetailsSofort
-> Maybe
     SetupAttemptPaymentMethodDetailsSofortGeneratedSepaDebitMandate'Variants
setupAttemptPaymentMethodDetailsSofortGeneratedSepaDebitMandate SetupAttemptPaymentMethodDetailsSofort
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"iban_last4" Text -> Maybe Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= SetupAttemptPaymentMethodDetailsSofort -> Maybe Text
setupAttemptPaymentMethodDetailsSofortIbanLast4 SetupAttemptPaymentMethodDetailsSofort
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"preferred_language" Text
-> Maybe SetupAttemptPaymentMethodDetailsSofortPreferredLanguage'
-> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= SetupAttemptPaymentMethodDetailsSofort
-> Maybe SetupAttemptPaymentMethodDetailsSofortPreferredLanguage'
setupAttemptPaymentMethodDetailsSofortPreferredLanguage SetupAttemptPaymentMethodDetailsSofort
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> (Text
"verified_name" Text -> Maybe Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= SetupAttemptPaymentMethodDetailsSofort -> Maybe Text
setupAttemptPaymentMethodDetailsSofortVerifiedName SetupAttemptPaymentMethodDetailsSofort
obj))))))))

instance Data.Aeson.Types.FromJSON.FromJSON SetupAttemptPaymentMethodDetailsSofort where
  parseJSON :: Value -> Parser SetupAttemptPaymentMethodDetailsSofort
parseJSON = String
-> (Object -> Parser SetupAttemptPaymentMethodDetailsSofort)
-> Value
-> Parser SetupAttemptPaymentMethodDetailsSofort
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.Aeson.Types.FromJSON.withObject String
"SetupAttemptPaymentMethodDetailsSofort" (\Object
obj -> ((((((((Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe
      SetupAttemptPaymentMethodDetailsSofortGeneratedSepaDebit'Variants
 -> Maybe
      SetupAttemptPaymentMethodDetailsSofortGeneratedSepaDebitMandate'Variants
 -> Maybe Text
 -> Maybe SetupAttemptPaymentMethodDetailsSofortPreferredLanguage'
 -> Maybe Text
 -> SetupAttemptPaymentMethodDetailsSofort)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe
           SetupAttemptPaymentMethodDetailsSofortGeneratedSepaDebit'Variants
      -> Maybe
           SetupAttemptPaymentMethodDetailsSofortGeneratedSepaDebitMandate'Variants
      -> Maybe Text
      -> Maybe SetupAttemptPaymentMethodDetailsSofortPreferredLanguage'
      -> Maybe Text
      -> SetupAttemptPaymentMethodDetailsSofort)
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe
     SetupAttemptPaymentMethodDetailsSofortGeneratedSepaDebit'Variants
-> Maybe
     SetupAttemptPaymentMethodDetailsSofortGeneratedSepaDebitMandate'Variants
-> Maybe Text
-> Maybe SetupAttemptPaymentMethodDetailsSofortPreferredLanguage'
-> Maybe Text
-> SetupAttemptPaymentMethodDetailsSofort
SetupAttemptPaymentMethodDetailsSofort Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe
        SetupAttemptPaymentMethodDetailsSofortGeneratedSepaDebit'Variants
   -> Maybe
        SetupAttemptPaymentMethodDetailsSofortGeneratedSepaDebitMandate'Variants
   -> Maybe Text
   -> Maybe SetupAttemptPaymentMethodDetailsSofortPreferredLanguage'
   -> Maybe Text
   -> SetupAttemptPaymentMethodDetailsSofort)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe
           SetupAttemptPaymentMethodDetailsSofortGeneratedSepaDebit'Variants
      -> Maybe
           SetupAttemptPaymentMethodDetailsSofortGeneratedSepaDebitMandate'Variants
      -> Maybe Text
      -> Maybe SetupAttemptPaymentMethodDetailsSofortPreferredLanguage'
      -> Maybe Text
      -> SetupAttemptPaymentMethodDetailsSofort)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Text
"bank_code")) Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe
        SetupAttemptPaymentMethodDetailsSofortGeneratedSepaDebit'Variants
   -> Maybe
        SetupAttemptPaymentMethodDetailsSofortGeneratedSepaDebitMandate'Variants
   -> Maybe Text
   -> Maybe SetupAttemptPaymentMethodDetailsSofortPreferredLanguage'
   -> Maybe Text
   -> SetupAttemptPaymentMethodDetailsSofort)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe
           SetupAttemptPaymentMethodDetailsSofortGeneratedSepaDebit'Variants
      -> Maybe
           SetupAttemptPaymentMethodDetailsSofortGeneratedSepaDebitMandate'Variants
      -> Maybe Text
      -> Maybe SetupAttemptPaymentMethodDetailsSofortPreferredLanguage'
      -> Maybe Text
      -> SetupAttemptPaymentMethodDetailsSofort)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Text
"bank_name")) Parser
  (Maybe Text
   -> Maybe
        SetupAttemptPaymentMethodDetailsSofortGeneratedSepaDebit'Variants
   -> Maybe
        SetupAttemptPaymentMethodDetailsSofortGeneratedSepaDebitMandate'Variants
   -> Maybe Text
   -> Maybe SetupAttemptPaymentMethodDetailsSofortPreferredLanguage'
   -> Maybe Text
   -> SetupAttemptPaymentMethodDetailsSofort)
-> Parser (Maybe Text)
-> Parser
     (Maybe
        SetupAttemptPaymentMethodDetailsSofortGeneratedSepaDebit'Variants
      -> Maybe
           SetupAttemptPaymentMethodDetailsSofortGeneratedSepaDebitMandate'Variants
      -> Maybe Text
      -> Maybe SetupAttemptPaymentMethodDetailsSofortPreferredLanguage'
      -> Maybe Text
      -> SetupAttemptPaymentMethodDetailsSofort)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Text
"bic")) Parser
  (Maybe
     SetupAttemptPaymentMethodDetailsSofortGeneratedSepaDebit'Variants
   -> Maybe
        SetupAttemptPaymentMethodDetailsSofortGeneratedSepaDebitMandate'Variants
   -> Maybe Text
   -> Maybe SetupAttemptPaymentMethodDetailsSofortPreferredLanguage'
   -> Maybe Text
   -> SetupAttemptPaymentMethodDetailsSofort)
-> Parser
     (Maybe
        SetupAttemptPaymentMethodDetailsSofortGeneratedSepaDebit'Variants)
-> Parser
     (Maybe
        SetupAttemptPaymentMethodDetailsSofortGeneratedSepaDebitMandate'Variants
      -> Maybe Text
      -> Maybe SetupAttemptPaymentMethodDetailsSofortPreferredLanguage'
      -> Maybe Text
      -> SetupAttemptPaymentMethodDetailsSofort)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object
-> Text
-> Parser
     (Maybe
        SetupAttemptPaymentMethodDetailsSofortGeneratedSepaDebit'Variants)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Text
"generated_sepa_debit")) Parser
  (Maybe
     SetupAttemptPaymentMethodDetailsSofortGeneratedSepaDebitMandate'Variants
   -> Maybe Text
   -> Maybe SetupAttemptPaymentMethodDetailsSofortPreferredLanguage'
   -> Maybe Text
   -> SetupAttemptPaymentMethodDetailsSofort)
-> Parser
     (Maybe
        SetupAttemptPaymentMethodDetailsSofortGeneratedSepaDebitMandate'Variants)
-> Parser
     (Maybe Text
      -> Maybe SetupAttemptPaymentMethodDetailsSofortPreferredLanguage'
      -> Maybe Text
      -> SetupAttemptPaymentMethodDetailsSofort)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object
-> Text
-> Parser
     (Maybe
        SetupAttemptPaymentMethodDetailsSofortGeneratedSepaDebitMandate'Variants)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Text
"generated_sepa_debit_mandate")) Parser
  (Maybe Text
   -> Maybe SetupAttemptPaymentMethodDetailsSofortPreferredLanguage'
   -> Maybe Text
   -> SetupAttemptPaymentMethodDetailsSofort)
-> Parser (Maybe Text)
-> Parser
     (Maybe SetupAttemptPaymentMethodDetailsSofortPreferredLanguage'
      -> Maybe Text -> SetupAttemptPaymentMethodDetailsSofort)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Text
"iban_last4")) Parser
  (Maybe SetupAttemptPaymentMethodDetailsSofortPreferredLanguage'
   -> Maybe Text -> SetupAttemptPaymentMethodDetailsSofort)
-> Parser
     (Maybe SetupAttemptPaymentMethodDetailsSofortPreferredLanguage')
-> Parser (Maybe Text -> SetupAttemptPaymentMethodDetailsSofort)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object
-> Text
-> Parser
     (Maybe SetupAttemptPaymentMethodDetailsSofortPreferredLanguage')
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Text
"preferred_language")) Parser (Maybe Text -> SetupAttemptPaymentMethodDetailsSofort)
-> Parser (Maybe Text)
-> Parser SetupAttemptPaymentMethodDetailsSofort
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Text
"verified_name"))

-- | Create a new 'SetupAttemptPaymentMethodDetailsSofort' with all required fields.
mkSetupAttemptPaymentMethodDetailsSofort :: SetupAttemptPaymentMethodDetailsSofort
mkSetupAttemptPaymentMethodDetailsSofort :: SetupAttemptPaymentMethodDetailsSofort
mkSetupAttemptPaymentMethodDetailsSofort =
  SetupAttemptPaymentMethodDetailsSofort :: Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe
     SetupAttemptPaymentMethodDetailsSofortGeneratedSepaDebit'Variants
-> Maybe
     SetupAttemptPaymentMethodDetailsSofortGeneratedSepaDebitMandate'Variants
-> Maybe Text
-> Maybe SetupAttemptPaymentMethodDetailsSofortPreferredLanguage'
-> Maybe Text
-> SetupAttemptPaymentMethodDetailsSofort
SetupAttemptPaymentMethodDetailsSofort
    { setupAttemptPaymentMethodDetailsSofortBankCode :: Maybe Text
setupAttemptPaymentMethodDetailsSofortBankCode = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing,
      setupAttemptPaymentMethodDetailsSofortBankName :: Maybe Text
setupAttemptPaymentMethodDetailsSofortBankName = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing,
      setupAttemptPaymentMethodDetailsSofortBic :: Maybe Text
setupAttemptPaymentMethodDetailsSofortBic = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing,
      setupAttemptPaymentMethodDetailsSofortGeneratedSepaDebit :: Maybe
  SetupAttemptPaymentMethodDetailsSofortGeneratedSepaDebit'Variants
setupAttemptPaymentMethodDetailsSofortGeneratedSepaDebit = Maybe
  SetupAttemptPaymentMethodDetailsSofortGeneratedSepaDebit'Variants
forall a. Maybe a
GHC.Maybe.Nothing,
      setupAttemptPaymentMethodDetailsSofortGeneratedSepaDebitMandate :: Maybe
  SetupAttemptPaymentMethodDetailsSofortGeneratedSepaDebitMandate'Variants
setupAttemptPaymentMethodDetailsSofortGeneratedSepaDebitMandate = Maybe
  SetupAttemptPaymentMethodDetailsSofortGeneratedSepaDebitMandate'Variants
forall a. Maybe a
GHC.Maybe.Nothing,
      setupAttemptPaymentMethodDetailsSofortIbanLast4 :: Maybe Text
setupAttemptPaymentMethodDetailsSofortIbanLast4 = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing,
      setupAttemptPaymentMethodDetailsSofortPreferredLanguage :: Maybe SetupAttemptPaymentMethodDetailsSofortPreferredLanguage'
setupAttemptPaymentMethodDetailsSofortPreferredLanguage = Maybe SetupAttemptPaymentMethodDetailsSofortPreferredLanguage'
forall a. Maybe a
GHC.Maybe.Nothing,
      setupAttemptPaymentMethodDetailsSofortVerifiedName :: Maybe Text
setupAttemptPaymentMethodDetailsSofortVerifiedName = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing
    }

-- | Defines the oneOf schema located at @components.schemas.setup_attempt_payment_method_details_sofort.properties.generated_sepa_debit.anyOf@ in the specification.
--
-- The ID of the SEPA Direct Debit PaymentMethod which was generated by this SetupAttempt.
data SetupAttemptPaymentMethodDetailsSofortGeneratedSepaDebit'Variants
  = SetupAttemptPaymentMethodDetailsSofortGeneratedSepaDebit'Text Data.Text.Internal.Text
  | SetupAttemptPaymentMethodDetailsSofortGeneratedSepaDebit'PaymentMethod PaymentMethod
  deriving (Int
-> SetupAttemptPaymentMethodDetailsSofortGeneratedSepaDebit'Variants
-> ShowS
[SetupAttemptPaymentMethodDetailsSofortGeneratedSepaDebit'Variants]
-> ShowS
SetupAttemptPaymentMethodDetailsSofortGeneratedSepaDebit'Variants
-> String
(Int
 -> SetupAttemptPaymentMethodDetailsSofortGeneratedSepaDebit'Variants
 -> ShowS)
-> (SetupAttemptPaymentMethodDetailsSofortGeneratedSepaDebit'Variants
    -> String)
-> ([SetupAttemptPaymentMethodDetailsSofortGeneratedSepaDebit'Variants]
    -> ShowS)
-> Show
     SetupAttemptPaymentMethodDetailsSofortGeneratedSepaDebit'Variants
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SetupAttemptPaymentMethodDetailsSofortGeneratedSepaDebit'Variants]
-> ShowS
$cshowList :: [SetupAttemptPaymentMethodDetailsSofortGeneratedSepaDebit'Variants]
-> ShowS
show :: SetupAttemptPaymentMethodDetailsSofortGeneratedSepaDebit'Variants
-> String
$cshow :: SetupAttemptPaymentMethodDetailsSofortGeneratedSepaDebit'Variants
-> String
showsPrec :: Int
-> SetupAttemptPaymentMethodDetailsSofortGeneratedSepaDebit'Variants
-> ShowS
$cshowsPrec :: Int
-> SetupAttemptPaymentMethodDetailsSofortGeneratedSepaDebit'Variants
-> ShowS
GHC.Show.Show, SetupAttemptPaymentMethodDetailsSofortGeneratedSepaDebit'Variants
-> SetupAttemptPaymentMethodDetailsSofortGeneratedSepaDebit'Variants
-> Bool
(SetupAttemptPaymentMethodDetailsSofortGeneratedSepaDebit'Variants
 -> SetupAttemptPaymentMethodDetailsSofortGeneratedSepaDebit'Variants
 -> Bool)
-> (SetupAttemptPaymentMethodDetailsSofortGeneratedSepaDebit'Variants
    -> SetupAttemptPaymentMethodDetailsSofortGeneratedSepaDebit'Variants
    -> Bool)
-> Eq
     SetupAttemptPaymentMethodDetailsSofortGeneratedSepaDebit'Variants
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SetupAttemptPaymentMethodDetailsSofortGeneratedSepaDebit'Variants
-> SetupAttemptPaymentMethodDetailsSofortGeneratedSepaDebit'Variants
-> Bool
$c/= :: SetupAttemptPaymentMethodDetailsSofortGeneratedSepaDebit'Variants
-> SetupAttemptPaymentMethodDetailsSofortGeneratedSepaDebit'Variants
-> Bool
== :: SetupAttemptPaymentMethodDetailsSofortGeneratedSepaDebit'Variants
-> SetupAttemptPaymentMethodDetailsSofortGeneratedSepaDebit'Variants
-> Bool
$c== :: SetupAttemptPaymentMethodDetailsSofortGeneratedSepaDebit'Variants
-> SetupAttemptPaymentMethodDetailsSofortGeneratedSepaDebit'Variants
-> Bool
GHC.Classes.Eq)

instance Data.Aeson.Types.ToJSON.ToJSON SetupAttemptPaymentMethodDetailsSofortGeneratedSepaDebit'Variants where
  toJSON :: SetupAttemptPaymentMethodDetailsSofortGeneratedSepaDebit'Variants
-> Value
toJSON (SetupAttemptPaymentMethodDetailsSofortGeneratedSepaDebit'Text Text
a) = Text -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON Text
a
  toJSON (SetupAttemptPaymentMethodDetailsSofortGeneratedSepaDebit'PaymentMethod PaymentMethod
a) = PaymentMethod -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON PaymentMethod
a

instance Data.Aeson.Types.FromJSON.FromJSON SetupAttemptPaymentMethodDetailsSofortGeneratedSepaDebit'Variants where
  parseJSON :: Value
-> Parser
     SetupAttemptPaymentMethodDetailsSofortGeneratedSepaDebit'Variants
parseJSON Value
val = case (Text
-> SetupAttemptPaymentMethodDetailsSofortGeneratedSepaDebit'Variants
SetupAttemptPaymentMethodDetailsSofortGeneratedSepaDebit'Text (Text
 -> SetupAttemptPaymentMethodDetailsSofortGeneratedSepaDebit'Variants)
-> Result Text
-> Result
     SetupAttemptPaymentMethodDetailsSofortGeneratedSepaDebit'Variants
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Data.Functor.<$> Value -> Result Text
forall a. FromJSON a => Value -> Result a
Data.Aeson.Types.FromJSON.fromJSON Value
val) Result
  SetupAttemptPaymentMethodDetailsSofortGeneratedSepaDebit'Variants
-> Result
     SetupAttemptPaymentMethodDetailsSofortGeneratedSepaDebit'Variants
-> Result
     SetupAttemptPaymentMethodDetailsSofortGeneratedSepaDebit'Variants
forall (f :: * -> *) a. Alternative f => f a -> f a -> f a
GHC.Base.<|> ((PaymentMethod
-> SetupAttemptPaymentMethodDetailsSofortGeneratedSepaDebit'Variants
SetupAttemptPaymentMethodDetailsSofortGeneratedSepaDebit'PaymentMethod (PaymentMethod
 -> SetupAttemptPaymentMethodDetailsSofortGeneratedSepaDebit'Variants)
-> Result PaymentMethod
-> Result
     SetupAttemptPaymentMethodDetailsSofortGeneratedSepaDebit'Variants
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Data.Functor.<$> Value -> Result PaymentMethod
forall a. FromJSON a => Value -> Result a
Data.Aeson.Types.FromJSON.fromJSON Value
val) Result
  SetupAttemptPaymentMethodDetailsSofortGeneratedSepaDebit'Variants
-> Result
     SetupAttemptPaymentMethodDetailsSofortGeneratedSepaDebit'Variants
-> Result
     SetupAttemptPaymentMethodDetailsSofortGeneratedSepaDebit'Variants
forall (f :: * -> *) a. Alternative f => f a -> f a -> f a
GHC.Base.<|> String
-> Result
     SetupAttemptPaymentMethodDetailsSofortGeneratedSepaDebit'Variants
forall a. String -> Result a
Data.Aeson.Types.Internal.Error String
"No variant matched") of
    Data.Aeson.Types.Internal.Success SetupAttemptPaymentMethodDetailsSofortGeneratedSepaDebit'Variants
a -> SetupAttemptPaymentMethodDetailsSofortGeneratedSepaDebit'Variants
-> Parser
     SetupAttemptPaymentMethodDetailsSofortGeneratedSepaDebit'Variants
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure SetupAttemptPaymentMethodDetailsSofortGeneratedSepaDebit'Variants
a
    Data.Aeson.Types.Internal.Error String
a -> String
-> Parser
     SetupAttemptPaymentMethodDetailsSofortGeneratedSepaDebit'Variants
forall (m :: * -> *) a. MonadFail m => String -> m a
Control.Monad.Fail.fail String
a

-- | Defines the oneOf schema located at @components.schemas.setup_attempt_payment_method_details_sofort.properties.generated_sepa_debit_mandate.anyOf@ in the specification.
--
-- The mandate for the SEPA Direct Debit PaymentMethod which was generated by this SetupAttempt.
data SetupAttemptPaymentMethodDetailsSofortGeneratedSepaDebitMandate'Variants
  = SetupAttemptPaymentMethodDetailsSofortGeneratedSepaDebitMandate'Text Data.Text.Internal.Text
  | SetupAttemptPaymentMethodDetailsSofortGeneratedSepaDebitMandate'Mandate Mandate
  deriving (Int
-> SetupAttemptPaymentMethodDetailsSofortGeneratedSepaDebitMandate'Variants
-> ShowS
[SetupAttemptPaymentMethodDetailsSofortGeneratedSepaDebitMandate'Variants]
-> ShowS
SetupAttemptPaymentMethodDetailsSofortGeneratedSepaDebitMandate'Variants
-> String
(Int
 -> SetupAttemptPaymentMethodDetailsSofortGeneratedSepaDebitMandate'Variants
 -> ShowS)
-> (SetupAttemptPaymentMethodDetailsSofortGeneratedSepaDebitMandate'Variants
    -> String)
-> ([SetupAttemptPaymentMethodDetailsSofortGeneratedSepaDebitMandate'Variants]
    -> ShowS)
-> Show
     SetupAttemptPaymentMethodDetailsSofortGeneratedSepaDebitMandate'Variants
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SetupAttemptPaymentMethodDetailsSofortGeneratedSepaDebitMandate'Variants]
-> ShowS
$cshowList :: [SetupAttemptPaymentMethodDetailsSofortGeneratedSepaDebitMandate'Variants]
-> ShowS
show :: SetupAttemptPaymentMethodDetailsSofortGeneratedSepaDebitMandate'Variants
-> String
$cshow :: SetupAttemptPaymentMethodDetailsSofortGeneratedSepaDebitMandate'Variants
-> String
showsPrec :: Int
-> SetupAttemptPaymentMethodDetailsSofortGeneratedSepaDebitMandate'Variants
-> ShowS
$cshowsPrec :: Int
-> SetupAttemptPaymentMethodDetailsSofortGeneratedSepaDebitMandate'Variants
-> ShowS
GHC.Show.Show, SetupAttemptPaymentMethodDetailsSofortGeneratedSepaDebitMandate'Variants
-> SetupAttemptPaymentMethodDetailsSofortGeneratedSepaDebitMandate'Variants
-> Bool
(SetupAttemptPaymentMethodDetailsSofortGeneratedSepaDebitMandate'Variants
 -> SetupAttemptPaymentMethodDetailsSofortGeneratedSepaDebitMandate'Variants
 -> Bool)
-> (SetupAttemptPaymentMethodDetailsSofortGeneratedSepaDebitMandate'Variants
    -> SetupAttemptPaymentMethodDetailsSofortGeneratedSepaDebitMandate'Variants
    -> Bool)
-> Eq
     SetupAttemptPaymentMethodDetailsSofortGeneratedSepaDebitMandate'Variants
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SetupAttemptPaymentMethodDetailsSofortGeneratedSepaDebitMandate'Variants
-> SetupAttemptPaymentMethodDetailsSofortGeneratedSepaDebitMandate'Variants
-> Bool
$c/= :: SetupAttemptPaymentMethodDetailsSofortGeneratedSepaDebitMandate'Variants
-> SetupAttemptPaymentMethodDetailsSofortGeneratedSepaDebitMandate'Variants
-> Bool
== :: SetupAttemptPaymentMethodDetailsSofortGeneratedSepaDebitMandate'Variants
-> SetupAttemptPaymentMethodDetailsSofortGeneratedSepaDebitMandate'Variants
-> Bool
$c== :: SetupAttemptPaymentMethodDetailsSofortGeneratedSepaDebitMandate'Variants
-> SetupAttemptPaymentMethodDetailsSofortGeneratedSepaDebitMandate'Variants
-> Bool
GHC.Classes.Eq)

instance Data.Aeson.Types.ToJSON.ToJSON SetupAttemptPaymentMethodDetailsSofortGeneratedSepaDebitMandate'Variants where
  toJSON :: SetupAttemptPaymentMethodDetailsSofortGeneratedSepaDebitMandate'Variants
-> Value
toJSON (SetupAttemptPaymentMethodDetailsSofortGeneratedSepaDebitMandate'Text Text
a) = Text -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON Text
a
  toJSON (SetupAttemptPaymentMethodDetailsSofortGeneratedSepaDebitMandate'Mandate Mandate
a) = Mandate -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON Mandate
a

instance Data.Aeson.Types.FromJSON.FromJSON SetupAttemptPaymentMethodDetailsSofortGeneratedSepaDebitMandate'Variants where
  parseJSON :: Value
-> Parser
     SetupAttemptPaymentMethodDetailsSofortGeneratedSepaDebitMandate'Variants
parseJSON Value
val = case (Text
-> SetupAttemptPaymentMethodDetailsSofortGeneratedSepaDebitMandate'Variants
SetupAttemptPaymentMethodDetailsSofortGeneratedSepaDebitMandate'Text (Text
 -> SetupAttemptPaymentMethodDetailsSofortGeneratedSepaDebitMandate'Variants)
-> Result Text
-> Result
     SetupAttemptPaymentMethodDetailsSofortGeneratedSepaDebitMandate'Variants
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Data.Functor.<$> Value -> Result Text
forall a. FromJSON a => Value -> Result a
Data.Aeson.Types.FromJSON.fromJSON Value
val) Result
  SetupAttemptPaymentMethodDetailsSofortGeneratedSepaDebitMandate'Variants
-> Result
     SetupAttemptPaymentMethodDetailsSofortGeneratedSepaDebitMandate'Variants
-> Result
     SetupAttemptPaymentMethodDetailsSofortGeneratedSepaDebitMandate'Variants
forall (f :: * -> *) a. Alternative f => f a -> f a -> f a
GHC.Base.<|> ((Mandate
-> SetupAttemptPaymentMethodDetailsSofortGeneratedSepaDebitMandate'Variants
SetupAttemptPaymentMethodDetailsSofortGeneratedSepaDebitMandate'Mandate (Mandate
 -> SetupAttemptPaymentMethodDetailsSofortGeneratedSepaDebitMandate'Variants)
-> Result Mandate
-> Result
     SetupAttemptPaymentMethodDetailsSofortGeneratedSepaDebitMandate'Variants
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Data.Functor.<$> Value -> Result Mandate
forall a. FromJSON a => Value -> Result a
Data.Aeson.Types.FromJSON.fromJSON Value
val) Result
  SetupAttemptPaymentMethodDetailsSofortGeneratedSepaDebitMandate'Variants
-> Result
     SetupAttemptPaymentMethodDetailsSofortGeneratedSepaDebitMandate'Variants
-> Result
     SetupAttemptPaymentMethodDetailsSofortGeneratedSepaDebitMandate'Variants
forall (f :: * -> *) a. Alternative f => f a -> f a -> f a
GHC.Base.<|> String
-> Result
     SetupAttemptPaymentMethodDetailsSofortGeneratedSepaDebitMandate'Variants
forall a. String -> Result a
Data.Aeson.Types.Internal.Error String
"No variant matched") of
    Data.Aeson.Types.Internal.Success SetupAttemptPaymentMethodDetailsSofortGeneratedSepaDebitMandate'Variants
a -> SetupAttemptPaymentMethodDetailsSofortGeneratedSepaDebitMandate'Variants
-> Parser
     SetupAttemptPaymentMethodDetailsSofortGeneratedSepaDebitMandate'Variants
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure SetupAttemptPaymentMethodDetailsSofortGeneratedSepaDebitMandate'Variants
a
    Data.Aeson.Types.Internal.Error String
a -> String
-> Parser
     SetupAttemptPaymentMethodDetailsSofortGeneratedSepaDebitMandate'Variants
forall (m :: * -> *) a. MonadFail m => String -> m a
Control.Monad.Fail.fail String
a

-- | Defines the enum schema located at @components.schemas.setup_attempt_payment_method_details_sofort.properties.preferred_language@ in the specification.
--
-- Preferred language of the Sofort authorization page that the customer is redirected to.
-- Can be one of \`en\`, \`de\`, \`fr\`, or \`nl\`
data SetupAttemptPaymentMethodDetailsSofortPreferredLanguage'
  = -- | This case is used if the value encountered during decoding does not match any of the provided cases in the specification.
    SetupAttemptPaymentMethodDetailsSofortPreferredLanguage'Other Data.Aeson.Types.Internal.Value
  | -- | This constructor can be used to send values to the server which are not present in the specification yet.
    SetupAttemptPaymentMethodDetailsSofortPreferredLanguage'Typed Data.Text.Internal.Text
  | -- | Represents the JSON value @"de"@
    SetupAttemptPaymentMethodDetailsSofortPreferredLanguage'EnumDe
  | -- | Represents the JSON value @"en"@
    SetupAttemptPaymentMethodDetailsSofortPreferredLanguage'EnumEn
  | -- | Represents the JSON value @"fr"@
    SetupAttemptPaymentMethodDetailsSofortPreferredLanguage'EnumFr
  | -- | Represents the JSON value @"nl"@
    SetupAttemptPaymentMethodDetailsSofortPreferredLanguage'EnumNl
  deriving (Int
-> SetupAttemptPaymentMethodDetailsSofortPreferredLanguage'
-> ShowS
[SetupAttemptPaymentMethodDetailsSofortPreferredLanguage'] -> ShowS
SetupAttemptPaymentMethodDetailsSofortPreferredLanguage' -> String
(Int
 -> SetupAttemptPaymentMethodDetailsSofortPreferredLanguage'
 -> ShowS)
-> (SetupAttemptPaymentMethodDetailsSofortPreferredLanguage'
    -> String)
-> ([SetupAttemptPaymentMethodDetailsSofortPreferredLanguage']
    -> ShowS)
-> Show SetupAttemptPaymentMethodDetailsSofortPreferredLanguage'
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SetupAttemptPaymentMethodDetailsSofortPreferredLanguage'] -> ShowS
$cshowList :: [SetupAttemptPaymentMethodDetailsSofortPreferredLanguage'] -> ShowS
show :: SetupAttemptPaymentMethodDetailsSofortPreferredLanguage' -> String
$cshow :: SetupAttemptPaymentMethodDetailsSofortPreferredLanguage' -> String
showsPrec :: Int
-> SetupAttemptPaymentMethodDetailsSofortPreferredLanguage'
-> ShowS
$cshowsPrec :: Int
-> SetupAttemptPaymentMethodDetailsSofortPreferredLanguage'
-> ShowS
GHC.Show.Show, SetupAttemptPaymentMethodDetailsSofortPreferredLanguage'
-> SetupAttemptPaymentMethodDetailsSofortPreferredLanguage' -> Bool
(SetupAttemptPaymentMethodDetailsSofortPreferredLanguage'
 -> SetupAttemptPaymentMethodDetailsSofortPreferredLanguage'
 -> Bool)
-> (SetupAttemptPaymentMethodDetailsSofortPreferredLanguage'
    -> SetupAttemptPaymentMethodDetailsSofortPreferredLanguage'
    -> Bool)
-> Eq SetupAttemptPaymentMethodDetailsSofortPreferredLanguage'
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SetupAttemptPaymentMethodDetailsSofortPreferredLanguage'
-> SetupAttemptPaymentMethodDetailsSofortPreferredLanguage' -> Bool
$c/= :: SetupAttemptPaymentMethodDetailsSofortPreferredLanguage'
-> SetupAttemptPaymentMethodDetailsSofortPreferredLanguage' -> Bool
== :: SetupAttemptPaymentMethodDetailsSofortPreferredLanguage'
-> SetupAttemptPaymentMethodDetailsSofortPreferredLanguage' -> Bool
$c== :: SetupAttemptPaymentMethodDetailsSofortPreferredLanguage'
-> SetupAttemptPaymentMethodDetailsSofortPreferredLanguage' -> Bool
GHC.Classes.Eq)

instance Data.Aeson.Types.ToJSON.ToJSON SetupAttemptPaymentMethodDetailsSofortPreferredLanguage' where
  toJSON :: SetupAttemptPaymentMethodDetailsSofortPreferredLanguage' -> Value
toJSON (SetupAttemptPaymentMethodDetailsSofortPreferredLanguage'Other Value
val) = Value
val
  toJSON (SetupAttemptPaymentMethodDetailsSofortPreferredLanguage'Typed Text
val) = Text -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON Text
val
  toJSON (SetupAttemptPaymentMethodDetailsSofortPreferredLanguage'
SetupAttemptPaymentMethodDetailsSofortPreferredLanguage'EnumDe) = Value
"de"
  toJSON (SetupAttemptPaymentMethodDetailsSofortPreferredLanguage'
SetupAttemptPaymentMethodDetailsSofortPreferredLanguage'EnumEn) = Value
"en"
  toJSON (SetupAttemptPaymentMethodDetailsSofortPreferredLanguage'
SetupAttemptPaymentMethodDetailsSofortPreferredLanguage'EnumFr) = Value
"fr"
  toJSON (SetupAttemptPaymentMethodDetailsSofortPreferredLanguage'
SetupAttemptPaymentMethodDetailsSofortPreferredLanguage'EnumNl) = Value
"nl"

instance Data.Aeson.Types.FromJSON.FromJSON SetupAttemptPaymentMethodDetailsSofortPreferredLanguage' where
  parseJSON :: Value
-> Parser SetupAttemptPaymentMethodDetailsSofortPreferredLanguage'
parseJSON Value
val =
    SetupAttemptPaymentMethodDetailsSofortPreferredLanguage'
-> Parser SetupAttemptPaymentMethodDetailsSofortPreferredLanguage'
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure
      ( if
            | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"de" -> SetupAttemptPaymentMethodDetailsSofortPreferredLanguage'
SetupAttemptPaymentMethodDetailsSofortPreferredLanguage'EnumDe
            | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"en" -> SetupAttemptPaymentMethodDetailsSofortPreferredLanguage'
SetupAttemptPaymentMethodDetailsSofortPreferredLanguage'EnumEn
            | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"fr" -> SetupAttemptPaymentMethodDetailsSofortPreferredLanguage'
SetupAttemptPaymentMethodDetailsSofortPreferredLanguage'EnumFr
            | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"nl" -> SetupAttemptPaymentMethodDetailsSofortPreferredLanguage'
SetupAttemptPaymentMethodDetailsSofortPreferredLanguage'EnumNl
            | Bool
GHC.Base.otherwise -> Value -> SetupAttemptPaymentMethodDetailsSofortPreferredLanguage'
SetupAttemptPaymentMethodDetailsSofortPreferredLanguage'Other Value
val
      )