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