{-# 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 PaymentIntentPaymentMethodOptionsMandateOptionsAcssDebit module StripeAPI.Types.PaymentIntentPaymentMethodOptionsMandateOptionsAcssDebit 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.payment_intent_payment_method_options_mandate_options_acss_debit@ in the specification. data PaymentIntentPaymentMethodOptionsMandateOptionsAcssDebit = PaymentIntentPaymentMethodOptionsMandateOptionsAcssDebit { -- | custom_mandate_url: A URL for custom mandate text -- -- Constraints: -- -- * Maximum length of 5000 paymentIntentPaymentMethodOptionsMandateOptionsAcssDebitCustomMandateUrl :: (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 paymentIntentPaymentMethodOptionsMandateOptionsAcssDebitIntervalDescription :: (GHC.Maybe.Maybe Data.Text.Internal.Text), -- | payment_schedule: Payment schedule for the mandate. paymentIntentPaymentMethodOptionsMandateOptionsAcssDebitPaymentSchedule :: (GHC.Maybe.Maybe PaymentIntentPaymentMethodOptionsMandateOptionsAcssDebitPaymentSchedule'), -- | transaction_type: Transaction type of the mandate. paymentIntentPaymentMethodOptionsMandateOptionsAcssDebitTransactionType :: (GHC.Maybe.Maybe PaymentIntentPaymentMethodOptionsMandateOptionsAcssDebitTransactionType') } deriving ( GHC.Show.Show, GHC.Classes.Eq ) instance Data.Aeson.Types.ToJSON.ToJSON PaymentIntentPaymentMethodOptionsMandateOptionsAcssDebit where toJSON obj = Data.Aeson.Types.Internal.object ("custom_mandate_url" Data.Aeson.Types.ToJSON..= paymentIntentPaymentMethodOptionsMandateOptionsAcssDebitCustomMandateUrl obj : "interval_description" Data.Aeson.Types.ToJSON..= paymentIntentPaymentMethodOptionsMandateOptionsAcssDebitIntervalDescription obj : "payment_schedule" Data.Aeson.Types.ToJSON..= paymentIntentPaymentMethodOptionsMandateOptionsAcssDebitPaymentSchedule obj : "transaction_type" Data.Aeson.Types.ToJSON..= paymentIntentPaymentMethodOptionsMandateOptionsAcssDebitTransactionType obj : GHC.Base.mempty) toEncoding obj = Data.Aeson.Encoding.Internal.pairs (("custom_mandate_url" Data.Aeson.Types.ToJSON..= paymentIntentPaymentMethodOptionsMandateOptionsAcssDebitCustomMandateUrl obj) GHC.Base.<> (("interval_description" Data.Aeson.Types.ToJSON..= paymentIntentPaymentMethodOptionsMandateOptionsAcssDebitIntervalDescription obj) GHC.Base.<> (("payment_schedule" Data.Aeson.Types.ToJSON..= paymentIntentPaymentMethodOptionsMandateOptionsAcssDebitPaymentSchedule obj) GHC.Base.<> ("transaction_type" Data.Aeson.Types.ToJSON..= paymentIntentPaymentMethodOptionsMandateOptionsAcssDebitTransactionType obj)))) instance Data.Aeson.Types.FromJSON.FromJSON PaymentIntentPaymentMethodOptionsMandateOptionsAcssDebit where parseJSON = Data.Aeson.Types.FromJSON.withObject "PaymentIntentPaymentMethodOptionsMandateOptionsAcssDebit" (\obj -> (((GHC.Base.pure PaymentIntentPaymentMethodOptionsMandateOptionsAcssDebit GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "custom_mandate_url")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "interval_description")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "payment_schedule")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "transaction_type")) -- | Create a new 'PaymentIntentPaymentMethodOptionsMandateOptionsAcssDebit' with all required fields. mkPaymentIntentPaymentMethodOptionsMandateOptionsAcssDebit :: PaymentIntentPaymentMethodOptionsMandateOptionsAcssDebit mkPaymentIntentPaymentMethodOptionsMandateOptionsAcssDebit = PaymentIntentPaymentMethodOptionsMandateOptionsAcssDebit { paymentIntentPaymentMethodOptionsMandateOptionsAcssDebitCustomMandateUrl = GHC.Maybe.Nothing, paymentIntentPaymentMethodOptionsMandateOptionsAcssDebitIntervalDescription = GHC.Maybe.Nothing, paymentIntentPaymentMethodOptionsMandateOptionsAcssDebitPaymentSchedule = GHC.Maybe.Nothing, paymentIntentPaymentMethodOptionsMandateOptionsAcssDebitTransactionType = GHC.Maybe.Nothing } -- | Defines the enum schema located at @components.schemas.payment_intent_payment_method_options_mandate_options_acss_debit.properties.payment_schedule@ in the specification. -- -- Payment schedule for the mandate. data PaymentIntentPaymentMethodOptionsMandateOptionsAcssDebitPaymentSchedule' = -- | This case is used if the value encountered during decoding does not match any of the provided cases in the specification. PaymentIntentPaymentMethodOptionsMandateOptionsAcssDebitPaymentSchedule'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. PaymentIntentPaymentMethodOptionsMandateOptionsAcssDebitPaymentSchedule'Typed Data.Text.Internal.Text | -- | Represents the JSON value @"combined"@ PaymentIntentPaymentMethodOptionsMandateOptionsAcssDebitPaymentSchedule'EnumCombined | -- | Represents the JSON value @"interval"@ PaymentIntentPaymentMethodOptionsMandateOptionsAcssDebitPaymentSchedule'EnumInterval | -- | Represents the JSON value @"sporadic"@ PaymentIntentPaymentMethodOptionsMandateOptionsAcssDebitPaymentSchedule'EnumSporadic deriving (GHC.Show.Show, GHC.Classes.Eq) instance Data.Aeson.Types.ToJSON.ToJSON PaymentIntentPaymentMethodOptionsMandateOptionsAcssDebitPaymentSchedule' where toJSON (PaymentIntentPaymentMethodOptionsMandateOptionsAcssDebitPaymentSchedule'Other val) = val toJSON (PaymentIntentPaymentMethodOptionsMandateOptionsAcssDebitPaymentSchedule'Typed val) = Data.Aeson.Types.ToJSON.toJSON val toJSON (PaymentIntentPaymentMethodOptionsMandateOptionsAcssDebitPaymentSchedule'EnumCombined) = "combined" toJSON (PaymentIntentPaymentMethodOptionsMandateOptionsAcssDebitPaymentSchedule'EnumInterval) = "interval" toJSON (PaymentIntentPaymentMethodOptionsMandateOptionsAcssDebitPaymentSchedule'EnumSporadic) = "sporadic" instance Data.Aeson.Types.FromJSON.FromJSON PaymentIntentPaymentMethodOptionsMandateOptionsAcssDebitPaymentSchedule' where parseJSON val = GHC.Base.pure ( if | val GHC.Classes.== "combined" -> PaymentIntentPaymentMethodOptionsMandateOptionsAcssDebitPaymentSchedule'EnumCombined | val GHC.Classes.== "interval" -> PaymentIntentPaymentMethodOptionsMandateOptionsAcssDebitPaymentSchedule'EnumInterval | val GHC.Classes.== "sporadic" -> PaymentIntentPaymentMethodOptionsMandateOptionsAcssDebitPaymentSchedule'EnumSporadic | GHC.Base.otherwise -> PaymentIntentPaymentMethodOptionsMandateOptionsAcssDebitPaymentSchedule'Other val ) -- | Defines the enum schema located at @components.schemas.payment_intent_payment_method_options_mandate_options_acss_debit.properties.transaction_type@ in the specification. -- -- Transaction type of the mandate. data PaymentIntentPaymentMethodOptionsMandateOptionsAcssDebitTransactionType' = -- | This case is used if the value encountered during decoding does not match any of the provided cases in the specification. PaymentIntentPaymentMethodOptionsMandateOptionsAcssDebitTransactionType'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. PaymentIntentPaymentMethodOptionsMandateOptionsAcssDebitTransactionType'Typed Data.Text.Internal.Text | -- | Represents the JSON value @"business"@ PaymentIntentPaymentMethodOptionsMandateOptionsAcssDebitTransactionType'EnumBusiness | -- | Represents the JSON value @"personal"@ PaymentIntentPaymentMethodOptionsMandateOptionsAcssDebitTransactionType'EnumPersonal deriving (GHC.Show.Show, GHC.Classes.Eq) instance Data.Aeson.Types.ToJSON.ToJSON PaymentIntentPaymentMethodOptionsMandateOptionsAcssDebitTransactionType' where toJSON (PaymentIntentPaymentMethodOptionsMandateOptionsAcssDebitTransactionType'Other val) = val toJSON (PaymentIntentPaymentMethodOptionsMandateOptionsAcssDebitTransactionType'Typed val) = Data.Aeson.Types.ToJSON.toJSON val toJSON (PaymentIntentPaymentMethodOptionsMandateOptionsAcssDebitTransactionType'EnumBusiness) = "business" toJSON (PaymentIntentPaymentMethodOptionsMandateOptionsAcssDebitTransactionType'EnumPersonal) = "personal" instance Data.Aeson.Types.FromJSON.FromJSON PaymentIntentPaymentMethodOptionsMandateOptionsAcssDebitTransactionType' where parseJSON val = GHC.Base.pure ( if | val GHC.Classes.== "business" -> PaymentIntentPaymentMethodOptionsMandateOptionsAcssDebitTransactionType'EnumBusiness | val GHC.Classes.== "personal" -> PaymentIntentPaymentMethodOptionsMandateOptionsAcssDebitTransactionType'EnumPersonal | GHC.Base.otherwise -> PaymentIntentPaymentMethodOptionsMandateOptionsAcssDebitTransactionType'Other val )