{-# 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 SetupIntentPaymentMethodOptionsAcssDebit
module StripeAPI.Types.SetupIntentPaymentMethodOptionsAcssDebit 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.SetupIntentPaymentMethodOptionsMandateOptionsAcssDebit
import qualified Prelude as GHC.Integer.Type
import qualified Prelude as GHC.Maybe

-- | Defines the object schema located at @components.schemas.setup_intent_payment_method_options_acss_debit@ in the specification.
data SetupIntentPaymentMethodOptionsAcssDebit = SetupIntentPaymentMethodOptionsAcssDebit
  { -- | currency: Currency supported by the bank account
    SetupIntentPaymentMethodOptionsAcssDebit
-> Maybe SetupIntentPaymentMethodOptionsAcssDebitCurrency'
setupIntentPaymentMethodOptionsAcssDebitCurrency :: (GHC.Maybe.Maybe SetupIntentPaymentMethodOptionsAcssDebitCurrency'),
    -- | mandate_options:
    SetupIntentPaymentMethodOptionsAcssDebit
-> Maybe SetupIntentPaymentMethodOptionsMandateOptionsAcssDebit
setupIntentPaymentMethodOptionsAcssDebitMandateOptions :: (GHC.Maybe.Maybe SetupIntentPaymentMethodOptionsMandateOptionsAcssDebit),
    -- | verification_method: Bank account verification method.
    SetupIntentPaymentMethodOptionsAcssDebit
-> Maybe
     SetupIntentPaymentMethodOptionsAcssDebitVerificationMethod'
setupIntentPaymentMethodOptionsAcssDebitVerificationMethod :: (GHC.Maybe.Maybe SetupIntentPaymentMethodOptionsAcssDebitVerificationMethod')
  }
  deriving
    ( Int -> SetupIntentPaymentMethodOptionsAcssDebit -> ShowS
[SetupIntentPaymentMethodOptionsAcssDebit] -> ShowS
SetupIntentPaymentMethodOptionsAcssDebit -> String
(Int -> SetupIntentPaymentMethodOptionsAcssDebit -> ShowS)
-> (SetupIntentPaymentMethodOptionsAcssDebit -> String)
-> ([SetupIntentPaymentMethodOptionsAcssDebit] -> ShowS)
-> Show SetupIntentPaymentMethodOptionsAcssDebit
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SetupIntentPaymentMethodOptionsAcssDebit] -> ShowS
$cshowList :: [SetupIntentPaymentMethodOptionsAcssDebit] -> ShowS
show :: SetupIntentPaymentMethodOptionsAcssDebit -> String
$cshow :: SetupIntentPaymentMethodOptionsAcssDebit -> String
showsPrec :: Int -> SetupIntentPaymentMethodOptionsAcssDebit -> ShowS
$cshowsPrec :: Int -> SetupIntentPaymentMethodOptionsAcssDebit -> ShowS
GHC.Show.Show,
      SetupIntentPaymentMethodOptionsAcssDebit
-> SetupIntentPaymentMethodOptionsAcssDebit -> Bool
(SetupIntentPaymentMethodOptionsAcssDebit
 -> SetupIntentPaymentMethodOptionsAcssDebit -> Bool)
-> (SetupIntentPaymentMethodOptionsAcssDebit
    -> SetupIntentPaymentMethodOptionsAcssDebit -> Bool)
-> Eq SetupIntentPaymentMethodOptionsAcssDebit
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SetupIntentPaymentMethodOptionsAcssDebit
-> SetupIntentPaymentMethodOptionsAcssDebit -> Bool
$c/= :: SetupIntentPaymentMethodOptionsAcssDebit
-> SetupIntentPaymentMethodOptionsAcssDebit -> Bool
== :: SetupIntentPaymentMethodOptionsAcssDebit
-> SetupIntentPaymentMethodOptionsAcssDebit -> Bool
$c== :: SetupIntentPaymentMethodOptionsAcssDebit
-> SetupIntentPaymentMethodOptionsAcssDebit -> Bool
GHC.Classes.Eq
    )

instance Data.Aeson.Types.ToJSON.ToJSON SetupIntentPaymentMethodOptionsAcssDebit where
  toJSON :: SetupIntentPaymentMethodOptionsAcssDebit -> Value
toJSON SetupIntentPaymentMethodOptionsAcssDebit
obj = [Pair] -> Value
Data.Aeson.Types.Internal.object (Text
"currency" Text
-> Maybe SetupIntentPaymentMethodOptionsAcssDebitCurrency' -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= SetupIntentPaymentMethodOptionsAcssDebit
-> Maybe SetupIntentPaymentMethodOptionsAcssDebitCurrency'
setupIntentPaymentMethodOptionsAcssDebitCurrency SetupIntentPaymentMethodOptionsAcssDebit
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"mandate_options" Text
-> Maybe SetupIntentPaymentMethodOptionsMandateOptionsAcssDebit
-> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= SetupIntentPaymentMethodOptionsAcssDebit
-> Maybe SetupIntentPaymentMethodOptionsMandateOptionsAcssDebit
setupIntentPaymentMethodOptionsAcssDebitMandateOptions SetupIntentPaymentMethodOptionsAcssDebit
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"verification_method" Text
-> Maybe
     SetupIntentPaymentMethodOptionsAcssDebitVerificationMethod'
-> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= SetupIntentPaymentMethodOptionsAcssDebit
-> Maybe
     SetupIntentPaymentMethodOptionsAcssDebitVerificationMethod'
setupIntentPaymentMethodOptionsAcssDebitVerificationMethod SetupIntentPaymentMethodOptionsAcssDebit
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: [Pair]
forall a. Monoid a => a
GHC.Base.mempty)
  toEncoding :: SetupIntentPaymentMethodOptionsAcssDebit -> Encoding
toEncoding SetupIntentPaymentMethodOptionsAcssDebit
obj = Series -> Encoding
Data.Aeson.Encoding.Internal.pairs ((Text
"currency" Text
-> Maybe SetupIntentPaymentMethodOptionsAcssDebitCurrency'
-> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= SetupIntentPaymentMethodOptionsAcssDebit
-> Maybe SetupIntentPaymentMethodOptionsAcssDebitCurrency'
setupIntentPaymentMethodOptionsAcssDebitCurrency SetupIntentPaymentMethodOptionsAcssDebit
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"mandate_options" Text
-> Maybe SetupIntentPaymentMethodOptionsMandateOptionsAcssDebit
-> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= SetupIntentPaymentMethodOptionsAcssDebit
-> Maybe SetupIntentPaymentMethodOptionsMandateOptionsAcssDebit
setupIntentPaymentMethodOptionsAcssDebitMandateOptions SetupIntentPaymentMethodOptionsAcssDebit
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> (Text
"verification_method" Text
-> Maybe
     SetupIntentPaymentMethodOptionsAcssDebitVerificationMethod'
-> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= SetupIntentPaymentMethodOptionsAcssDebit
-> Maybe
     SetupIntentPaymentMethodOptionsAcssDebitVerificationMethod'
setupIntentPaymentMethodOptionsAcssDebitVerificationMethod SetupIntentPaymentMethodOptionsAcssDebit
obj)))

instance Data.Aeson.Types.FromJSON.FromJSON SetupIntentPaymentMethodOptionsAcssDebit where
  parseJSON :: Value -> Parser SetupIntentPaymentMethodOptionsAcssDebit
parseJSON = String
-> (Object -> Parser SetupIntentPaymentMethodOptionsAcssDebit)
-> Value
-> Parser SetupIntentPaymentMethodOptionsAcssDebit
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.Aeson.Types.FromJSON.withObject String
"SetupIntentPaymentMethodOptionsAcssDebit" (\Object
obj -> (((Maybe SetupIntentPaymentMethodOptionsAcssDebitCurrency'
 -> Maybe SetupIntentPaymentMethodOptionsMandateOptionsAcssDebit
 -> Maybe
      SetupIntentPaymentMethodOptionsAcssDebitVerificationMethod'
 -> SetupIntentPaymentMethodOptionsAcssDebit)
-> Parser
     (Maybe SetupIntentPaymentMethodOptionsAcssDebitCurrency'
      -> Maybe SetupIntentPaymentMethodOptionsMandateOptionsAcssDebit
      -> Maybe
           SetupIntentPaymentMethodOptionsAcssDebitVerificationMethod'
      -> SetupIntentPaymentMethodOptionsAcssDebit)
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure Maybe SetupIntentPaymentMethodOptionsAcssDebitCurrency'
-> Maybe SetupIntentPaymentMethodOptionsMandateOptionsAcssDebit
-> Maybe
     SetupIntentPaymentMethodOptionsAcssDebitVerificationMethod'
-> SetupIntentPaymentMethodOptionsAcssDebit
SetupIntentPaymentMethodOptionsAcssDebit Parser
  (Maybe SetupIntentPaymentMethodOptionsAcssDebitCurrency'
   -> Maybe SetupIntentPaymentMethodOptionsMandateOptionsAcssDebit
   -> Maybe
        SetupIntentPaymentMethodOptionsAcssDebitVerificationMethod'
   -> SetupIntentPaymentMethodOptionsAcssDebit)
-> Parser (Maybe SetupIntentPaymentMethodOptionsAcssDebitCurrency')
-> Parser
     (Maybe SetupIntentPaymentMethodOptionsMandateOptionsAcssDebit
      -> Maybe
           SetupIntentPaymentMethodOptionsAcssDebitVerificationMethod'
      -> SetupIntentPaymentMethodOptionsAcssDebit)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object
-> Text
-> Parser (Maybe SetupIntentPaymentMethodOptionsAcssDebitCurrency')
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Text
"currency")) Parser
  (Maybe SetupIntentPaymentMethodOptionsMandateOptionsAcssDebit
   -> Maybe
        SetupIntentPaymentMethodOptionsAcssDebitVerificationMethod'
   -> SetupIntentPaymentMethodOptionsAcssDebit)
-> Parser
     (Maybe SetupIntentPaymentMethodOptionsMandateOptionsAcssDebit)
-> Parser
     (Maybe SetupIntentPaymentMethodOptionsAcssDebitVerificationMethod'
      -> SetupIntentPaymentMethodOptionsAcssDebit)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object
-> Text
-> Parser
     (Maybe SetupIntentPaymentMethodOptionsMandateOptionsAcssDebit)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Text
"mandate_options")) Parser
  (Maybe SetupIntentPaymentMethodOptionsAcssDebitVerificationMethod'
   -> SetupIntentPaymentMethodOptionsAcssDebit)
-> Parser
     (Maybe SetupIntentPaymentMethodOptionsAcssDebitVerificationMethod')
-> Parser SetupIntentPaymentMethodOptionsAcssDebit
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object
-> Text
-> Parser
     (Maybe SetupIntentPaymentMethodOptionsAcssDebitVerificationMethod')
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Text
"verification_method"))

-- | Create a new 'SetupIntentPaymentMethodOptionsAcssDebit' with all required fields.
mkSetupIntentPaymentMethodOptionsAcssDebit :: SetupIntentPaymentMethodOptionsAcssDebit
mkSetupIntentPaymentMethodOptionsAcssDebit :: SetupIntentPaymentMethodOptionsAcssDebit
mkSetupIntentPaymentMethodOptionsAcssDebit =
  SetupIntentPaymentMethodOptionsAcssDebit :: Maybe SetupIntentPaymentMethodOptionsAcssDebitCurrency'
-> Maybe SetupIntentPaymentMethodOptionsMandateOptionsAcssDebit
-> Maybe
     SetupIntentPaymentMethodOptionsAcssDebitVerificationMethod'
-> SetupIntentPaymentMethodOptionsAcssDebit
SetupIntentPaymentMethodOptionsAcssDebit
    { setupIntentPaymentMethodOptionsAcssDebitCurrency :: Maybe SetupIntentPaymentMethodOptionsAcssDebitCurrency'
setupIntentPaymentMethodOptionsAcssDebitCurrency = Maybe SetupIntentPaymentMethodOptionsAcssDebitCurrency'
forall a. Maybe a
GHC.Maybe.Nothing,
      setupIntentPaymentMethodOptionsAcssDebitMandateOptions :: Maybe SetupIntentPaymentMethodOptionsMandateOptionsAcssDebit
setupIntentPaymentMethodOptionsAcssDebitMandateOptions = Maybe SetupIntentPaymentMethodOptionsMandateOptionsAcssDebit
forall a. Maybe a
GHC.Maybe.Nothing,
      setupIntentPaymentMethodOptionsAcssDebitVerificationMethod :: Maybe SetupIntentPaymentMethodOptionsAcssDebitVerificationMethod'
setupIntentPaymentMethodOptionsAcssDebitVerificationMethod = Maybe SetupIntentPaymentMethodOptionsAcssDebitVerificationMethod'
forall a. Maybe a
GHC.Maybe.Nothing
    }

-- | Defines the enum schema located at @components.schemas.setup_intent_payment_method_options_acss_debit.properties.currency@ in the specification.
--
-- Currency supported by the bank account
data SetupIntentPaymentMethodOptionsAcssDebitCurrency'
  = -- | This case is used if the value encountered during decoding does not match any of the provided cases in the specification.
    SetupIntentPaymentMethodOptionsAcssDebitCurrency'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.
    SetupIntentPaymentMethodOptionsAcssDebitCurrency'Typed Data.Text.Internal.Text
  | -- | Represents the JSON value @"cad"@
    SetupIntentPaymentMethodOptionsAcssDebitCurrency'EnumCad
  | -- | Represents the JSON value @"usd"@
    SetupIntentPaymentMethodOptionsAcssDebitCurrency'EnumUsd
  deriving (Int -> SetupIntentPaymentMethodOptionsAcssDebitCurrency' -> ShowS
[SetupIntentPaymentMethodOptionsAcssDebitCurrency'] -> ShowS
SetupIntentPaymentMethodOptionsAcssDebitCurrency' -> String
(Int -> SetupIntentPaymentMethodOptionsAcssDebitCurrency' -> ShowS)
-> (SetupIntentPaymentMethodOptionsAcssDebitCurrency' -> String)
-> ([SetupIntentPaymentMethodOptionsAcssDebitCurrency'] -> ShowS)
-> Show SetupIntentPaymentMethodOptionsAcssDebitCurrency'
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SetupIntentPaymentMethodOptionsAcssDebitCurrency'] -> ShowS
$cshowList :: [SetupIntentPaymentMethodOptionsAcssDebitCurrency'] -> ShowS
show :: SetupIntentPaymentMethodOptionsAcssDebitCurrency' -> String
$cshow :: SetupIntentPaymentMethodOptionsAcssDebitCurrency' -> String
showsPrec :: Int -> SetupIntentPaymentMethodOptionsAcssDebitCurrency' -> ShowS
$cshowsPrec :: Int -> SetupIntentPaymentMethodOptionsAcssDebitCurrency' -> ShowS
GHC.Show.Show, SetupIntentPaymentMethodOptionsAcssDebitCurrency'
-> SetupIntentPaymentMethodOptionsAcssDebitCurrency' -> Bool
(SetupIntentPaymentMethodOptionsAcssDebitCurrency'
 -> SetupIntentPaymentMethodOptionsAcssDebitCurrency' -> Bool)
-> (SetupIntentPaymentMethodOptionsAcssDebitCurrency'
    -> SetupIntentPaymentMethodOptionsAcssDebitCurrency' -> Bool)
-> Eq SetupIntentPaymentMethodOptionsAcssDebitCurrency'
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SetupIntentPaymentMethodOptionsAcssDebitCurrency'
-> SetupIntentPaymentMethodOptionsAcssDebitCurrency' -> Bool
$c/= :: SetupIntentPaymentMethodOptionsAcssDebitCurrency'
-> SetupIntentPaymentMethodOptionsAcssDebitCurrency' -> Bool
== :: SetupIntentPaymentMethodOptionsAcssDebitCurrency'
-> SetupIntentPaymentMethodOptionsAcssDebitCurrency' -> Bool
$c== :: SetupIntentPaymentMethodOptionsAcssDebitCurrency'
-> SetupIntentPaymentMethodOptionsAcssDebitCurrency' -> Bool
GHC.Classes.Eq)

instance Data.Aeson.Types.ToJSON.ToJSON SetupIntentPaymentMethodOptionsAcssDebitCurrency' where
  toJSON :: SetupIntentPaymentMethodOptionsAcssDebitCurrency' -> Value
toJSON (SetupIntentPaymentMethodOptionsAcssDebitCurrency'Other Value
val) = Value
val
  toJSON (SetupIntentPaymentMethodOptionsAcssDebitCurrency'Typed Text
val) = Text -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON Text
val
  toJSON (SetupIntentPaymentMethodOptionsAcssDebitCurrency'
SetupIntentPaymentMethodOptionsAcssDebitCurrency'EnumCad) = Value
"cad"
  toJSON (SetupIntentPaymentMethodOptionsAcssDebitCurrency'
SetupIntentPaymentMethodOptionsAcssDebitCurrency'EnumUsd) = Value
"usd"

instance Data.Aeson.Types.FromJSON.FromJSON SetupIntentPaymentMethodOptionsAcssDebitCurrency' where
  parseJSON :: Value -> Parser SetupIntentPaymentMethodOptionsAcssDebitCurrency'
parseJSON Value
val =
    SetupIntentPaymentMethodOptionsAcssDebitCurrency'
-> Parser SetupIntentPaymentMethodOptionsAcssDebitCurrency'
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
"cad" -> SetupIntentPaymentMethodOptionsAcssDebitCurrency'
SetupIntentPaymentMethodOptionsAcssDebitCurrency'EnumCad
            | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"usd" -> SetupIntentPaymentMethodOptionsAcssDebitCurrency'
SetupIntentPaymentMethodOptionsAcssDebitCurrency'EnumUsd
            | Bool
GHC.Base.otherwise -> Value -> SetupIntentPaymentMethodOptionsAcssDebitCurrency'
SetupIntentPaymentMethodOptionsAcssDebitCurrency'Other Value
val
      )

-- | Defines the enum schema located at @components.schemas.setup_intent_payment_method_options_acss_debit.properties.verification_method@ in the specification.
--
-- Bank account verification method.
data SetupIntentPaymentMethodOptionsAcssDebitVerificationMethod'
  = -- | This case is used if the value encountered during decoding does not match any of the provided cases in the specification.
    SetupIntentPaymentMethodOptionsAcssDebitVerificationMethod'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.
    SetupIntentPaymentMethodOptionsAcssDebitVerificationMethod'Typed Data.Text.Internal.Text
  | -- | Represents the JSON value @"automatic"@
    SetupIntentPaymentMethodOptionsAcssDebitVerificationMethod'EnumAutomatic
  | -- | Represents the JSON value @"instant"@
    SetupIntentPaymentMethodOptionsAcssDebitVerificationMethod'EnumInstant
  | -- | Represents the JSON value @"microdeposits"@
    SetupIntentPaymentMethodOptionsAcssDebitVerificationMethod'EnumMicrodeposits
  deriving (Int
-> SetupIntentPaymentMethodOptionsAcssDebitVerificationMethod'
-> ShowS
[SetupIntentPaymentMethodOptionsAcssDebitVerificationMethod']
-> ShowS
SetupIntentPaymentMethodOptionsAcssDebitVerificationMethod'
-> String
(Int
 -> SetupIntentPaymentMethodOptionsAcssDebitVerificationMethod'
 -> ShowS)
-> (SetupIntentPaymentMethodOptionsAcssDebitVerificationMethod'
    -> String)
-> ([SetupIntentPaymentMethodOptionsAcssDebitVerificationMethod']
    -> ShowS)
-> Show SetupIntentPaymentMethodOptionsAcssDebitVerificationMethod'
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SetupIntentPaymentMethodOptionsAcssDebitVerificationMethod']
-> ShowS
$cshowList :: [SetupIntentPaymentMethodOptionsAcssDebitVerificationMethod']
-> ShowS
show :: SetupIntentPaymentMethodOptionsAcssDebitVerificationMethod'
-> String
$cshow :: SetupIntentPaymentMethodOptionsAcssDebitVerificationMethod'
-> String
showsPrec :: Int
-> SetupIntentPaymentMethodOptionsAcssDebitVerificationMethod'
-> ShowS
$cshowsPrec :: Int
-> SetupIntentPaymentMethodOptionsAcssDebitVerificationMethod'
-> ShowS
GHC.Show.Show, SetupIntentPaymentMethodOptionsAcssDebitVerificationMethod'
-> SetupIntentPaymentMethodOptionsAcssDebitVerificationMethod'
-> Bool
(SetupIntentPaymentMethodOptionsAcssDebitVerificationMethod'
 -> SetupIntentPaymentMethodOptionsAcssDebitVerificationMethod'
 -> Bool)
-> (SetupIntentPaymentMethodOptionsAcssDebitVerificationMethod'
    -> SetupIntentPaymentMethodOptionsAcssDebitVerificationMethod'
    -> Bool)
-> Eq SetupIntentPaymentMethodOptionsAcssDebitVerificationMethod'
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SetupIntentPaymentMethodOptionsAcssDebitVerificationMethod'
-> SetupIntentPaymentMethodOptionsAcssDebitVerificationMethod'
-> Bool
$c/= :: SetupIntentPaymentMethodOptionsAcssDebitVerificationMethod'
-> SetupIntentPaymentMethodOptionsAcssDebitVerificationMethod'
-> Bool
== :: SetupIntentPaymentMethodOptionsAcssDebitVerificationMethod'
-> SetupIntentPaymentMethodOptionsAcssDebitVerificationMethod'
-> Bool
$c== :: SetupIntentPaymentMethodOptionsAcssDebitVerificationMethod'
-> SetupIntentPaymentMethodOptionsAcssDebitVerificationMethod'
-> Bool
GHC.Classes.Eq)

instance Data.Aeson.Types.ToJSON.ToJSON SetupIntentPaymentMethodOptionsAcssDebitVerificationMethod' where
  toJSON :: SetupIntentPaymentMethodOptionsAcssDebitVerificationMethod'
-> Value
toJSON (SetupIntentPaymentMethodOptionsAcssDebitVerificationMethod'Other Value
val) = Value
val
  toJSON (SetupIntentPaymentMethodOptionsAcssDebitVerificationMethod'Typed Text
val) = Text -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON Text
val
  toJSON (SetupIntentPaymentMethodOptionsAcssDebitVerificationMethod'
SetupIntentPaymentMethodOptionsAcssDebitVerificationMethod'EnumAutomatic) = Value
"automatic"
  toJSON (SetupIntentPaymentMethodOptionsAcssDebitVerificationMethod'
SetupIntentPaymentMethodOptionsAcssDebitVerificationMethod'EnumInstant) = Value
"instant"
  toJSON (SetupIntentPaymentMethodOptionsAcssDebitVerificationMethod'
SetupIntentPaymentMethodOptionsAcssDebitVerificationMethod'EnumMicrodeposits) = Value
"microdeposits"

instance Data.Aeson.Types.FromJSON.FromJSON SetupIntentPaymentMethodOptionsAcssDebitVerificationMethod' where
  parseJSON :: Value
-> Parser
     SetupIntentPaymentMethodOptionsAcssDebitVerificationMethod'
parseJSON Value
val =
    SetupIntentPaymentMethodOptionsAcssDebitVerificationMethod'
-> Parser
     SetupIntentPaymentMethodOptionsAcssDebitVerificationMethod'
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
"automatic" -> SetupIntentPaymentMethodOptionsAcssDebitVerificationMethod'
SetupIntentPaymentMethodOptionsAcssDebitVerificationMethod'EnumAutomatic
            | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"instant" -> SetupIntentPaymentMethodOptionsAcssDebitVerificationMethod'
SetupIntentPaymentMethodOptionsAcssDebitVerificationMethod'EnumInstant
            | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"microdeposits" -> SetupIntentPaymentMethodOptionsAcssDebitVerificationMethod'
SetupIntentPaymentMethodOptionsAcssDebitVerificationMethod'EnumMicrodeposits
            | Bool
GHC.Base.otherwise -> Value
-> SetupIntentPaymentMethodOptionsAcssDebitVerificationMethod'
SetupIntentPaymentMethodOptionsAcssDebitVerificationMethod'Other Value
val
      )