{-# 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 SetupIntentPaymentMethodOptionsMandateOptionsAcssDebit
module StripeAPI.Types.SetupIntentPaymentMethodOptionsMandateOptionsAcssDebit 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 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_mandate_options_acss_debit@ in the specification.
data SetupIntentPaymentMethodOptionsMandateOptionsAcssDebit = SetupIntentPaymentMethodOptionsMandateOptionsAcssDebit
  { -- | custom_mandate_url: A URL for custom mandate text
    --
    -- Constraints:
    --
    -- * Maximum length of 5000
    SetupIntentPaymentMethodOptionsMandateOptionsAcssDebit
-> Maybe Text
setupIntentPaymentMethodOptionsMandateOptionsAcssDebitCustomMandateUrl :: (GHC.Maybe.Maybe Data.Text.Internal.Text),
    -- | interval_description: Description of the interval. Only required if \'payment_schedule\' parmeter is \'interval\' or \'combined\'.
    --
    -- Constraints:
    --
    -- * Maximum length of 5000
    SetupIntentPaymentMethodOptionsMandateOptionsAcssDebit
-> Maybe Text
setupIntentPaymentMethodOptionsMandateOptionsAcssDebitIntervalDescription :: (GHC.Maybe.Maybe Data.Text.Internal.Text),
    -- | payment_schedule: Payment schedule for the mandate.
    SetupIntentPaymentMethodOptionsMandateOptionsAcssDebit
-> Maybe
     SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitPaymentSchedule'
setupIntentPaymentMethodOptionsMandateOptionsAcssDebitPaymentSchedule :: (GHC.Maybe.Maybe SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitPaymentSchedule'),
    -- | transaction_type: Transaction type of the mandate.
    SetupIntentPaymentMethodOptionsMandateOptionsAcssDebit
-> Maybe
     SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitTransactionType'
setupIntentPaymentMethodOptionsMandateOptionsAcssDebitTransactionType :: (GHC.Maybe.Maybe SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitTransactionType')
  }
  deriving
    ( Int
-> SetupIntentPaymentMethodOptionsMandateOptionsAcssDebit -> ShowS
[SetupIntentPaymentMethodOptionsMandateOptionsAcssDebit] -> ShowS
SetupIntentPaymentMethodOptionsMandateOptionsAcssDebit -> String
(Int
 -> SetupIntentPaymentMethodOptionsMandateOptionsAcssDebit -> ShowS)
-> (SetupIntentPaymentMethodOptionsMandateOptionsAcssDebit
    -> String)
-> ([SetupIntentPaymentMethodOptionsMandateOptionsAcssDebit]
    -> ShowS)
-> Show SetupIntentPaymentMethodOptionsMandateOptionsAcssDebit
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SetupIntentPaymentMethodOptionsMandateOptionsAcssDebit] -> ShowS
$cshowList :: [SetupIntentPaymentMethodOptionsMandateOptionsAcssDebit] -> ShowS
show :: SetupIntentPaymentMethodOptionsMandateOptionsAcssDebit -> String
$cshow :: SetupIntentPaymentMethodOptionsMandateOptionsAcssDebit -> String
showsPrec :: Int
-> SetupIntentPaymentMethodOptionsMandateOptionsAcssDebit -> ShowS
$cshowsPrec :: Int
-> SetupIntentPaymentMethodOptionsMandateOptionsAcssDebit -> ShowS
GHC.Show.Show,
      SetupIntentPaymentMethodOptionsMandateOptionsAcssDebit
-> SetupIntentPaymentMethodOptionsMandateOptionsAcssDebit -> Bool
(SetupIntentPaymentMethodOptionsMandateOptionsAcssDebit
 -> SetupIntentPaymentMethodOptionsMandateOptionsAcssDebit -> Bool)
-> (SetupIntentPaymentMethodOptionsMandateOptionsAcssDebit
    -> SetupIntentPaymentMethodOptionsMandateOptionsAcssDebit -> Bool)
-> Eq SetupIntentPaymentMethodOptionsMandateOptionsAcssDebit
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SetupIntentPaymentMethodOptionsMandateOptionsAcssDebit
-> SetupIntentPaymentMethodOptionsMandateOptionsAcssDebit -> Bool
$c/= :: SetupIntentPaymentMethodOptionsMandateOptionsAcssDebit
-> SetupIntentPaymentMethodOptionsMandateOptionsAcssDebit -> Bool
== :: SetupIntentPaymentMethodOptionsMandateOptionsAcssDebit
-> SetupIntentPaymentMethodOptionsMandateOptionsAcssDebit -> Bool
$c== :: SetupIntentPaymentMethodOptionsMandateOptionsAcssDebit
-> SetupIntentPaymentMethodOptionsMandateOptionsAcssDebit -> Bool
GHC.Classes.Eq
    )

instance Data.Aeson.Types.ToJSON.ToJSON SetupIntentPaymentMethodOptionsMandateOptionsAcssDebit where
  toJSON :: SetupIntentPaymentMethodOptionsMandateOptionsAcssDebit -> Value
toJSON SetupIntentPaymentMethodOptionsMandateOptionsAcssDebit
obj = [Pair] -> Value
Data.Aeson.Types.Internal.object (Text
"custom_mandate_url" Text -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= SetupIntentPaymentMethodOptionsMandateOptionsAcssDebit
-> Maybe Text
setupIntentPaymentMethodOptionsMandateOptionsAcssDebitCustomMandateUrl SetupIntentPaymentMethodOptionsMandateOptionsAcssDebit
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"interval_description" Text -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= SetupIntentPaymentMethodOptionsMandateOptionsAcssDebit
-> Maybe Text
setupIntentPaymentMethodOptionsMandateOptionsAcssDebitIntervalDescription SetupIntentPaymentMethodOptionsMandateOptionsAcssDebit
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"payment_schedule" Text
-> Maybe
     SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitPaymentSchedule'
-> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= SetupIntentPaymentMethodOptionsMandateOptionsAcssDebit
-> Maybe
     SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitPaymentSchedule'
setupIntentPaymentMethodOptionsMandateOptionsAcssDebitPaymentSchedule SetupIntentPaymentMethodOptionsMandateOptionsAcssDebit
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"transaction_type" Text
-> Maybe
     SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitTransactionType'
-> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= SetupIntentPaymentMethodOptionsMandateOptionsAcssDebit
-> Maybe
     SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitTransactionType'
setupIntentPaymentMethodOptionsMandateOptionsAcssDebitTransactionType SetupIntentPaymentMethodOptionsMandateOptionsAcssDebit
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: [Pair]
forall a. Monoid a => a
GHC.Base.mempty)
  toEncoding :: SetupIntentPaymentMethodOptionsMandateOptionsAcssDebit -> Encoding
toEncoding SetupIntentPaymentMethodOptionsMandateOptionsAcssDebit
obj = Series -> Encoding
Data.Aeson.Encoding.Internal.pairs ((Text
"custom_mandate_url" Text -> Maybe Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= SetupIntentPaymentMethodOptionsMandateOptionsAcssDebit
-> Maybe Text
setupIntentPaymentMethodOptionsMandateOptionsAcssDebitCustomMandateUrl SetupIntentPaymentMethodOptionsMandateOptionsAcssDebit
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"interval_description" Text -> Maybe Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= SetupIntentPaymentMethodOptionsMandateOptionsAcssDebit
-> Maybe Text
setupIntentPaymentMethodOptionsMandateOptionsAcssDebitIntervalDescription SetupIntentPaymentMethodOptionsMandateOptionsAcssDebit
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"payment_schedule" Text
-> Maybe
     SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitPaymentSchedule'
-> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= SetupIntentPaymentMethodOptionsMandateOptionsAcssDebit
-> Maybe
     SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitPaymentSchedule'
setupIntentPaymentMethodOptionsMandateOptionsAcssDebitPaymentSchedule SetupIntentPaymentMethodOptionsMandateOptionsAcssDebit
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> (Text
"transaction_type" Text
-> Maybe
     SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitTransactionType'
-> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= SetupIntentPaymentMethodOptionsMandateOptionsAcssDebit
-> Maybe
     SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitTransactionType'
setupIntentPaymentMethodOptionsMandateOptionsAcssDebitTransactionType SetupIntentPaymentMethodOptionsMandateOptionsAcssDebit
obj))))

instance Data.Aeson.Types.FromJSON.FromJSON SetupIntentPaymentMethodOptionsMandateOptionsAcssDebit where
  parseJSON :: Value
-> Parser SetupIntentPaymentMethodOptionsMandateOptionsAcssDebit
parseJSON = String
-> (Object
    -> Parser SetupIntentPaymentMethodOptionsMandateOptionsAcssDebit)
-> Value
-> Parser SetupIntentPaymentMethodOptionsMandateOptionsAcssDebit
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.Aeson.Types.FromJSON.withObject String
"SetupIntentPaymentMethodOptionsMandateOptionsAcssDebit" (\Object
obj -> ((((Maybe Text
 -> Maybe Text
 -> Maybe
      SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitPaymentSchedule'
 -> Maybe
      SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitTransactionType'
 -> SetupIntentPaymentMethodOptionsMandateOptionsAcssDebit)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe
           SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitPaymentSchedule'
      -> Maybe
           SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitTransactionType'
      -> SetupIntentPaymentMethodOptionsMandateOptionsAcssDebit)
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure Maybe Text
-> Maybe Text
-> Maybe
     SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitPaymentSchedule'
-> Maybe
     SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitTransactionType'
-> SetupIntentPaymentMethodOptionsMandateOptionsAcssDebit
SetupIntentPaymentMethodOptionsMandateOptionsAcssDebit Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe
        SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitPaymentSchedule'
   -> Maybe
        SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitTransactionType'
   -> SetupIntentPaymentMethodOptionsMandateOptionsAcssDebit)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe
           SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitPaymentSchedule'
      -> Maybe
           SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitTransactionType'
      -> SetupIntentPaymentMethodOptionsMandateOptionsAcssDebit)
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
"custom_mandate_url")) Parser
  (Maybe Text
   -> Maybe
        SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitPaymentSchedule'
   -> Maybe
        SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitTransactionType'
   -> SetupIntentPaymentMethodOptionsMandateOptionsAcssDebit)
-> Parser (Maybe Text)
-> Parser
     (Maybe
        SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitPaymentSchedule'
      -> Maybe
           SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitTransactionType'
      -> SetupIntentPaymentMethodOptionsMandateOptionsAcssDebit)
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
"interval_description")) Parser
  (Maybe
     SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitPaymentSchedule'
   -> Maybe
        SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitTransactionType'
   -> SetupIntentPaymentMethodOptionsMandateOptionsAcssDebit)
-> Parser
     (Maybe
        SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitPaymentSchedule')
-> Parser
     (Maybe
        SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitTransactionType'
      -> SetupIntentPaymentMethodOptionsMandateOptionsAcssDebit)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object
-> Text
-> Parser
     (Maybe
        SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitPaymentSchedule')
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Text
"payment_schedule")) Parser
  (Maybe
     SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitTransactionType'
   -> SetupIntentPaymentMethodOptionsMandateOptionsAcssDebit)
-> Parser
     (Maybe
        SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitTransactionType')
-> Parser SetupIntentPaymentMethodOptionsMandateOptionsAcssDebit
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object
-> Text
-> Parser
     (Maybe
        SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitTransactionType')
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Text
"transaction_type"))

-- | Create a new 'SetupIntentPaymentMethodOptionsMandateOptionsAcssDebit' with all required fields.
mkSetupIntentPaymentMethodOptionsMandateOptionsAcssDebit :: SetupIntentPaymentMethodOptionsMandateOptionsAcssDebit
mkSetupIntentPaymentMethodOptionsMandateOptionsAcssDebit :: SetupIntentPaymentMethodOptionsMandateOptionsAcssDebit
mkSetupIntentPaymentMethodOptionsMandateOptionsAcssDebit =
  SetupIntentPaymentMethodOptionsMandateOptionsAcssDebit :: Maybe Text
-> Maybe Text
-> Maybe
     SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitPaymentSchedule'
-> Maybe
     SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitTransactionType'
-> SetupIntentPaymentMethodOptionsMandateOptionsAcssDebit
SetupIntentPaymentMethodOptionsMandateOptionsAcssDebit
    { setupIntentPaymentMethodOptionsMandateOptionsAcssDebitCustomMandateUrl :: Maybe Text
setupIntentPaymentMethodOptionsMandateOptionsAcssDebitCustomMandateUrl = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing,
      setupIntentPaymentMethodOptionsMandateOptionsAcssDebitIntervalDescription :: Maybe Text
setupIntentPaymentMethodOptionsMandateOptionsAcssDebitIntervalDescription = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing,
      setupIntentPaymentMethodOptionsMandateOptionsAcssDebitPaymentSchedule :: Maybe
  SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitPaymentSchedule'
setupIntentPaymentMethodOptionsMandateOptionsAcssDebitPaymentSchedule = Maybe
  SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitPaymentSchedule'
forall a. Maybe a
GHC.Maybe.Nothing,
      setupIntentPaymentMethodOptionsMandateOptionsAcssDebitTransactionType :: Maybe
  SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitTransactionType'
setupIntentPaymentMethodOptionsMandateOptionsAcssDebitTransactionType = Maybe
  SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitTransactionType'
forall a. Maybe a
GHC.Maybe.Nothing
    }

-- | Defines the enum schema located at @components.schemas.setup_intent_payment_method_options_mandate_options_acss_debit.properties.payment_schedule@ in the specification.
--
-- Payment schedule for the mandate.
data SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitPaymentSchedule'
  = -- | This case is used if the value encountered during decoding does not match any of the provided cases in the specification.
    SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitPaymentSchedule'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.
    SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitPaymentSchedule'Typed Data.Text.Internal.Text
  | -- | Represents the JSON value @"combined"@
    SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitPaymentSchedule'EnumCombined
  | -- | Represents the JSON value @"interval"@
    SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitPaymentSchedule'EnumInterval
  | -- | Represents the JSON value @"sporadic"@
    SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitPaymentSchedule'EnumSporadic
  deriving (Int
-> SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitPaymentSchedule'
-> ShowS
[SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitPaymentSchedule']
-> ShowS
SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitPaymentSchedule'
-> String
(Int
 -> SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitPaymentSchedule'
 -> ShowS)
-> (SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitPaymentSchedule'
    -> String)
-> ([SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitPaymentSchedule']
    -> ShowS)
-> Show
     SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitPaymentSchedule'
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitPaymentSchedule']
-> ShowS
$cshowList :: [SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitPaymentSchedule']
-> ShowS
show :: SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitPaymentSchedule'
-> String
$cshow :: SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitPaymentSchedule'
-> String
showsPrec :: Int
-> SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitPaymentSchedule'
-> ShowS
$cshowsPrec :: Int
-> SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitPaymentSchedule'
-> ShowS
GHC.Show.Show, SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitPaymentSchedule'
-> SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitPaymentSchedule'
-> Bool
(SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitPaymentSchedule'
 -> SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitPaymentSchedule'
 -> Bool)
-> (SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitPaymentSchedule'
    -> SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitPaymentSchedule'
    -> Bool)
-> Eq
     SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitPaymentSchedule'
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitPaymentSchedule'
-> SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitPaymentSchedule'
-> Bool
$c/= :: SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitPaymentSchedule'
-> SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitPaymentSchedule'
-> Bool
== :: SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitPaymentSchedule'
-> SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitPaymentSchedule'
-> Bool
$c== :: SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitPaymentSchedule'
-> SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitPaymentSchedule'
-> Bool
GHC.Classes.Eq)

instance Data.Aeson.Types.ToJSON.ToJSON SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitPaymentSchedule' where
  toJSON :: SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitPaymentSchedule'
-> Value
toJSON (SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitPaymentSchedule'Other Value
val) = Value
val
  toJSON (SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitPaymentSchedule'Typed Text
val) = Text -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON Text
val
  toJSON (SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitPaymentSchedule'
SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitPaymentSchedule'EnumCombined) = Value
"combined"
  toJSON (SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitPaymentSchedule'
SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitPaymentSchedule'EnumInterval) = Value
"interval"
  toJSON (SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitPaymentSchedule'
SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitPaymentSchedule'EnumSporadic) = Value
"sporadic"

instance Data.Aeson.Types.FromJSON.FromJSON SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitPaymentSchedule' where
  parseJSON :: Value
-> Parser
     SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitPaymentSchedule'
parseJSON Value
val =
    SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitPaymentSchedule'
-> Parser
     SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitPaymentSchedule'
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
"combined" -> SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitPaymentSchedule'
SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitPaymentSchedule'EnumCombined
            | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"interval" -> SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitPaymentSchedule'
SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitPaymentSchedule'EnumInterval
            | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"sporadic" -> SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitPaymentSchedule'
SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitPaymentSchedule'EnumSporadic
            | Bool
GHC.Base.otherwise -> Value
-> SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitPaymentSchedule'
SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitPaymentSchedule'Other Value
val
      )

-- | Defines the enum schema located at @components.schemas.setup_intent_payment_method_options_mandate_options_acss_debit.properties.transaction_type@ in the specification.
--
-- Transaction type of the mandate.
data SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitTransactionType'
  = -- | This case is used if the value encountered during decoding does not match any of the provided cases in the specification.
    SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitTransactionType'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.
    SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitTransactionType'Typed Data.Text.Internal.Text
  | -- | Represents the JSON value @"business"@
    SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitTransactionType'EnumBusiness
  | -- | Represents the JSON value @"personal"@
    SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitTransactionType'EnumPersonal
  deriving (Int
-> SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitTransactionType'
-> ShowS
[SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitTransactionType']
-> ShowS
SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitTransactionType'
-> String
(Int
 -> SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitTransactionType'
 -> ShowS)
-> (SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitTransactionType'
    -> String)
-> ([SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitTransactionType']
    -> ShowS)
-> Show
     SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitTransactionType'
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitTransactionType']
-> ShowS
$cshowList :: [SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitTransactionType']
-> ShowS
show :: SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitTransactionType'
-> String
$cshow :: SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitTransactionType'
-> String
showsPrec :: Int
-> SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitTransactionType'
-> ShowS
$cshowsPrec :: Int
-> SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitTransactionType'
-> ShowS
GHC.Show.Show, SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitTransactionType'
-> SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitTransactionType'
-> Bool
(SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitTransactionType'
 -> SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitTransactionType'
 -> Bool)
-> (SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitTransactionType'
    -> SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitTransactionType'
    -> Bool)
-> Eq
     SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitTransactionType'
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitTransactionType'
-> SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitTransactionType'
-> Bool
$c/= :: SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitTransactionType'
-> SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitTransactionType'
-> Bool
== :: SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitTransactionType'
-> SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitTransactionType'
-> Bool
$c== :: SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitTransactionType'
-> SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitTransactionType'
-> Bool
GHC.Classes.Eq)

instance Data.Aeson.Types.ToJSON.ToJSON SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitTransactionType' where
  toJSON :: SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitTransactionType'
-> Value
toJSON (SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitTransactionType'Other Value
val) = Value
val
  toJSON (SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitTransactionType'Typed Text
val) = Text -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON Text
val
  toJSON (SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitTransactionType'
SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitTransactionType'EnumBusiness) = Value
"business"
  toJSON (SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitTransactionType'
SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitTransactionType'EnumPersonal) = Value
"personal"

instance Data.Aeson.Types.FromJSON.FromJSON SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitTransactionType' where
  parseJSON :: Value
-> Parser
     SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitTransactionType'
parseJSON Value
val =
    SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitTransactionType'
-> Parser
     SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitTransactionType'
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
"business" -> SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitTransactionType'
SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitTransactionType'EnumBusiness
            | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"personal" -> SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitTransactionType'
SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitTransactionType'EnumPersonal
            | Bool
GHC.Base.otherwise -> Value
-> SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitTransactionType'
SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitTransactionType'Other Value
val
      )