{-# 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 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 setupIntentPaymentMethodOptionsMandateOptionsAcssDebitIntervalDescription :: (GHC.Maybe.Maybe Data.Text.Internal.Text), -- | payment_schedule: Payment schedule for the mandate. setupIntentPaymentMethodOptionsMandateOptionsAcssDebitPaymentSchedule :: (GHC.Maybe.Maybe SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitPaymentSchedule'), -- | transaction_type: Transaction type of the mandate. setupIntentPaymentMethodOptionsMandateOptionsAcssDebitTransactionType :: (GHC.Maybe.Maybe SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitTransactionType') } deriving ( GHC.Show.Show, GHC.Classes.Eq ) instance Data.Aeson.Types.ToJSON.ToJSON SetupIntentPaymentMethodOptionsMandateOptionsAcssDebit where toJSON obj = Data.Aeson.Types.Internal.object ("custom_mandate_url" Data.Aeson.Types.ToJSON..= setupIntentPaymentMethodOptionsMandateOptionsAcssDebitCustomMandateUrl obj : "interval_description" Data.Aeson.Types.ToJSON..= setupIntentPaymentMethodOptionsMandateOptionsAcssDebitIntervalDescription obj : "payment_schedule" Data.Aeson.Types.ToJSON..= setupIntentPaymentMethodOptionsMandateOptionsAcssDebitPaymentSchedule obj : "transaction_type" Data.Aeson.Types.ToJSON..= setupIntentPaymentMethodOptionsMandateOptionsAcssDebitTransactionType obj : GHC.Base.mempty) toEncoding obj = Data.Aeson.Encoding.Internal.pairs (("custom_mandate_url" Data.Aeson.Types.ToJSON..= setupIntentPaymentMethodOptionsMandateOptionsAcssDebitCustomMandateUrl obj) GHC.Base.<> (("interval_description" Data.Aeson.Types.ToJSON..= setupIntentPaymentMethodOptionsMandateOptionsAcssDebitIntervalDescription obj) GHC.Base.<> (("payment_schedule" Data.Aeson.Types.ToJSON..= setupIntentPaymentMethodOptionsMandateOptionsAcssDebitPaymentSchedule obj) GHC.Base.<> ("transaction_type" Data.Aeson.Types.ToJSON..= setupIntentPaymentMethodOptionsMandateOptionsAcssDebitTransactionType obj)))) instance Data.Aeson.Types.FromJSON.FromJSON SetupIntentPaymentMethodOptionsMandateOptionsAcssDebit where parseJSON = Data.Aeson.Types.FromJSON.withObject "SetupIntentPaymentMethodOptionsMandateOptionsAcssDebit" (\obj -> (((GHC.Base.pure SetupIntentPaymentMethodOptionsMandateOptionsAcssDebit 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 'SetupIntentPaymentMethodOptionsMandateOptionsAcssDebit' with all required fields. mkSetupIntentPaymentMethodOptionsMandateOptionsAcssDebit :: SetupIntentPaymentMethodOptionsMandateOptionsAcssDebit mkSetupIntentPaymentMethodOptionsMandateOptionsAcssDebit = SetupIntentPaymentMethodOptionsMandateOptionsAcssDebit { setupIntentPaymentMethodOptionsMandateOptionsAcssDebitCustomMandateUrl = GHC.Maybe.Nothing, setupIntentPaymentMethodOptionsMandateOptionsAcssDebitIntervalDescription = GHC.Maybe.Nothing, setupIntentPaymentMethodOptionsMandateOptionsAcssDebitPaymentSchedule = GHC.Maybe.Nothing, setupIntentPaymentMethodOptionsMandateOptionsAcssDebitTransactionType = 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 (GHC.Show.Show, GHC.Classes.Eq) instance Data.Aeson.Types.ToJSON.ToJSON SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitPaymentSchedule' where toJSON (SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitPaymentSchedule'Other val) = val toJSON (SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitPaymentSchedule'Typed val) = Data.Aeson.Types.ToJSON.toJSON val toJSON (SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitPaymentSchedule'EnumCombined) = "combined" toJSON (SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitPaymentSchedule'EnumInterval) = "interval" toJSON (SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitPaymentSchedule'EnumSporadic) = "sporadic" instance Data.Aeson.Types.FromJSON.FromJSON SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitPaymentSchedule' where parseJSON val = GHC.Base.pure ( if | val GHC.Classes.== "combined" -> SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitPaymentSchedule'EnumCombined | val GHC.Classes.== "interval" -> SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitPaymentSchedule'EnumInterval | val GHC.Classes.== "sporadic" -> SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitPaymentSchedule'EnumSporadic | GHC.Base.otherwise -> SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitPaymentSchedule'Other 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 (GHC.Show.Show, GHC.Classes.Eq) instance Data.Aeson.Types.ToJSON.ToJSON SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitTransactionType' where toJSON (SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitTransactionType'Other val) = val toJSON (SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitTransactionType'Typed val) = Data.Aeson.Types.ToJSON.toJSON val toJSON (SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitTransactionType'EnumBusiness) = "business" toJSON (SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitTransactionType'EnumPersonal) = "personal" instance Data.Aeson.Types.FromJSON.FromJSON SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitTransactionType' where parseJSON val = GHC.Base.pure ( if | val GHC.Classes.== "business" -> SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitTransactionType'EnumBusiness | val GHC.Classes.== "personal" -> SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitTransactionType'EnumPersonal | GHC.Base.otherwise -> SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitTransactionType'Other val )