{-# LANGUAGE ExplicitForAll #-} {-# 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 different functions to run the operation postSetupIntentsIntent module StripeAPI.Operations.PostSetupIntentsIntent where import qualified Control.Monad.Fail import qualified Control.Monad.Trans.Reader 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.Either 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 Data.Vector import qualified GHC.Base import qualified GHC.Classes import qualified GHC.Int import qualified GHC.Show import qualified GHC.Types import qualified Network.HTTP.Client import qualified Network.HTTP.Client as Network.HTTP.Client.Request import qualified Network.HTTP.Client as Network.HTTP.Client.Types import qualified Network.HTTP.Simple import qualified Network.HTTP.Types import qualified Network.HTTP.Types as Network.HTTP.Types.Status import qualified Network.HTTP.Types as Network.HTTP.Types.URI import qualified StripeAPI.Common import StripeAPI.Types import qualified Prelude as GHC.Integer.Type import qualified Prelude as GHC.Maybe -- | > POST /v1/setup_intents/{intent} -- -- \

Updates a SetupIntent object.\<\/p> postSetupIntentsIntent :: forall m. StripeAPI.Common.MonadHTTP m => -- | intent | Constraints: Maximum length of 5000 Data.Text.Internal.Text -> -- | The request body to send GHC.Maybe.Maybe PostSetupIntentsIntentRequestBody -> -- | Monadic computation which returns the result of the operation StripeAPI.Common.ClientT m (Network.HTTP.Client.Types.Response PostSetupIntentsIntentResponse) postSetupIntentsIntent intent body = GHC.Base.fmap ( \response_0 -> GHC.Base.fmap ( Data.Either.either PostSetupIntentsIntentResponseError GHC.Base.id GHC.Base.. ( \response body -> if | (\status_1 -> Network.HTTP.Types.Status.statusCode status_1 GHC.Classes.== 200) (Network.HTTP.Client.Types.responseStatus response) -> PostSetupIntentsIntentResponse200 Data.Functor.<$> ( Data.Aeson.eitherDecodeStrict body :: Data.Either.Either GHC.Base.String SetupIntent ) | GHC.Base.const GHC.Types.True (Network.HTTP.Client.Types.responseStatus response) -> PostSetupIntentsIntentResponseDefault Data.Functor.<$> ( Data.Aeson.eitherDecodeStrict body :: Data.Either.Either GHC.Base.String Error ) | GHC.Base.otherwise -> Data.Either.Left "Missing default response type" ) response_0 ) response_0 ) (StripeAPI.Common.doBodyCallWithConfigurationM (Data.Text.toUpper GHC.Base.$ Data.Text.pack "POST") (Data.Text.pack ("/v1/setup_intents/" GHC.Base.++ (Data.ByteString.Char8.unpack (Network.HTTP.Types.URI.urlEncode GHC.Types.True GHC.Base.$ (Data.ByteString.Char8.pack GHC.Base.$ StripeAPI.Common.stringifyModel intent)) GHC.Base.++ ""))) GHC.Base.mempty body StripeAPI.Common.RequestBodyEncodingFormData) -- | Defines the object schema located at @paths.\/v1\/setup_intents\/{intent}.POST.requestBody.content.application\/x-www-form-urlencoded.schema@ in the specification. data PostSetupIntentsIntentRequestBody = PostSetupIntentsIntentRequestBody { -- | customer: ID of the Customer this SetupIntent belongs to, if one exists. -- -- If present, the SetupIntent\'s payment method will be attached to the Customer on successful setup. Payment methods attached to other Customers cannot be used with this SetupIntent. -- -- Constraints: -- -- * Maximum length of 5000 postSetupIntentsIntentRequestBodyCustomer :: (GHC.Maybe.Maybe Data.Text.Internal.Text), -- | description: An arbitrary string attached to the object. Often useful for displaying to users. -- -- Constraints: -- -- * Maximum length of 1000 postSetupIntentsIntentRequestBodyDescription :: (GHC.Maybe.Maybe Data.Text.Internal.Text), -- | expand: Specifies which fields in the response should be expanded. postSetupIntentsIntentRequestBodyExpand :: (GHC.Maybe.Maybe ([Data.Text.Internal.Text])), -- | metadata: Set of [key-value pairs](https:\/\/stripe.com\/docs\/api\/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to \`metadata\`. postSetupIntentsIntentRequestBodyMetadata :: (GHC.Maybe.Maybe PostSetupIntentsIntentRequestBodyMetadata'Variants), -- | payment_method: ID of the payment method (a PaymentMethod, Card, or saved Source object) to attach to this SetupIntent. -- -- Constraints: -- -- * Maximum length of 5000 postSetupIntentsIntentRequestBodyPaymentMethod :: (GHC.Maybe.Maybe Data.Text.Internal.Text), -- | payment_method_options: Payment-method-specific configuration for this SetupIntent. postSetupIntentsIntentRequestBodyPaymentMethodOptions :: (GHC.Maybe.Maybe PostSetupIntentsIntentRequestBodyPaymentMethodOptions'), -- | payment_method_types: The list of payment method types (e.g. card) that this SetupIntent is allowed to set up. If this is not provided, defaults to [\"card\"]. postSetupIntentsIntentRequestBodyPaymentMethodTypes :: (GHC.Maybe.Maybe ([Data.Text.Internal.Text])) } deriving ( GHC.Show.Show, GHC.Classes.Eq ) instance Data.Aeson.Types.ToJSON.ToJSON PostSetupIntentsIntentRequestBody where toJSON obj = Data.Aeson.Types.Internal.object ("customer" Data.Aeson.Types.ToJSON..= postSetupIntentsIntentRequestBodyCustomer obj : "description" Data.Aeson.Types.ToJSON..= postSetupIntentsIntentRequestBodyDescription obj : "expand" Data.Aeson.Types.ToJSON..= postSetupIntentsIntentRequestBodyExpand obj : "metadata" Data.Aeson.Types.ToJSON..= postSetupIntentsIntentRequestBodyMetadata obj : "payment_method" Data.Aeson.Types.ToJSON..= postSetupIntentsIntentRequestBodyPaymentMethod obj : "payment_method_options" Data.Aeson.Types.ToJSON..= postSetupIntentsIntentRequestBodyPaymentMethodOptions obj : "payment_method_types" Data.Aeson.Types.ToJSON..= postSetupIntentsIntentRequestBodyPaymentMethodTypes obj : GHC.Base.mempty) toEncoding obj = Data.Aeson.Encoding.Internal.pairs (("customer" Data.Aeson.Types.ToJSON..= postSetupIntentsIntentRequestBodyCustomer obj) GHC.Base.<> (("description" Data.Aeson.Types.ToJSON..= postSetupIntentsIntentRequestBodyDescription obj) GHC.Base.<> (("expand" Data.Aeson.Types.ToJSON..= postSetupIntentsIntentRequestBodyExpand obj) GHC.Base.<> (("metadata" Data.Aeson.Types.ToJSON..= postSetupIntentsIntentRequestBodyMetadata obj) GHC.Base.<> (("payment_method" Data.Aeson.Types.ToJSON..= postSetupIntentsIntentRequestBodyPaymentMethod obj) GHC.Base.<> (("payment_method_options" Data.Aeson.Types.ToJSON..= postSetupIntentsIntentRequestBodyPaymentMethodOptions obj) GHC.Base.<> ("payment_method_types" Data.Aeson.Types.ToJSON..= postSetupIntentsIntentRequestBodyPaymentMethodTypes obj))))))) instance Data.Aeson.Types.FromJSON.FromJSON PostSetupIntentsIntentRequestBody where parseJSON = Data.Aeson.Types.FromJSON.withObject "PostSetupIntentsIntentRequestBody" (\obj -> ((((((GHC.Base.pure PostSetupIntentsIntentRequestBody GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "customer")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "description")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "expand")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "metadata")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "payment_method")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "payment_method_options")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "payment_method_types")) -- | Create a new 'PostSetupIntentsIntentRequestBody' with all required fields. mkPostSetupIntentsIntentRequestBody :: PostSetupIntentsIntentRequestBody mkPostSetupIntentsIntentRequestBody = PostSetupIntentsIntentRequestBody { postSetupIntentsIntentRequestBodyCustomer = GHC.Maybe.Nothing, postSetupIntentsIntentRequestBodyDescription = GHC.Maybe.Nothing, postSetupIntentsIntentRequestBodyExpand = GHC.Maybe.Nothing, postSetupIntentsIntentRequestBodyMetadata = GHC.Maybe.Nothing, postSetupIntentsIntentRequestBodyPaymentMethod = GHC.Maybe.Nothing, postSetupIntentsIntentRequestBodyPaymentMethodOptions = GHC.Maybe.Nothing, postSetupIntentsIntentRequestBodyPaymentMethodTypes = GHC.Maybe.Nothing } -- | Defines the oneOf schema located at @paths.\/v1\/setup_intents\/{intent}.POST.requestBody.content.application\/x-www-form-urlencoded.schema.properties.metadata.anyOf@ in the specification. -- -- Set of [key-value pairs](https:\/\/stripe.com\/docs\/api\/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to \`metadata\`. data PostSetupIntentsIntentRequestBodyMetadata'Variants = -- | Represents the JSON value @""@ PostSetupIntentsIntentRequestBodyMetadata'EmptyString | PostSetupIntentsIntentRequestBodyMetadata'Object Data.Aeson.Types.Internal.Object deriving (GHC.Show.Show, GHC.Classes.Eq) instance Data.Aeson.Types.ToJSON.ToJSON PostSetupIntentsIntentRequestBodyMetadata'Variants where toJSON (PostSetupIntentsIntentRequestBodyMetadata'Object a) = Data.Aeson.Types.ToJSON.toJSON a toJSON (PostSetupIntentsIntentRequestBodyMetadata'EmptyString) = "" instance Data.Aeson.Types.FromJSON.FromJSON PostSetupIntentsIntentRequestBodyMetadata'Variants where parseJSON val = if | val GHC.Classes.== "" -> GHC.Base.pure PostSetupIntentsIntentRequestBodyMetadata'EmptyString | GHC.Base.otherwise -> case (PostSetupIntentsIntentRequestBodyMetadata'Object 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 object schema located at @paths.\/v1\/setup_intents\/{intent}.POST.requestBody.content.application\/x-www-form-urlencoded.schema.properties.payment_method_options@ in the specification. -- -- Payment-method-specific configuration for this SetupIntent. data PostSetupIntentsIntentRequestBodyPaymentMethodOptions' = PostSetupIntentsIntentRequestBodyPaymentMethodOptions' { -- | acss_debit postSetupIntentsIntentRequestBodyPaymentMethodOptions'AcssDebit :: (GHC.Maybe.Maybe PostSetupIntentsIntentRequestBodyPaymentMethodOptions'AcssDebit'), -- | card postSetupIntentsIntentRequestBodyPaymentMethodOptions'Card :: (GHC.Maybe.Maybe PostSetupIntentsIntentRequestBodyPaymentMethodOptions'Card'), -- | sepa_debit postSetupIntentsIntentRequestBodyPaymentMethodOptions'SepaDebit :: (GHC.Maybe.Maybe PostSetupIntentsIntentRequestBodyPaymentMethodOptions'SepaDebit') } deriving ( GHC.Show.Show, GHC.Classes.Eq ) instance Data.Aeson.Types.ToJSON.ToJSON PostSetupIntentsIntentRequestBodyPaymentMethodOptions' where toJSON obj = Data.Aeson.Types.Internal.object ("acss_debit" Data.Aeson.Types.ToJSON..= postSetupIntentsIntentRequestBodyPaymentMethodOptions'AcssDebit obj : "card" Data.Aeson.Types.ToJSON..= postSetupIntentsIntentRequestBodyPaymentMethodOptions'Card obj : "sepa_debit" Data.Aeson.Types.ToJSON..= postSetupIntentsIntentRequestBodyPaymentMethodOptions'SepaDebit obj : GHC.Base.mempty) toEncoding obj = Data.Aeson.Encoding.Internal.pairs (("acss_debit" Data.Aeson.Types.ToJSON..= postSetupIntentsIntentRequestBodyPaymentMethodOptions'AcssDebit obj) GHC.Base.<> (("card" Data.Aeson.Types.ToJSON..= postSetupIntentsIntentRequestBodyPaymentMethodOptions'Card obj) GHC.Base.<> ("sepa_debit" Data.Aeson.Types.ToJSON..= postSetupIntentsIntentRequestBodyPaymentMethodOptions'SepaDebit obj))) instance Data.Aeson.Types.FromJSON.FromJSON PostSetupIntentsIntentRequestBodyPaymentMethodOptions' where parseJSON = Data.Aeson.Types.FromJSON.withObject "PostSetupIntentsIntentRequestBodyPaymentMethodOptions'" (\obj -> ((GHC.Base.pure PostSetupIntentsIntentRequestBodyPaymentMethodOptions' GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "acss_debit")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "card")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "sepa_debit")) -- | Create a new 'PostSetupIntentsIntentRequestBodyPaymentMethodOptions'' with all required fields. mkPostSetupIntentsIntentRequestBodyPaymentMethodOptions' :: PostSetupIntentsIntentRequestBodyPaymentMethodOptions' mkPostSetupIntentsIntentRequestBodyPaymentMethodOptions' = PostSetupIntentsIntentRequestBodyPaymentMethodOptions' { postSetupIntentsIntentRequestBodyPaymentMethodOptions'AcssDebit = GHC.Maybe.Nothing, postSetupIntentsIntentRequestBodyPaymentMethodOptions'Card = GHC.Maybe.Nothing, postSetupIntentsIntentRequestBodyPaymentMethodOptions'SepaDebit = GHC.Maybe.Nothing } -- | Defines the object schema located at @paths.\/v1\/setup_intents\/{intent}.POST.requestBody.content.application\/x-www-form-urlencoded.schema.properties.payment_method_options.properties.acss_debit@ in the specification. data PostSetupIntentsIntentRequestBodyPaymentMethodOptions'AcssDebit' = PostSetupIntentsIntentRequestBodyPaymentMethodOptions'AcssDebit' { -- | currency postSetupIntentsIntentRequestBodyPaymentMethodOptions'AcssDebit'Currency :: (GHC.Maybe.Maybe PostSetupIntentsIntentRequestBodyPaymentMethodOptions'AcssDebit'Currency'), -- | mandate_options postSetupIntentsIntentRequestBodyPaymentMethodOptions'AcssDebit'MandateOptions :: (GHC.Maybe.Maybe PostSetupIntentsIntentRequestBodyPaymentMethodOptions'AcssDebit'MandateOptions'), -- | verification_method postSetupIntentsIntentRequestBodyPaymentMethodOptions'AcssDebit'VerificationMethod :: (GHC.Maybe.Maybe PostSetupIntentsIntentRequestBodyPaymentMethodOptions'AcssDebit'VerificationMethod') } deriving ( GHC.Show.Show, GHC.Classes.Eq ) instance Data.Aeson.Types.ToJSON.ToJSON PostSetupIntentsIntentRequestBodyPaymentMethodOptions'AcssDebit' where toJSON obj = Data.Aeson.Types.Internal.object ("currency" Data.Aeson.Types.ToJSON..= postSetupIntentsIntentRequestBodyPaymentMethodOptions'AcssDebit'Currency obj : "mandate_options" Data.Aeson.Types.ToJSON..= postSetupIntentsIntentRequestBodyPaymentMethodOptions'AcssDebit'MandateOptions obj : "verification_method" Data.Aeson.Types.ToJSON..= postSetupIntentsIntentRequestBodyPaymentMethodOptions'AcssDebit'VerificationMethod obj : GHC.Base.mempty) toEncoding obj = Data.Aeson.Encoding.Internal.pairs (("currency" Data.Aeson.Types.ToJSON..= postSetupIntentsIntentRequestBodyPaymentMethodOptions'AcssDebit'Currency obj) GHC.Base.<> (("mandate_options" Data.Aeson.Types.ToJSON..= postSetupIntentsIntentRequestBodyPaymentMethodOptions'AcssDebit'MandateOptions obj) GHC.Base.<> ("verification_method" Data.Aeson.Types.ToJSON..= postSetupIntentsIntentRequestBodyPaymentMethodOptions'AcssDebit'VerificationMethod obj))) instance Data.Aeson.Types.FromJSON.FromJSON PostSetupIntentsIntentRequestBodyPaymentMethodOptions'AcssDebit' where parseJSON = Data.Aeson.Types.FromJSON.withObject "PostSetupIntentsIntentRequestBodyPaymentMethodOptions'AcssDebit'" (\obj -> ((GHC.Base.pure PostSetupIntentsIntentRequestBodyPaymentMethodOptions'AcssDebit' GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "currency")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "mandate_options")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "verification_method")) -- | Create a new 'PostSetupIntentsIntentRequestBodyPaymentMethodOptions'AcssDebit'' with all required fields. mkPostSetupIntentsIntentRequestBodyPaymentMethodOptions'AcssDebit' :: PostSetupIntentsIntentRequestBodyPaymentMethodOptions'AcssDebit' mkPostSetupIntentsIntentRequestBodyPaymentMethodOptions'AcssDebit' = PostSetupIntentsIntentRequestBodyPaymentMethodOptions'AcssDebit' { postSetupIntentsIntentRequestBodyPaymentMethodOptions'AcssDebit'Currency = GHC.Maybe.Nothing, postSetupIntentsIntentRequestBodyPaymentMethodOptions'AcssDebit'MandateOptions = GHC.Maybe.Nothing, postSetupIntentsIntentRequestBodyPaymentMethodOptions'AcssDebit'VerificationMethod = GHC.Maybe.Nothing } -- | Defines the enum schema located at @paths.\/v1\/setup_intents\/{intent}.POST.requestBody.content.application\/x-www-form-urlencoded.schema.properties.payment_method_options.properties.acss_debit.properties.currency@ in the specification. data PostSetupIntentsIntentRequestBodyPaymentMethodOptions'AcssDebit'Currency' = -- | This case is used if the value encountered during decoding does not match any of the provided cases in the specification. PostSetupIntentsIntentRequestBodyPaymentMethodOptions'AcssDebit'Currency'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. PostSetupIntentsIntentRequestBodyPaymentMethodOptions'AcssDebit'Currency'Typed Data.Text.Internal.Text | -- | Represents the JSON value @"cad"@ PostSetupIntentsIntentRequestBodyPaymentMethodOptions'AcssDebit'Currency'EnumCad | -- | Represents the JSON value @"usd"@ PostSetupIntentsIntentRequestBodyPaymentMethodOptions'AcssDebit'Currency'EnumUsd deriving (GHC.Show.Show, GHC.Classes.Eq) instance Data.Aeson.Types.ToJSON.ToJSON PostSetupIntentsIntentRequestBodyPaymentMethodOptions'AcssDebit'Currency' where toJSON (PostSetupIntentsIntentRequestBodyPaymentMethodOptions'AcssDebit'Currency'Other val) = val toJSON (PostSetupIntentsIntentRequestBodyPaymentMethodOptions'AcssDebit'Currency'Typed val) = Data.Aeson.Types.ToJSON.toJSON val toJSON (PostSetupIntentsIntentRequestBodyPaymentMethodOptions'AcssDebit'Currency'EnumCad) = "cad" toJSON (PostSetupIntentsIntentRequestBodyPaymentMethodOptions'AcssDebit'Currency'EnumUsd) = "usd" instance Data.Aeson.Types.FromJSON.FromJSON PostSetupIntentsIntentRequestBodyPaymentMethodOptions'AcssDebit'Currency' where parseJSON val = GHC.Base.pure ( if | val GHC.Classes.== "cad" -> PostSetupIntentsIntentRequestBodyPaymentMethodOptions'AcssDebit'Currency'EnumCad | val GHC.Classes.== "usd" -> PostSetupIntentsIntentRequestBodyPaymentMethodOptions'AcssDebit'Currency'EnumUsd | GHC.Base.otherwise -> PostSetupIntentsIntentRequestBodyPaymentMethodOptions'AcssDebit'Currency'Other val ) -- | Defines the object schema located at @paths.\/v1\/setup_intents\/{intent}.POST.requestBody.content.application\/x-www-form-urlencoded.schema.properties.payment_method_options.properties.acss_debit.properties.mandate_options@ in the specification. data PostSetupIntentsIntentRequestBodyPaymentMethodOptions'AcssDebit'MandateOptions' = PostSetupIntentsIntentRequestBodyPaymentMethodOptions'AcssDebit'MandateOptions' { -- | custom_mandate_url postSetupIntentsIntentRequestBodyPaymentMethodOptions'AcssDebit'MandateOptions'CustomMandateUrl :: (GHC.Maybe.Maybe PostSetupIntentsIntentRequestBodyPaymentMethodOptions'AcssDebit'MandateOptions'CustomMandateUrl'Variants), -- | interval_description -- -- Constraints: -- -- * Maximum length of 500 postSetupIntentsIntentRequestBodyPaymentMethodOptions'AcssDebit'MandateOptions'IntervalDescription :: (GHC.Maybe.Maybe Data.Text.Internal.Text), -- | payment_schedule postSetupIntentsIntentRequestBodyPaymentMethodOptions'AcssDebit'MandateOptions'PaymentSchedule :: (GHC.Maybe.Maybe PostSetupIntentsIntentRequestBodyPaymentMethodOptions'AcssDebit'MandateOptions'PaymentSchedule'), -- | transaction_type postSetupIntentsIntentRequestBodyPaymentMethodOptions'AcssDebit'MandateOptions'TransactionType :: (GHC.Maybe.Maybe PostSetupIntentsIntentRequestBodyPaymentMethodOptions'AcssDebit'MandateOptions'TransactionType') } deriving ( GHC.Show.Show, GHC.Classes.Eq ) instance Data.Aeson.Types.ToJSON.ToJSON PostSetupIntentsIntentRequestBodyPaymentMethodOptions'AcssDebit'MandateOptions' where toJSON obj = Data.Aeson.Types.Internal.object ("custom_mandate_url" Data.Aeson.Types.ToJSON..= postSetupIntentsIntentRequestBodyPaymentMethodOptions'AcssDebit'MandateOptions'CustomMandateUrl obj : "interval_description" Data.Aeson.Types.ToJSON..= postSetupIntentsIntentRequestBodyPaymentMethodOptions'AcssDebit'MandateOptions'IntervalDescription obj : "payment_schedule" Data.Aeson.Types.ToJSON..= postSetupIntentsIntentRequestBodyPaymentMethodOptions'AcssDebit'MandateOptions'PaymentSchedule obj : "transaction_type" Data.Aeson.Types.ToJSON..= postSetupIntentsIntentRequestBodyPaymentMethodOptions'AcssDebit'MandateOptions'TransactionType obj : GHC.Base.mempty) toEncoding obj = Data.Aeson.Encoding.Internal.pairs (("custom_mandate_url" Data.Aeson.Types.ToJSON..= postSetupIntentsIntentRequestBodyPaymentMethodOptions'AcssDebit'MandateOptions'CustomMandateUrl obj) GHC.Base.<> (("interval_description" Data.Aeson.Types.ToJSON..= postSetupIntentsIntentRequestBodyPaymentMethodOptions'AcssDebit'MandateOptions'IntervalDescription obj) GHC.Base.<> (("payment_schedule" Data.Aeson.Types.ToJSON..= postSetupIntentsIntentRequestBodyPaymentMethodOptions'AcssDebit'MandateOptions'PaymentSchedule obj) GHC.Base.<> ("transaction_type" Data.Aeson.Types.ToJSON..= postSetupIntentsIntentRequestBodyPaymentMethodOptions'AcssDebit'MandateOptions'TransactionType obj)))) instance Data.Aeson.Types.FromJSON.FromJSON PostSetupIntentsIntentRequestBodyPaymentMethodOptions'AcssDebit'MandateOptions' where parseJSON = Data.Aeson.Types.FromJSON.withObject "PostSetupIntentsIntentRequestBodyPaymentMethodOptions'AcssDebit'MandateOptions'" (\obj -> (((GHC.Base.pure PostSetupIntentsIntentRequestBodyPaymentMethodOptions'AcssDebit'MandateOptions' 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 'PostSetupIntentsIntentRequestBodyPaymentMethodOptions'AcssDebit'MandateOptions'' with all required fields. mkPostSetupIntentsIntentRequestBodyPaymentMethodOptions'AcssDebit'MandateOptions' :: PostSetupIntentsIntentRequestBodyPaymentMethodOptions'AcssDebit'MandateOptions' mkPostSetupIntentsIntentRequestBodyPaymentMethodOptions'AcssDebit'MandateOptions' = PostSetupIntentsIntentRequestBodyPaymentMethodOptions'AcssDebit'MandateOptions' { postSetupIntentsIntentRequestBodyPaymentMethodOptions'AcssDebit'MandateOptions'CustomMandateUrl = GHC.Maybe.Nothing, postSetupIntentsIntentRequestBodyPaymentMethodOptions'AcssDebit'MandateOptions'IntervalDescription = GHC.Maybe.Nothing, postSetupIntentsIntentRequestBodyPaymentMethodOptions'AcssDebit'MandateOptions'PaymentSchedule = GHC.Maybe.Nothing, postSetupIntentsIntentRequestBodyPaymentMethodOptions'AcssDebit'MandateOptions'TransactionType = GHC.Maybe.Nothing } -- | Defines the oneOf schema located at @paths.\/v1\/setup_intents\/{intent}.POST.requestBody.content.application\/x-www-form-urlencoded.schema.properties.payment_method_options.properties.acss_debit.properties.mandate_options.properties.custom_mandate_url.anyOf@ in the specification. data PostSetupIntentsIntentRequestBodyPaymentMethodOptions'AcssDebit'MandateOptions'CustomMandateUrl'Variants = -- | Represents the JSON value @""@ PostSetupIntentsIntentRequestBodyPaymentMethodOptions'AcssDebit'MandateOptions'CustomMandateUrl'EmptyString | PostSetupIntentsIntentRequestBodyPaymentMethodOptions'AcssDebit'MandateOptions'CustomMandateUrl'Text Data.Text.Internal.Text deriving (GHC.Show.Show, GHC.Classes.Eq) instance Data.Aeson.Types.ToJSON.ToJSON PostSetupIntentsIntentRequestBodyPaymentMethodOptions'AcssDebit'MandateOptions'CustomMandateUrl'Variants where toJSON (PostSetupIntentsIntentRequestBodyPaymentMethodOptions'AcssDebit'MandateOptions'CustomMandateUrl'Text a) = Data.Aeson.Types.ToJSON.toJSON a toJSON (PostSetupIntentsIntentRequestBodyPaymentMethodOptions'AcssDebit'MandateOptions'CustomMandateUrl'EmptyString) = "" instance Data.Aeson.Types.FromJSON.FromJSON PostSetupIntentsIntentRequestBodyPaymentMethodOptions'AcssDebit'MandateOptions'CustomMandateUrl'Variants where parseJSON val = if | val GHC.Classes.== "" -> GHC.Base.pure PostSetupIntentsIntentRequestBodyPaymentMethodOptions'AcssDebit'MandateOptions'CustomMandateUrl'EmptyString | GHC.Base.otherwise -> case (PostSetupIntentsIntentRequestBodyPaymentMethodOptions'AcssDebit'MandateOptions'CustomMandateUrl'Text 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 @paths.\/v1\/setup_intents\/{intent}.POST.requestBody.content.application\/x-www-form-urlencoded.schema.properties.payment_method_options.properties.acss_debit.properties.mandate_options.properties.payment_schedule@ in the specification. data PostSetupIntentsIntentRequestBodyPaymentMethodOptions'AcssDebit'MandateOptions'PaymentSchedule' = -- | This case is used if the value encountered during decoding does not match any of the provided cases in the specification. PostSetupIntentsIntentRequestBodyPaymentMethodOptions'AcssDebit'MandateOptions'PaymentSchedule'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. PostSetupIntentsIntentRequestBodyPaymentMethodOptions'AcssDebit'MandateOptions'PaymentSchedule'Typed Data.Text.Internal.Text | -- | Represents the JSON value @"combined"@ PostSetupIntentsIntentRequestBodyPaymentMethodOptions'AcssDebit'MandateOptions'PaymentSchedule'EnumCombined | -- | Represents the JSON value @"interval"@ PostSetupIntentsIntentRequestBodyPaymentMethodOptions'AcssDebit'MandateOptions'PaymentSchedule'EnumInterval | -- | Represents the JSON value @"sporadic"@ PostSetupIntentsIntentRequestBodyPaymentMethodOptions'AcssDebit'MandateOptions'PaymentSchedule'EnumSporadic deriving (GHC.Show.Show, GHC.Classes.Eq) instance Data.Aeson.Types.ToJSON.ToJSON PostSetupIntentsIntentRequestBodyPaymentMethodOptions'AcssDebit'MandateOptions'PaymentSchedule' where toJSON (PostSetupIntentsIntentRequestBodyPaymentMethodOptions'AcssDebit'MandateOptions'PaymentSchedule'Other val) = val toJSON (PostSetupIntentsIntentRequestBodyPaymentMethodOptions'AcssDebit'MandateOptions'PaymentSchedule'Typed val) = Data.Aeson.Types.ToJSON.toJSON val toJSON (PostSetupIntentsIntentRequestBodyPaymentMethodOptions'AcssDebit'MandateOptions'PaymentSchedule'EnumCombined) = "combined" toJSON (PostSetupIntentsIntentRequestBodyPaymentMethodOptions'AcssDebit'MandateOptions'PaymentSchedule'EnumInterval) = "interval" toJSON (PostSetupIntentsIntentRequestBodyPaymentMethodOptions'AcssDebit'MandateOptions'PaymentSchedule'EnumSporadic) = "sporadic" instance Data.Aeson.Types.FromJSON.FromJSON PostSetupIntentsIntentRequestBodyPaymentMethodOptions'AcssDebit'MandateOptions'PaymentSchedule' where parseJSON val = GHC.Base.pure ( if | val GHC.Classes.== "combined" -> PostSetupIntentsIntentRequestBodyPaymentMethodOptions'AcssDebit'MandateOptions'PaymentSchedule'EnumCombined | val GHC.Classes.== "interval" -> PostSetupIntentsIntentRequestBodyPaymentMethodOptions'AcssDebit'MandateOptions'PaymentSchedule'EnumInterval | val GHC.Classes.== "sporadic" -> PostSetupIntentsIntentRequestBodyPaymentMethodOptions'AcssDebit'MandateOptions'PaymentSchedule'EnumSporadic | GHC.Base.otherwise -> PostSetupIntentsIntentRequestBodyPaymentMethodOptions'AcssDebit'MandateOptions'PaymentSchedule'Other val ) -- | Defines the enum schema located at @paths.\/v1\/setup_intents\/{intent}.POST.requestBody.content.application\/x-www-form-urlencoded.schema.properties.payment_method_options.properties.acss_debit.properties.mandate_options.properties.transaction_type@ in the specification. data PostSetupIntentsIntentRequestBodyPaymentMethodOptions'AcssDebit'MandateOptions'TransactionType' = -- | This case is used if the value encountered during decoding does not match any of the provided cases in the specification. PostSetupIntentsIntentRequestBodyPaymentMethodOptions'AcssDebit'MandateOptions'TransactionType'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. PostSetupIntentsIntentRequestBodyPaymentMethodOptions'AcssDebit'MandateOptions'TransactionType'Typed Data.Text.Internal.Text | -- | Represents the JSON value @"business"@ PostSetupIntentsIntentRequestBodyPaymentMethodOptions'AcssDebit'MandateOptions'TransactionType'EnumBusiness | -- | Represents the JSON value @"personal"@ PostSetupIntentsIntentRequestBodyPaymentMethodOptions'AcssDebit'MandateOptions'TransactionType'EnumPersonal deriving (GHC.Show.Show, GHC.Classes.Eq) instance Data.Aeson.Types.ToJSON.ToJSON PostSetupIntentsIntentRequestBodyPaymentMethodOptions'AcssDebit'MandateOptions'TransactionType' where toJSON (PostSetupIntentsIntentRequestBodyPaymentMethodOptions'AcssDebit'MandateOptions'TransactionType'Other val) = val toJSON (PostSetupIntentsIntentRequestBodyPaymentMethodOptions'AcssDebit'MandateOptions'TransactionType'Typed val) = Data.Aeson.Types.ToJSON.toJSON val toJSON (PostSetupIntentsIntentRequestBodyPaymentMethodOptions'AcssDebit'MandateOptions'TransactionType'EnumBusiness) = "business" toJSON (PostSetupIntentsIntentRequestBodyPaymentMethodOptions'AcssDebit'MandateOptions'TransactionType'EnumPersonal) = "personal" instance Data.Aeson.Types.FromJSON.FromJSON PostSetupIntentsIntentRequestBodyPaymentMethodOptions'AcssDebit'MandateOptions'TransactionType' where parseJSON val = GHC.Base.pure ( if | val GHC.Classes.== "business" -> PostSetupIntentsIntentRequestBodyPaymentMethodOptions'AcssDebit'MandateOptions'TransactionType'EnumBusiness | val GHC.Classes.== "personal" -> PostSetupIntentsIntentRequestBodyPaymentMethodOptions'AcssDebit'MandateOptions'TransactionType'EnumPersonal | GHC.Base.otherwise -> PostSetupIntentsIntentRequestBodyPaymentMethodOptions'AcssDebit'MandateOptions'TransactionType'Other val ) -- | Defines the enum schema located at @paths.\/v1\/setup_intents\/{intent}.POST.requestBody.content.application\/x-www-form-urlencoded.schema.properties.payment_method_options.properties.acss_debit.properties.verification_method@ in the specification. data PostSetupIntentsIntentRequestBodyPaymentMethodOptions'AcssDebit'VerificationMethod' = -- | This case is used if the value encountered during decoding does not match any of the provided cases in the specification. PostSetupIntentsIntentRequestBodyPaymentMethodOptions'AcssDebit'VerificationMethod'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. PostSetupIntentsIntentRequestBodyPaymentMethodOptions'AcssDebit'VerificationMethod'Typed Data.Text.Internal.Text | -- | Represents the JSON value @"automatic"@ PostSetupIntentsIntentRequestBodyPaymentMethodOptions'AcssDebit'VerificationMethod'EnumAutomatic | -- | Represents the JSON value @"instant"@ PostSetupIntentsIntentRequestBodyPaymentMethodOptions'AcssDebit'VerificationMethod'EnumInstant | -- | Represents the JSON value @"microdeposits"@ PostSetupIntentsIntentRequestBodyPaymentMethodOptions'AcssDebit'VerificationMethod'EnumMicrodeposits deriving (GHC.Show.Show, GHC.Classes.Eq) instance Data.Aeson.Types.ToJSON.ToJSON PostSetupIntentsIntentRequestBodyPaymentMethodOptions'AcssDebit'VerificationMethod' where toJSON (PostSetupIntentsIntentRequestBodyPaymentMethodOptions'AcssDebit'VerificationMethod'Other val) = val toJSON (PostSetupIntentsIntentRequestBodyPaymentMethodOptions'AcssDebit'VerificationMethod'Typed val) = Data.Aeson.Types.ToJSON.toJSON val toJSON (PostSetupIntentsIntentRequestBodyPaymentMethodOptions'AcssDebit'VerificationMethod'EnumAutomatic) = "automatic" toJSON (PostSetupIntentsIntentRequestBodyPaymentMethodOptions'AcssDebit'VerificationMethod'EnumInstant) = "instant" toJSON (PostSetupIntentsIntentRequestBodyPaymentMethodOptions'AcssDebit'VerificationMethod'EnumMicrodeposits) = "microdeposits" instance Data.Aeson.Types.FromJSON.FromJSON PostSetupIntentsIntentRequestBodyPaymentMethodOptions'AcssDebit'VerificationMethod' where parseJSON val = GHC.Base.pure ( if | val GHC.Classes.== "automatic" -> PostSetupIntentsIntentRequestBodyPaymentMethodOptions'AcssDebit'VerificationMethod'EnumAutomatic | val GHC.Classes.== "instant" -> PostSetupIntentsIntentRequestBodyPaymentMethodOptions'AcssDebit'VerificationMethod'EnumInstant | val GHC.Classes.== "microdeposits" -> PostSetupIntentsIntentRequestBodyPaymentMethodOptions'AcssDebit'VerificationMethod'EnumMicrodeposits | GHC.Base.otherwise -> PostSetupIntentsIntentRequestBodyPaymentMethodOptions'AcssDebit'VerificationMethod'Other val ) -- | Defines the object schema located at @paths.\/v1\/setup_intents\/{intent}.POST.requestBody.content.application\/x-www-form-urlencoded.schema.properties.payment_method_options.properties.card@ in the specification. data PostSetupIntentsIntentRequestBodyPaymentMethodOptions'Card' = PostSetupIntentsIntentRequestBodyPaymentMethodOptions'Card' { -- | request_three_d_secure -- -- Constraints: -- -- * Maximum length of 5000 postSetupIntentsIntentRequestBodyPaymentMethodOptions'Card'RequestThreeDSecure :: (GHC.Maybe.Maybe PostSetupIntentsIntentRequestBodyPaymentMethodOptions'Card'RequestThreeDSecure') } deriving ( GHC.Show.Show, GHC.Classes.Eq ) instance Data.Aeson.Types.ToJSON.ToJSON PostSetupIntentsIntentRequestBodyPaymentMethodOptions'Card' where toJSON obj = Data.Aeson.Types.Internal.object ("request_three_d_secure" Data.Aeson.Types.ToJSON..= postSetupIntentsIntentRequestBodyPaymentMethodOptions'Card'RequestThreeDSecure obj : GHC.Base.mempty) toEncoding obj = Data.Aeson.Encoding.Internal.pairs ("request_three_d_secure" Data.Aeson.Types.ToJSON..= postSetupIntentsIntentRequestBodyPaymentMethodOptions'Card'RequestThreeDSecure obj) instance Data.Aeson.Types.FromJSON.FromJSON PostSetupIntentsIntentRequestBodyPaymentMethodOptions'Card' where parseJSON = Data.Aeson.Types.FromJSON.withObject "PostSetupIntentsIntentRequestBodyPaymentMethodOptions'Card'" (\obj -> GHC.Base.pure PostSetupIntentsIntentRequestBodyPaymentMethodOptions'Card' GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "request_three_d_secure")) -- | Create a new 'PostSetupIntentsIntentRequestBodyPaymentMethodOptions'Card'' with all required fields. mkPostSetupIntentsIntentRequestBodyPaymentMethodOptions'Card' :: PostSetupIntentsIntentRequestBodyPaymentMethodOptions'Card' mkPostSetupIntentsIntentRequestBodyPaymentMethodOptions'Card' = PostSetupIntentsIntentRequestBodyPaymentMethodOptions'Card' {postSetupIntentsIntentRequestBodyPaymentMethodOptions'Card'RequestThreeDSecure = GHC.Maybe.Nothing} -- | Defines the enum schema located at @paths.\/v1\/setup_intents\/{intent}.POST.requestBody.content.application\/x-www-form-urlencoded.schema.properties.payment_method_options.properties.card.properties.request_three_d_secure@ in the specification. data PostSetupIntentsIntentRequestBodyPaymentMethodOptions'Card'RequestThreeDSecure' = -- | This case is used if the value encountered during decoding does not match any of the provided cases in the specification. PostSetupIntentsIntentRequestBodyPaymentMethodOptions'Card'RequestThreeDSecure'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. PostSetupIntentsIntentRequestBodyPaymentMethodOptions'Card'RequestThreeDSecure'Typed Data.Text.Internal.Text | -- | Represents the JSON value @"any"@ PostSetupIntentsIntentRequestBodyPaymentMethodOptions'Card'RequestThreeDSecure'EnumAny | -- | Represents the JSON value @"automatic"@ PostSetupIntentsIntentRequestBodyPaymentMethodOptions'Card'RequestThreeDSecure'EnumAutomatic deriving (GHC.Show.Show, GHC.Classes.Eq) instance Data.Aeson.Types.ToJSON.ToJSON PostSetupIntentsIntentRequestBodyPaymentMethodOptions'Card'RequestThreeDSecure' where toJSON (PostSetupIntentsIntentRequestBodyPaymentMethodOptions'Card'RequestThreeDSecure'Other val) = val toJSON (PostSetupIntentsIntentRequestBodyPaymentMethodOptions'Card'RequestThreeDSecure'Typed val) = Data.Aeson.Types.ToJSON.toJSON val toJSON (PostSetupIntentsIntentRequestBodyPaymentMethodOptions'Card'RequestThreeDSecure'EnumAny) = "any" toJSON (PostSetupIntentsIntentRequestBodyPaymentMethodOptions'Card'RequestThreeDSecure'EnumAutomatic) = "automatic" instance Data.Aeson.Types.FromJSON.FromJSON PostSetupIntentsIntentRequestBodyPaymentMethodOptions'Card'RequestThreeDSecure' where parseJSON val = GHC.Base.pure ( if | val GHC.Classes.== "any" -> PostSetupIntentsIntentRequestBodyPaymentMethodOptions'Card'RequestThreeDSecure'EnumAny | val GHC.Classes.== "automatic" -> PostSetupIntentsIntentRequestBodyPaymentMethodOptions'Card'RequestThreeDSecure'EnumAutomatic | GHC.Base.otherwise -> PostSetupIntentsIntentRequestBodyPaymentMethodOptions'Card'RequestThreeDSecure'Other val ) -- | Defines the object schema located at @paths.\/v1\/setup_intents\/{intent}.POST.requestBody.content.application\/x-www-form-urlencoded.schema.properties.payment_method_options.properties.sepa_debit@ in the specification. data PostSetupIntentsIntentRequestBodyPaymentMethodOptions'SepaDebit' = PostSetupIntentsIntentRequestBodyPaymentMethodOptions'SepaDebit' { -- | mandate_options postSetupIntentsIntentRequestBodyPaymentMethodOptions'SepaDebit'MandateOptions :: (GHC.Maybe.Maybe Data.Aeson.Types.Internal.Object) } deriving ( GHC.Show.Show, GHC.Classes.Eq ) instance Data.Aeson.Types.ToJSON.ToJSON PostSetupIntentsIntentRequestBodyPaymentMethodOptions'SepaDebit' where toJSON obj = Data.Aeson.Types.Internal.object ("mandate_options" Data.Aeson.Types.ToJSON..= postSetupIntentsIntentRequestBodyPaymentMethodOptions'SepaDebit'MandateOptions obj : GHC.Base.mempty) toEncoding obj = Data.Aeson.Encoding.Internal.pairs ("mandate_options" Data.Aeson.Types.ToJSON..= postSetupIntentsIntentRequestBodyPaymentMethodOptions'SepaDebit'MandateOptions obj) instance Data.Aeson.Types.FromJSON.FromJSON PostSetupIntentsIntentRequestBodyPaymentMethodOptions'SepaDebit' where parseJSON = Data.Aeson.Types.FromJSON.withObject "PostSetupIntentsIntentRequestBodyPaymentMethodOptions'SepaDebit'" (\obj -> GHC.Base.pure PostSetupIntentsIntentRequestBodyPaymentMethodOptions'SepaDebit' GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "mandate_options")) -- | Create a new 'PostSetupIntentsIntentRequestBodyPaymentMethodOptions'SepaDebit'' with all required fields. mkPostSetupIntentsIntentRequestBodyPaymentMethodOptions'SepaDebit' :: PostSetupIntentsIntentRequestBodyPaymentMethodOptions'SepaDebit' mkPostSetupIntentsIntentRequestBodyPaymentMethodOptions'SepaDebit' = PostSetupIntentsIntentRequestBodyPaymentMethodOptions'SepaDebit' {postSetupIntentsIntentRequestBodyPaymentMethodOptions'SepaDebit'MandateOptions = GHC.Maybe.Nothing} -- | Represents a response of the operation 'postSetupIntentsIntent'. -- -- The response constructor is chosen by the status code of the response. If no case matches (no specific case for the response code, no range case, no default case), 'PostSetupIntentsIntentResponseError' is used. data PostSetupIntentsIntentResponse = -- | Means either no matching case available or a parse error PostSetupIntentsIntentResponseError GHC.Base.String | -- | Successful response. PostSetupIntentsIntentResponse200 SetupIntent | -- | Error response. PostSetupIntentsIntentResponseDefault Error deriving (GHC.Show.Show, GHC.Classes.Eq)