{-# 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.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.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 the \'payment_schedule\' parameter is \'interval\' or \'combined\'. -- -- Constraints: -- -- * Maximum length of 5000 paymentIntentPaymentMethodOptionsMandateOptionsAcssDebitIntervalDescription :: (GHC.Maybe.Maybe (StripeAPI.Common.Nullable Data.Text.Internal.Text)), -- | payment_schedule: Payment schedule for the mandate. paymentIntentPaymentMethodOptionsMandateOptionsAcssDebitPaymentSchedule :: (GHC.Maybe.Maybe (StripeAPI.Common.Nullable PaymentIntentPaymentMethodOptionsMandateOptionsAcssDebitPaymentSchedule'NonNullable)), -- | transaction_type: Transaction type of the mandate. paymentIntentPaymentMethodOptionsMandateOptionsAcssDebitTransactionType :: (GHC.Maybe.Maybe (StripeAPI.Common.Nullable PaymentIntentPaymentMethodOptionsMandateOptionsAcssDebitTransactionType'NonNullable)) } deriving ( GHC.Show.Show, GHC.Classes.Eq ) instance Data.Aeson.Types.ToJSON.ToJSON PaymentIntentPaymentMethodOptionsMandateOptionsAcssDebit where toJSON obj = Data.Aeson.Types.Internal.object (Data.Foldable.concat (Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("custom_mandate_url" Data.Aeson.Types.ToJSON..=)) (paymentIntentPaymentMethodOptionsMandateOptionsAcssDebitCustomMandateUrl obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("interval_description" Data.Aeson.Types.ToJSON..=)) (paymentIntentPaymentMethodOptionsMandateOptionsAcssDebitIntervalDescription obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("payment_schedule" Data.Aeson.Types.ToJSON..=)) (paymentIntentPaymentMethodOptionsMandateOptionsAcssDebitPaymentSchedule obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("transaction_type" Data.Aeson.Types.ToJSON..=)) (paymentIntentPaymentMethodOptionsMandateOptionsAcssDebitTransactionType obj) : GHC.Base.mempty)) toEncoding obj = Data.Aeson.Encoding.Internal.pairs (GHC.Base.mconcat (Data.Foldable.concat (Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("custom_mandate_url" Data.Aeson.Types.ToJSON..=)) (paymentIntentPaymentMethodOptionsMandateOptionsAcssDebitCustomMandateUrl obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("interval_description" Data.Aeson.Types.ToJSON..=)) (paymentIntentPaymentMethodOptionsMandateOptionsAcssDebitIntervalDescription obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("payment_schedule" Data.Aeson.Types.ToJSON..=)) (paymentIntentPaymentMethodOptionsMandateOptionsAcssDebitPaymentSchedule obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("transaction_type" Data.Aeson.Types.ToJSON..=)) (paymentIntentPaymentMethodOptionsMandateOptionsAcssDebitTransactionType obj) : GHC.Base.mempty))) 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'NonNullable = -- | This case is used if the value encountered during decoding does not match any of the provided cases in the specification. PaymentIntentPaymentMethodOptionsMandateOptionsAcssDebitPaymentSchedule'NonNullableOther 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'NonNullableTyped Data.Text.Internal.Text | -- | Represents the JSON value @"combined"@ PaymentIntentPaymentMethodOptionsMandateOptionsAcssDebitPaymentSchedule'NonNullableEnumCombined | -- | Represents the JSON value @"interval"@ PaymentIntentPaymentMethodOptionsMandateOptionsAcssDebitPaymentSchedule'NonNullableEnumInterval | -- | Represents the JSON value @"sporadic"@ PaymentIntentPaymentMethodOptionsMandateOptionsAcssDebitPaymentSchedule'NonNullableEnumSporadic deriving (GHC.Show.Show, GHC.Classes.Eq) instance Data.Aeson.Types.ToJSON.ToJSON PaymentIntentPaymentMethodOptionsMandateOptionsAcssDebitPaymentSchedule'NonNullable where toJSON (PaymentIntentPaymentMethodOptionsMandateOptionsAcssDebitPaymentSchedule'NonNullableOther val) = val toJSON (PaymentIntentPaymentMethodOptionsMandateOptionsAcssDebitPaymentSchedule'NonNullableTyped val) = Data.Aeson.Types.ToJSON.toJSON val toJSON (PaymentIntentPaymentMethodOptionsMandateOptionsAcssDebitPaymentSchedule'NonNullableEnumCombined) = "combined" toJSON (PaymentIntentPaymentMethodOptionsMandateOptionsAcssDebitPaymentSchedule'NonNullableEnumInterval) = "interval" toJSON (PaymentIntentPaymentMethodOptionsMandateOptionsAcssDebitPaymentSchedule'NonNullableEnumSporadic) = "sporadic" instance Data.Aeson.Types.FromJSON.FromJSON PaymentIntentPaymentMethodOptionsMandateOptionsAcssDebitPaymentSchedule'NonNullable where parseJSON val = GHC.Base.pure ( if | val GHC.Classes.== "combined" -> PaymentIntentPaymentMethodOptionsMandateOptionsAcssDebitPaymentSchedule'NonNullableEnumCombined | val GHC.Classes.== "interval" -> PaymentIntentPaymentMethodOptionsMandateOptionsAcssDebitPaymentSchedule'NonNullableEnumInterval | val GHC.Classes.== "sporadic" -> PaymentIntentPaymentMethodOptionsMandateOptionsAcssDebitPaymentSchedule'NonNullableEnumSporadic | GHC.Base.otherwise -> PaymentIntentPaymentMethodOptionsMandateOptionsAcssDebitPaymentSchedule'NonNullableOther 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'NonNullable = -- | This case is used if the value encountered during decoding does not match any of the provided cases in the specification. PaymentIntentPaymentMethodOptionsMandateOptionsAcssDebitTransactionType'NonNullableOther 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'NonNullableTyped Data.Text.Internal.Text | -- | Represents the JSON value @"business"@ PaymentIntentPaymentMethodOptionsMandateOptionsAcssDebitTransactionType'NonNullableEnumBusiness | -- | Represents the JSON value @"personal"@ PaymentIntentPaymentMethodOptionsMandateOptionsAcssDebitTransactionType'NonNullableEnumPersonal deriving (GHC.Show.Show, GHC.Classes.Eq) instance Data.Aeson.Types.ToJSON.ToJSON PaymentIntentPaymentMethodOptionsMandateOptionsAcssDebitTransactionType'NonNullable where toJSON (PaymentIntentPaymentMethodOptionsMandateOptionsAcssDebitTransactionType'NonNullableOther val) = val toJSON (PaymentIntentPaymentMethodOptionsMandateOptionsAcssDebitTransactionType'NonNullableTyped val) = Data.Aeson.Types.ToJSON.toJSON val toJSON (PaymentIntentPaymentMethodOptionsMandateOptionsAcssDebitTransactionType'NonNullableEnumBusiness) = "business" toJSON (PaymentIntentPaymentMethodOptionsMandateOptionsAcssDebitTransactionType'NonNullableEnumPersonal) = "personal" instance Data.Aeson.Types.FromJSON.FromJSON PaymentIntentPaymentMethodOptionsMandateOptionsAcssDebitTransactionType'NonNullable where parseJSON val = GHC.Base.pure ( if | val GHC.Classes.== "business" -> PaymentIntentPaymentMethodOptionsMandateOptionsAcssDebitTransactionType'NonNullableEnumBusiness | val GHC.Classes.== "personal" -> PaymentIntentPaymentMethodOptionsMandateOptionsAcssDebitTransactionType'NonNullableEnumPersonal | GHC.Base.otherwise -> PaymentIntentPaymentMethodOptionsMandateOptionsAcssDebitTransactionType'NonNullableOther val )