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

-- | Contains the types generated from the schema InvoicePaymentMethodOptionsBancontact
module StripeAPI.Types.InvoicePaymentMethodOptionsBancontact 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.Foldable
import qualified Data.Functor
import qualified Data.Maybe
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.invoice_payment_method_options_bancontact@ in the specification.
data InvoicePaymentMethodOptionsBancontact = InvoicePaymentMethodOptionsBancontact
  | preferred_language : Preferred language of the  authorization page that the customer is redirected to .
    invoicePaymentMethodOptionsBancontactPreferredLanguage :: InvoicePaymentMethodOptionsBancontactPreferredLanguage'
  }
  deriving
    ( GHC.Show.Show,
      GHC.Classes.Eq
    )

instance Data.Aeson.Types.ToJSON.ToJSON InvoicePaymentMethodOptionsBancontact where
  toJSON obj = Data.Aeson.Types.Internal.object (Data.Foldable.concat (["preferred_language" Data.Aeson.Types.ToJSON..= invoicePaymentMethodOptionsBancontactPreferredLanguage obj] : GHC.Base.mempty))
  toEncoding obj = Data.Aeson.Encoding.Internal.pairs (GHC.Base.mconcat (Data.Foldable.concat (["preferred_language" Data.Aeson.Types.ToJSON..= invoicePaymentMethodOptionsBancontactPreferredLanguage obj] : GHC.Base.mempty)))

instance Data.Aeson.Types.FromJSON.FromJSON InvoicePaymentMethodOptionsBancontact where
  parseJSON = Data.Aeson.Types.FromJSON.withObject "InvoicePaymentMethodOptionsBancontact" (\obj -> GHC.Base.pure InvoicePaymentMethodOptionsBancontact GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..: "preferred_language"))

-- | Create a new 'InvoicePaymentMethodOptionsBancontact' with all required fields.
mkInvoicePaymentMethodOptionsBancontact ::
  -- | 'invoicePaymentMethodOptionsBancontactPreferredLanguage'
  InvoicePaymentMethodOptionsBancontactPreferredLanguage' ->
  InvoicePaymentMethodOptionsBancontact
mkInvoicePaymentMethodOptionsBancontact invoicePaymentMethodOptionsBancontactPreferredLanguage = InvoicePaymentMethodOptionsBancontact {invoicePaymentMethodOptionsBancontactPreferredLanguage = invoicePaymentMethodOptionsBancontactPreferredLanguage}

-- | Defines the enum schema located at @components.schemas.invoice_payment_method_options_bancontact.properties.preferred_language@ in the specification.
--
  Preferred language of the  authorization page that the customer is redirected to .
data InvoicePaymentMethodOptionsBancontactPreferredLanguage'
  = -- | This case is used if the value encountered during decoding does not match any of the provided cases in the specification.
    InvoicePaymentMethodOptionsBancontactPreferredLanguage'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.
    InvoicePaymentMethodOptionsBancontactPreferredLanguage'Typed Data.Text.Internal.Text
  | Represents the JSON value @"de"@
    InvoicePaymentMethodOptionsBancontactPreferredLanguage'EnumDe
  | Represents the JSON value @"en"@
    InvoicePaymentMethodOptionsBancontactPreferredLanguage'EnumEn
  | -- | Represents the JSON value @"fr"@
    InvoicePaymentMethodOptionsBancontactPreferredLanguage'EnumFr
  | Represents the JSON value @"nl"@
    InvoicePaymentMethodOptionsBancontactPreferredLanguage'EnumNl
  deriving (GHC.Show.Show, GHC.Classes.Eq)

instance Data.Aeson.Types.ToJSON.ToJSON InvoicePaymentMethodOptionsBancontactPreferredLanguage' where
  toJSON (InvoicePaymentMethodOptionsBancontactPreferredLanguage'Other val) = val
  toJSON (InvoicePaymentMethodOptionsBancontactPreferredLanguage'Typed val) = Data.Aeson.Types.ToJSON.toJSON val
  toJSON (InvoicePaymentMethodOptionsBancontactPreferredLanguage'EnumDe) = "de"
  toJSON (InvoicePaymentMethodOptionsBancontactPreferredLanguage'EnumEn) = "en"
  toJSON (InvoicePaymentMethodOptionsBancontactPreferredLanguage'EnumFr) = "fr"
  toJSON (InvoicePaymentMethodOptionsBancontactPreferredLanguage'EnumNl) = "nl"

instance Data.Aeson.Types.FromJSON.FromJSON InvoicePaymentMethodOptionsBancontactPreferredLanguage' where
  parseJSON val =
    GHC.Base.pure
      ( if
            | val GHC.Classes.== "de" -> InvoicePaymentMethodOptionsBancontactPreferredLanguage'EnumDe
            | val GHC.Classes.== "en" -> InvoicePaymentMethodOptionsBancontactPreferredLanguage'EnumEn
            | val GHC.Classes.== "fr" -> InvoicePaymentMethodOptionsBancontactPreferredLanguage'EnumFr
            | val GHC.Classes.== "nl" -> InvoicePaymentMethodOptionsBancontactPreferredLanguage'EnumNl
            | GHC.Base.otherwise -> InvoicePaymentMethodOptionsBancontactPreferredLanguage'Other val
      )

# LANGUAGE MultiWayIf #
# LANGUAGE OverloadedStrings #
 | Contains the types generated from the schema InvoicePaymentMethodOptionsBancontact
 | Defines the object schema located at @components.schemas.invoice_payment_method_options_bancontact@ in the specification.
 | Create a new 'InvoicePaymentMethodOptionsBancontact' with all required fields.
 | 'invoicePaymentMethodOptionsBancontactPreferredLanguage'
 | Defines the enum schema located at @components.schemas.invoice_payment_method_options_bancontact.properties.preferred_language@ in the specification.

 | This case is used if the value encountered during decoding does not match any of the provided cases in the specification.
 | This constructor can be used to send values to the server which are not present in the specification yet.
 | Represents the JSON value @"fr"@
  CHANGE WITH CAUTION : This is a generated code file generated by -OpenAPI-Code-Generator/Haskell-OpenAPI-Client-Code-Generator .

module StripeAPI.Types.InvoicePaymentMethodOptionsBancontact 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.Foldable
import qualified Data.Functor
import qualified Data.Maybe
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

data InvoicePaymentMethodOptionsBancontact = InvoicePaymentMethodOptionsBancontact
  | preferred_language : Preferred language of the  authorization page that the customer is redirected to .
    invoicePaymentMethodOptionsBancontactPreferredLanguage :: InvoicePaymentMethodOptionsBancontactPreferredLanguage'
  }
  deriving
    ( GHC.Show.Show,
      GHC.Classes.Eq
    )

instance Data.Aeson.Types.ToJSON.ToJSON InvoicePaymentMethodOptionsBancontact where
  toJSON obj = Data.Aeson.Types.Internal.object (Data.Foldable.concat (["preferred_language" Data.Aeson.Types.ToJSON..= invoicePaymentMethodOptionsBancontactPreferredLanguage obj] : GHC.Base.mempty))
  toEncoding obj = Data.Aeson.Encoding.Internal.pairs (GHC.Base.mconcat (Data.Foldable.concat (["preferred_language" Data.Aeson.Types.ToJSON..= invoicePaymentMethodOptionsBancontactPreferredLanguage obj] : GHC.Base.mempty)))

instance Data.Aeson.Types.FromJSON.FromJSON InvoicePaymentMethodOptionsBancontact where
  parseJSON = Data.Aeson.Types.FromJSON.withObject "InvoicePaymentMethodOptionsBancontact" (\obj -> GHC.Base.pure InvoicePaymentMethodOptionsBancontact GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..: "preferred_language"))

mkInvoicePaymentMethodOptionsBancontact ::
  InvoicePaymentMethodOptionsBancontactPreferredLanguage' ->
  InvoicePaymentMethodOptionsBancontact
mkInvoicePaymentMethodOptionsBancontact invoicePaymentMethodOptionsBancontactPreferredLanguage = InvoicePaymentMethodOptionsBancontact {invoicePaymentMethodOptionsBancontactPreferredLanguage = invoicePaymentMethodOptionsBancontactPreferredLanguage}

  Preferred language of the  authorization page that the customer is redirected to .
data InvoicePaymentMethodOptionsBancontactPreferredLanguage'
    InvoicePaymentMethodOptionsBancontactPreferredLanguage'Other Data.Aeson.Types.Internal.Value
    InvoicePaymentMethodOptionsBancontactPreferredLanguage'Typed Data.Text.Internal.Text
  | Represents the JSON value @"de"@
    InvoicePaymentMethodOptionsBancontactPreferredLanguage'EnumDe
  | Represents the JSON value @"en"@
    InvoicePaymentMethodOptionsBancontactPreferredLanguage'EnumEn
    InvoicePaymentMethodOptionsBancontactPreferredLanguage'EnumFr
  | Represents the JSON value @"nl"@
    InvoicePaymentMethodOptionsBancontactPreferredLanguage'EnumNl
  deriving (GHC.Show.Show, GHC.Classes.Eq)

instance Data.Aeson.Types.ToJSON.ToJSON InvoicePaymentMethodOptionsBancontactPreferredLanguage' where
  toJSON (InvoicePaymentMethodOptionsBancontactPreferredLanguage'Other val) = val
  toJSON (InvoicePaymentMethodOptionsBancontactPreferredLanguage'Typed val) = Data.Aeson.Types.ToJSON.toJSON val
  toJSON (InvoicePaymentMethodOptionsBancontactPreferredLanguage'EnumDe) = "de"
  toJSON (InvoicePaymentMethodOptionsBancontactPreferredLanguage'EnumEn) = "en"
  toJSON (InvoicePaymentMethodOptionsBancontactPreferredLanguage'EnumFr) = "fr"
  toJSON (InvoicePaymentMethodOptionsBancontactPreferredLanguage'EnumNl) = "nl"

instance Data.Aeson.Types.FromJSON.FromJSON InvoicePaymentMethodOptionsBancontactPreferredLanguage' where
  parseJSON val =
    GHC.Base.pure
      ( if
            | val GHC.Classes.== "de" -> InvoicePaymentMethodOptionsBancontactPreferredLanguage'EnumDe
            | val GHC.Classes.== "en" -> InvoicePaymentMethodOptionsBancontactPreferredLanguage'EnumEn
            | val GHC.Classes.== "fr" -> InvoicePaymentMethodOptionsBancontactPreferredLanguage'EnumFr
            | val GHC.Classes.== "nl" -> InvoicePaymentMethodOptionsBancontactPreferredLanguage'EnumNl
            | GHC.Base.otherwise -> InvoicePaymentMethodOptionsBancontactPreferredLanguage'Other val
      )
