{-# 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 InvoicesPaymentMethodOptions
module StripeAPI.Types.InvoicesPaymentMethodOptions 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.InvoicePaymentMethodOptionsBancontact
import {-# SOURCE #-} StripeAPI.Types.InvoicePaymentMethodOptionsCard
import qualified Prelude as GHC.Integer.Type
import qualified Prelude as GHC.Maybe

-- | Defines the object schema located at @components.schemas.invoices_payment_method_options@ in the specification.
data InvoicesPaymentMethodOptions = InvoicesPaymentMethodOptions
  { -- | bancontact: If paying by \`bancontact\`, this sub-hash contains details about the Bancontact payment method options to pass to the invoice’s PaymentIntent.
    InvoicesPaymentMethodOptions
-> Maybe InvoicesPaymentMethodOptionsBancontact'
invoicesPaymentMethodOptionsBancontact :: (GHC.Maybe.Maybe InvoicesPaymentMethodOptionsBancontact'),
    -- | card: If paying by \`card\`, this sub-hash contains details about the Card payment method options to pass to the invoice’s PaymentIntent.
    InvoicesPaymentMethodOptions
-> Maybe InvoicesPaymentMethodOptionsCard'
invoicesPaymentMethodOptionsCard :: (GHC.Maybe.Maybe InvoicesPaymentMethodOptionsCard')
  }
  deriving
    ( Int -> InvoicesPaymentMethodOptions -> ShowS
[InvoicesPaymentMethodOptions] -> ShowS
InvoicesPaymentMethodOptions -> String
(Int -> InvoicesPaymentMethodOptions -> ShowS)
-> (InvoicesPaymentMethodOptions -> String)
-> ([InvoicesPaymentMethodOptions] -> ShowS)
-> Show InvoicesPaymentMethodOptions
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [InvoicesPaymentMethodOptions] -> ShowS
$cshowList :: [InvoicesPaymentMethodOptions] -> ShowS
show :: InvoicesPaymentMethodOptions -> String
$cshow :: InvoicesPaymentMethodOptions -> String
showsPrec :: Int -> InvoicesPaymentMethodOptions -> ShowS
$cshowsPrec :: Int -> InvoicesPaymentMethodOptions -> ShowS
GHC.Show.Show,
      InvoicesPaymentMethodOptions
-> InvoicesPaymentMethodOptions -> Bool
(InvoicesPaymentMethodOptions
 -> InvoicesPaymentMethodOptions -> Bool)
-> (InvoicesPaymentMethodOptions
    -> InvoicesPaymentMethodOptions -> Bool)
-> Eq InvoicesPaymentMethodOptions
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: InvoicesPaymentMethodOptions
-> InvoicesPaymentMethodOptions -> Bool
$c/= :: InvoicesPaymentMethodOptions
-> InvoicesPaymentMethodOptions -> Bool
== :: InvoicesPaymentMethodOptions
-> InvoicesPaymentMethodOptions -> Bool
$c== :: InvoicesPaymentMethodOptions
-> InvoicesPaymentMethodOptions -> Bool
GHC.Classes.Eq
    )

instance Data.Aeson.Types.ToJSON.ToJSON InvoicesPaymentMethodOptions where
  toJSON :: InvoicesPaymentMethodOptions -> Value
toJSON InvoicesPaymentMethodOptions
obj = [Pair] -> Value
Data.Aeson.Types.Internal.object (Text
"bancontact" Text -> Maybe InvoicesPaymentMethodOptionsBancontact' -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= InvoicesPaymentMethodOptions
-> Maybe InvoicesPaymentMethodOptionsBancontact'
invoicesPaymentMethodOptionsBancontact InvoicesPaymentMethodOptions
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"card" Text -> Maybe InvoicesPaymentMethodOptionsCard' -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= InvoicesPaymentMethodOptions
-> Maybe InvoicesPaymentMethodOptionsCard'
invoicesPaymentMethodOptionsCard InvoicesPaymentMethodOptions
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: [Pair]
forall a. Monoid a => a
GHC.Base.mempty)
  toEncoding :: InvoicesPaymentMethodOptions -> Encoding
toEncoding InvoicesPaymentMethodOptions
obj = Series -> Encoding
Data.Aeson.Encoding.Internal.pairs ((Text
"bancontact" Text -> Maybe InvoicesPaymentMethodOptionsBancontact' -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= InvoicesPaymentMethodOptions
-> Maybe InvoicesPaymentMethodOptionsBancontact'
invoicesPaymentMethodOptionsBancontact InvoicesPaymentMethodOptions
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> (Text
"card" Text -> Maybe InvoicesPaymentMethodOptionsCard' -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= InvoicesPaymentMethodOptions
-> Maybe InvoicesPaymentMethodOptionsCard'
invoicesPaymentMethodOptionsCard InvoicesPaymentMethodOptions
obj))

instance Data.Aeson.Types.FromJSON.FromJSON InvoicesPaymentMethodOptions where
  parseJSON :: Value -> Parser InvoicesPaymentMethodOptions
parseJSON = String
-> (Object -> Parser InvoicesPaymentMethodOptions)
-> Value
-> Parser InvoicesPaymentMethodOptions
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.Aeson.Types.FromJSON.withObject String
"InvoicesPaymentMethodOptions" (\Object
obj -> ((Maybe InvoicesPaymentMethodOptionsBancontact'
 -> Maybe InvoicesPaymentMethodOptionsCard'
 -> InvoicesPaymentMethodOptions)
-> Parser
     (Maybe InvoicesPaymentMethodOptionsBancontact'
      -> Maybe InvoicesPaymentMethodOptionsCard'
      -> InvoicesPaymentMethodOptions)
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure Maybe InvoicesPaymentMethodOptionsBancontact'
-> Maybe InvoicesPaymentMethodOptionsCard'
-> InvoicesPaymentMethodOptions
InvoicesPaymentMethodOptions Parser
  (Maybe InvoicesPaymentMethodOptionsBancontact'
   -> Maybe InvoicesPaymentMethodOptionsCard'
   -> InvoicesPaymentMethodOptions)
-> Parser (Maybe InvoicesPaymentMethodOptionsBancontact')
-> Parser
     (Maybe InvoicesPaymentMethodOptionsCard'
      -> InvoicesPaymentMethodOptions)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object
-> Text -> Parser (Maybe InvoicesPaymentMethodOptionsBancontact')
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Text
"bancontact")) Parser
  (Maybe InvoicesPaymentMethodOptionsCard'
   -> InvoicesPaymentMethodOptions)
-> Parser (Maybe InvoicesPaymentMethodOptionsCard')
-> Parser InvoicesPaymentMethodOptions
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Text -> Parser (Maybe InvoicesPaymentMethodOptionsCard')
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Text
"card"))

-- | Create a new 'InvoicesPaymentMethodOptions' with all required fields.
mkInvoicesPaymentMethodOptions :: InvoicesPaymentMethodOptions
mkInvoicesPaymentMethodOptions :: InvoicesPaymentMethodOptions
mkInvoicesPaymentMethodOptions =
  InvoicesPaymentMethodOptions :: Maybe InvoicesPaymentMethodOptionsBancontact'
-> Maybe InvoicesPaymentMethodOptionsCard'
-> InvoicesPaymentMethodOptions
InvoicesPaymentMethodOptions
    { invoicesPaymentMethodOptionsBancontact :: Maybe InvoicesPaymentMethodOptionsBancontact'
invoicesPaymentMethodOptionsBancontact = Maybe InvoicesPaymentMethodOptionsBancontact'
forall a. Maybe a
GHC.Maybe.Nothing,
      invoicesPaymentMethodOptionsCard :: Maybe InvoicesPaymentMethodOptionsCard'
invoicesPaymentMethodOptionsCard = Maybe InvoicesPaymentMethodOptionsCard'
forall a. Maybe a
GHC.Maybe.Nothing
    }

-- | Defines the object schema located at @components.schemas.invoices_payment_method_options.properties.bancontact.anyOf@ in the specification.
--
-- If paying by \\\`bancontact\\\`, this sub-hash contains details about the Bancontact payment method options to pass to the invoice’s PaymentIntent.
data InvoicesPaymentMethodOptionsBancontact' = InvoicesPaymentMethodOptionsBancontact'
  { -- | preferred_language: Preferred language of the Bancontact authorization page that the customer is redirected to.
    InvoicesPaymentMethodOptionsBancontact'
-> Maybe InvoicesPaymentMethodOptionsBancontact'PreferredLanguage'
invoicesPaymentMethodOptionsBancontact'PreferredLanguage :: (GHC.Maybe.Maybe InvoicesPaymentMethodOptionsBancontact'PreferredLanguage')
  }
  deriving
    ( Int -> InvoicesPaymentMethodOptionsBancontact' -> ShowS
[InvoicesPaymentMethodOptionsBancontact'] -> ShowS
InvoicesPaymentMethodOptionsBancontact' -> String
(Int -> InvoicesPaymentMethodOptionsBancontact' -> ShowS)
-> (InvoicesPaymentMethodOptionsBancontact' -> String)
-> ([InvoicesPaymentMethodOptionsBancontact'] -> ShowS)
-> Show InvoicesPaymentMethodOptionsBancontact'
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [InvoicesPaymentMethodOptionsBancontact'] -> ShowS
$cshowList :: [InvoicesPaymentMethodOptionsBancontact'] -> ShowS
show :: InvoicesPaymentMethodOptionsBancontact' -> String
$cshow :: InvoicesPaymentMethodOptionsBancontact' -> String
showsPrec :: Int -> InvoicesPaymentMethodOptionsBancontact' -> ShowS
$cshowsPrec :: Int -> InvoicesPaymentMethodOptionsBancontact' -> ShowS
GHC.Show.Show,
      InvoicesPaymentMethodOptionsBancontact'
-> InvoicesPaymentMethodOptionsBancontact' -> Bool
(InvoicesPaymentMethodOptionsBancontact'
 -> InvoicesPaymentMethodOptionsBancontact' -> Bool)
-> (InvoicesPaymentMethodOptionsBancontact'
    -> InvoicesPaymentMethodOptionsBancontact' -> Bool)
-> Eq InvoicesPaymentMethodOptionsBancontact'
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: InvoicesPaymentMethodOptionsBancontact'
-> InvoicesPaymentMethodOptionsBancontact' -> Bool
$c/= :: InvoicesPaymentMethodOptionsBancontact'
-> InvoicesPaymentMethodOptionsBancontact' -> Bool
== :: InvoicesPaymentMethodOptionsBancontact'
-> InvoicesPaymentMethodOptionsBancontact' -> Bool
$c== :: InvoicesPaymentMethodOptionsBancontact'
-> InvoicesPaymentMethodOptionsBancontact' -> Bool
GHC.Classes.Eq
    )

instance Data.Aeson.Types.ToJSON.ToJSON InvoicesPaymentMethodOptionsBancontact' where
  toJSON :: InvoicesPaymentMethodOptionsBancontact' -> Value
toJSON InvoicesPaymentMethodOptionsBancontact'
obj = [Pair] -> Value
Data.Aeson.Types.Internal.object (Text
"preferred_language" Text
-> Maybe InvoicesPaymentMethodOptionsBancontact'PreferredLanguage'
-> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= InvoicesPaymentMethodOptionsBancontact'
-> Maybe InvoicesPaymentMethodOptionsBancontact'PreferredLanguage'
invoicesPaymentMethodOptionsBancontact'PreferredLanguage InvoicesPaymentMethodOptionsBancontact'
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: [Pair]
forall a. Monoid a => a
GHC.Base.mempty)
  toEncoding :: InvoicesPaymentMethodOptionsBancontact' -> Encoding
toEncoding InvoicesPaymentMethodOptionsBancontact'
obj = Series -> Encoding
Data.Aeson.Encoding.Internal.pairs (Text
"preferred_language" Text
-> Maybe InvoicesPaymentMethodOptionsBancontact'PreferredLanguage'
-> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= InvoicesPaymentMethodOptionsBancontact'
-> Maybe InvoicesPaymentMethodOptionsBancontact'PreferredLanguage'
invoicesPaymentMethodOptionsBancontact'PreferredLanguage InvoicesPaymentMethodOptionsBancontact'
obj)

instance Data.Aeson.Types.FromJSON.FromJSON InvoicesPaymentMethodOptionsBancontact' where
  parseJSON :: Value -> Parser InvoicesPaymentMethodOptionsBancontact'
parseJSON = String
-> (Object -> Parser InvoicesPaymentMethodOptionsBancontact')
-> Value
-> Parser InvoicesPaymentMethodOptionsBancontact'
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.Aeson.Types.FromJSON.withObject String
"InvoicesPaymentMethodOptionsBancontact'" (\Object
obj -> (Maybe InvoicesPaymentMethodOptionsBancontact'PreferredLanguage'
 -> InvoicesPaymentMethodOptionsBancontact')
-> Parser
     (Maybe InvoicesPaymentMethodOptionsBancontact'PreferredLanguage'
      -> InvoicesPaymentMethodOptionsBancontact')
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure Maybe InvoicesPaymentMethodOptionsBancontact'PreferredLanguage'
-> InvoicesPaymentMethodOptionsBancontact'
InvoicesPaymentMethodOptionsBancontact' Parser
  (Maybe InvoicesPaymentMethodOptionsBancontact'PreferredLanguage'
   -> InvoicesPaymentMethodOptionsBancontact')
-> Parser
     (Maybe InvoicesPaymentMethodOptionsBancontact'PreferredLanguage')
-> Parser InvoicesPaymentMethodOptionsBancontact'
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object
-> Text
-> Parser
     (Maybe InvoicesPaymentMethodOptionsBancontact'PreferredLanguage')
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Text
"preferred_language"))

-- | Create a new 'InvoicesPaymentMethodOptionsBancontact'' with all required fields.
mkInvoicesPaymentMethodOptionsBancontact' :: InvoicesPaymentMethodOptionsBancontact'
mkInvoicesPaymentMethodOptionsBancontact' :: InvoicesPaymentMethodOptionsBancontact'
mkInvoicesPaymentMethodOptionsBancontact' = InvoicesPaymentMethodOptionsBancontact' :: Maybe InvoicesPaymentMethodOptionsBancontact'PreferredLanguage'
-> InvoicesPaymentMethodOptionsBancontact'
InvoicesPaymentMethodOptionsBancontact' {invoicesPaymentMethodOptionsBancontact'PreferredLanguage :: Maybe InvoicesPaymentMethodOptionsBancontact'PreferredLanguage'
invoicesPaymentMethodOptionsBancontact'PreferredLanguage = Maybe InvoicesPaymentMethodOptionsBancontact'PreferredLanguage'
forall a. Maybe a
GHC.Maybe.Nothing}

-- | Defines the enum schema located at @components.schemas.invoices_payment_method_options.properties.bancontact.anyOf.properties.preferred_language@ in the specification.
--
-- Preferred language of the Bancontact authorization page that the customer is redirected to.
data InvoicesPaymentMethodOptionsBancontact'PreferredLanguage'
  = -- | This case is used if the value encountered during decoding does not match any of the provided cases in the specification.
    InvoicesPaymentMethodOptionsBancontact'PreferredLanguage'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.
    InvoicesPaymentMethodOptionsBancontact'PreferredLanguage'Typed Data.Text.Internal.Text
  | -- | Represents the JSON value @"de"@
    InvoicesPaymentMethodOptionsBancontact'PreferredLanguage'EnumDe
  | -- | Represents the JSON value @"en"@
    InvoicesPaymentMethodOptionsBancontact'PreferredLanguage'EnumEn
  | -- | Represents the JSON value @"fr"@
    InvoicesPaymentMethodOptionsBancontact'PreferredLanguage'EnumFr
  | -- | Represents the JSON value @"nl"@
    InvoicesPaymentMethodOptionsBancontact'PreferredLanguage'EnumNl
  deriving (Int
-> InvoicesPaymentMethodOptionsBancontact'PreferredLanguage'
-> ShowS
[InvoicesPaymentMethodOptionsBancontact'PreferredLanguage']
-> ShowS
InvoicesPaymentMethodOptionsBancontact'PreferredLanguage' -> String
(Int
 -> InvoicesPaymentMethodOptionsBancontact'PreferredLanguage'
 -> ShowS)
-> (InvoicesPaymentMethodOptionsBancontact'PreferredLanguage'
    -> String)
-> ([InvoicesPaymentMethodOptionsBancontact'PreferredLanguage']
    -> ShowS)
-> Show InvoicesPaymentMethodOptionsBancontact'PreferredLanguage'
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [InvoicesPaymentMethodOptionsBancontact'PreferredLanguage']
-> ShowS
$cshowList :: [InvoicesPaymentMethodOptionsBancontact'PreferredLanguage']
-> ShowS
show :: InvoicesPaymentMethodOptionsBancontact'PreferredLanguage' -> String
$cshow :: InvoicesPaymentMethodOptionsBancontact'PreferredLanguage' -> String
showsPrec :: Int
-> InvoicesPaymentMethodOptionsBancontact'PreferredLanguage'
-> ShowS
$cshowsPrec :: Int
-> InvoicesPaymentMethodOptionsBancontact'PreferredLanguage'
-> ShowS
GHC.Show.Show, InvoicesPaymentMethodOptionsBancontact'PreferredLanguage'
-> InvoicesPaymentMethodOptionsBancontact'PreferredLanguage'
-> Bool
(InvoicesPaymentMethodOptionsBancontact'PreferredLanguage'
 -> InvoicesPaymentMethodOptionsBancontact'PreferredLanguage'
 -> Bool)
-> (InvoicesPaymentMethodOptionsBancontact'PreferredLanguage'
    -> InvoicesPaymentMethodOptionsBancontact'PreferredLanguage'
    -> Bool)
-> Eq InvoicesPaymentMethodOptionsBancontact'PreferredLanguage'
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: InvoicesPaymentMethodOptionsBancontact'PreferredLanguage'
-> InvoicesPaymentMethodOptionsBancontact'PreferredLanguage'
-> Bool
$c/= :: InvoicesPaymentMethodOptionsBancontact'PreferredLanguage'
-> InvoicesPaymentMethodOptionsBancontact'PreferredLanguage'
-> Bool
== :: InvoicesPaymentMethodOptionsBancontact'PreferredLanguage'
-> InvoicesPaymentMethodOptionsBancontact'PreferredLanguage'
-> Bool
$c== :: InvoicesPaymentMethodOptionsBancontact'PreferredLanguage'
-> InvoicesPaymentMethodOptionsBancontact'PreferredLanguage'
-> Bool
GHC.Classes.Eq)

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

instance Data.Aeson.Types.FromJSON.FromJSON InvoicesPaymentMethodOptionsBancontact'PreferredLanguage' where
  parseJSON :: Value
-> Parser InvoicesPaymentMethodOptionsBancontact'PreferredLanguage'
parseJSON Value
val =
    InvoicesPaymentMethodOptionsBancontact'PreferredLanguage'
-> Parser InvoicesPaymentMethodOptionsBancontact'PreferredLanguage'
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" -> InvoicesPaymentMethodOptionsBancontact'PreferredLanguage'
InvoicesPaymentMethodOptionsBancontact'PreferredLanguage'EnumDe
            | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"en" -> InvoicesPaymentMethodOptionsBancontact'PreferredLanguage'
InvoicesPaymentMethodOptionsBancontact'PreferredLanguage'EnumEn
            | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"fr" -> InvoicesPaymentMethodOptionsBancontact'PreferredLanguage'
InvoicesPaymentMethodOptionsBancontact'PreferredLanguage'EnumFr
            | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"nl" -> InvoicesPaymentMethodOptionsBancontact'PreferredLanguage'
InvoicesPaymentMethodOptionsBancontact'PreferredLanguage'EnumNl
            | Bool
GHC.Base.otherwise -> Value -> InvoicesPaymentMethodOptionsBancontact'PreferredLanguage'
InvoicesPaymentMethodOptionsBancontact'PreferredLanguage'Other Value
val
      )

-- | Defines the object schema located at @components.schemas.invoices_payment_method_options.properties.card.anyOf@ in the specification.
--
-- If paying by \\\`card\\\`, this sub-hash contains details about the Card payment method options to pass to the invoice’s PaymentIntent.
data InvoicesPaymentMethodOptionsCard' = InvoicesPaymentMethodOptionsCard'
  { -- | request_three_d_secure: We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https:\/\/stripe.com\/docs\/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. Read our guide on [manually requesting 3D Secure](https:\/\/stripe.com\/docs\/payments\/3d-secure\#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine.
    InvoicesPaymentMethodOptionsCard'
-> Maybe InvoicesPaymentMethodOptionsCard'RequestThreeDSecure'
invoicesPaymentMethodOptionsCard'RequestThreeDSecure :: (GHC.Maybe.Maybe InvoicesPaymentMethodOptionsCard'RequestThreeDSecure')
  }
  deriving
    ( Int -> InvoicesPaymentMethodOptionsCard' -> ShowS
[InvoicesPaymentMethodOptionsCard'] -> ShowS
InvoicesPaymentMethodOptionsCard' -> String
(Int -> InvoicesPaymentMethodOptionsCard' -> ShowS)
-> (InvoicesPaymentMethodOptionsCard' -> String)
-> ([InvoicesPaymentMethodOptionsCard'] -> ShowS)
-> Show InvoicesPaymentMethodOptionsCard'
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [InvoicesPaymentMethodOptionsCard'] -> ShowS
$cshowList :: [InvoicesPaymentMethodOptionsCard'] -> ShowS
show :: InvoicesPaymentMethodOptionsCard' -> String
$cshow :: InvoicesPaymentMethodOptionsCard' -> String
showsPrec :: Int -> InvoicesPaymentMethodOptionsCard' -> ShowS
$cshowsPrec :: Int -> InvoicesPaymentMethodOptionsCard' -> ShowS
GHC.Show.Show,
      InvoicesPaymentMethodOptionsCard'
-> InvoicesPaymentMethodOptionsCard' -> Bool
(InvoicesPaymentMethodOptionsCard'
 -> InvoicesPaymentMethodOptionsCard' -> Bool)
-> (InvoicesPaymentMethodOptionsCard'
    -> InvoicesPaymentMethodOptionsCard' -> Bool)
-> Eq InvoicesPaymentMethodOptionsCard'
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: InvoicesPaymentMethodOptionsCard'
-> InvoicesPaymentMethodOptionsCard' -> Bool
$c/= :: InvoicesPaymentMethodOptionsCard'
-> InvoicesPaymentMethodOptionsCard' -> Bool
== :: InvoicesPaymentMethodOptionsCard'
-> InvoicesPaymentMethodOptionsCard' -> Bool
$c== :: InvoicesPaymentMethodOptionsCard'
-> InvoicesPaymentMethodOptionsCard' -> Bool
GHC.Classes.Eq
    )

instance Data.Aeson.Types.ToJSON.ToJSON InvoicesPaymentMethodOptionsCard' where
  toJSON :: InvoicesPaymentMethodOptionsCard' -> Value
toJSON InvoicesPaymentMethodOptionsCard'
obj = [Pair] -> Value
Data.Aeson.Types.Internal.object (Text
"request_three_d_secure" Text
-> Maybe InvoicesPaymentMethodOptionsCard'RequestThreeDSecure'
-> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= InvoicesPaymentMethodOptionsCard'
-> Maybe InvoicesPaymentMethodOptionsCard'RequestThreeDSecure'
invoicesPaymentMethodOptionsCard'RequestThreeDSecure InvoicesPaymentMethodOptionsCard'
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: [Pair]
forall a. Monoid a => a
GHC.Base.mempty)
  toEncoding :: InvoicesPaymentMethodOptionsCard' -> Encoding
toEncoding InvoicesPaymentMethodOptionsCard'
obj = Series -> Encoding
Data.Aeson.Encoding.Internal.pairs (Text
"request_three_d_secure" Text
-> Maybe InvoicesPaymentMethodOptionsCard'RequestThreeDSecure'
-> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= InvoicesPaymentMethodOptionsCard'
-> Maybe InvoicesPaymentMethodOptionsCard'RequestThreeDSecure'
invoicesPaymentMethodOptionsCard'RequestThreeDSecure InvoicesPaymentMethodOptionsCard'
obj)

instance Data.Aeson.Types.FromJSON.FromJSON InvoicesPaymentMethodOptionsCard' where
  parseJSON :: Value -> Parser InvoicesPaymentMethodOptionsCard'
parseJSON = String
-> (Object -> Parser InvoicesPaymentMethodOptionsCard')
-> Value
-> Parser InvoicesPaymentMethodOptionsCard'
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.Aeson.Types.FromJSON.withObject String
"InvoicesPaymentMethodOptionsCard'" (\Object
obj -> (Maybe InvoicesPaymentMethodOptionsCard'RequestThreeDSecure'
 -> InvoicesPaymentMethodOptionsCard')
-> Parser
     (Maybe InvoicesPaymentMethodOptionsCard'RequestThreeDSecure'
      -> InvoicesPaymentMethodOptionsCard')
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure Maybe InvoicesPaymentMethodOptionsCard'RequestThreeDSecure'
-> InvoicesPaymentMethodOptionsCard'
InvoicesPaymentMethodOptionsCard' Parser
  (Maybe InvoicesPaymentMethodOptionsCard'RequestThreeDSecure'
   -> InvoicesPaymentMethodOptionsCard')
-> Parser
     (Maybe InvoicesPaymentMethodOptionsCard'RequestThreeDSecure')
-> Parser InvoicesPaymentMethodOptionsCard'
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object
-> Text
-> Parser
     (Maybe InvoicesPaymentMethodOptionsCard'RequestThreeDSecure')
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Text
"request_three_d_secure"))

-- | Create a new 'InvoicesPaymentMethodOptionsCard'' with all required fields.
mkInvoicesPaymentMethodOptionsCard' :: InvoicesPaymentMethodOptionsCard'
mkInvoicesPaymentMethodOptionsCard' :: InvoicesPaymentMethodOptionsCard'
mkInvoicesPaymentMethodOptionsCard' = InvoicesPaymentMethodOptionsCard' :: Maybe InvoicesPaymentMethodOptionsCard'RequestThreeDSecure'
-> InvoicesPaymentMethodOptionsCard'
InvoicesPaymentMethodOptionsCard' {invoicesPaymentMethodOptionsCard'RequestThreeDSecure :: Maybe InvoicesPaymentMethodOptionsCard'RequestThreeDSecure'
invoicesPaymentMethodOptionsCard'RequestThreeDSecure = Maybe InvoicesPaymentMethodOptionsCard'RequestThreeDSecure'
forall a. Maybe a
GHC.Maybe.Nothing}

-- | Defines the enum schema located at @components.schemas.invoices_payment_method_options.properties.card.anyOf.properties.request_three_d_secure@ in the specification.
--
-- We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https:\/\/stripe.com\/docs\/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. Read our guide on [manually requesting 3D Secure](https:\/\/stripe.com\/docs\/payments\/3d-secure\#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine.
data InvoicesPaymentMethodOptionsCard'RequestThreeDSecure'
  = -- | This case is used if the value encountered during decoding does not match any of the provided cases in the specification.
    InvoicesPaymentMethodOptionsCard'RequestThreeDSecure'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.
    InvoicesPaymentMethodOptionsCard'RequestThreeDSecure'Typed Data.Text.Internal.Text
  | -- | Represents the JSON value @"any"@
    InvoicesPaymentMethodOptionsCard'RequestThreeDSecure'EnumAny
  | -- | Represents the JSON value @"automatic"@
    InvoicesPaymentMethodOptionsCard'RequestThreeDSecure'EnumAutomatic
  deriving (Int
-> InvoicesPaymentMethodOptionsCard'RequestThreeDSecure' -> ShowS
[InvoicesPaymentMethodOptionsCard'RequestThreeDSecure'] -> ShowS
InvoicesPaymentMethodOptionsCard'RequestThreeDSecure' -> String
(Int
 -> InvoicesPaymentMethodOptionsCard'RequestThreeDSecure' -> ShowS)
-> (InvoicesPaymentMethodOptionsCard'RequestThreeDSecure'
    -> String)
-> ([InvoicesPaymentMethodOptionsCard'RequestThreeDSecure']
    -> ShowS)
-> Show InvoicesPaymentMethodOptionsCard'RequestThreeDSecure'
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [InvoicesPaymentMethodOptionsCard'RequestThreeDSecure'] -> ShowS
$cshowList :: [InvoicesPaymentMethodOptionsCard'RequestThreeDSecure'] -> ShowS
show :: InvoicesPaymentMethodOptionsCard'RequestThreeDSecure' -> String
$cshow :: InvoicesPaymentMethodOptionsCard'RequestThreeDSecure' -> String
showsPrec :: Int
-> InvoicesPaymentMethodOptionsCard'RequestThreeDSecure' -> ShowS
$cshowsPrec :: Int
-> InvoicesPaymentMethodOptionsCard'RequestThreeDSecure' -> ShowS
GHC.Show.Show, InvoicesPaymentMethodOptionsCard'RequestThreeDSecure'
-> InvoicesPaymentMethodOptionsCard'RequestThreeDSecure' -> Bool
(InvoicesPaymentMethodOptionsCard'RequestThreeDSecure'
 -> InvoicesPaymentMethodOptionsCard'RequestThreeDSecure' -> Bool)
-> (InvoicesPaymentMethodOptionsCard'RequestThreeDSecure'
    -> InvoicesPaymentMethodOptionsCard'RequestThreeDSecure' -> Bool)
-> Eq InvoicesPaymentMethodOptionsCard'RequestThreeDSecure'
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: InvoicesPaymentMethodOptionsCard'RequestThreeDSecure'
-> InvoicesPaymentMethodOptionsCard'RequestThreeDSecure' -> Bool
$c/= :: InvoicesPaymentMethodOptionsCard'RequestThreeDSecure'
-> InvoicesPaymentMethodOptionsCard'RequestThreeDSecure' -> Bool
== :: InvoicesPaymentMethodOptionsCard'RequestThreeDSecure'
-> InvoicesPaymentMethodOptionsCard'RequestThreeDSecure' -> Bool
$c== :: InvoicesPaymentMethodOptionsCard'RequestThreeDSecure'
-> InvoicesPaymentMethodOptionsCard'RequestThreeDSecure' -> Bool
GHC.Classes.Eq)

instance Data.Aeson.Types.ToJSON.ToJSON InvoicesPaymentMethodOptionsCard'RequestThreeDSecure' where
  toJSON :: InvoicesPaymentMethodOptionsCard'RequestThreeDSecure' -> Value
toJSON (InvoicesPaymentMethodOptionsCard'RequestThreeDSecure'Other Value
val) = Value
val
  toJSON (InvoicesPaymentMethodOptionsCard'RequestThreeDSecure'Typed Text
val) = Text -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON Text
val
  toJSON (InvoicesPaymentMethodOptionsCard'RequestThreeDSecure'
InvoicesPaymentMethodOptionsCard'RequestThreeDSecure'EnumAny) = Value
"any"
  toJSON (InvoicesPaymentMethodOptionsCard'RequestThreeDSecure'
InvoicesPaymentMethodOptionsCard'RequestThreeDSecure'EnumAutomatic) = Value
"automatic"

instance Data.Aeson.Types.FromJSON.FromJSON InvoicesPaymentMethodOptionsCard'RequestThreeDSecure' where
  parseJSON :: Value
-> Parser InvoicesPaymentMethodOptionsCard'RequestThreeDSecure'
parseJSON Value
val =
    InvoicesPaymentMethodOptionsCard'RequestThreeDSecure'
-> Parser InvoicesPaymentMethodOptionsCard'RequestThreeDSecure'
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
"any" -> InvoicesPaymentMethodOptionsCard'RequestThreeDSecure'
InvoicesPaymentMethodOptionsCard'RequestThreeDSecure'EnumAny
            | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"automatic" -> InvoicesPaymentMethodOptionsCard'RequestThreeDSecure'
InvoicesPaymentMethodOptionsCard'RequestThreeDSecure'EnumAutomatic
            | Bool
GHC.Base.otherwise -> Value -> InvoicesPaymentMethodOptionsCard'RequestThreeDSecure'
InvoicesPaymentMethodOptionsCard'RequestThreeDSecure'Other Value
val
      )