{-# 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 postCustomersCustomerSubscriptions module StripeAPI.Operations.PostCustomersCustomerSubscriptions 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/customers/{customer}/subscriptions -- -- \

Creates a new subscription on an existing customer.\<\/p> postCustomersCustomerSubscriptions :: forall m. StripeAPI.Common.MonadHTTP m => -- | customer | Constraints: Maximum length of 5000 Data.Text.Internal.Text -> -- | The request body to send GHC.Maybe.Maybe PostCustomersCustomerSubscriptionsRequestBody -> -- | Monadic computation which returns the result of the operation StripeAPI.Common.ClientT m (Network.HTTP.Client.Types.Response PostCustomersCustomerSubscriptionsResponse) postCustomersCustomerSubscriptions customer body = GHC.Base.fmap ( \response_0 -> GHC.Base.fmap ( Data.Either.either PostCustomersCustomerSubscriptionsResponseError 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) -> PostCustomersCustomerSubscriptionsResponse200 Data.Functor.<$> ( Data.Aeson.eitherDecodeStrict body :: Data.Either.Either GHC.Base.String Subscription ) | GHC.Base.const GHC.Types.True (Network.HTTP.Client.Types.responseStatus response) -> PostCustomersCustomerSubscriptionsResponseDefault 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/customers/" 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 customer)) GHC.Base.++ "/subscriptions"))) GHC.Base.mempty body StripeAPI.Common.RequestBodyEncodingFormData) -- | Defines the object schema located at @paths.\/v1\/customers\/{customer}\/subscriptions.POST.requestBody.content.application\/x-www-form-urlencoded.schema@ in the specification. data PostCustomersCustomerSubscriptionsRequestBody = PostCustomersCustomerSubscriptionsRequestBody { -- | add_invoice_items: A list of prices and quantities that will generate invoice items appended to the first invoice for this subscription. You may pass up to 20 items. postCustomersCustomerSubscriptionsRequestBodyAddInvoiceItems :: (GHC.Maybe.Maybe ([PostCustomersCustomerSubscriptionsRequestBodyAddInvoiceItems'])), -- | application_fee_percent: A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice subtotal that will be transferred to the application owner\'s Stripe account. The request must be made by a platform account on a connected account in order to set an application fee percentage. For more information, see the application fees [documentation](https:\/\/stripe.com\/docs\/connect\/subscriptions\#collecting-fees-on-subscriptions). postCustomersCustomerSubscriptionsRequestBodyApplicationFeePercent :: (GHC.Maybe.Maybe GHC.Types.Double), -- | automatic_tax: Automatic tax settings for this subscription. postCustomersCustomerSubscriptionsRequestBodyAutomaticTax :: (GHC.Maybe.Maybe PostCustomersCustomerSubscriptionsRequestBodyAutomaticTax'), -- | backdate_start_date: For new subscriptions, a past timestamp to backdate the subscription\'s start date to. If set, the first invoice will contain a proration for the timespan between the start date and the current time. Can be combined with trials and the billing cycle anchor. postCustomersCustomerSubscriptionsRequestBodyBackdateStartDate :: (GHC.Maybe.Maybe GHC.Types.Int), -- | billing_cycle_anchor: A future timestamp to anchor the subscription\'s [billing cycle](https:\/\/stripe.com\/docs\/subscriptions\/billing-cycle). This is used to determine the date of the first full invoice, and, for plans with \`month\` or \`year\` intervals, the day of the month for subsequent invoices. postCustomersCustomerSubscriptionsRequestBodyBillingCycleAnchor :: (GHC.Maybe.Maybe GHC.Types.Int), -- | billing_thresholds: Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. Pass an empty string to remove previously-defined thresholds. postCustomersCustomerSubscriptionsRequestBodyBillingThresholds :: (GHC.Maybe.Maybe PostCustomersCustomerSubscriptionsRequestBodyBillingThresholds'Variants), -- | cancel_at: A timestamp at which the subscription should cancel. If set to a date before the current period ends, this will cause a proration if prorations have been enabled using \`proration_behavior\`. If set during a future period, this will always cause a proration for that period. postCustomersCustomerSubscriptionsRequestBodyCancelAt :: (GHC.Maybe.Maybe GHC.Types.Int), -- | cancel_at_period_end: Boolean indicating whether this subscription should cancel at the end of the current period. postCustomersCustomerSubscriptionsRequestBodyCancelAtPeriodEnd :: (GHC.Maybe.Maybe GHC.Types.Bool), -- | collection_method: Either \`charge_automatically\`, or \`send_invoice\`. When charging automatically, Stripe will attempt to pay this subscription at the end of the cycle using the default source attached to the customer. When sending an invoice, Stripe will email your customer an invoice with payment instructions. Defaults to \`charge_automatically\`. postCustomersCustomerSubscriptionsRequestBodyCollectionMethod :: (GHC.Maybe.Maybe PostCustomersCustomerSubscriptionsRequestBodyCollectionMethod'), -- | coupon: The ID of the coupon to apply to this subscription. A coupon applied to a subscription will only affect invoices created for that particular subscription. -- -- Constraints: -- -- * Maximum length of 5000 postCustomersCustomerSubscriptionsRequestBodyCoupon :: (GHC.Maybe.Maybe Data.Text.Internal.Text), -- | days_until_due: Number of days a customer has to pay invoices generated by this subscription. Valid only for subscriptions where \`collection_method\` is set to \`send_invoice\`. postCustomersCustomerSubscriptionsRequestBodyDaysUntilDue :: (GHC.Maybe.Maybe GHC.Types.Int), -- | default_payment_method: ID of the default payment method for the subscription. It must belong to the customer associated with the subscription. This takes precedence over \`default_source\`. If neither are set, invoices will use the customer\'s [invoice_settings.default_payment_method](https:\/\/stripe.com\/docs\/api\/customers\/object\#customer_object-invoice_settings-default_payment_method) or [default_source](https:\/\/stripe.com\/docs\/api\/customers\/object\#customer_object-default_source). -- -- Constraints: -- -- * Maximum length of 5000 postCustomersCustomerSubscriptionsRequestBodyDefaultPaymentMethod :: (GHC.Maybe.Maybe Data.Text.Internal.Text), -- | default_source: ID of the default payment source for the subscription. It must belong to the customer associated with the subscription and be in a chargeable state. If \`default_payment_method\` is also set, \`default_payment_method\` will take precedence. If neither are set, invoices will use the customer\'s [invoice_settings.default_payment_method](https:\/\/stripe.com\/docs\/api\/customers\/object\#customer_object-invoice_settings-default_payment_method) or [default_source](https:\/\/stripe.com\/docs\/api\/customers\/object\#customer_object-default_source). -- -- Constraints: -- -- * Maximum length of 5000 postCustomersCustomerSubscriptionsRequestBodyDefaultSource :: (GHC.Maybe.Maybe Data.Text.Internal.Text), -- | default_tax_rates: The tax rates that will apply to any subscription item that does not have \`tax_rates\` set. Invoices created will have their \`default_tax_rates\` populated from the subscription. postCustomersCustomerSubscriptionsRequestBodyDefaultTaxRates :: (GHC.Maybe.Maybe PostCustomersCustomerSubscriptionsRequestBodyDefaultTaxRates'Variants), -- | expand: Specifies which fields in the response should be expanded. postCustomersCustomerSubscriptionsRequestBodyExpand :: (GHC.Maybe.Maybe ([Data.Text.Internal.Text])), -- | items: A list of up to 20 subscription items, each with an attached price. postCustomersCustomerSubscriptionsRequestBodyItems :: (GHC.Maybe.Maybe ([PostCustomersCustomerSubscriptionsRequestBodyItems'])), -- | 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\`. postCustomersCustomerSubscriptionsRequestBodyMetadata :: (GHC.Maybe.Maybe PostCustomersCustomerSubscriptionsRequestBodyMetadata'Variants), -- | off_session: Indicates if a customer is on or off-session while an invoice payment is attempted. postCustomersCustomerSubscriptionsRequestBodyOffSession :: (GHC.Maybe.Maybe GHC.Types.Bool), -- | payment_behavior: Use \`allow_incomplete\` to create subscriptions with \`status=incomplete\` if the first invoice cannot be paid. Creating subscriptions with this status allows you to manage scenarios where additional user actions are needed to pay a subscription\'s invoice. For example, SCA regulation may require 3DS authentication to complete payment. See the [SCA Migration Guide](https:\/\/stripe.com\/docs\/billing\/migration\/strong-customer-authentication) for Billing to learn more. This is the default behavior. -- -- Use \`default_incomplete\` to create Subscriptions with \`status=incomplete\` when the first invoice requires payment, otherwise start as active. Subscriptions transition to \`status=active\` when successfully confirming the payment intent on the first invoice. This allows simpler management of scenarios where additional user actions are needed to pay a subscription’s invoice. Such as failed payments, [SCA regulation](https:\/\/stripe.com\/docs\/billing\/migration\/strong-customer-authentication), or collecting a mandate for a bank debit payment method. If the payment intent is not confirmed within 23 hours subscriptions transition to \`status=expired_incomplete\`, which is a terminal state. -- -- Use \`error_if_incomplete\` if you want Stripe to return an HTTP 402 status code if a subscription\'s first invoice cannot be paid. For example, if a payment method requires 3DS authentication due to SCA regulation and further user action is needed, this parameter does not create a subscription and returns an error instead. This was the default behavior for API versions prior to 2019-03-14. See the [changelog](https:\/\/stripe.com\/docs\/upgrades\#2019-03-14) to learn more. -- -- \`pending_if_incomplete\` is only used with updates and cannot be passed when creating a subscription. postCustomersCustomerSubscriptionsRequestBodyPaymentBehavior :: (GHC.Maybe.Maybe PostCustomersCustomerSubscriptionsRequestBodyPaymentBehavior'), -- | pending_invoice_item_interval: Specifies an interval for how often to bill for any pending invoice items. It is analogous to calling [Create an invoice](https:\/\/stripe.com\/docs\/api\#create_invoice) for the given subscription at the specified interval. postCustomersCustomerSubscriptionsRequestBodyPendingInvoiceItemInterval :: (GHC.Maybe.Maybe PostCustomersCustomerSubscriptionsRequestBodyPendingInvoiceItemInterval'Variants), -- | promotion_code: The API ID of a promotion code to apply to this subscription. A promotion code applied to a subscription will only affect invoices created for that particular subscription. -- -- Constraints: -- -- * Maximum length of 5000 postCustomersCustomerSubscriptionsRequestBodyPromotionCode :: (GHC.Maybe.Maybe Data.Text.Internal.Text), -- | proration_behavior: Determines how to handle [prorations](https:\/\/stripe.com\/docs\/subscriptions\/billing-cycle\#prorations) resulting from the \`billing_cycle_anchor\`. Valid values are \`create_prorations\` or \`none\`. -- -- Passing \`create_prorations\` will cause proration invoice items to be created when applicable. Prorations can be disabled by passing \`none\`. If no value is passed, the default is \`create_prorations\`. postCustomersCustomerSubscriptionsRequestBodyProrationBehavior :: (GHC.Maybe.Maybe PostCustomersCustomerSubscriptionsRequestBodyProrationBehavior'), -- | transfer_data: If specified, the funds from the subscription\'s invoices will be transferred to the destination and the ID of the resulting transfers will be found on the resulting charges. postCustomersCustomerSubscriptionsRequestBodyTransferData :: (GHC.Maybe.Maybe PostCustomersCustomerSubscriptionsRequestBodyTransferData'), -- | trial_end: Unix timestamp representing the end of the trial period the customer will get before being charged for the first time. This will always overwrite any trials that might apply via a subscribed plan. If set, trial_end will override the default trial period of the plan the customer is being subscribed to. The special value \`now\` can be provided to end the customer\'s trial immediately. Can be at most two years from \`billing_cycle_anchor\`. postCustomersCustomerSubscriptionsRequestBodyTrialEnd :: (GHC.Maybe.Maybe PostCustomersCustomerSubscriptionsRequestBodyTrialEnd'Variants), -- | trial_from_plan: Indicates if a plan\'s \`trial_period_days\` should be applied to the subscription. Setting \`trial_end\` per subscription is preferred, and this defaults to \`false\`. Setting this flag to \`true\` together with \`trial_end\` is not allowed. postCustomersCustomerSubscriptionsRequestBodyTrialFromPlan :: (GHC.Maybe.Maybe GHC.Types.Bool), -- | trial_period_days: Integer representing the number of trial period days before the customer is charged for the first time. This will always overwrite any trials that might apply via a subscribed plan. postCustomersCustomerSubscriptionsRequestBodyTrialPeriodDays :: (GHC.Maybe.Maybe GHC.Types.Int) } deriving ( GHC.Show.Show, GHC.Classes.Eq ) instance Data.Aeson.Types.ToJSON.ToJSON PostCustomersCustomerSubscriptionsRequestBody where toJSON obj = Data.Aeson.Types.Internal.object ("add_invoice_items" Data.Aeson.Types.ToJSON..= postCustomersCustomerSubscriptionsRequestBodyAddInvoiceItems obj : "application_fee_percent" Data.Aeson.Types.ToJSON..= postCustomersCustomerSubscriptionsRequestBodyApplicationFeePercent obj : "automatic_tax" Data.Aeson.Types.ToJSON..= postCustomersCustomerSubscriptionsRequestBodyAutomaticTax obj : "backdate_start_date" Data.Aeson.Types.ToJSON..= postCustomersCustomerSubscriptionsRequestBodyBackdateStartDate obj : "billing_cycle_anchor" Data.Aeson.Types.ToJSON..= postCustomersCustomerSubscriptionsRequestBodyBillingCycleAnchor obj : "billing_thresholds" Data.Aeson.Types.ToJSON..= postCustomersCustomerSubscriptionsRequestBodyBillingThresholds obj : "cancel_at" Data.Aeson.Types.ToJSON..= postCustomersCustomerSubscriptionsRequestBodyCancelAt obj : "cancel_at_period_end" Data.Aeson.Types.ToJSON..= postCustomersCustomerSubscriptionsRequestBodyCancelAtPeriodEnd obj : "collection_method" Data.Aeson.Types.ToJSON..= postCustomersCustomerSubscriptionsRequestBodyCollectionMethod obj : "coupon" Data.Aeson.Types.ToJSON..= postCustomersCustomerSubscriptionsRequestBodyCoupon obj : "days_until_due" Data.Aeson.Types.ToJSON..= postCustomersCustomerSubscriptionsRequestBodyDaysUntilDue obj : "default_payment_method" Data.Aeson.Types.ToJSON..= postCustomersCustomerSubscriptionsRequestBodyDefaultPaymentMethod obj : "default_source" Data.Aeson.Types.ToJSON..= postCustomersCustomerSubscriptionsRequestBodyDefaultSource obj : "default_tax_rates" Data.Aeson.Types.ToJSON..= postCustomersCustomerSubscriptionsRequestBodyDefaultTaxRates obj : "expand" Data.Aeson.Types.ToJSON..= postCustomersCustomerSubscriptionsRequestBodyExpand obj : "items" Data.Aeson.Types.ToJSON..= postCustomersCustomerSubscriptionsRequestBodyItems obj : "metadata" Data.Aeson.Types.ToJSON..= postCustomersCustomerSubscriptionsRequestBodyMetadata obj : "off_session" Data.Aeson.Types.ToJSON..= postCustomersCustomerSubscriptionsRequestBodyOffSession obj : "payment_behavior" Data.Aeson.Types.ToJSON..= postCustomersCustomerSubscriptionsRequestBodyPaymentBehavior obj : "pending_invoice_item_interval" Data.Aeson.Types.ToJSON..= postCustomersCustomerSubscriptionsRequestBodyPendingInvoiceItemInterval obj : "promotion_code" Data.Aeson.Types.ToJSON..= postCustomersCustomerSubscriptionsRequestBodyPromotionCode obj : "proration_behavior" Data.Aeson.Types.ToJSON..= postCustomersCustomerSubscriptionsRequestBodyProrationBehavior obj : "transfer_data" Data.Aeson.Types.ToJSON..= postCustomersCustomerSubscriptionsRequestBodyTransferData obj : "trial_end" Data.Aeson.Types.ToJSON..= postCustomersCustomerSubscriptionsRequestBodyTrialEnd obj : "trial_from_plan" Data.Aeson.Types.ToJSON..= postCustomersCustomerSubscriptionsRequestBodyTrialFromPlan obj : "trial_period_days" Data.Aeson.Types.ToJSON..= postCustomersCustomerSubscriptionsRequestBodyTrialPeriodDays obj : GHC.Base.mempty) toEncoding obj = Data.Aeson.Encoding.Internal.pairs (("add_invoice_items" Data.Aeson.Types.ToJSON..= postCustomersCustomerSubscriptionsRequestBodyAddInvoiceItems obj) GHC.Base.<> (("application_fee_percent" Data.Aeson.Types.ToJSON..= postCustomersCustomerSubscriptionsRequestBodyApplicationFeePercent obj) GHC.Base.<> (("automatic_tax" Data.Aeson.Types.ToJSON..= postCustomersCustomerSubscriptionsRequestBodyAutomaticTax obj) GHC.Base.<> (("backdate_start_date" Data.Aeson.Types.ToJSON..= postCustomersCustomerSubscriptionsRequestBodyBackdateStartDate obj) GHC.Base.<> (("billing_cycle_anchor" Data.Aeson.Types.ToJSON..= postCustomersCustomerSubscriptionsRequestBodyBillingCycleAnchor obj) GHC.Base.<> (("billing_thresholds" Data.Aeson.Types.ToJSON..= postCustomersCustomerSubscriptionsRequestBodyBillingThresholds obj) GHC.Base.<> (("cancel_at" Data.Aeson.Types.ToJSON..= postCustomersCustomerSubscriptionsRequestBodyCancelAt obj) GHC.Base.<> (("cancel_at_period_end" Data.Aeson.Types.ToJSON..= postCustomersCustomerSubscriptionsRequestBodyCancelAtPeriodEnd obj) GHC.Base.<> (("collection_method" Data.Aeson.Types.ToJSON..= postCustomersCustomerSubscriptionsRequestBodyCollectionMethod obj) GHC.Base.<> (("coupon" Data.Aeson.Types.ToJSON..= postCustomersCustomerSubscriptionsRequestBodyCoupon obj) GHC.Base.<> (("days_until_due" Data.Aeson.Types.ToJSON..= postCustomersCustomerSubscriptionsRequestBodyDaysUntilDue obj) GHC.Base.<> (("default_payment_method" Data.Aeson.Types.ToJSON..= postCustomersCustomerSubscriptionsRequestBodyDefaultPaymentMethod obj) GHC.Base.<> (("default_source" Data.Aeson.Types.ToJSON..= postCustomersCustomerSubscriptionsRequestBodyDefaultSource obj) GHC.Base.<> (("default_tax_rates" Data.Aeson.Types.ToJSON..= postCustomersCustomerSubscriptionsRequestBodyDefaultTaxRates obj) GHC.Base.<> (("expand" Data.Aeson.Types.ToJSON..= postCustomersCustomerSubscriptionsRequestBodyExpand obj) GHC.Base.<> (("items" Data.Aeson.Types.ToJSON..= postCustomersCustomerSubscriptionsRequestBodyItems obj) GHC.Base.<> (("metadata" Data.Aeson.Types.ToJSON..= postCustomersCustomerSubscriptionsRequestBodyMetadata obj) GHC.Base.<> (("off_session" Data.Aeson.Types.ToJSON..= postCustomersCustomerSubscriptionsRequestBodyOffSession obj) GHC.Base.<> (("payment_behavior" Data.Aeson.Types.ToJSON..= postCustomersCustomerSubscriptionsRequestBodyPaymentBehavior obj) GHC.Base.<> (("pending_invoice_item_interval" Data.Aeson.Types.ToJSON..= postCustomersCustomerSubscriptionsRequestBodyPendingInvoiceItemInterval obj) GHC.Base.<> (("promotion_code" Data.Aeson.Types.ToJSON..= postCustomersCustomerSubscriptionsRequestBodyPromotionCode obj) GHC.Base.<> (("proration_behavior" Data.Aeson.Types.ToJSON..= postCustomersCustomerSubscriptionsRequestBodyProrationBehavior obj) GHC.Base.<> (("transfer_data" Data.Aeson.Types.ToJSON..= postCustomersCustomerSubscriptionsRequestBodyTransferData obj) GHC.Base.<> (("trial_end" Data.Aeson.Types.ToJSON..= postCustomersCustomerSubscriptionsRequestBodyTrialEnd obj) GHC.Base.<> (("trial_from_plan" Data.Aeson.Types.ToJSON..= postCustomersCustomerSubscriptionsRequestBodyTrialFromPlan obj) GHC.Base.<> ("trial_period_days" Data.Aeson.Types.ToJSON..= postCustomersCustomerSubscriptionsRequestBodyTrialPeriodDays obj)))))))))))))))))))))))))) instance Data.Aeson.Types.FromJSON.FromJSON PostCustomersCustomerSubscriptionsRequestBody where parseJSON = Data.Aeson.Types.FromJSON.withObject "PostCustomersCustomerSubscriptionsRequestBody" (\obj -> (((((((((((((((((((((((((GHC.Base.pure PostCustomersCustomerSubscriptionsRequestBody GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "add_invoice_items")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "application_fee_percent")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "automatic_tax")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "backdate_start_date")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "billing_cycle_anchor")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "billing_thresholds")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "cancel_at")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "cancel_at_period_end")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "collection_method")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "coupon")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "days_until_due")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "default_payment_method")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "default_source")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "default_tax_rates")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "expand")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "items")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "metadata")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "off_session")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "payment_behavior")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "pending_invoice_item_interval")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "promotion_code")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "proration_behavior")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "transfer_data")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "trial_end")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "trial_from_plan")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "trial_period_days")) -- | Create a new 'PostCustomersCustomerSubscriptionsRequestBody' with all required fields. mkPostCustomersCustomerSubscriptionsRequestBody :: PostCustomersCustomerSubscriptionsRequestBody mkPostCustomersCustomerSubscriptionsRequestBody = PostCustomersCustomerSubscriptionsRequestBody { postCustomersCustomerSubscriptionsRequestBodyAddInvoiceItems = GHC.Maybe.Nothing, postCustomersCustomerSubscriptionsRequestBodyApplicationFeePercent = GHC.Maybe.Nothing, postCustomersCustomerSubscriptionsRequestBodyAutomaticTax = GHC.Maybe.Nothing, postCustomersCustomerSubscriptionsRequestBodyBackdateStartDate = GHC.Maybe.Nothing, postCustomersCustomerSubscriptionsRequestBodyBillingCycleAnchor = GHC.Maybe.Nothing, postCustomersCustomerSubscriptionsRequestBodyBillingThresholds = GHC.Maybe.Nothing, postCustomersCustomerSubscriptionsRequestBodyCancelAt = GHC.Maybe.Nothing, postCustomersCustomerSubscriptionsRequestBodyCancelAtPeriodEnd = GHC.Maybe.Nothing, postCustomersCustomerSubscriptionsRequestBodyCollectionMethod = GHC.Maybe.Nothing, postCustomersCustomerSubscriptionsRequestBodyCoupon = GHC.Maybe.Nothing, postCustomersCustomerSubscriptionsRequestBodyDaysUntilDue = GHC.Maybe.Nothing, postCustomersCustomerSubscriptionsRequestBodyDefaultPaymentMethod = GHC.Maybe.Nothing, postCustomersCustomerSubscriptionsRequestBodyDefaultSource = GHC.Maybe.Nothing, postCustomersCustomerSubscriptionsRequestBodyDefaultTaxRates = GHC.Maybe.Nothing, postCustomersCustomerSubscriptionsRequestBodyExpand = GHC.Maybe.Nothing, postCustomersCustomerSubscriptionsRequestBodyItems = GHC.Maybe.Nothing, postCustomersCustomerSubscriptionsRequestBodyMetadata = GHC.Maybe.Nothing, postCustomersCustomerSubscriptionsRequestBodyOffSession = GHC.Maybe.Nothing, postCustomersCustomerSubscriptionsRequestBodyPaymentBehavior = GHC.Maybe.Nothing, postCustomersCustomerSubscriptionsRequestBodyPendingInvoiceItemInterval = GHC.Maybe.Nothing, postCustomersCustomerSubscriptionsRequestBodyPromotionCode = GHC.Maybe.Nothing, postCustomersCustomerSubscriptionsRequestBodyProrationBehavior = GHC.Maybe.Nothing, postCustomersCustomerSubscriptionsRequestBodyTransferData = GHC.Maybe.Nothing, postCustomersCustomerSubscriptionsRequestBodyTrialEnd = GHC.Maybe.Nothing, postCustomersCustomerSubscriptionsRequestBodyTrialFromPlan = GHC.Maybe.Nothing, postCustomersCustomerSubscriptionsRequestBodyTrialPeriodDays = GHC.Maybe.Nothing } -- | Defines the object schema located at @paths.\/v1\/customers\/{customer}\/subscriptions.POST.requestBody.content.application\/x-www-form-urlencoded.schema.properties.add_invoice_items.items@ in the specification. data PostCustomersCustomerSubscriptionsRequestBodyAddInvoiceItems' = PostCustomersCustomerSubscriptionsRequestBodyAddInvoiceItems' { -- | price -- -- Constraints: -- -- * Maximum length of 5000 postCustomersCustomerSubscriptionsRequestBodyAddInvoiceItems'Price :: (GHC.Maybe.Maybe Data.Text.Internal.Text), -- | price_data postCustomersCustomerSubscriptionsRequestBodyAddInvoiceItems'PriceData :: (GHC.Maybe.Maybe PostCustomersCustomerSubscriptionsRequestBodyAddInvoiceItems'PriceData'), -- | quantity postCustomersCustomerSubscriptionsRequestBodyAddInvoiceItems'Quantity :: (GHC.Maybe.Maybe GHC.Types.Int), -- | tax_rates postCustomersCustomerSubscriptionsRequestBodyAddInvoiceItems'TaxRates :: (GHC.Maybe.Maybe PostCustomersCustomerSubscriptionsRequestBodyAddInvoiceItems'TaxRates'Variants) } deriving ( GHC.Show.Show, GHC.Classes.Eq ) instance Data.Aeson.Types.ToJSON.ToJSON PostCustomersCustomerSubscriptionsRequestBodyAddInvoiceItems' where toJSON obj = Data.Aeson.Types.Internal.object ("price" Data.Aeson.Types.ToJSON..= postCustomersCustomerSubscriptionsRequestBodyAddInvoiceItems'Price obj : "price_data" Data.Aeson.Types.ToJSON..= postCustomersCustomerSubscriptionsRequestBodyAddInvoiceItems'PriceData obj : "quantity" Data.Aeson.Types.ToJSON..= postCustomersCustomerSubscriptionsRequestBodyAddInvoiceItems'Quantity obj : "tax_rates" Data.Aeson.Types.ToJSON..= postCustomersCustomerSubscriptionsRequestBodyAddInvoiceItems'TaxRates obj : GHC.Base.mempty) toEncoding obj = Data.Aeson.Encoding.Internal.pairs (("price" Data.Aeson.Types.ToJSON..= postCustomersCustomerSubscriptionsRequestBodyAddInvoiceItems'Price obj) GHC.Base.<> (("price_data" Data.Aeson.Types.ToJSON..= postCustomersCustomerSubscriptionsRequestBodyAddInvoiceItems'PriceData obj) GHC.Base.<> (("quantity" Data.Aeson.Types.ToJSON..= postCustomersCustomerSubscriptionsRequestBodyAddInvoiceItems'Quantity obj) GHC.Base.<> ("tax_rates" Data.Aeson.Types.ToJSON..= postCustomersCustomerSubscriptionsRequestBodyAddInvoiceItems'TaxRates obj)))) instance Data.Aeson.Types.FromJSON.FromJSON PostCustomersCustomerSubscriptionsRequestBodyAddInvoiceItems' where parseJSON = Data.Aeson.Types.FromJSON.withObject "PostCustomersCustomerSubscriptionsRequestBodyAddInvoiceItems'" (\obj -> (((GHC.Base.pure PostCustomersCustomerSubscriptionsRequestBodyAddInvoiceItems' GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "price")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "price_data")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "quantity")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "tax_rates")) -- | Create a new 'PostCustomersCustomerSubscriptionsRequestBodyAddInvoiceItems'' with all required fields. mkPostCustomersCustomerSubscriptionsRequestBodyAddInvoiceItems' :: PostCustomersCustomerSubscriptionsRequestBodyAddInvoiceItems' mkPostCustomersCustomerSubscriptionsRequestBodyAddInvoiceItems' = PostCustomersCustomerSubscriptionsRequestBodyAddInvoiceItems' { postCustomersCustomerSubscriptionsRequestBodyAddInvoiceItems'Price = GHC.Maybe.Nothing, postCustomersCustomerSubscriptionsRequestBodyAddInvoiceItems'PriceData = GHC.Maybe.Nothing, postCustomersCustomerSubscriptionsRequestBodyAddInvoiceItems'Quantity = GHC.Maybe.Nothing, postCustomersCustomerSubscriptionsRequestBodyAddInvoiceItems'TaxRates = GHC.Maybe.Nothing } -- | Defines the object schema located at @paths.\/v1\/customers\/{customer}\/subscriptions.POST.requestBody.content.application\/x-www-form-urlencoded.schema.properties.add_invoice_items.items.properties.price_data@ in the specification. data PostCustomersCustomerSubscriptionsRequestBodyAddInvoiceItems'PriceData' = PostCustomersCustomerSubscriptionsRequestBodyAddInvoiceItems'PriceData' { -- | currency postCustomersCustomerSubscriptionsRequestBodyAddInvoiceItems'PriceData'Currency :: Data.Text.Internal.Text, -- | product -- -- Constraints: -- -- * Maximum length of 5000 postCustomersCustomerSubscriptionsRequestBodyAddInvoiceItems'PriceData'Product :: Data.Text.Internal.Text, -- | tax_behavior postCustomersCustomerSubscriptionsRequestBodyAddInvoiceItems'PriceData'TaxBehavior :: (GHC.Maybe.Maybe PostCustomersCustomerSubscriptionsRequestBodyAddInvoiceItems'PriceData'TaxBehavior'), -- | unit_amount postCustomersCustomerSubscriptionsRequestBodyAddInvoiceItems'PriceData'UnitAmount :: (GHC.Maybe.Maybe GHC.Types.Int), -- | unit_amount_decimal postCustomersCustomerSubscriptionsRequestBodyAddInvoiceItems'PriceData'UnitAmountDecimal :: (GHC.Maybe.Maybe Data.Text.Internal.Text) } deriving ( GHC.Show.Show, GHC.Classes.Eq ) instance Data.Aeson.Types.ToJSON.ToJSON PostCustomersCustomerSubscriptionsRequestBodyAddInvoiceItems'PriceData' where toJSON obj = Data.Aeson.Types.Internal.object ("currency" Data.Aeson.Types.ToJSON..= postCustomersCustomerSubscriptionsRequestBodyAddInvoiceItems'PriceData'Currency obj : "product" Data.Aeson.Types.ToJSON..= postCustomersCustomerSubscriptionsRequestBodyAddInvoiceItems'PriceData'Product obj : "tax_behavior" Data.Aeson.Types.ToJSON..= postCustomersCustomerSubscriptionsRequestBodyAddInvoiceItems'PriceData'TaxBehavior obj : "unit_amount" Data.Aeson.Types.ToJSON..= postCustomersCustomerSubscriptionsRequestBodyAddInvoiceItems'PriceData'UnitAmount obj : "unit_amount_decimal" Data.Aeson.Types.ToJSON..= postCustomersCustomerSubscriptionsRequestBodyAddInvoiceItems'PriceData'UnitAmountDecimal obj : GHC.Base.mempty) toEncoding obj = Data.Aeson.Encoding.Internal.pairs (("currency" Data.Aeson.Types.ToJSON..= postCustomersCustomerSubscriptionsRequestBodyAddInvoiceItems'PriceData'Currency obj) GHC.Base.<> (("product" Data.Aeson.Types.ToJSON..= postCustomersCustomerSubscriptionsRequestBodyAddInvoiceItems'PriceData'Product obj) GHC.Base.<> (("tax_behavior" Data.Aeson.Types.ToJSON..= postCustomersCustomerSubscriptionsRequestBodyAddInvoiceItems'PriceData'TaxBehavior obj) GHC.Base.<> (("unit_amount" Data.Aeson.Types.ToJSON..= postCustomersCustomerSubscriptionsRequestBodyAddInvoiceItems'PriceData'UnitAmount obj) GHC.Base.<> ("unit_amount_decimal" Data.Aeson.Types.ToJSON..= postCustomersCustomerSubscriptionsRequestBodyAddInvoiceItems'PriceData'UnitAmountDecimal obj))))) instance Data.Aeson.Types.FromJSON.FromJSON PostCustomersCustomerSubscriptionsRequestBodyAddInvoiceItems'PriceData' where parseJSON = Data.Aeson.Types.FromJSON.withObject "PostCustomersCustomerSubscriptionsRequestBodyAddInvoiceItems'PriceData'" (\obj -> ((((GHC.Base.pure PostCustomersCustomerSubscriptionsRequestBodyAddInvoiceItems'PriceData' GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..: "currency")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..: "product")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "tax_behavior")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "unit_amount")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "unit_amount_decimal")) -- | Create a new 'PostCustomersCustomerSubscriptionsRequestBodyAddInvoiceItems'PriceData'' with all required fields. mkPostCustomersCustomerSubscriptionsRequestBodyAddInvoiceItems'PriceData' :: -- | 'postCustomersCustomerSubscriptionsRequestBodyAddInvoiceItems'PriceData'Currency' Data.Text.Internal.Text -> -- | 'postCustomersCustomerSubscriptionsRequestBodyAddInvoiceItems'PriceData'Product' Data.Text.Internal.Text -> PostCustomersCustomerSubscriptionsRequestBodyAddInvoiceItems'PriceData' mkPostCustomersCustomerSubscriptionsRequestBodyAddInvoiceItems'PriceData' postCustomersCustomerSubscriptionsRequestBodyAddInvoiceItems'PriceData'Currency postCustomersCustomerSubscriptionsRequestBodyAddInvoiceItems'PriceData'Product = PostCustomersCustomerSubscriptionsRequestBodyAddInvoiceItems'PriceData' { postCustomersCustomerSubscriptionsRequestBodyAddInvoiceItems'PriceData'Currency = postCustomersCustomerSubscriptionsRequestBodyAddInvoiceItems'PriceData'Currency, postCustomersCustomerSubscriptionsRequestBodyAddInvoiceItems'PriceData'Product = postCustomersCustomerSubscriptionsRequestBodyAddInvoiceItems'PriceData'Product, postCustomersCustomerSubscriptionsRequestBodyAddInvoiceItems'PriceData'TaxBehavior = GHC.Maybe.Nothing, postCustomersCustomerSubscriptionsRequestBodyAddInvoiceItems'PriceData'UnitAmount = GHC.Maybe.Nothing, postCustomersCustomerSubscriptionsRequestBodyAddInvoiceItems'PriceData'UnitAmountDecimal = GHC.Maybe.Nothing } -- | Defines the enum schema located at @paths.\/v1\/customers\/{customer}\/subscriptions.POST.requestBody.content.application\/x-www-form-urlencoded.schema.properties.add_invoice_items.items.properties.price_data.properties.tax_behavior@ in the specification. data PostCustomersCustomerSubscriptionsRequestBodyAddInvoiceItems'PriceData'TaxBehavior' = -- | This case is used if the value encountered during decoding does not match any of the provided cases in the specification. PostCustomersCustomerSubscriptionsRequestBodyAddInvoiceItems'PriceData'TaxBehavior'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. PostCustomersCustomerSubscriptionsRequestBodyAddInvoiceItems'PriceData'TaxBehavior'Typed Data.Text.Internal.Text | -- | Represents the JSON value @"exclusive"@ PostCustomersCustomerSubscriptionsRequestBodyAddInvoiceItems'PriceData'TaxBehavior'EnumExclusive | -- | Represents the JSON value @"inclusive"@ PostCustomersCustomerSubscriptionsRequestBodyAddInvoiceItems'PriceData'TaxBehavior'EnumInclusive | -- | Represents the JSON value @"unspecified"@ PostCustomersCustomerSubscriptionsRequestBodyAddInvoiceItems'PriceData'TaxBehavior'EnumUnspecified deriving (GHC.Show.Show, GHC.Classes.Eq) instance Data.Aeson.Types.ToJSON.ToJSON PostCustomersCustomerSubscriptionsRequestBodyAddInvoiceItems'PriceData'TaxBehavior' where toJSON (PostCustomersCustomerSubscriptionsRequestBodyAddInvoiceItems'PriceData'TaxBehavior'Other val) = val toJSON (PostCustomersCustomerSubscriptionsRequestBodyAddInvoiceItems'PriceData'TaxBehavior'Typed val) = Data.Aeson.Types.ToJSON.toJSON val toJSON (PostCustomersCustomerSubscriptionsRequestBodyAddInvoiceItems'PriceData'TaxBehavior'EnumExclusive) = "exclusive" toJSON (PostCustomersCustomerSubscriptionsRequestBodyAddInvoiceItems'PriceData'TaxBehavior'EnumInclusive) = "inclusive" toJSON (PostCustomersCustomerSubscriptionsRequestBodyAddInvoiceItems'PriceData'TaxBehavior'EnumUnspecified) = "unspecified" instance Data.Aeson.Types.FromJSON.FromJSON PostCustomersCustomerSubscriptionsRequestBodyAddInvoiceItems'PriceData'TaxBehavior' where parseJSON val = GHC.Base.pure ( if | val GHC.Classes.== "exclusive" -> PostCustomersCustomerSubscriptionsRequestBodyAddInvoiceItems'PriceData'TaxBehavior'EnumExclusive | val GHC.Classes.== "inclusive" -> PostCustomersCustomerSubscriptionsRequestBodyAddInvoiceItems'PriceData'TaxBehavior'EnumInclusive | val GHC.Classes.== "unspecified" -> PostCustomersCustomerSubscriptionsRequestBodyAddInvoiceItems'PriceData'TaxBehavior'EnumUnspecified | GHC.Base.otherwise -> PostCustomersCustomerSubscriptionsRequestBodyAddInvoiceItems'PriceData'TaxBehavior'Other val ) -- | Defines the oneOf schema located at @paths.\/v1\/customers\/{customer}\/subscriptions.POST.requestBody.content.application\/x-www-form-urlencoded.schema.properties.add_invoice_items.items.properties.tax_rates.anyOf@ in the specification. data PostCustomersCustomerSubscriptionsRequestBodyAddInvoiceItems'TaxRates'Variants = -- | Represents the JSON value @""@ PostCustomersCustomerSubscriptionsRequestBodyAddInvoiceItems'TaxRates'EmptyString | PostCustomersCustomerSubscriptionsRequestBodyAddInvoiceItems'TaxRates'ListTText ([Data.Text.Internal.Text]) deriving (GHC.Show.Show, GHC.Classes.Eq) instance Data.Aeson.Types.ToJSON.ToJSON PostCustomersCustomerSubscriptionsRequestBodyAddInvoiceItems'TaxRates'Variants where toJSON (PostCustomersCustomerSubscriptionsRequestBodyAddInvoiceItems'TaxRates'ListTText a) = Data.Aeson.Types.ToJSON.toJSON a toJSON (PostCustomersCustomerSubscriptionsRequestBodyAddInvoiceItems'TaxRates'EmptyString) = "" instance Data.Aeson.Types.FromJSON.FromJSON PostCustomersCustomerSubscriptionsRequestBodyAddInvoiceItems'TaxRates'Variants where parseJSON val = if | val GHC.Classes.== "" -> GHC.Base.pure PostCustomersCustomerSubscriptionsRequestBodyAddInvoiceItems'TaxRates'EmptyString | GHC.Base.otherwise -> case (PostCustomersCustomerSubscriptionsRequestBodyAddInvoiceItems'TaxRates'ListTText 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\/customers\/{customer}\/subscriptions.POST.requestBody.content.application\/x-www-form-urlencoded.schema.properties.automatic_tax@ in the specification. -- -- Automatic tax settings for this subscription. data PostCustomersCustomerSubscriptionsRequestBodyAutomaticTax' = PostCustomersCustomerSubscriptionsRequestBodyAutomaticTax' { -- | enabled postCustomersCustomerSubscriptionsRequestBodyAutomaticTax'Enabled :: GHC.Types.Bool } deriving ( GHC.Show.Show, GHC.Classes.Eq ) instance Data.Aeson.Types.ToJSON.ToJSON PostCustomersCustomerSubscriptionsRequestBodyAutomaticTax' where toJSON obj = Data.Aeson.Types.Internal.object ("enabled" Data.Aeson.Types.ToJSON..= postCustomersCustomerSubscriptionsRequestBodyAutomaticTax'Enabled obj : GHC.Base.mempty) toEncoding obj = Data.Aeson.Encoding.Internal.pairs ("enabled" Data.Aeson.Types.ToJSON..= postCustomersCustomerSubscriptionsRequestBodyAutomaticTax'Enabled obj) instance Data.Aeson.Types.FromJSON.FromJSON PostCustomersCustomerSubscriptionsRequestBodyAutomaticTax' where parseJSON = Data.Aeson.Types.FromJSON.withObject "PostCustomersCustomerSubscriptionsRequestBodyAutomaticTax'" (\obj -> GHC.Base.pure PostCustomersCustomerSubscriptionsRequestBodyAutomaticTax' GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..: "enabled")) -- | Create a new 'PostCustomersCustomerSubscriptionsRequestBodyAutomaticTax'' with all required fields. mkPostCustomersCustomerSubscriptionsRequestBodyAutomaticTax' :: -- | 'postCustomersCustomerSubscriptionsRequestBodyAutomaticTax'Enabled' GHC.Types.Bool -> PostCustomersCustomerSubscriptionsRequestBodyAutomaticTax' mkPostCustomersCustomerSubscriptionsRequestBodyAutomaticTax' postCustomersCustomerSubscriptionsRequestBodyAutomaticTax'Enabled = PostCustomersCustomerSubscriptionsRequestBodyAutomaticTax' {postCustomersCustomerSubscriptionsRequestBodyAutomaticTax'Enabled = postCustomersCustomerSubscriptionsRequestBodyAutomaticTax'Enabled} -- | Defines the object schema located at @paths.\/v1\/customers\/{customer}\/subscriptions.POST.requestBody.content.application\/x-www-form-urlencoded.schema.properties.billing_thresholds.anyOf@ in the specification. data PostCustomersCustomerSubscriptionsRequestBodyBillingThresholds'OneOf1 = PostCustomersCustomerSubscriptionsRequestBodyBillingThresholds'OneOf1 { -- | amount_gte postCustomersCustomerSubscriptionsRequestBodyBillingThresholds'OneOf1AmountGte :: (GHC.Maybe.Maybe GHC.Types.Int), -- | reset_billing_cycle_anchor postCustomersCustomerSubscriptionsRequestBodyBillingThresholds'OneOf1ResetBillingCycleAnchor :: (GHC.Maybe.Maybe GHC.Types.Bool) } deriving ( GHC.Show.Show, GHC.Classes.Eq ) instance Data.Aeson.Types.ToJSON.ToJSON PostCustomersCustomerSubscriptionsRequestBodyBillingThresholds'OneOf1 where toJSON obj = Data.Aeson.Types.Internal.object ("amount_gte" Data.Aeson.Types.ToJSON..= postCustomersCustomerSubscriptionsRequestBodyBillingThresholds'OneOf1AmountGte obj : "reset_billing_cycle_anchor" Data.Aeson.Types.ToJSON..= postCustomersCustomerSubscriptionsRequestBodyBillingThresholds'OneOf1ResetBillingCycleAnchor obj : GHC.Base.mempty) toEncoding obj = Data.Aeson.Encoding.Internal.pairs (("amount_gte" Data.Aeson.Types.ToJSON..= postCustomersCustomerSubscriptionsRequestBodyBillingThresholds'OneOf1AmountGte obj) GHC.Base.<> ("reset_billing_cycle_anchor" Data.Aeson.Types.ToJSON..= postCustomersCustomerSubscriptionsRequestBodyBillingThresholds'OneOf1ResetBillingCycleAnchor obj)) instance Data.Aeson.Types.FromJSON.FromJSON PostCustomersCustomerSubscriptionsRequestBodyBillingThresholds'OneOf1 where parseJSON = Data.Aeson.Types.FromJSON.withObject "PostCustomersCustomerSubscriptionsRequestBodyBillingThresholds'OneOf1" (\obj -> (GHC.Base.pure PostCustomersCustomerSubscriptionsRequestBodyBillingThresholds'OneOf1 GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "amount_gte")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "reset_billing_cycle_anchor")) -- | Create a new 'PostCustomersCustomerSubscriptionsRequestBodyBillingThresholds'OneOf1' with all required fields. mkPostCustomersCustomerSubscriptionsRequestBodyBillingThresholds'OneOf1 :: PostCustomersCustomerSubscriptionsRequestBodyBillingThresholds'OneOf1 mkPostCustomersCustomerSubscriptionsRequestBodyBillingThresholds'OneOf1 = PostCustomersCustomerSubscriptionsRequestBodyBillingThresholds'OneOf1 { postCustomersCustomerSubscriptionsRequestBodyBillingThresholds'OneOf1AmountGte = GHC.Maybe.Nothing, postCustomersCustomerSubscriptionsRequestBodyBillingThresholds'OneOf1ResetBillingCycleAnchor = GHC.Maybe.Nothing } -- | Defines the oneOf schema located at @paths.\/v1\/customers\/{customer}\/subscriptions.POST.requestBody.content.application\/x-www-form-urlencoded.schema.properties.billing_thresholds.anyOf@ in the specification. -- -- Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. Pass an empty string to remove previously-defined thresholds. data PostCustomersCustomerSubscriptionsRequestBodyBillingThresholds'Variants = -- | Represents the JSON value @""@ PostCustomersCustomerSubscriptionsRequestBodyBillingThresholds'EmptyString | PostCustomersCustomerSubscriptionsRequestBodyBillingThresholds'PostCustomersCustomerSubscriptionsRequestBodyBillingThresholds'OneOf1 PostCustomersCustomerSubscriptionsRequestBodyBillingThresholds'OneOf1 deriving (GHC.Show.Show, GHC.Classes.Eq) instance Data.Aeson.Types.ToJSON.ToJSON PostCustomersCustomerSubscriptionsRequestBodyBillingThresholds'Variants where toJSON (PostCustomersCustomerSubscriptionsRequestBodyBillingThresholds'PostCustomersCustomerSubscriptionsRequestBodyBillingThresholds'OneOf1 a) = Data.Aeson.Types.ToJSON.toJSON a toJSON (PostCustomersCustomerSubscriptionsRequestBodyBillingThresholds'EmptyString) = "" instance Data.Aeson.Types.FromJSON.FromJSON PostCustomersCustomerSubscriptionsRequestBodyBillingThresholds'Variants where parseJSON val = if | val GHC.Classes.== "" -> GHC.Base.pure PostCustomersCustomerSubscriptionsRequestBodyBillingThresholds'EmptyString | GHC.Base.otherwise -> case (PostCustomersCustomerSubscriptionsRequestBodyBillingThresholds'PostCustomersCustomerSubscriptionsRequestBodyBillingThresholds'OneOf1 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\/customers\/{customer}\/subscriptions.POST.requestBody.content.application\/x-www-form-urlencoded.schema.properties.collection_method@ in the specification. -- -- Either \`charge_automatically\`, or \`send_invoice\`. When charging automatically, Stripe will attempt to pay this subscription at the end of the cycle using the default source attached to the customer. When sending an invoice, Stripe will email your customer an invoice with payment instructions. Defaults to \`charge_automatically\`. data PostCustomersCustomerSubscriptionsRequestBodyCollectionMethod' = -- | This case is used if the value encountered during decoding does not match any of the provided cases in the specification. PostCustomersCustomerSubscriptionsRequestBodyCollectionMethod'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. PostCustomersCustomerSubscriptionsRequestBodyCollectionMethod'Typed Data.Text.Internal.Text | -- | Represents the JSON value @"charge_automatically"@ PostCustomersCustomerSubscriptionsRequestBodyCollectionMethod'EnumChargeAutomatically | -- | Represents the JSON value @"send_invoice"@ PostCustomersCustomerSubscriptionsRequestBodyCollectionMethod'EnumSendInvoice deriving (GHC.Show.Show, GHC.Classes.Eq) instance Data.Aeson.Types.ToJSON.ToJSON PostCustomersCustomerSubscriptionsRequestBodyCollectionMethod' where toJSON (PostCustomersCustomerSubscriptionsRequestBodyCollectionMethod'Other val) = val toJSON (PostCustomersCustomerSubscriptionsRequestBodyCollectionMethod'Typed val) = Data.Aeson.Types.ToJSON.toJSON val toJSON (PostCustomersCustomerSubscriptionsRequestBodyCollectionMethod'EnumChargeAutomatically) = "charge_automatically" toJSON (PostCustomersCustomerSubscriptionsRequestBodyCollectionMethod'EnumSendInvoice) = "send_invoice" instance Data.Aeson.Types.FromJSON.FromJSON PostCustomersCustomerSubscriptionsRequestBodyCollectionMethod' where parseJSON val = GHC.Base.pure ( if | val GHC.Classes.== "charge_automatically" -> PostCustomersCustomerSubscriptionsRequestBodyCollectionMethod'EnumChargeAutomatically | val GHC.Classes.== "send_invoice" -> PostCustomersCustomerSubscriptionsRequestBodyCollectionMethod'EnumSendInvoice | GHC.Base.otherwise -> PostCustomersCustomerSubscriptionsRequestBodyCollectionMethod'Other val ) -- | Defines the oneOf schema located at @paths.\/v1\/customers\/{customer}\/subscriptions.POST.requestBody.content.application\/x-www-form-urlencoded.schema.properties.default_tax_rates.anyOf@ in the specification. -- -- The tax rates that will apply to any subscription item that does not have \`tax_rates\` set. Invoices created will have their \`default_tax_rates\` populated from the subscription. data PostCustomersCustomerSubscriptionsRequestBodyDefaultTaxRates'Variants = -- | Represents the JSON value @""@ PostCustomersCustomerSubscriptionsRequestBodyDefaultTaxRates'EmptyString | PostCustomersCustomerSubscriptionsRequestBodyDefaultTaxRates'ListTText ([Data.Text.Internal.Text]) deriving (GHC.Show.Show, GHC.Classes.Eq) instance Data.Aeson.Types.ToJSON.ToJSON PostCustomersCustomerSubscriptionsRequestBodyDefaultTaxRates'Variants where toJSON (PostCustomersCustomerSubscriptionsRequestBodyDefaultTaxRates'ListTText a) = Data.Aeson.Types.ToJSON.toJSON a toJSON (PostCustomersCustomerSubscriptionsRequestBodyDefaultTaxRates'EmptyString) = "" instance Data.Aeson.Types.FromJSON.FromJSON PostCustomersCustomerSubscriptionsRequestBodyDefaultTaxRates'Variants where parseJSON val = if | val GHC.Classes.== "" -> GHC.Base.pure PostCustomersCustomerSubscriptionsRequestBodyDefaultTaxRates'EmptyString | GHC.Base.otherwise -> case (PostCustomersCustomerSubscriptionsRequestBodyDefaultTaxRates'ListTText 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\/customers\/{customer}\/subscriptions.POST.requestBody.content.application\/x-www-form-urlencoded.schema.properties.items.items@ in the specification. data PostCustomersCustomerSubscriptionsRequestBodyItems' = PostCustomersCustomerSubscriptionsRequestBodyItems' { -- | billing_thresholds postCustomersCustomerSubscriptionsRequestBodyItems'BillingThresholds :: (GHC.Maybe.Maybe PostCustomersCustomerSubscriptionsRequestBodyItems'BillingThresholds'Variants), -- | metadata postCustomersCustomerSubscriptionsRequestBodyItems'Metadata :: (GHC.Maybe.Maybe Data.Aeson.Types.Internal.Object), -- | price -- -- Constraints: -- -- * Maximum length of 5000 postCustomersCustomerSubscriptionsRequestBodyItems'Price :: (GHC.Maybe.Maybe Data.Text.Internal.Text), -- | price_data postCustomersCustomerSubscriptionsRequestBodyItems'PriceData :: (GHC.Maybe.Maybe PostCustomersCustomerSubscriptionsRequestBodyItems'PriceData'), -- | quantity postCustomersCustomerSubscriptionsRequestBodyItems'Quantity :: (GHC.Maybe.Maybe GHC.Types.Int), -- | tax_rates postCustomersCustomerSubscriptionsRequestBodyItems'TaxRates :: (GHC.Maybe.Maybe PostCustomersCustomerSubscriptionsRequestBodyItems'TaxRates'Variants) } deriving ( GHC.Show.Show, GHC.Classes.Eq ) instance Data.Aeson.Types.ToJSON.ToJSON PostCustomersCustomerSubscriptionsRequestBodyItems' where toJSON obj = Data.Aeson.Types.Internal.object ("billing_thresholds" Data.Aeson.Types.ToJSON..= postCustomersCustomerSubscriptionsRequestBodyItems'BillingThresholds obj : "metadata" Data.Aeson.Types.ToJSON..= postCustomersCustomerSubscriptionsRequestBodyItems'Metadata obj : "price" Data.Aeson.Types.ToJSON..= postCustomersCustomerSubscriptionsRequestBodyItems'Price obj : "price_data" Data.Aeson.Types.ToJSON..= postCustomersCustomerSubscriptionsRequestBodyItems'PriceData obj : "quantity" Data.Aeson.Types.ToJSON..= postCustomersCustomerSubscriptionsRequestBodyItems'Quantity obj : "tax_rates" Data.Aeson.Types.ToJSON..= postCustomersCustomerSubscriptionsRequestBodyItems'TaxRates obj : GHC.Base.mempty) toEncoding obj = Data.Aeson.Encoding.Internal.pairs (("billing_thresholds" Data.Aeson.Types.ToJSON..= postCustomersCustomerSubscriptionsRequestBodyItems'BillingThresholds obj) GHC.Base.<> (("metadata" Data.Aeson.Types.ToJSON..= postCustomersCustomerSubscriptionsRequestBodyItems'Metadata obj) GHC.Base.<> (("price" Data.Aeson.Types.ToJSON..= postCustomersCustomerSubscriptionsRequestBodyItems'Price obj) GHC.Base.<> (("price_data" Data.Aeson.Types.ToJSON..= postCustomersCustomerSubscriptionsRequestBodyItems'PriceData obj) GHC.Base.<> (("quantity" Data.Aeson.Types.ToJSON..= postCustomersCustomerSubscriptionsRequestBodyItems'Quantity obj) GHC.Base.<> ("tax_rates" Data.Aeson.Types.ToJSON..= postCustomersCustomerSubscriptionsRequestBodyItems'TaxRates obj)))))) instance Data.Aeson.Types.FromJSON.FromJSON PostCustomersCustomerSubscriptionsRequestBodyItems' where parseJSON = Data.Aeson.Types.FromJSON.withObject "PostCustomersCustomerSubscriptionsRequestBodyItems'" (\obj -> (((((GHC.Base.pure PostCustomersCustomerSubscriptionsRequestBodyItems' GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "billing_thresholds")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "metadata")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "price")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "price_data")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "quantity")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "tax_rates")) -- | Create a new 'PostCustomersCustomerSubscriptionsRequestBodyItems'' with all required fields. mkPostCustomersCustomerSubscriptionsRequestBodyItems' :: PostCustomersCustomerSubscriptionsRequestBodyItems' mkPostCustomersCustomerSubscriptionsRequestBodyItems' = PostCustomersCustomerSubscriptionsRequestBodyItems' { postCustomersCustomerSubscriptionsRequestBodyItems'BillingThresholds = GHC.Maybe.Nothing, postCustomersCustomerSubscriptionsRequestBodyItems'Metadata = GHC.Maybe.Nothing, postCustomersCustomerSubscriptionsRequestBodyItems'Price = GHC.Maybe.Nothing, postCustomersCustomerSubscriptionsRequestBodyItems'PriceData = GHC.Maybe.Nothing, postCustomersCustomerSubscriptionsRequestBodyItems'Quantity = GHC.Maybe.Nothing, postCustomersCustomerSubscriptionsRequestBodyItems'TaxRates = GHC.Maybe.Nothing } -- | Defines the object schema located at @paths.\/v1\/customers\/{customer}\/subscriptions.POST.requestBody.content.application\/x-www-form-urlencoded.schema.properties.items.items.properties.billing_thresholds.anyOf@ in the specification. data PostCustomersCustomerSubscriptionsRequestBodyItems'BillingThresholds'OneOf1 = PostCustomersCustomerSubscriptionsRequestBodyItems'BillingThresholds'OneOf1 { -- | usage_gte postCustomersCustomerSubscriptionsRequestBodyItems'BillingThresholds'OneOf1UsageGte :: GHC.Types.Int } deriving ( GHC.Show.Show, GHC.Classes.Eq ) instance Data.Aeson.Types.ToJSON.ToJSON PostCustomersCustomerSubscriptionsRequestBodyItems'BillingThresholds'OneOf1 where toJSON obj = Data.Aeson.Types.Internal.object ("usage_gte" Data.Aeson.Types.ToJSON..= postCustomersCustomerSubscriptionsRequestBodyItems'BillingThresholds'OneOf1UsageGte obj : GHC.Base.mempty) toEncoding obj = Data.Aeson.Encoding.Internal.pairs ("usage_gte" Data.Aeson.Types.ToJSON..= postCustomersCustomerSubscriptionsRequestBodyItems'BillingThresholds'OneOf1UsageGte obj) instance Data.Aeson.Types.FromJSON.FromJSON PostCustomersCustomerSubscriptionsRequestBodyItems'BillingThresholds'OneOf1 where parseJSON = Data.Aeson.Types.FromJSON.withObject "PostCustomersCustomerSubscriptionsRequestBodyItems'BillingThresholds'OneOf1" (\obj -> GHC.Base.pure PostCustomersCustomerSubscriptionsRequestBodyItems'BillingThresholds'OneOf1 GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..: "usage_gte")) -- | Create a new 'PostCustomersCustomerSubscriptionsRequestBodyItems'BillingThresholds'OneOf1' with all required fields. mkPostCustomersCustomerSubscriptionsRequestBodyItems'BillingThresholds'OneOf1 :: -- | 'postCustomersCustomerSubscriptionsRequestBodyItems'BillingThresholds'OneOf1UsageGte' GHC.Types.Int -> PostCustomersCustomerSubscriptionsRequestBodyItems'BillingThresholds'OneOf1 mkPostCustomersCustomerSubscriptionsRequestBodyItems'BillingThresholds'OneOf1 postCustomersCustomerSubscriptionsRequestBodyItems'BillingThresholds'OneOf1UsageGte = PostCustomersCustomerSubscriptionsRequestBodyItems'BillingThresholds'OneOf1 {postCustomersCustomerSubscriptionsRequestBodyItems'BillingThresholds'OneOf1UsageGte = postCustomersCustomerSubscriptionsRequestBodyItems'BillingThresholds'OneOf1UsageGte} -- | Defines the oneOf schema located at @paths.\/v1\/customers\/{customer}\/subscriptions.POST.requestBody.content.application\/x-www-form-urlencoded.schema.properties.items.items.properties.billing_thresholds.anyOf@ in the specification. data PostCustomersCustomerSubscriptionsRequestBodyItems'BillingThresholds'Variants = -- | Represents the JSON value @""@ PostCustomersCustomerSubscriptionsRequestBodyItems'BillingThresholds'EmptyString | PostCustomersCustomerSubscriptionsRequestBodyItems'BillingThresholds'PostCustomersCustomerSubscriptionsRequestBodyItems'BillingThresholds'OneOf1 PostCustomersCustomerSubscriptionsRequestBodyItems'BillingThresholds'OneOf1 deriving (GHC.Show.Show, GHC.Classes.Eq) instance Data.Aeson.Types.ToJSON.ToJSON PostCustomersCustomerSubscriptionsRequestBodyItems'BillingThresholds'Variants where toJSON (PostCustomersCustomerSubscriptionsRequestBodyItems'BillingThresholds'PostCustomersCustomerSubscriptionsRequestBodyItems'BillingThresholds'OneOf1 a) = Data.Aeson.Types.ToJSON.toJSON a toJSON (PostCustomersCustomerSubscriptionsRequestBodyItems'BillingThresholds'EmptyString) = "" instance Data.Aeson.Types.FromJSON.FromJSON PostCustomersCustomerSubscriptionsRequestBodyItems'BillingThresholds'Variants where parseJSON val = if | val GHC.Classes.== "" -> GHC.Base.pure PostCustomersCustomerSubscriptionsRequestBodyItems'BillingThresholds'EmptyString | GHC.Base.otherwise -> case (PostCustomersCustomerSubscriptionsRequestBodyItems'BillingThresholds'PostCustomersCustomerSubscriptionsRequestBodyItems'BillingThresholds'OneOf1 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\/customers\/{customer}\/subscriptions.POST.requestBody.content.application\/x-www-form-urlencoded.schema.properties.items.items.properties.price_data@ in the specification. data PostCustomersCustomerSubscriptionsRequestBodyItems'PriceData' = PostCustomersCustomerSubscriptionsRequestBodyItems'PriceData' { -- | currency postCustomersCustomerSubscriptionsRequestBodyItems'PriceData'Currency :: Data.Text.Internal.Text, -- | product -- -- Constraints: -- -- * Maximum length of 5000 postCustomersCustomerSubscriptionsRequestBodyItems'PriceData'Product :: Data.Text.Internal.Text, -- | recurring postCustomersCustomerSubscriptionsRequestBodyItems'PriceData'Recurring :: PostCustomersCustomerSubscriptionsRequestBodyItems'PriceData'Recurring', -- | tax_behavior postCustomersCustomerSubscriptionsRequestBodyItems'PriceData'TaxBehavior :: (GHC.Maybe.Maybe PostCustomersCustomerSubscriptionsRequestBodyItems'PriceData'TaxBehavior'), -- | unit_amount postCustomersCustomerSubscriptionsRequestBodyItems'PriceData'UnitAmount :: (GHC.Maybe.Maybe GHC.Types.Int), -- | unit_amount_decimal postCustomersCustomerSubscriptionsRequestBodyItems'PriceData'UnitAmountDecimal :: (GHC.Maybe.Maybe Data.Text.Internal.Text) } deriving ( GHC.Show.Show, GHC.Classes.Eq ) instance Data.Aeson.Types.ToJSON.ToJSON PostCustomersCustomerSubscriptionsRequestBodyItems'PriceData' where toJSON obj = Data.Aeson.Types.Internal.object ("currency" Data.Aeson.Types.ToJSON..= postCustomersCustomerSubscriptionsRequestBodyItems'PriceData'Currency obj : "product" Data.Aeson.Types.ToJSON..= postCustomersCustomerSubscriptionsRequestBodyItems'PriceData'Product obj : "recurring" Data.Aeson.Types.ToJSON..= postCustomersCustomerSubscriptionsRequestBodyItems'PriceData'Recurring obj : "tax_behavior" Data.Aeson.Types.ToJSON..= postCustomersCustomerSubscriptionsRequestBodyItems'PriceData'TaxBehavior obj : "unit_amount" Data.Aeson.Types.ToJSON..= postCustomersCustomerSubscriptionsRequestBodyItems'PriceData'UnitAmount obj : "unit_amount_decimal" Data.Aeson.Types.ToJSON..= postCustomersCustomerSubscriptionsRequestBodyItems'PriceData'UnitAmountDecimal obj : GHC.Base.mempty) toEncoding obj = Data.Aeson.Encoding.Internal.pairs (("currency" Data.Aeson.Types.ToJSON..= postCustomersCustomerSubscriptionsRequestBodyItems'PriceData'Currency obj) GHC.Base.<> (("product" Data.Aeson.Types.ToJSON..= postCustomersCustomerSubscriptionsRequestBodyItems'PriceData'Product obj) GHC.Base.<> (("recurring" Data.Aeson.Types.ToJSON..= postCustomersCustomerSubscriptionsRequestBodyItems'PriceData'Recurring obj) GHC.Base.<> (("tax_behavior" Data.Aeson.Types.ToJSON..= postCustomersCustomerSubscriptionsRequestBodyItems'PriceData'TaxBehavior obj) GHC.Base.<> (("unit_amount" Data.Aeson.Types.ToJSON..= postCustomersCustomerSubscriptionsRequestBodyItems'PriceData'UnitAmount obj) GHC.Base.<> ("unit_amount_decimal" Data.Aeson.Types.ToJSON..= postCustomersCustomerSubscriptionsRequestBodyItems'PriceData'UnitAmountDecimal obj)))))) instance Data.Aeson.Types.FromJSON.FromJSON PostCustomersCustomerSubscriptionsRequestBodyItems'PriceData' where parseJSON = Data.Aeson.Types.FromJSON.withObject "PostCustomersCustomerSubscriptionsRequestBodyItems'PriceData'" (\obj -> (((((GHC.Base.pure PostCustomersCustomerSubscriptionsRequestBodyItems'PriceData' GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..: "currency")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..: "product")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..: "recurring")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "tax_behavior")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "unit_amount")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "unit_amount_decimal")) -- | Create a new 'PostCustomersCustomerSubscriptionsRequestBodyItems'PriceData'' with all required fields. mkPostCustomersCustomerSubscriptionsRequestBodyItems'PriceData' :: -- | 'postCustomersCustomerSubscriptionsRequestBodyItems'PriceData'Currency' Data.Text.Internal.Text -> -- | 'postCustomersCustomerSubscriptionsRequestBodyItems'PriceData'Product' Data.Text.Internal.Text -> -- | 'postCustomersCustomerSubscriptionsRequestBodyItems'PriceData'Recurring' PostCustomersCustomerSubscriptionsRequestBodyItems'PriceData'Recurring' -> PostCustomersCustomerSubscriptionsRequestBodyItems'PriceData' mkPostCustomersCustomerSubscriptionsRequestBodyItems'PriceData' postCustomersCustomerSubscriptionsRequestBodyItems'PriceData'Currency postCustomersCustomerSubscriptionsRequestBodyItems'PriceData'Product postCustomersCustomerSubscriptionsRequestBodyItems'PriceData'Recurring = PostCustomersCustomerSubscriptionsRequestBodyItems'PriceData' { postCustomersCustomerSubscriptionsRequestBodyItems'PriceData'Currency = postCustomersCustomerSubscriptionsRequestBodyItems'PriceData'Currency, postCustomersCustomerSubscriptionsRequestBodyItems'PriceData'Product = postCustomersCustomerSubscriptionsRequestBodyItems'PriceData'Product, postCustomersCustomerSubscriptionsRequestBodyItems'PriceData'Recurring = postCustomersCustomerSubscriptionsRequestBodyItems'PriceData'Recurring, postCustomersCustomerSubscriptionsRequestBodyItems'PriceData'TaxBehavior = GHC.Maybe.Nothing, postCustomersCustomerSubscriptionsRequestBodyItems'PriceData'UnitAmount = GHC.Maybe.Nothing, postCustomersCustomerSubscriptionsRequestBodyItems'PriceData'UnitAmountDecimal = GHC.Maybe.Nothing } -- | Defines the object schema located at @paths.\/v1\/customers\/{customer}\/subscriptions.POST.requestBody.content.application\/x-www-form-urlencoded.schema.properties.items.items.properties.price_data.properties.recurring@ in the specification. data PostCustomersCustomerSubscriptionsRequestBodyItems'PriceData'Recurring' = PostCustomersCustomerSubscriptionsRequestBodyItems'PriceData'Recurring' { -- | interval postCustomersCustomerSubscriptionsRequestBodyItems'PriceData'Recurring'Interval :: PostCustomersCustomerSubscriptionsRequestBodyItems'PriceData'Recurring'Interval', -- | interval_count postCustomersCustomerSubscriptionsRequestBodyItems'PriceData'Recurring'IntervalCount :: (GHC.Maybe.Maybe GHC.Types.Int) } deriving ( GHC.Show.Show, GHC.Classes.Eq ) instance Data.Aeson.Types.ToJSON.ToJSON PostCustomersCustomerSubscriptionsRequestBodyItems'PriceData'Recurring' where toJSON obj = Data.Aeson.Types.Internal.object ("interval" Data.Aeson.Types.ToJSON..= postCustomersCustomerSubscriptionsRequestBodyItems'PriceData'Recurring'Interval obj : "interval_count" Data.Aeson.Types.ToJSON..= postCustomersCustomerSubscriptionsRequestBodyItems'PriceData'Recurring'IntervalCount obj : GHC.Base.mempty) toEncoding obj = Data.Aeson.Encoding.Internal.pairs (("interval" Data.Aeson.Types.ToJSON..= postCustomersCustomerSubscriptionsRequestBodyItems'PriceData'Recurring'Interval obj) GHC.Base.<> ("interval_count" Data.Aeson.Types.ToJSON..= postCustomersCustomerSubscriptionsRequestBodyItems'PriceData'Recurring'IntervalCount obj)) instance Data.Aeson.Types.FromJSON.FromJSON PostCustomersCustomerSubscriptionsRequestBodyItems'PriceData'Recurring' where parseJSON = Data.Aeson.Types.FromJSON.withObject "PostCustomersCustomerSubscriptionsRequestBodyItems'PriceData'Recurring'" (\obj -> (GHC.Base.pure PostCustomersCustomerSubscriptionsRequestBodyItems'PriceData'Recurring' GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..: "interval")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "interval_count")) -- | Create a new 'PostCustomersCustomerSubscriptionsRequestBodyItems'PriceData'Recurring'' with all required fields. mkPostCustomersCustomerSubscriptionsRequestBodyItems'PriceData'Recurring' :: -- | 'postCustomersCustomerSubscriptionsRequestBodyItems'PriceData'Recurring'Interval' PostCustomersCustomerSubscriptionsRequestBodyItems'PriceData'Recurring'Interval' -> PostCustomersCustomerSubscriptionsRequestBodyItems'PriceData'Recurring' mkPostCustomersCustomerSubscriptionsRequestBodyItems'PriceData'Recurring' postCustomersCustomerSubscriptionsRequestBodyItems'PriceData'Recurring'Interval = PostCustomersCustomerSubscriptionsRequestBodyItems'PriceData'Recurring' { postCustomersCustomerSubscriptionsRequestBodyItems'PriceData'Recurring'Interval = postCustomersCustomerSubscriptionsRequestBodyItems'PriceData'Recurring'Interval, postCustomersCustomerSubscriptionsRequestBodyItems'PriceData'Recurring'IntervalCount = GHC.Maybe.Nothing } -- | Defines the enum schema located at @paths.\/v1\/customers\/{customer}\/subscriptions.POST.requestBody.content.application\/x-www-form-urlencoded.schema.properties.items.items.properties.price_data.properties.recurring.properties.interval@ in the specification. data PostCustomersCustomerSubscriptionsRequestBodyItems'PriceData'Recurring'Interval' = -- | This case is used if the value encountered during decoding does not match any of the provided cases in the specification. PostCustomersCustomerSubscriptionsRequestBodyItems'PriceData'Recurring'Interval'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. PostCustomersCustomerSubscriptionsRequestBodyItems'PriceData'Recurring'Interval'Typed Data.Text.Internal.Text | -- | Represents the JSON value @"day"@ PostCustomersCustomerSubscriptionsRequestBodyItems'PriceData'Recurring'Interval'EnumDay | -- | Represents the JSON value @"month"@ PostCustomersCustomerSubscriptionsRequestBodyItems'PriceData'Recurring'Interval'EnumMonth | -- | Represents the JSON value @"week"@ PostCustomersCustomerSubscriptionsRequestBodyItems'PriceData'Recurring'Interval'EnumWeek | -- | Represents the JSON value @"year"@ PostCustomersCustomerSubscriptionsRequestBodyItems'PriceData'Recurring'Interval'EnumYear deriving (GHC.Show.Show, GHC.Classes.Eq) instance Data.Aeson.Types.ToJSON.ToJSON PostCustomersCustomerSubscriptionsRequestBodyItems'PriceData'Recurring'Interval' where toJSON (PostCustomersCustomerSubscriptionsRequestBodyItems'PriceData'Recurring'Interval'Other val) = val toJSON (PostCustomersCustomerSubscriptionsRequestBodyItems'PriceData'Recurring'Interval'Typed val) = Data.Aeson.Types.ToJSON.toJSON val toJSON (PostCustomersCustomerSubscriptionsRequestBodyItems'PriceData'Recurring'Interval'EnumDay) = "day" toJSON (PostCustomersCustomerSubscriptionsRequestBodyItems'PriceData'Recurring'Interval'EnumMonth) = "month" toJSON (PostCustomersCustomerSubscriptionsRequestBodyItems'PriceData'Recurring'Interval'EnumWeek) = "week" toJSON (PostCustomersCustomerSubscriptionsRequestBodyItems'PriceData'Recurring'Interval'EnumYear) = "year" instance Data.Aeson.Types.FromJSON.FromJSON PostCustomersCustomerSubscriptionsRequestBodyItems'PriceData'Recurring'Interval' where parseJSON val = GHC.Base.pure ( if | val GHC.Classes.== "day" -> PostCustomersCustomerSubscriptionsRequestBodyItems'PriceData'Recurring'Interval'EnumDay | val GHC.Classes.== "month" -> PostCustomersCustomerSubscriptionsRequestBodyItems'PriceData'Recurring'Interval'EnumMonth | val GHC.Classes.== "week" -> PostCustomersCustomerSubscriptionsRequestBodyItems'PriceData'Recurring'Interval'EnumWeek | val GHC.Classes.== "year" -> PostCustomersCustomerSubscriptionsRequestBodyItems'PriceData'Recurring'Interval'EnumYear | GHC.Base.otherwise -> PostCustomersCustomerSubscriptionsRequestBodyItems'PriceData'Recurring'Interval'Other val ) -- | Defines the enum schema located at @paths.\/v1\/customers\/{customer}\/subscriptions.POST.requestBody.content.application\/x-www-form-urlencoded.schema.properties.items.items.properties.price_data.properties.tax_behavior@ in the specification. data PostCustomersCustomerSubscriptionsRequestBodyItems'PriceData'TaxBehavior' = -- | This case is used if the value encountered during decoding does not match any of the provided cases in the specification. PostCustomersCustomerSubscriptionsRequestBodyItems'PriceData'TaxBehavior'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. PostCustomersCustomerSubscriptionsRequestBodyItems'PriceData'TaxBehavior'Typed Data.Text.Internal.Text | -- | Represents the JSON value @"exclusive"@ PostCustomersCustomerSubscriptionsRequestBodyItems'PriceData'TaxBehavior'EnumExclusive | -- | Represents the JSON value @"inclusive"@ PostCustomersCustomerSubscriptionsRequestBodyItems'PriceData'TaxBehavior'EnumInclusive | -- | Represents the JSON value @"unspecified"@ PostCustomersCustomerSubscriptionsRequestBodyItems'PriceData'TaxBehavior'EnumUnspecified deriving (GHC.Show.Show, GHC.Classes.Eq) instance Data.Aeson.Types.ToJSON.ToJSON PostCustomersCustomerSubscriptionsRequestBodyItems'PriceData'TaxBehavior' where toJSON (PostCustomersCustomerSubscriptionsRequestBodyItems'PriceData'TaxBehavior'Other val) = val toJSON (PostCustomersCustomerSubscriptionsRequestBodyItems'PriceData'TaxBehavior'Typed val) = Data.Aeson.Types.ToJSON.toJSON val toJSON (PostCustomersCustomerSubscriptionsRequestBodyItems'PriceData'TaxBehavior'EnumExclusive) = "exclusive" toJSON (PostCustomersCustomerSubscriptionsRequestBodyItems'PriceData'TaxBehavior'EnumInclusive) = "inclusive" toJSON (PostCustomersCustomerSubscriptionsRequestBodyItems'PriceData'TaxBehavior'EnumUnspecified) = "unspecified" instance Data.Aeson.Types.FromJSON.FromJSON PostCustomersCustomerSubscriptionsRequestBodyItems'PriceData'TaxBehavior' where parseJSON val = GHC.Base.pure ( if | val GHC.Classes.== "exclusive" -> PostCustomersCustomerSubscriptionsRequestBodyItems'PriceData'TaxBehavior'EnumExclusive | val GHC.Classes.== "inclusive" -> PostCustomersCustomerSubscriptionsRequestBodyItems'PriceData'TaxBehavior'EnumInclusive | val GHC.Classes.== "unspecified" -> PostCustomersCustomerSubscriptionsRequestBodyItems'PriceData'TaxBehavior'EnumUnspecified | GHC.Base.otherwise -> PostCustomersCustomerSubscriptionsRequestBodyItems'PriceData'TaxBehavior'Other val ) -- | Defines the oneOf schema located at @paths.\/v1\/customers\/{customer}\/subscriptions.POST.requestBody.content.application\/x-www-form-urlencoded.schema.properties.items.items.properties.tax_rates.anyOf@ in the specification. data PostCustomersCustomerSubscriptionsRequestBodyItems'TaxRates'Variants = -- | Represents the JSON value @""@ PostCustomersCustomerSubscriptionsRequestBodyItems'TaxRates'EmptyString | PostCustomersCustomerSubscriptionsRequestBodyItems'TaxRates'ListTText ([Data.Text.Internal.Text]) deriving (GHC.Show.Show, GHC.Classes.Eq) instance Data.Aeson.Types.ToJSON.ToJSON PostCustomersCustomerSubscriptionsRequestBodyItems'TaxRates'Variants where toJSON (PostCustomersCustomerSubscriptionsRequestBodyItems'TaxRates'ListTText a) = Data.Aeson.Types.ToJSON.toJSON a toJSON (PostCustomersCustomerSubscriptionsRequestBodyItems'TaxRates'EmptyString) = "" instance Data.Aeson.Types.FromJSON.FromJSON PostCustomersCustomerSubscriptionsRequestBodyItems'TaxRates'Variants where parseJSON val = if | val GHC.Classes.== "" -> GHC.Base.pure PostCustomersCustomerSubscriptionsRequestBodyItems'TaxRates'EmptyString | GHC.Base.otherwise -> case (PostCustomersCustomerSubscriptionsRequestBodyItems'TaxRates'ListTText 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 oneOf schema located at @paths.\/v1\/customers\/{customer}\/subscriptions.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 PostCustomersCustomerSubscriptionsRequestBodyMetadata'Variants = -- | Represents the JSON value @""@ PostCustomersCustomerSubscriptionsRequestBodyMetadata'EmptyString | PostCustomersCustomerSubscriptionsRequestBodyMetadata'Object Data.Aeson.Types.Internal.Object deriving (GHC.Show.Show, GHC.Classes.Eq) instance Data.Aeson.Types.ToJSON.ToJSON PostCustomersCustomerSubscriptionsRequestBodyMetadata'Variants where toJSON (PostCustomersCustomerSubscriptionsRequestBodyMetadata'Object a) = Data.Aeson.Types.ToJSON.toJSON a toJSON (PostCustomersCustomerSubscriptionsRequestBodyMetadata'EmptyString) = "" instance Data.Aeson.Types.FromJSON.FromJSON PostCustomersCustomerSubscriptionsRequestBodyMetadata'Variants where parseJSON val = if | val GHC.Classes.== "" -> GHC.Base.pure PostCustomersCustomerSubscriptionsRequestBodyMetadata'EmptyString | GHC.Base.otherwise -> case (PostCustomersCustomerSubscriptionsRequestBodyMetadata'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 enum schema located at @paths.\/v1\/customers\/{customer}\/subscriptions.POST.requestBody.content.application\/x-www-form-urlencoded.schema.properties.payment_behavior@ in the specification. -- -- Use \`allow_incomplete\` to create subscriptions with \`status=incomplete\` if the first invoice cannot be paid. Creating subscriptions with this status allows you to manage scenarios where additional user actions are needed to pay a subscription\'s invoice. For example, SCA regulation may require 3DS authentication to complete payment. See the [SCA Migration Guide](https:\/\/stripe.com\/docs\/billing\/migration\/strong-customer-authentication) for Billing to learn more. This is the default behavior. -- -- Use \`default_incomplete\` to create Subscriptions with \`status=incomplete\` when the first invoice requires payment, otherwise start as active. Subscriptions transition to \`status=active\` when successfully confirming the payment intent on the first invoice. This allows simpler management of scenarios where additional user actions are needed to pay a subscription’s invoice. Such as failed payments, [SCA regulation](https:\/\/stripe.com\/docs\/billing\/migration\/strong-customer-authentication), or collecting a mandate for a bank debit payment method. If the payment intent is not confirmed within 23 hours subscriptions transition to \`status=expired_incomplete\`, which is a terminal state. -- -- Use \`error_if_incomplete\` if you want Stripe to return an HTTP 402 status code if a subscription\'s first invoice cannot be paid. For example, if a payment method requires 3DS authentication due to SCA regulation and further user action is needed, this parameter does not create a subscription and returns an error instead. This was the default behavior for API versions prior to 2019-03-14. See the [changelog](https:\/\/stripe.com\/docs\/upgrades\#2019-03-14) to learn more. -- -- \`pending_if_incomplete\` is only used with updates and cannot be passed when creating a subscription. data PostCustomersCustomerSubscriptionsRequestBodyPaymentBehavior' = -- | This case is used if the value encountered during decoding does not match any of the provided cases in the specification. PostCustomersCustomerSubscriptionsRequestBodyPaymentBehavior'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. PostCustomersCustomerSubscriptionsRequestBodyPaymentBehavior'Typed Data.Text.Internal.Text | -- | Represents the JSON value @"allow_incomplete"@ PostCustomersCustomerSubscriptionsRequestBodyPaymentBehavior'EnumAllowIncomplete | -- | Represents the JSON value @"default_incomplete"@ PostCustomersCustomerSubscriptionsRequestBodyPaymentBehavior'EnumDefaultIncomplete | -- | Represents the JSON value @"error_if_incomplete"@ PostCustomersCustomerSubscriptionsRequestBodyPaymentBehavior'EnumErrorIfIncomplete | -- | Represents the JSON value @"pending_if_incomplete"@ PostCustomersCustomerSubscriptionsRequestBodyPaymentBehavior'EnumPendingIfIncomplete deriving (GHC.Show.Show, GHC.Classes.Eq) instance Data.Aeson.Types.ToJSON.ToJSON PostCustomersCustomerSubscriptionsRequestBodyPaymentBehavior' where toJSON (PostCustomersCustomerSubscriptionsRequestBodyPaymentBehavior'Other val) = val toJSON (PostCustomersCustomerSubscriptionsRequestBodyPaymentBehavior'Typed val) = Data.Aeson.Types.ToJSON.toJSON val toJSON (PostCustomersCustomerSubscriptionsRequestBodyPaymentBehavior'EnumAllowIncomplete) = "allow_incomplete" toJSON (PostCustomersCustomerSubscriptionsRequestBodyPaymentBehavior'EnumDefaultIncomplete) = "default_incomplete" toJSON (PostCustomersCustomerSubscriptionsRequestBodyPaymentBehavior'EnumErrorIfIncomplete) = "error_if_incomplete" toJSON (PostCustomersCustomerSubscriptionsRequestBodyPaymentBehavior'EnumPendingIfIncomplete) = "pending_if_incomplete" instance Data.Aeson.Types.FromJSON.FromJSON PostCustomersCustomerSubscriptionsRequestBodyPaymentBehavior' where parseJSON val = GHC.Base.pure ( if | val GHC.Classes.== "allow_incomplete" -> PostCustomersCustomerSubscriptionsRequestBodyPaymentBehavior'EnumAllowIncomplete | val GHC.Classes.== "default_incomplete" -> PostCustomersCustomerSubscriptionsRequestBodyPaymentBehavior'EnumDefaultIncomplete | val GHC.Classes.== "error_if_incomplete" -> PostCustomersCustomerSubscriptionsRequestBodyPaymentBehavior'EnumErrorIfIncomplete | val GHC.Classes.== "pending_if_incomplete" -> PostCustomersCustomerSubscriptionsRequestBodyPaymentBehavior'EnumPendingIfIncomplete | GHC.Base.otherwise -> PostCustomersCustomerSubscriptionsRequestBodyPaymentBehavior'Other val ) -- | Defines the object schema located at @paths.\/v1\/customers\/{customer}\/subscriptions.POST.requestBody.content.application\/x-www-form-urlencoded.schema.properties.pending_invoice_item_interval.anyOf@ in the specification. data PostCustomersCustomerSubscriptionsRequestBodyPendingInvoiceItemInterval'OneOf1 = PostCustomersCustomerSubscriptionsRequestBodyPendingInvoiceItemInterval'OneOf1 { -- | interval postCustomersCustomerSubscriptionsRequestBodyPendingInvoiceItemInterval'OneOf1Interval :: PostCustomersCustomerSubscriptionsRequestBodyPendingInvoiceItemInterval'OneOf1Interval', -- | interval_count postCustomersCustomerSubscriptionsRequestBodyPendingInvoiceItemInterval'OneOf1IntervalCount :: (GHC.Maybe.Maybe GHC.Types.Int) } deriving ( GHC.Show.Show, GHC.Classes.Eq ) instance Data.Aeson.Types.ToJSON.ToJSON PostCustomersCustomerSubscriptionsRequestBodyPendingInvoiceItemInterval'OneOf1 where toJSON obj = Data.Aeson.Types.Internal.object ("interval" Data.Aeson.Types.ToJSON..= postCustomersCustomerSubscriptionsRequestBodyPendingInvoiceItemInterval'OneOf1Interval obj : "interval_count" Data.Aeson.Types.ToJSON..= postCustomersCustomerSubscriptionsRequestBodyPendingInvoiceItemInterval'OneOf1IntervalCount obj : GHC.Base.mempty) toEncoding obj = Data.Aeson.Encoding.Internal.pairs (("interval" Data.Aeson.Types.ToJSON..= postCustomersCustomerSubscriptionsRequestBodyPendingInvoiceItemInterval'OneOf1Interval obj) GHC.Base.<> ("interval_count" Data.Aeson.Types.ToJSON..= postCustomersCustomerSubscriptionsRequestBodyPendingInvoiceItemInterval'OneOf1IntervalCount obj)) instance Data.Aeson.Types.FromJSON.FromJSON PostCustomersCustomerSubscriptionsRequestBodyPendingInvoiceItemInterval'OneOf1 where parseJSON = Data.Aeson.Types.FromJSON.withObject "PostCustomersCustomerSubscriptionsRequestBodyPendingInvoiceItemInterval'OneOf1" (\obj -> (GHC.Base.pure PostCustomersCustomerSubscriptionsRequestBodyPendingInvoiceItemInterval'OneOf1 GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..: "interval")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "interval_count")) -- | Create a new 'PostCustomersCustomerSubscriptionsRequestBodyPendingInvoiceItemInterval'OneOf1' with all required fields. mkPostCustomersCustomerSubscriptionsRequestBodyPendingInvoiceItemInterval'OneOf1 :: -- | 'postCustomersCustomerSubscriptionsRequestBodyPendingInvoiceItemInterval'OneOf1Interval' PostCustomersCustomerSubscriptionsRequestBodyPendingInvoiceItemInterval'OneOf1Interval' -> PostCustomersCustomerSubscriptionsRequestBodyPendingInvoiceItemInterval'OneOf1 mkPostCustomersCustomerSubscriptionsRequestBodyPendingInvoiceItemInterval'OneOf1 postCustomersCustomerSubscriptionsRequestBodyPendingInvoiceItemInterval'OneOf1Interval = PostCustomersCustomerSubscriptionsRequestBodyPendingInvoiceItemInterval'OneOf1 { postCustomersCustomerSubscriptionsRequestBodyPendingInvoiceItemInterval'OneOf1Interval = postCustomersCustomerSubscriptionsRequestBodyPendingInvoiceItemInterval'OneOf1Interval, postCustomersCustomerSubscriptionsRequestBodyPendingInvoiceItemInterval'OneOf1IntervalCount = GHC.Maybe.Nothing } -- | Defines the enum schema located at @paths.\/v1\/customers\/{customer}\/subscriptions.POST.requestBody.content.application\/x-www-form-urlencoded.schema.properties.pending_invoice_item_interval.anyOf.properties.interval@ in the specification. data PostCustomersCustomerSubscriptionsRequestBodyPendingInvoiceItemInterval'OneOf1Interval' = -- | This case is used if the value encountered during decoding does not match any of the provided cases in the specification. PostCustomersCustomerSubscriptionsRequestBodyPendingInvoiceItemInterval'OneOf1Interval'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. PostCustomersCustomerSubscriptionsRequestBodyPendingInvoiceItemInterval'OneOf1Interval'Typed Data.Text.Internal.Text | -- | Represents the JSON value @"day"@ PostCustomersCustomerSubscriptionsRequestBodyPendingInvoiceItemInterval'OneOf1Interval'EnumDay | -- | Represents the JSON value @"month"@ PostCustomersCustomerSubscriptionsRequestBodyPendingInvoiceItemInterval'OneOf1Interval'EnumMonth | -- | Represents the JSON value @"week"@ PostCustomersCustomerSubscriptionsRequestBodyPendingInvoiceItemInterval'OneOf1Interval'EnumWeek | -- | Represents the JSON value @"year"@ PostCustomersCustomerSubscriptionsRequestBodyPendingInvoiceItemInterval'OneOf1Interval'EnumYear deriving (GHC.Show.Show, GHC.Classes.Eq) instance Data.Aeson.Types.ToJSON.ToJSON PostCustomersCustomerSubscriptionsRequestBodyPendingInvoiceItemInterval'OneOf1Interval' where toJSON (PostCustomersCustomerSubscriptionsRequestBodyPendingInvoiceItemInterval'OneOf1Interval'Other val) = val toJSON (PostCustomersCustomerSubscriptionsRequestBodyPendingInvoiceItemInterval'OneOf1Interval'Typed val) = Data.Aeson.Types.ToJSON.toJSON val toJSON (PostCustomersCustomerSubscriptionsRequestBodyPendingInvoiceItemInterval'OneOf1Interval'EnumDay) = "day" toJSON (PostCustomersCustomerSubscriptionsRequestBodyPendingInvoiceItemInterval'OneOf1Interval'EnumMonth) = "month" toJSON (PostCustomersCustomerSubscriptionsRequestBodyPendingInvoiceItemInterval'OneOf1Interval'EnumWeek) = "week" toJSON (PostCustomersCustomerSubscriptionsRequestBodyPendingInvoiceItemInterval'OneOf1Interval'EnumYear) = "year" instance Data.Aeson.Types.FromJSON.FromJSON PostCustomersCustomerSubscriptionsRequestBodyPendingInvoiceItemInterval'OneOf1Interval' where parseJSON val = GHC.Base.pure ( if | val GHC.Classes.== "day" -> PostCustomersCustomerSubscriptionsRequestBodyPendingInvoiceItemInterval'OneOf1Interval'EnumDay | val GHC.Classes.== "month" -> PostCustomersCustomerSubscriptionsRequestBodyPendingInvoiceItemInterval'OneOf1Interval'EnumMonth | val GHC.Classes.== "week" -> PostCustomersCustomerSubscriptionsRequestBodyPendingInvoiceItemInterval'OneOf1Interval'EnumWeek | val GHC.Classes.== "year" -> PostCustomersCustomerSubscriptionsRequestBodyPendingInvoiceItemInterval'OneOf1Interval'EnumYear | GHC.Base.otherwise -> PostCustomersCustomerSubscriptionsRequestBodyPendingInvoiceItemInterval'OneOf1Interval'Other val ) -- | Defines the oneOf schema located at @paths.\/v1\/customers\/{customer}\/subscriptions.POST.requestBody.content.application\/x-www-form-urlencoded.schema.properties.pending_invoice_item_interval.anyOf@ in the specification. -- -- Specifies an interval for how often to bill for any pending invoice items. It is analogous to calling [Create an invoice](https:\/\/stripe.com\/docs\/api\#create_invoice) for the given subscription at the specified interval. data PostCustomersCustomerSubscriptionsRequestBodyPendingInvoiceItemInterval'Variants = -- | Represents the JSON value @""@ PostCustomersCustomerSubscriptionsRequestBodyPendingInvoiceItemInterval'EmptyString | PostCustomersCustomerSubscriptionsRequestBodyPendingInvoiceItemInterval'PostCustomersCustomerSubscriptionsRequestBodyPendingInvoiceItemInterval'OneOf1 PostCustomersCustomerSubscriptionsRequestBodyPendingInvoiceItemInterval'OneOf1 deriving (GHC.Show.Show, GHC.Classes.Eq) instance Data.Aeson.Types.ToJSON.ToJSON PostCustomersCustomerSubscriptionsRequestBodyPendingInvoiceItemInterval'Variants where toJSON (PostCustomersCustomerSubscriptionsRequestBodyPendingInvoiceItemInterval'PostCustomersCustomerSubscriptionsRequestBodyPendingInvoiceItemInterval'OneOf1 a) = Data.Aeson.Types.ToJSON.toJSON a toJSON (PostCustomersCustomerSubscriptionsRequestBodyPendingInvoiceItemInterval'EmptyString) = "" instance Data.Aeson.Types.FromJSON.FromJSON PostCustomersCustomerSubscriptionsRequestBodyPendingInvoiceItemInterval'Variants where parseJSON val = if | val GHC.Classes.== "" -> GHC.Base.pure PostCustomersCustomerSubscriptionsRequestBodyPendingInvoiceItemInterval'EmptyString | GHC.Base.otherwise -> case (PostCustomersCustomerSubscriptionsRequestBodyPendingInvoiceItemInterval'PostCustomersCustomerSubscriptionsRequestBodyPendingInvoiceItemInterval'OneOf1 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\/customers\/{customer}\/subscriptions.POST.requestBody.content.application\/x-www-form-urlencoded.schema.properties.proration_behavior@ in the specification. -- -- Determines how to handle [prorations](https:\/\/stripe.com\/docs\/subscriptions\/billing-cycle\#prorations) resulting from the \`billing_cycle_anchor\`. Valid values are \`create_prorations\` or \`none\`. -- -- Passing \`create_prorations\` will cause proration invoice items to be created when applicable. Prorations can be disabled by passing \`none\`. If no value is passed, the default is \`create_prorations\`. data PostCustomersCustomerSubscriptionsRequestBodyProrationBehavior' = -- | This case is used if the value encountered during decoding does not match any of the provided cases in the specification. PostCustomersCustomerSubscriptionsRequestBodyProrationBehavior'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. PostCustomersCustomerSubscriptionsRequestBodyProrationBehavior'Typed Data.Text.Internal.Text | -- | Represents the JSON value @"always_invoice"@ PostCustomersCustomerSubscriptionsRequestBodyProrationBehavior'EnumAlwaysInvoice | -- | Represents the JSON value @"create_prorations"@ PostCustomersCustomerSubscriptionsRequestBodyProrationBehavior'EnumCreateProrations | -- | Represents the JSON value @"none"@ PostCustomersCustomerSubscriptionsRequestBodyProrationBehavior'EnumNone deriving (GHC.Show.Show, GHC.Classes.Eq) instance Data.Aeson.Types.ToJSON.ToJSON PostCustomersCustomerSubscriptionsRequestBodyProrationBehavior' where toJSON (PostCustomersCustomerSubscriptionsRequestBodyProrationBehavior'Other val) = val toJSON (PostCustomersCustomerSubscriptionsRequestBodyProrationBehavior'Typed val) = Data.Aeson.Types.ToJSON.toJSON val toJSON (PostCustomersCustomerSubscriptionsRequestBodyProrationBehavior'EnumAlwaysInvoice) = "always_invoice" toJSON (PostCustomersCustomerSubscriptionsRequestBodyProrationBehavior'EnumCreateProrations) = "create_prorations" toJSON (PostCustomersCustomerSubscriptionsRequestBodyProrationBehavior'EnumNone) = "none" instance Data.Aeson.Types.FromJSON.FromJSON PostCustomersCustomerSubscriptionsRequestBodyProrationBehavior' where parseJSON val = GHC.Base.pure ( if | val GHC.Classes.== "always_invoice" -> PostCustomersCustomerSubscriptionsRequestBodyProrationBehavior'EnumAlwaysInvoice | val GHC.Classes.== "create_prorations" -> PostCustomersCustomerSubscriptionsRequestBodyProrationBehavior'EnumCreateProrations | val GHC.Classes.== "none" -> PostCustomersCustomerSubscriptionsRequestBodyProrationBehavior'EnumNone | GHC.Base.otherwise -> PostCustomersCustomerSubscriptionsRequestBodyProrationBehavior'Other val ) -- | Defines the object schema located at @paths.\/v1\/customers\/{customer}\/subscriptions.POST.requestBody.content.application\/x-www-form-urlencoded.schema.properties.transfer_data@ in the specification. -- -- If specified, the funds from the subscription\'s invoices will be transferred to the destination and the ID of the resulting transfers will be found on the resulting charges. data PostCustomersCustomerSubscriptionsRequestBodyTransferData' = PostCustomersCustomerSubscriptionsRequestBodyTransferData' { -- | amount_percent postCustomersCustomerSubscriptionsRequestBodyTransferData'AmountPercent :: (GHC.Maybe.Maybe GHC.Types.Double), -- | destination postCustomersCustomerSubscriptionsRequestBodyTransferData'Destination :: Data.Text.Internal.Text } deriving ( GHC.Show.Show, GHC.Classes.Eq ) instance Data.Aeson.Types.ToJSON.ToJSON PostCustomersCustomerSubscriptionsRequestBodyTransferData' where toJSON obj = Data.Aeson.Types.Internal.object ("amount_percent" Data.Aeson.Types.ToJSON..= postCustomersCustomerSubscriptionsRequestBodyTransferData'AmountPercent obj : "destination" Data.Aeson.Types.ToJSON..= postCustomersCustomerSubscriptionsRequestBodyTransferData'Destination obj : GHC.Base.mempty) toEncoding obj = Data.Aeson.Encoding.Internal.pairs (("amount_percent" Data.Aeson.Types.ToJSON..= postCustomersCustomerSubscriptionsRequestBodyTransferData'AmountPercent obj) GHC.Base.<> ("destination" Data.Aeson.Types.ToJSON..= postCustomersCustomerSubscriptionsRequestBodyTransferData'Destination obj)) instance Data.Aeson.Types.FromJSON.FromJSON PostCustomersCustomerSubscriptionsRequestBodyTransferData' where parseJSON = Data.Aeson.Types.FromJSON.withObject "PostCustomersCustomerSubscriptionsRequestBodyTransferData'" (\obj -> (GHC.Base.pure PostCustomersCustomerSubscriptionsRequestBodyTransferData' GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "amount_percent")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..: "destination")) -- | Create a new 'PostCustomersCustomerSubscriptionsRequestBodyTransferData'' with all required fields. mkPostCustomersCustomerSubscriptionsRequestBodyTransferData' :: -- | 'postCustomersCustomerSubscriptionsRequestBodyTransferData'Destination' Data.Text.Internal.Text -> PostCustomersCustomerSubscriptionsRequestBodyTransferData' mkPostCustomersCustomerSubscriptionsRequestBodyTransferData' postCustomersCustomerSubscriptionsRequestBodyTransferData'Destination = PostCustomersCustomerSubscriptionsRequestBodyTransferData' { postCustomersCustomerSubscriptionsRequestBodyTransferData'AmountPercent = GHC.Maybe.Nothing, postCustomersCustomerSubscriptionsRequestBodyTransferData'Destination = postCustomersCustomerSubscriptionsRequestBodyTransferData'Destination } -- | Defines the oneOf schema located at @paths.\/v1\/customers\/{customer}\/subscriptions.POST.requestBody.content.application\/x-www-form-urlencoded.schema.properties.trial_end.anyOf@ in the specification. -- -- Unix timestamp representing the end of the trial period the customer will get before being charged for the first time. This will always overwrite any trials that might apply via a subscribed plan. If set, trial_end will override the default trial period of the plan the customer is being subscribed to. The special value \`now\` can be provided to end the customer\'s trial immediately. Can be at most two years from \`billing_cycle_anchor\`. data PostCustomersCustomerSubscriptionsRequestBodyTrialEnd'Variants = -- | Represents the JSON value @"now"@ PostCustomersCustomerSubscriptionsRequestBodyTrialEnd'Now | PostCustomersCustomerSubscriptionsRequestBodyTrialEnd'Int GHC.Types.Int deriving (GHC.Show.Show, GHC.Classes.Eq) instance Data.Aeson.Types.ToJSON.ToJSON PostCustomersCustomerSubscriptionsRequestBodyTrialEnd'Variants where toJSON (PostCustomersCustomerSubscriptionsRequestBodyTrialEnd'Int a) = Data.Aeson.Types.ToJSON.toJSON a toJSON (PostCustomersCustomerSubscriptionsRequestBodyTrialEnd'Now) = "now" instance Data.Aeson.Types.FromJSON.FromJSON PostCustomersCustomerSubscriptionsRequestBodyTrialEnd'Variants where parseJSON val = if | val GHC.Classes.== "now" -> GHC.Base.pure PostCustomersCustomerSubscriptionsRequestBodyTrialEnd'Now | GHC.Base.otherwise -> case (PostCustomersCustomerSubscriptionsRequestBodyTrialEnd'Int 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 -- | Represents a response of the operation 'postCustomersCustomerSubscriptions'. -- -- 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), 'PostCustomersCustomerSubscriptionsResponseError' is used. data PostCustomersCustomerSubscriptionsResponse = -- | Means either no matching case available or a parse error PostCustomersCustomerSubscriptionsResponseError GHC.Base.String | -- | Successful response. PostCustomersCustomerSubscriptionsResponse200 Subscription | -- | Error response. PostCustomersCustomerSubscriptionsResponseDefault Error deriving (GHC.Show.Show, GHC.Classes.Eq)