{-# 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 SetupAttemptPaymentMethodDetailsBancontact module StripeAPI.Types.SetupAttemptPaymentMethodDetailsBancontact where import qualified Control.Monad.Fail import qualified Data.Aeson import qualified Data.Aeson as Data.Aeson.Encoding.Internal import qualified Data.Aeson as Data.Aeson.Types import qualified Data.Aeson as Data.Aeson.Types.FromJSON import qualified Data.Aeson as Data.Aeson.Types.Internal import qualified Data.Aeson as Data.Aeson.Types.ToJSON import qualified Data.ByteString.Char8 import qualified Data.ByteString.Char8 as Data.ByteString.Internal import qualified Data.Functor import qualified Data.Scientific import qualified Data.Text import qualified Data.Text.Internal import qualified Data.Time.Calendar as Data.Time.Calendar.Days import qualified Data.Time.LocalTime as Data.Time.LocalTime.Internal.ZonedTime import qualified GHC.Base import qualified GHC.Classes import qualified GHC.Int import qualified GHC.Show import qualified GHC.Types import qualified StripeAPI.Common import StripeAPI.TypeAlias import {-# SOURCE #-} StripeAPI.Types.Mandate import {-# SOURCE #-} StripeAPI.Types.PaymentMethod import qualified Prelude as GHC.Integer.Type import qualified Prelude as GHC.Maybe -- | Defines the object schema located at @components.schemas.setup_attempt_payment_method_details_bancontact@ in the specification. data SetupAttemptPaymentMethodDetailsBancontact = SetupAttemptPaymentMethodDetailsBancontact { -- | bank_code: Bank code of bank associated with the bank account. -- -- Constraints: -- -- * Maximum length of 5000 setupAttemptPaymentMethodDetailsBancontactBankCode :: (GHC.Maybe.Maybe Data.Text.Internal.Text), -- | bank_name: Name of the bank associated with the bank account. -- -- Constraints: -- -- * Maximum length of 5000 setupAttemptPaymentMethodDetailsBancontactBankName :: (GHC.Maybe.Maybe Data.Text.Internal.Text), -- | bic: Bank Identifier Code of the bank associated with the bank account. -- -- Constraints: -- -- * Maximum length of 5000 setupAttemptPaymentMethodDetailsBancontactBic :: (GHC.Maybe.Maybe Data.Text.Internal.Text), -- | generated_sepa_debit: The ID of the SEPA Direct Debit PaymentMethod which was generated by this SetupAttempt. setupAttemptPaymentMethodDetailsBancontactGeneratedSepaDebit :: (GHC.Maybe.Maybe SetupAttemptPaymentMethodDetailsBancontactGeneratedSepaDebit'Variants), -- | generated_sepa_debit_mandate: The mandate for the SEPA Direct Debit PaymentMethod which was generated by this SetupAttempt. setupAttemptPaymentMethodDetailsBancontactGeneratedSepaDebitMandate :: (GHC.Maybe.Maybe SetupAttemptPaymentMethodDetailsBancontactGeneratedSepaDebitMandate'Variants), -- | iban_last4: Last four characters of the IBAN. -- -- Constraints: -- -- * Maximum length of 5000 setupAttemptPaymentMethodDetailsBancontactIbanLast4 :: (GHC.Maybe.Maybe Data.Text.Internal.Text), -- | preferred_language: Preferred language of the Bancontact authorization page that the customer is redirected to. -- Can be one of \`en\`, \`de\`, \`fr\`, or \`nl\` setupAttemptPaymentMethodDetailsBancontactPreferredLanguage :: (GHC.Maybe.Maybe SetupAttemptPaymentMethodDetailsBancontactPreferredLanguage'), -- | verified_name: Owner\'s verified full name. Values are verified or provided by Bancontact directly -- (if supported) at the time of authorization or settlement. They cannot be set or mutated. -- -- Constraints: -- -- * Maximum length of 5000 setupAttemptPaymentMethodDetailsBancontactVerifiedName :: (GHC.Maybe.Maybe Data.Text.Internal.Text) } deriving ( GHC.Show.Show, GHC.Classes.Eq ) instance Data.Aeson.Types.ToJSON.ToJSON SetupAttemptPaymentMethodDetailsBancontact where toJSON obj = Data.Aeson.Types.Internal.object ("bank_code" Data.Aeson.Types.ToJSON..= setupAttemptPaymentMethodDetailsBancontactBankCode obj : "bank_name" Data.Aeson.Types.ToJSON..= setupAttemptPaymentMethodDetailsBancontactBankName obj : "bic" Data.Aeson.Types.ToJSON..= setupAttemptPaymentMethodDetailsBancontactBic obj : "generated_sepa_debit" Data.Aeson.Types.ToJSON..= setupAttemptPaymentMethodDetailsBancontactGeneratedSepaDebit obj : "generated_sepa_debit_mandate" Data.Aeson.Types.ToJSON..= setupAttemptPaymentMethodDetailsBancontactGeneratedSepaDebitMandate obj : "iban_last4" Data.Aeson.Types.ToJSON..= setupAttemptPaymentMethodDetailsBancontactIbanLast4 obj : "preferred_language" Data.Aeson.Types.ToJSON..= setupAttemptPaymentMethodDetailsBancontactPreferredLanguage obj : "verified_name" Data.Aeson.Types.ToJSON..= setupAttemptPaymentMethodDetailsBancontactVerifiedName obj : GHC.Base.mempty) toEncoding obj = Data.Aeson.Encoding.Internal.pairs (("bank_code" Data.Aeson.Types.ToJSON..= setupAttemptPaymentMethodDetailsBancontactBankCode obj) GHC.Base.<> (("bank_name" Data.Aeson.Types.ToJSON..= setupAttemptPaymentMethodDetailsBancontactBankName obj) GHC.Base.<> (("bic" Data.Aeson.Types.ToJSON..= setupAttemptPaymentMethodDetailsBancontactBic obj) GHC.Base.<> (("generated_sepa_debit" Data.Aeson.Types.ToJSON..= setupAttemptPaymentMethodDetailsBancontactGeneratedSepaDebit obj) GHC.Base.<> (("generated_sepa_debit_mandate" Data.Aeson.Types.ToJSON..= setupAttemptPaymentMethodDetailsBancontactGeneratedSepaDebitMandate obj) GHC.Base.<> (("iban_last4" Data.Aeson.Types.ToJSON..= setupAttemptPaymentMethodDetailsBancontactIbanLast4 obj) GHC.Base.<> (("preferred_language" Data.Aeson.Types.ToJSON..= setupAttemptPaymentMethodDetailsBancontactPreferredLanguage obj) GHC.Base.<> ("verified_name" Data.Aeson.Types.ToJSON..= setupAttemptPaymentMethodDetailsBancontactVerifiedName obj)))))))) instance Data.Aeson.Types.FromJSON.FromJSON SetupAttemptPaymentMethodDetailsBancontact where parseJSON = Data.Aeson.Types.FromJSON.withObject "SetupAttemptPaymentMethodDetailsBancontact" (\obj -> (((((((GHC.Base.pure SetupAttemptPaymentMethodDetailsBancontact GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "bank_code")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "bank_name")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "bic")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "generated_sepa_debit")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "generated_sepa_debit_mandate")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "iban_last4")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "preferred_language")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "verified_name")) -- | Create a new 'SetupAttemptPaymentMethodDetailsBancontact' with all required fields. mkSetupAttemptPaymentMethodDetailsBancontact :: SetupAttemptPaymentMethodDetailsBancontact mkSetupAttemptPaymentMethodDetailsBancontact = SetupAttemptPaymentMethodDetailsBancontact { setupAttemptPaymentMethodDetailsBancontactBankCode = GHC.Maybe.Nothing, setupAttemptPaymentMethodDetailsBancontactBankName = GHC.Maybe.Nothing, setupAttemptPaymentMethodDetailsBancontactBic = GHC.Maybe.Nothing, setupAttemptPaymentMethodDetailsBancontactGeneratedSepaDebit = GHC.Maybe.Nothing, setupAttemptPaymentMethodDetailsBancontactGeneratedSepaDebitMandate = GHC.Maybe.Nothing, setupAttemptPaymentMethodDetailsBancontactIbanLast4 = GHC.Maybe.Nothing, setupAttemptPaymentMethodDetailsBancontactPreferredLanguage = GHC.Maybe.Nothing, setupAttemptPaymentMethodDetailsBancontactVerifiedName = GHC.Maybe.Nothing } -- | Defines the oneOf schema located at @components.schemas.setup_attempt_payment_method_details_bancontact.properties.generated_sepa_debit.anyOf@ in the specification. -- -- The ID of the SEPA Direct Debit PaymentMethod which was generated by this SetupAttempt. data SetupAttemptPaymentMethodDetailsBancontactGeneratedSepaDebit'Variants = SetupAttemptPaymentMethodDetailsBancontactGeneratedSepaDebit'Text Data.Text.Internal.Text | SetupAttemptPaymentMethodDetailsBancontactGeneratedSepaDebit'PaymentMethod PaymentMethod deriving (GHC.Show.Show, GHC.Classes.Eq) instance Data.Aeson.Types.ToJSON.ToJSON SetupAttemptPaymentMethodDetailsBancontactGeneratedSepaDebit'Variants where toJSON (SetupAttemptPaymentMethodDetailsBancontactGeneratedSepaDebit'Text a) = Data.Aeson.Types.ToJSON.toJSON a toJSON (SetupAttemptPaymentMethodDetailsBancontactGeneratedSepaDebit'PaymentMethod a) = Data.Aeson.Types.ToJSON.toJSON a instance Data.Aeson.Types.FromJSON.FromJSON SetupAttemptPaymentMethodDetailsBancontactGeneratedSepaDebit'Variants where parseJSON val = case (SetupAttemptPaymentMethodDetailsBancontactGeneratedSepaDebit'Text Data.Functor.<$> Data.Aeson.Types.FromJSON.fromJSON val) GHC.Base.<|> ((SetupAttemptPaymentMethodDetailsBancontactGeneratedSepaDebit'PaymentMethod Data.Functor.<$> Data.Aeson.Types.FromJSON.fromJSON val) GHC.Base.<|> Data.Aeson.Types.Internal.Error "No variant matched") of Data.Aeson.Types.Internal.Success a -> GHC.Base.pure a Data.Aeson.Types.Internal.Error a -> Control.Monad.Fail.fail a -- | Defines the oneOf schema located at @components.schemas.setup_attempt_payment_method_details_bancontact.properties.generated_sepa_debit_mandate.anyOf@ in the specification. -- -- The mandate for the SEPA Direct Debit PaymentMethod which was generated by this SetupAttempt. data SetupAttemptPaymentMethodDetailsBancontactGeneratedSepaDebitMandate'Variants = SetupAttemptPaymentMethodDetailsBancontactGeneratedSepaDebitMandate'Text Data.Text.Internal.Text | SetupAttemptPaymentMethodDetailsBancontactGeneratedSepaDebitMandate'Mandate Mandate deriving (GHC.Show.Show, GHC.Classes.Eq) instance Data.Aeson.Types.ToJSON.ToJSON SetupAttemptPaymentMethodDetailsBancontactGeneratedSepaDebitMandate'Variants where toJSON (SetupAttemptPaymentMethodDetailsBancontactGeneratedSepaDebitMandate'Text a) = Data.Aeson.Types.ToJSON.toJSON a toJSON (SetupAttemptPaymentMethodDetailsBancontactGeneratedSepaDebitMandate'Mandate a) = Data.Aeson.Types.ToJSON.toJSON a instance Data.Aeson.Types.FromJSON.FromJSON SetupAttemptPaymentMethodDetailsBancontactGeneratedSepaDebitMandate'Variants where parseJSON val = case (SetupAttemptPaymentMethodDetailsBancontactGeneratedSepaDebitMandate'Text Data.Functor.<$> Data.Aeson.Types.FromJSON.fromJSON val) GHC.Base.<|> ((SetupAttemptPaymentMethodDetailsBancontactGeneratedSepaDebitMandate'Mandate Data.Functor.<$> Data.Aeson.Types.FromJSON.fromJSON val) GHC.Base.<|> Data.Aeson.Types.Internal.Error "No variant matched") of Data.Aeson.Types.Internal.Success a -> GHC.Base.pure a Data.Aeson.Types.Internal.Error a -> Control.Monad.Fail.fail a -- | Defines the enum schema located at @components.schemas.setup_attempt_payment_method_details_bancontact.properties.preferred_language@ in the specification. -- -- Preferred language of the Bancontact authorization page that the customer is redirected to. -- Can be one of \`en\`, \`de\`, \`fr\`, or \`nl\` data SetupAttemptPaymentMethodDetailsBancontactPreferredLanguage' = -- | This case is used if the value encountered during decoding does not match any of the provided cases in the specification. SetupAttemptPaymentMethodDetailsBancontactPreferredLanguage'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. SetupAttemptPaymentMethodDetailsBancontactPreferredLanguage'Typed Data.Text.Internal.Text | -- | Represents the JSON value @"de"@ SetupAttemptPaymentMethodDetailsBancontactPreferredLanguage'EnumDe | -- | Represents the JSON value @"en"@ SetupAttemptPaymentMethodDetailsBancontactPreferredLanguage'EnumEn | -- | Represents the JSON value @"fr"@ SetupAttemptPaymentMethodDetailsBancontactPreferredLanguage'EnumFr | -- | Represents the JSON value @"nl"@ SetupAttemptPaymentMethodDetailsBancontactPreferredLanguage'EnumNl deriving (GHC.Show.Show, GHC.Classes.Eq) instance Data.Aeson.Types.ToJSON.ToJSON SetupAttemptPaymentMethodDetailsBancontactPreferredLanguage' where toJSON (SetupAttemptPaymentMethodDetailsBancontactPreferredLanguage'Other val) = val toJSON (SetupAttemptPaymentMethodDetailsBancontactPreferredLanguage'Typed val) = Data.Aeson.Types.ToJSON.toJSON val toJSON (SetupAttemptPaymentMethodDetailsBancontactPreferredLanguage'EnumDe) = "de" toJSON (SetupAttemptPaymentMethodDetailsBancontactPreferredLanguage'EnumEn) = "en" toJSON (SetupAttemptPaymentMethodDetailsBancontactPreferredLanguage'EnumFr) = "fr" toJSON (SetupAttemptPaymentMethodDetailsBancontactPreferredLanguage'EnumNl) = "nl" instance Data.Aeson.Types.FromJSON.FromJSON SetupAttemptPaymentMethodDetailsBancontactPreferredLanguage' where parseJSON val = GHC.Base.pure ( if | val GHC.Classes.== "de" -> SetupAttemptPaymentMethodDetailsBancontactPreferredLanguage'EnumDe | val GHC.Classes.== "en" -> SetupAttemptPaymentMethodDetailsBancontactPreferredLanguage'EnumEn | val GHC.Classes.== "fr" -> SetupAttemptPaymentMethodDetailsBancontactPreferredLanguage'EnumFr | val GHC.Classes.== "nl" -> SetupAttemptPaymentMethodDetailsBancontactPreferredLanguage'EnumNl | GHC.Base.otherwise -> SetupAttemptPaymentMethodDetailsBancontactPreferredLanguage'Other val )