{-# 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 postSubscriptions module StripeAPI.Operations.PostSubscriptions 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/subscriptions -- -- \

Creates a new subscription on an existing customer. Each customer can have up to 500 active or scheduled subscriptions.\<\/p> postSubscriptions :: forall m. StripeAPI.Common.MonadHTTP m => -- | The request body to send PostSubscriptionsRequestBody -> -- | Monadic computation which returns the result of the operation StripeAPI.Common.ClientT m (Network.HTTP.Client.Types.Response PostSubscriptionsResponse) postSubscriptions body = GHC.Base.fmap ( \response_0 -> GHC.Base.fmap ( Data.Either.either PostSubscriptionsResponseError 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) -> PostSubscriptionsResponse200 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) -> PostSubscriptionsResponseDefault 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/subscriptions") GHC.Base.mempty (GHC.Maybe.Just body) StripeAPI.Common.RequestBodyEncodingFormData) -- | Defines the object schema located at @paths.\/v1\/subscriptions.POST.requestBody.content.application\/x-www-form-urlencoded.schema@ in the specification. data PostSubscriptionsRequestBody = PostSubscriptionsRequestBody { -- | 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. postSubscriptionsRequestBodyAddInvoiceItems :: (GHC.Maybe.Maybe ([PostSubscriptionsRequestBodyAddInvoiceItems'])), -- | 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). postSubscriptionsRequestBodyApplicationFeePercent :: (GHC.Maybe.Maybe GHC.Types.Double), -- | automatic_tax: Automatic tax settings for this subscription. postSubscriptionsRequestBodyAutomaticTax :: (GHC.Maybe.Maybe PostSubscriptionsRequestBodyAutomaticTax'), -- | 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. postSubscriptionsRequestBodyBackdateStartDate :: (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. postSubscriptionsRequestBodyBillingCycleAnchor :: (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. postSubscriptionsRequestBodyBillingThresholds :: (GHC.Maybe.Maybe PostSubscriptionsRequestBodyBillingThresholds'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. postSubscriptionsRequestBodyCancelAt :: (GHC.Maybe.Maybe GHC.Types.Int), -- | cancel_at_period_end: Boolean indicating whether this subscription should cancel at the end of the current period. postSubscriptionsRequestBodyCancelAtPeriodEnd :: (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\`. postSubscriptionsRequestBodyCollectionMethod :: (GHC.Maybe.Maybe PostSubscriptionsRequestBodyCollectionMethod'), -- | 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 postSubscriptionsRequestBodyCoupon :: (GHC.Maybe.Maybe Data.Text.Internal.Text), -- | customer: The identifier of the customer to subscribe. -- -- Constraints: -- -- * Maximum length of 5000 postSubscriptionsRequestBodyCustomer :: 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\`. postSubscriptionsRequestBodyDaysUntilDue :: (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 postSubscriptionsRequestBodyDefaultPaymentMethod :: (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 postSubscriptionsRequestBodyDefaultSource :: (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. postSubscriptionsRequestBodyDefaultTaxRates :: (GHC.Maybe.Maybe PostSubscriptionsRequestBodyDefaultTaxRates'Variants), -- | expand: Specifies which fields in the response should be expanded. postSubscriptionsRequestBodyExpand :: (GHC.Maybe.Maybe ([Data.Text.Internal.Text])), -- | items: A list of up to 20 subscription items, each with an attached price. postSubscriptionsRequestBodyItems :: (GHC.Maybe.Maybe ([PostSubscriptionsRequestBodyItems'])), -- | 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\`. postSubscriptionsRequestBodyMetadata :: (GHC.Maybe.Maybe PostSubscriptionsRequestBodyMetadata'Variants), -- | off_session: Indicates if a customer is on or off-session while an invoice payment is attempted. postSubscriptionsRequestBodyOffSession :: (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. postSubscriptionsRequestBodyPaymentBehavior :: (GHC.Maybe.Maybe PostSubscriptionsRequestBodyPaymentBehavior'), -- | 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. postSubscriptionsRequestBodyPendingInvoiceItemInterval :: (GHC.Maybe.Maybe PostSubscriptionsRequestBodyPendingInvoiceItemInterval'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 postSubscriptionsRequestBodyPromotionCode :: (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\`. postSubscriptionsRequestBodyProrationBehavior :: (GHC.Maybe.Maybe PostSubscriptionsRequestBodyProrationBehavior'), -- | 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. postSubscriptionsRequestBodyTransferData :: (GHC.Maybe.Maybe PostSubscriptionsRequestBodyTransferData'), -- | 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\`. postSubscriptionsRequestBodyTrialEnd :: (GHC.Maybe.Maybe PostSubscriptionsRequestBodyTrialEnd'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. postSubscriptionsRequestBodyTrialFromPlan :: (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. postSubscriptionsRequestBodyTrialPeriodDays :: (GHC.Maybe.Maybe GHC.Types.Int) } deriving ( GHC.Show.Show, GHC.Classes.Eq ) instance Data.Aeson.Types.ToJSON.ToJSON PostSubscriptionsRequestBody where toJSON obj = Data.Aeson.Types.Internal.object ("add_invoice_items" Data.Aeson.Types.ToJSON..= postSubscriptionsRequestBodyAddInvoiceItems obj : "application_fee_percent" Data.Aeson.Types.ToJSON..= postSubscriptionsRequestBodyApplicationFeePercent obj : "automatic_tax" Data.Aeson.Types.ToJSON..= postSubscriptionsRequestBodyAutomaticTax obj : "backdate_start_date" Data.Aeson.Types.ToJSON..= postSubscriptionsRequestBodyBackdateStartDate obj : "billing_cycle_anchor" Data.Aeson.Types.ToJSON..= postSubscriptionsRequestBodyBillingCycleAnchor obj : "billing_thresholds" Data.Aeson.Types.ToJSON..= postSubscriptionsRequestBodyBillingThresholds obj : "cancel_at" Data.Aeson.Types.ToJSON..= postSubscriptionsRequestBodyCancelAt obj : "cancel_at_period_end" Data.Aeson.Types.ToJSON..= postSubscriptionsRequestBodyCancelAtPeriodEnd obj : "collection_method" Data.Aeson.Types.ToJSON..= postSubscriptionsRequestBodyCollectionMethod obj : "coupon" Data.Aeson.Types.ToJSON..= postSubscriptionsRequestBodyCoupon obj : "customer" Data.Aeson.Types.ToJSON..= postSubscriptionsRequestBodyCustomer obj : "days_until_due" Data.Aeson.Types.ToJSON..= postSubscriptionsRequestBodyDaysUntilDue obj : "default_payment_method" Data.Aeson.Types.ToJSON..= postSubscriptionsRequestBodyDefaultPaymentMethod obj : "default_source" Data.Aeson.Types.ToJSON..= postSubscriptionsRequestBodyDefaultSource obj : "default_tax_rates" Data.Aeson.Types.ToJSON..= postSubscriptionsRequestBodyDefaultTaxRates obj : "expand" Data.Aeson.Types.ToJSON..= postSubscriptionsRequestBodyExpand obj : "items" Data.Aeson.Types.ToJSON..= postSubscriptionsRequestBodyItems obj : "metadata" Data.Aeson.Types.ToJSON..= postSubscriptionsRequestBodyMetadata obj : "off_session" Data.Aeson.Types.ToJSON..= postSubscriptionsRequestBodyOffSession obj : "payment_behavior" Data.Aeson.Types.ToJSON..= postSubscriptionsRequestBodyPaymentBehavior obj : "pending_invoice_item_interval" Data.Aeson.Types.ToJSON..= postSubscriptionsRequestBodyPendingInvoiceItemInterval obj : "promotion_code" Data.Aeson.Types.ToJSON..= postSubscriptionsRequestBodyPromotionCode obj : "proration_behavior" Data.Aeson.Types.ToJSON..= postSubscriptionsRequestBodyProrationBehavior obj : "transfer_data" Data.Aeson.Types.ToJSON..= postSubscriptionsRequestBodyTransferData obj : "trial_end" Data.Aeson.Types.ToJSON..= postSubscriptionsRequestBodyTrialEnd obj : "trial_from_plan" Data.Aeson.Types.ToJSON..= postSubscriptionsRequestBodyTrialFromPlan obj : "trial_period_days" Data.Aeson.Types.ToJSON..= postSubscriptionsRequestBodyTrialPeriodDays obj : GHC.Base.mempty) toEncoding obj = Data.Aeson.Encoding.Internal.pairs (("add_invoice_items" Data.Aeson.Types.ToJSON..= postSubscriptionsRequestBodyAddInvoiceItems obj) GHC.Base.<> (("application_fee_percent" Data.Aeson.Types.ToJSON..= postSubscriptionsRequestBodyApplicationFeePercent obj) GHC.Base.<> (("automatic_tax" Data.Aeson.Types.ToJSON..= postSubscriptionsRequestBodyAutomaticTax obj) GHC.Base.<> (("backdate_start_date" Data.Aeson.Types.ToJSON..= postSubscriptionsRequestBodyBackdateStartDate obj) GHC.Base.<> (("billing_cycle_anchor" Data.Aeson.Types.ToJSON..= postSubscriptionsRequestBodyBillingCycleAnchor obj) GHC.Base.<> (("billing_thresholds" Data.Aeson.Types.ToJSON..= postSubscriptionsRequestBodyBillingThresholds obj) GHC.Base.<> (("cancel_at" Data.Aeson.Types.ToJSON..= postSubscriptionsRequestBodyCancelAt obj) GHC.Base.<> (("cancel_at_period_end" Data.Aeson.Types.ToJSON..= postSubscriptionsRequestBodyCancelAtPeriodEnd obj) GHC.Base.<> (("collection_method" Data.Aeson.Types.ToJSON..= postSubscriptionsRequestBodyCollectionMethod obj) GHC.Base.<> (("coupon" Data.Aeson.Types.ToJSON..= postSubscriptionsRequestBodyCoupon obj) GHC.Base.<> (("customer" Data.Aeson.Types.ToJSON..= postSubscriptionsRequestBodyCustomer obj) GHC.Base.<> (("days_until_due" Data.Aeson.Types.ToJSON..= postSubscriptionsRequestBodyDaysUntilDue obj) GHC.Base.<> (("default_payment_method" Data.Aeson.Types.ToJSON..= postSubscriptionsRequestBodyDefaultPaymentMethod obj) GHC.Base.<> (("default_source" Data.Aeson.Types.ToJSON..= postSubscriptionsRequestBodyDefaultSource obj) GHC.Base.<> (("default_tax_rates" Data.Aeson.Types.ToJSON..= postSubscriptionsRequestBodyDefaultTaxRates obj) GHC.Base.<> (("expand" Data.Aeson.Types.ToJSON..= postSubscriptionsRequestBodyExpand obj) GHC.Base.<> (("items" Data.Aeson.Types.ToJSON..= postSubscriptionsRequestBodyItems obj) GHC.Base.<> (("metadata" Data.Aeson.Types.ToJSON..= postSubscriptionsRequestBodyMetadata obj) GHC.Base.<> (("off_session" Data.Aeson.Types.ToJSON..= postSubscriptionsRequestBodyOffSession obj) GHC.Base.<> (("payment_behavior" Data.Aeson.Types.ToJSON..= postSubscriptionsRequestBodyPaymentBehavior obj) GHC.Base.<> (("pending_invoice_item_interval" Data.Aeson.Types.ToJSON..= postSubscriptionsRequestBodyPendingInvoiceItemInterval obj) GHC.Base.<> (("promotion_code" Data.Aeson.Types.ToJSON..= postSubscriptionsRequestBodyPromotionCode obj) GHC.Base.<> (("proration_behavior" Data.Aeson.Types.ToJSON..= postSubscriptionsRequestBodyProrationBehavior obj) GHC.Base.<> (("transfer_data" Data.Aeson.Types.ToJSON..= postSubscriptionsRequestBodyTransferData obj) GHC.Base.<> (("trial_end" Data.Aeson.Types.ToJSON..= postSubscriptionsRequestBodyTrialEnd obj) GHC.Base.<> (("trial_from_plan" Data.Aeson.Types.ToJSON..= postSubscriptionsRequestBodyTrialFromPlan obj) GHC.Base.<> ("trial_period_days" Data.Aeson.Types.ToJSON..= postSubscriptionsRequestBodyTrialPeriodDays obj))))))))))))))))))))))))))) instance Data.Aeson.Types.FromJSON.FromJSON PostSubscriptionsRequestBody where parseJSON = Data.Aeson.Types.FromJSON.withObject "PostSubscriptionsRequestBody" (\obj -> ((((((((((((((((((((((((((GHC.Base.pure PostSubscriptionsRequestBody 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..: "customer")) 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 'PostSubscriptionsRequestBody' with all required fields. mkPostSubscriptionsRequestBody :: -- | 'postSubscriptionsRequestBodyCustomer' Data.Text.Internal.Text -> PostSubscriptionsRequestBody mkPostSubscriptionsRequestBody postSubscriptionsRequestBodyCustomer = PostSubscriptionsRequestBody { postSubscriptionsRequestBodyAddInvoiceItems = GHC.Maybe.Nothing, postSubscriptionsRequestBodyApplicationFeePercent = GHC.Maybe.Nothing, postSubscriptionsRequestBodyAutomaticTax = GHC.Maybe.Nothing, postSubscriptionsRequestBodyBackdateStartDate = GHC.Maybe.Nothing, postSubscriptionsRequestBodyBillingCycleAnchor = GHC.Maybe.Nothing, postSubscriptionsRequestBodyBillingThresholds = GHC.Maybe.Nothing, postSubscriptionsRequestBodyCancelAt = GHC.Maybe.Nothing, postSubscriptionsRequestBodyCancelAtPeriodEnd = GHC.Maybe.Nothing, postSubscriptionsRequestBodyCollectionMethod = GHC.Maybe.Nothing, postSubscriptionsRequestBodyCoupon = GHC.Maybe.Nothing, postSubscriptionsRequestBodyCustomer = postSubscriptionsRequestBodyCustomer, postSubscriptionsRequestBodyDaysUntilDue = GHC.Maybe.Nothing, postSubscriptionsRequestBodyDefaultPaymentMethod = GHC.Maybe.Nothing, postSubscriptionsRequestBodyDefaultSource = GHC.Maybe.Nothing, postSubscriptionsRequestBodyDefaultTaxRates = GHC.Maybe.Nothing, postSubscriptionsRequestBodyExpand = GHC.Maybe.Nothing, postSubscriptionsRequestBodyItems = GHC.Maybe.Nothing, postSubscriptionsRequestBodyMetadata = GHC.Maybe.Nothing, postSubscriptionsRequestBodyOffSession = GHC.Maybe.Nothing, postSubscriptionsRequestBodyPaymentBehavior = GHC.Maybe.Nothing, postSubscriptionsRequestBodyPendingInvoiceItemInterval = GHC.Maybe.Nothing, postSubscriptionsRequestBodyPromotionCode = GHC.Maybe.Nothing, postSubscriptionsRequestBodyProrationBehavior = GHC.Maybe.Nothing, postSubscriptionsRequestBodyTransferData = GHC.Maybe.Nothing, postSubscriptionsRequestBodyTrialEnd = GHC.Maybe.Nothing, postSubscriptionsRequestBodyTrialFromPlan = GHC.Maybe.Nothing, postSubscriptionsRequestBodyTrialPeriodDays = GHC.Maybe.Nothing } -- | Defines the object schema located at @paths.\/v1\/subscriptions.POST.requestBody.content.application\/x-www-form-urlencoded.schema.properties.add_invoice_items.items@ in the specification. data PostSubscriptionsRequestBodyAddInvoiceItems' = PostSubscriptionsRequestBodyAddInvoiceItems' { -- | price -- -- Constraints: -- -- * Maximum length of 5000 postSubscriptionsRequestBodyAddInvoiceItems'Price :: (GHC.Maybe.Maybe Data.Text.Internal.Text), -- | price_data postSubscriptionsRequestBodyAddInvoiceItems'PriceData :: (GHC.Maybe.Maybe PostSubscriptionsRequestBodyAddInvoiceItems'PriceData'), -- | quantity postSubscriptionsRequestBodyAddInvoiceItems'Quantity :: (GHC.Maybe.Maybe GHC.Types.Int), -- | tax_rates postSubscriptionsRequestBodyAddInvoiceItems'TaxRates :: (GHC.Maybe.Maybe PostSubscriptionsRequestBodyAddInvoiceItems'TaxRates'Variants) } deriving ( GHC.Show.Show, GHC.Classes.Eq ) instance Data.Aeson.Types.ToJSON.ToJSON PostSubscriptionsRequestBodyAddInvoiceItems' where toJSON obj = Data.Aeson.Types.Internal.object ("price" Data.Aeson.Types.ToJSON..= postSubscriptionsRequestBodyAddInvoiceItems'Price obj : "price_data" Data.Aeson.Types.ToJSON..= postSubscriptionsRequestBodyAddInvoiceItems'PriceData obj : "quantity" Data.Aeson.Types.ToJSON..= postSubscriptionsRequestBodyAddInvoiceItems'Quantity obj : "tax_rates" Data.Aeson.Types.ToJSON..= postSubscriptionsRequestBodyAddInvoiceItems'TaxRates obj : GHC.Base.mempty) toEncoding obj = Data.Aeson.Encoding.Internal.pairs (("price" Data.Aeson.Types.ToJSON..= postSubscriptionsRequestBodyAddInvoiceItems'Price obj) GHC.Base.<> (("price_data" Data.Aeson.Types.ToJSON..= postSubscriptionsRequestBodyAddInvoiceItems'PriceData obj) GHC.Base.<> (("quantity" Data.Aeson.Types.ToJSON..= postSubscriptionsRequestBodyAddInvoiceItems'Quantity obj) GHC.Base.<> ("tax_rates" Data.Aeson.Types.ToJSON..= postSubscriptionsRequestBodyAddInvoiceItems'TaxRates obj)))) instance Data.Aeson.Types.FromJSON.FromJSON PostSubscriptionsRequestBodyAddInvoiceItems' where parseJSON = Data.Aeson.Types.FromJSON.withObject "PostSubscriptionsRequestBodyAddInvoiceItems'" (\obj -> (((GHC.Base.pure PostSubscriptionsRequestBodyAddInvoiceItems' 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 'PostSubscriptionsRequestBodyAddInvoiceItems'' with all required fields. mkPostSubscriptionsRequestBodyAddInvoiceItems' :: PostSubscriptionsRequestBodyAddInvoiceItems' mkPostSubscriptionsRequestBodyAddInvoiceItems' = PostSubscriptionsRequestBodyAddInvoiceItems' { postSubscriptionsRequestBodyAddInvoiceItems'Price = GHC.Maybe.Nothing, postSubscriptionsRequestBodyAddInvoiceItems'PriceData = GHC.Maybe.Nothing, postSubscriptionsRequestBodyAddInvoiceItems'Quantity = GHC.Maybe.Nothing, postSubscriptionsRequestBodyAddInvoiceItems'TaxRates = GHC.Maybe.Nothing } -- | Defines the object schema located at @paths.\/v1\/subscriptions.POST.requestBody.content.application\/x-www-form-urlencoded.schema.properties.add_invoice_items.items.properties.price_data@ in the specification. data PostSubscriptionsRequestBodyAddInvoiceItems'PriceData' = PostSubscriptionsRequestBodyAddInvoiceItems'PriceData' { -- | currency postSubscriptionsRequestBodyAddInvoiceItems'PriceData'Currency :: Data.Text.Internal.Text, -- | product -- -- Constraints: -- -- * Maximum length of 5000 postSubscriptionsRequestBodyAddInvoiceItems'PriceData'Product :: Data.Text.Internal.Text, -- | tax_behavior postSubscriptionsRequestBodyAddInvoiceItems'PriceData'TaxBehavior :: (GHC.Maybe.Maybe PostSubscriptionsRequestBodyAddInvoiceItems'PriceData'TaxBehavior'), -- | unit_amount postSubscriptionsRequestBodyAddInvoiceItems'PriceData'UnitAmount :: (GHC.Maybe.Maybe GHC.Types.Int), -- | unit_amount_decimal postSubscriptionsRequestBodyAddInvoiceItems'PriceData'UnitAmountDecimal :: (GHC.Maybe.Maybe Data.Text.Internal.Text) } deriving ( GHC.Show.Show, GHC.Classes.Eq ) instance Data.Aeson.Types.ToJSON.ToJSON PostSubscriptionsRequestBodyAddInvoiceItems'PriceData' where toJSON obj = Data.Aeson.Types.Internal.object ("currency" Data.Aeson.Types.ToJSON..= postSubscriptionsRequestBodyAddInvoiceItems'PriceData'Currency obj : "product" Data.Aeson.Types.ToJSON..= postSubscriptionsRequestBodyAddInvoiceItems'PriceData'Product obj : "tax_behavior" Data.Aeson.Types.ToJSON..= postSubscriptionsRequestBodyAddInvoiceItems'PriceData'TaxBehavior obj : "unit_amount" Data.Aeson.Types.ToJSON..= postSubscriptionsRequestBodyAddInvoiceItems'PriceData'UnitAmount obj : "unit_amount_decimal" Data.Aeson.Types.ToJSON..= postSubscriptionsRequestBodyAddInvoiceItems'PriceData'UnitAmountDecimal obj : GHC.Base.mempty) toEncoding obj = Data.Aeson.Encoding.Internal.pairs (("currency" Data.Aeson.Types.ToJSON..= postSubscriptionsRequestBodyAddInvoiceItems'PriceData'Currency obj) GHC.Base.<> (("product" Data.Aeson.Types.ToJSON..= postSubscriptionsRequestBodyAddInvoiceItems'PriceData'Product obj) GHC.Base.<> (("tax_behavior" Data.Aeson.Types.ToJSON..= postSubscriptionsRequestBodyAddInvoiceItems'PriceData'TaxBehavior obj) GHC.Base.<> (("unit_amount" Data.Aeson.Types.ToJSON..= postSubscriptionsRequestBodyAddInvoiceItems'PriceData'UnitAmount obj) GHC.Base.<> ("unit_amount_decimal" Data.Aeson.Types.ToJSON..= postSubscriptionsRequestBodyAddInvoiceItems'PriceData'UnitAmountDecimal obj))))) instance Data.Aeson.Types.FromJSON.FromJSON PostSubscriptionsRequestBodyAddInvoiceItems'PriceData' where parseJSON = Data.Aeson.Types.FromJSON.withObject "PostSubscriptionsRequestBodyAddInvoiceItems'PriceData'" (\obj -> ((((GHC.Base.pure PostSubscriptionsRequestBodyAddInvoiceItems'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 'PostSubscriptionsRequestBodyAddInvoiceItems'PriceData'' with all required fields. mkPostSubscriptionsRequestBodyAddInvoiceItems'PriceData' :: -- | 'postSubscriptionsRequestBodyAddInvoiceItems'PriceData'Currency' Data.Text.Internal.Text -> -- | 'postSubscriptionsRequestBodyAddInvoiceItems'PriceData'Product' Data.Text.Internal.Text -> PostSubscriptionsRequestBodyAddInvoiceItems'PriceData' mkPostSubscriptionsRequestBodyAddInvoiceItems'PriceData' postSubscriptionsRequestBodyAddInvoiceItems'PriceData'Currency postSubscriptionsRequestBodyAddInvoiceItems'PriceData'Product = PostSubscriptionsRequestBodyAddInvoiceItems'PriceData' { postSubscriptionsRequestBodyAddInvoiceItems'PriceData'Currency = postSubscriptionsRequestBodyAddInvoiceItems'PriceData'Currency, postSubscriptionsRequestBodyAddInvoiceItems'PriceData'Product = postSubscriptionsRequestBodyAddInvoiceItems'PriceData'Product, postSubscriptionsRequestBodyAddInvoiceItems'PriceData'TaxBehavior = GHC.Maybe.Nothing, postSubscriptionsRequestBodyAddInvoiceItems'PriceData'UnitAmount = GHC.Maybe.Nothing, postSubscriptionsRequestBodyAddInvoiceItems'PriceData'UnitAmountDecimal = GHC.Maybe.Nothing } -- | Defines the enum schema located at @paths.\/v1\/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 PostSubscriptionsRequestBodyAddInvoiceItems'PriceData'TaxBehavior' = -- | This case is used if the value encountered during decoding does not match any of the provided cases in the specification. PostSubscriptionsRequestBodyAddInvoiceItems'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. PostSubscriptionsRequestBodyAddInvoiceItems'PriceData'TaxBehavior'Typed Data.Text.Internal.Text | -- | Represents the JSON value @"exclusive"@ PostSubscriptionsRequestBodyAddInvoiceItems'PriceData'TaxBehavior'EnumExclusive | -- | Represents the JSON value @"inclusive"@ PostSubscriptionsRequestBodyAddInvoiceItems'PriceData'TaxBehavior'EnumInclusive | -- | Represents the JSON value @"unspecified"@ PostSubscriptionsRequestBodyAddInvoiceItems'PriceData'TaxBehavior'EnumUnspecified deriving (GHC.Show.Show, GHC.Classes.Eq) instance Data.Aeson.Types.ToJSON.ToJSON PostSubscriptionsRequestBodyAddInvoiceItems'PriceData'TaxBehavior' where toJSON (PostSubscriptionsRequestBodyAddInvoiceItems'PriceData'TaxBehavior'Other val) = val toJSON (PostSubscriptionsRequestBodyAddInvoiceItems'PriceData'TaxBehavior'Typed val) = Data.Aeson.Types.ToJSON.toJSON val toJSON (PostSubscriptionsRequestBodyAddInvoiceItems'PriceData'TaxBehavior'EnumExclusive) = "exclusive" toJSON (PostSubscriptionsRequestBodyAddInvoiceItems'PriceData'TaxBehavior'EnumInclusive) = "inclusive" toJSON (PostSubscriptionsRequestBodyAddInvoiceItems'PriceData'TaxBehavior'EnumUnspecified) = "unspecified" instance Data.Aeson.Types.FromJSON.FromJSON PostSubscriptionsRequestBodyAddInvoiceItems'PriceData'TaxBehavior' where parseJSON val = GHC.Base.pure ( if | val GHC.Classes.== "exclusive" -> PostSubscriptionsRequestBodyAddInvoiceItems'PriceData'TaxBehavior'EnumExclusive | val GHC.Classes.== "inclusive" -> PostSubscriptionsRequestBodyAddInvoiceItems'PriceData'TaxBehavior'EnumInclusive | val GHC.Classes.== "unspecified" -> PostSubscriptionsRequestBodyAddInvoiceItems'PriceData'TaxBehavior'EnumUnspecified | GHC.Base.otherwise -> PostSubscriptionsRequestBodyAddInvoiceItems'PriceData'TaxBehavior'Other val ) -- | Defines the oneOf schema located at @paths.\/v1\/subscriptions.POST.requestBody.content.application\/x-www-form-urlencoded.schema.properties.add_invoice_items.items.properties.tax_rates.anyOf@ in the specification. data PostSubscriptionsRequestBodyAddInvoiceItems'TaxRates'Variants = -- | Represents the JSON value @""@ PostSubscriptionsRequestBodyAddInvoiceItems'TaxRates'EmptyString | PostSubscriptionsRequestBodyAddInvoiceItems'TaxRates'ListTText ([Data.Text.Internal.Text]) deriving (GHC.Show.Show, GHC.Classes.Eq) instance Data.Aeson.Types.ToJSON.ToJSON PostSubscriptionsRequestBodyAddInvoiceItems'TaxRates'Variants where toJSON (PostSubscriptionsRequestBodyAddInvoiceItems'TaxRates'ListTText a) = Data.Aeson.Types.ToJSON.toJSON a toJSON (PostSubscriptionsRequestBodyAddInvoiceItems'TaxRates'EmptyString) = "" instance Data.Aeson.Types.FromJSON.FromJSON PostSubscriptionsRequestBodyAddInvoiceItems'TaxRates'Variants where parseJSON val = if | val GHC.Classes.== "" -> GHC.Base.pure PostSubscriptionsRequestBodyAddInvoiceItems'TaxRates'EmptyString | GHC.Base.otherwise -> case (PostSubscriptionsRequestBodyAddInvoiceItems'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\/subscriptions.POST.requestBody.content.application\/x-www-form-urlencoded.schema.properties.automatic_tax@ in the specification. -- -- Automatic tax settings for this subscription. data PostSubscriptionsRequestBodyAutomaticTax' = PostSubscriptionsRequestBodyAutomaticTax' { -- | enabled postSubscriptionsRequestBodyAutomaticTax'Enabled :: GHC.Types.Bool } deriving ( GHC.Show.Show, GHC.Classes.Eq ) instance Data.Aeson.Types.ToJSON.ToJSON PostSubscriptionsRequestBodyAutomaticTax' where toJSON obj = Data.Aeson.Types.Internal.object ("enabled" Data.Aeson.Types.ToJSON..= postSubscriptionsRequestBodyAutomaticTax'Enabled obj : GHC.Base.mempty) toEncoding obj = Data.Aeson.Encoding.Internal.pairs ("enabled" Data.Aeson.Types.ToJSON..= postSubscriptionsRequestBodyAutomaticTax'Enabled obj) instance Data.Aeson.Types.FromJSON.FromJSON PostSubscriptionsRequestBodyAutomaticTax' where parseJSON = Data.Aeson.Types.FromJSON.withObject "PostSubscriptionsRequestBodyAutomaticTax'" (\obj -> GHC.Base.pure PostSubscriptionsRequestBodyAutomaticTax' GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..: "enabled")) -- | Create a new 'PostSubscriptionsRequestBodyAutomaticTax'' with all required fields. mkPostSubscriptionsRequestBodyAutomaticTax' :: -- | 'postSubscriptionsRequestBodyAutomaticTax'Enabled' GHC.Types.Bool -> PostSubscriptionsRequestBodyAutomaticTax' mkPostSubscriptionsRequestBodyAutomaticTax' postSubscriptionsRequestBodyAutomaticTax'Enabled = PostSubscriptionsRequestBodyAutomaticTax' {postSubscriptionsRequestBodyAutomaticTax'Enabled = postSubscriptionsRequestBodyAutomaticTax'Enabled} -- | Defines the object schema located at @paths.\/v1\/subscriptions.POST.requestBody.content.application\/x-www-form-urlencoded.schema.properties.billing_thresholds.anyOf@ in the specification. data PostSubscriptionsRequestBodyBillingThresholds'OneOf1 = PostSubscriptionsRequestBodyBillingThresholds'OneOf1 { -- | amount_gte postSubscriptionsRequestBodyBillingThresholds'OneOf1AmountGte :: (GHC.Maybe.Maybe GHC.Types.Int), -- | reset_billing_cycle_anchor postSubscriptionsRequestBodyBillingThresholds'OneOf1ResetBillingCycleAnchor :: (GHC.Maybe.Maybe GHC.Types.Bool) } deriving ( GHC.Show.Show, GHC.Classes.Eq ) instance Data.Aeson.Types.ToJSON.ToJSON PostSubscriptionsRequestBodyBillingThresholds'OneOf1 where toJSON obj = Data.Aeson.Types.Internal.object ("amount_gte" Data.Aeson.Types.ToJSON..= postSubscriptionsRequestBodyBillingThresholds'OneOf1AmountGte obj : "reset_billing_cycle_anchor" Data.Aeson.Types.ToJSON..= postSubscriptionsRequestBodyBillingThresholds'OneOf1ResetBillingCycleAnchor obj : GHC.Base.mempty) toEncoding obj = Data.Aeson.Encoding.Internal.pairs (("amount_gte" Data.Aeson.Types.ToJSON..= postSubscriptionsRequestBodyBillingThresholds'OneOf1AmountGte obj) GHC.Base.<> ("reset_billing_cycle_anchor" Data.Aeson.Types.ToJSON..= postSubscriptionsRequestBodyBillingThresholds'OneOf1ResetBillingCycleAnchor obj)) instance Data.Aeson.Types.FromJSON.FromJSON PostSubscriptionsRequestBodyBillingThresholds'OneOf1 where parseJSON = Data.Aeson.Types.FromJSON.withObject "PostSubscriptionsRequestBodyBillingThresholds'OneOf1" (\obj -> (GHC.Base.pure PostSubscriptionsRequestBodyBillingThresholds'OneOf1 GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "amount_gte")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "reset_billing_cycle_anchor")) -- | Create a new 'PostSubscriptionsRequestBodyBillingThresholds'OneOf1' with all required fields. mkPostSubscriptionsRequestBodyBillingThresholds'OneOf1 :: PostSubscriptionsRequestBodyBillingThresholds'OneOf1 mkPostSubscriptionsRequestBodyBillingThresholds'OneOf1 = PostSubscriptionsRequestBodyBillingThresholds'OneOf1 { postSubscriptionsRequestBodyBillingThresholds'OneOf1AmountGte = GHC.Maybe.Nothing, postSubscriptionsRequestBodyBillingThresholds'OneOf1ResetBillingCycleAnchor = GHC.Maybe.Nothing } -- | Defines the oneOf schema located at @paths.\/v1\/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 PostSubscriptionsRequestBodyBillingThresholds'Variants = -- | Represents the JSON value @""@ PostSubscriptionsRequestBodyBillingThresholds'EmptyString | PostSubscriptionsRequestBodyBillingThresholds'PostSubscriptionsRequestBodyBillingThresholds'OneOf1 PostSubscriptionsRequestBodyBillingThresholds'OneOf1 deriving (GHC.Show.Show, GHC.Classes.Eq) instance Data.Aeson.Types.ToJSON.ToJSON PostSubscriptionsRequestBodyBillingThresholds'Variants where toJSON (PostSubscriptionsRequestBodyBillingThresholds'PostSubscriptionsRequestBodyBillingThresholds'OneOf1 a) = Data.Aeson.Types.ToJSON.toJSON a toJSON (PostSubscriptionsRequestBodyBillingThresholds'EmptyString) = "" instance Data.Aeson.Types.FromJSON.FromJSON PostSubscriptionsRequestBodyBillingThresholds'Variants where parseJSON val = if | val GHC.Classes.== "" -> GHC.Base.pure PostSubscriptionsRequestBodyBillingThresholds'EmptyString | GHC.Base.otherwise -> case (PostSubscriptionsRequestBodyBillingThresholds'PostSubscriptionsRequestBodyBillingThresholds'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\/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 PostSubscriptionsRequestBodyCollectionMethod' = -- | This case is used if the value encountered during decoding does not match any of the provided cases in the specification. PostSubscriptionsRequestBodyCollectionMethod'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. PostSubscriptionsRequestBodyCollectionMethod'Typed Data.Text.Internal.Text | -- | Represents the JSON value @"charge_automatically"@ PostSubscriptionsRequestBodyCollectionMethod'EnumChargeAutomatically | -- | Represents the JSON value @"send_invoice"@ PostSubscriptionsRequestBodyCollectionMethod'EnumSendInvoice deriving (GHC.Show.Show, GHC.Classes.Eq) instance Data.Aeson.Types.ToJSON.ToJSON PostSubscriptionsRequestBodyCollectionMethod' where toJSON (PostSubscriptionsRequestBodyCollectionMethod'Other val) = val toJSON (PostSubscriptionsRequestBodyCollectionMethod'Typed val) = Data.Aeson.Types.ToJSON.toJSON val toJSON (PostSubscriptionsRequestBodyCollectionMethod'EnumChargeAutomatically) = "charge_automatically" toJSON (PostSubscriptionsRequestBodyCollectionMethod'EnumSendInvoice) = "send_invoice" instance Data.Aeson.Types.FromJSON.FromJSON PostSubscriptionsRequestBodyCollectionMethod' where parseJSON val = GHC.Base.pure ( if | val GHC.Classes.== "charge_automatically" -> PostSubscriptionsRequestBodyCollectionMethod'EnumChargeAutomatically | val GHC.Classes.== "send_invoice" -> PostSubscriptionsRequestBodyCollectionMethod'EnumSendInvoice | GHC.Base.otherwise -> PostSubscriptionsRequestBodyCollectionMethod'Other val ) -- | Defines the oneOf schema located at @paths.\/v1\/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 PostSubscriptionsRequestBodyDefaultTaxRates'Variants = -- | Represents the JSON value @""@ PostSubscriptionsRequestBodyDefaultTaxRates'EmptyString | PostSubscriptionsRequestBodyDefaultTaxRates'ListTText ([Data.Text.Internal.Text]) deriving (GHC.Show.Show, GHC.Classes.Eq) instance Data.Aeson.Types.ToJSON.ToJSON PostSubscriptionsRequestBodyDefaultTaxRates'Variants where toJSON (PostSubscriptionsRequestBodyDefaultTaxRates'ListTText a) = Data.Aeson.Types.ToJSON.toJSON a toJSON (PostSubscriptionsRequestBodyDefaultTaxRates'EmptyString) = "" instance Data.Aeson.Types.FromJSON.FromJSON PostSubscriptionsRequestBodyDefaultTaxRates'Variants where parseJSON val = if | val GHC.Classes.== "" -> GHC.Base.pure PostSubscriptionsRequestBodyDefaultTaxRates'EmptyString | GHC.Base.otherwise -> case (PostSubscriptionsRequestBodyDefaultTaxRates'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\/subscriptions.POST.requestBody.content.application\/x-www-form-urlencoded.schema.properties.items.items@ in the specification. data PostSubscriptionsRequestBodyItems' = PostSubscriptionsRequestBodyItems' { -- | billing_thresholds postSubscriptionsRequestBodyItems'BillingThresholds :: (GHC.Maybe.Maybe PostSubscriptionsRequestBodyItems'BillingThresholds'Variants), -- | metadata postSubscriptionsRequestBodyItems'Metadata :: (GHC.Maybe.Maybe Data.Aeson.Types.Internal.Object), -- | price -- -- Constraints: -- -- * Maximum length of 5000 postSubscriptionsRequestBodyItems'Price :: (GHC.Maybe.Maybe Data.Text.Internal.Text), -- | price_data postSubscriptionsRequestBodyItems'PriceData :: (GHC.Maybe.Maybe PostSubscriptionsRequestBodyItems'PriceData'), -- | quantity postSubscriptionsRequestBodyItems'Quantity :: (GHC.Maybe.Maybe GHC.Types.Int), -- | tax_rates postSubscriptionsRequestBodyItems'TaxRates :: (GHC.Maybe.Maybe PostSubscriptionsRequestBodyItems'TaxRates'Variants) } deriving ( GHC.Show.Show, GHC.Classes.Eq ) instance Data.Aeson.Types.ToJSON.ToJSON PostSubscriptionsRequestBodyItems' where toJSON obj = Data.Aeson.Types.Internal.object ("billing_thresholds" Data.Aeson.Types.ToJSON..= postSubscriptionsRequestBodyItems'BillingThresholds obj : "metadata" Data.Aeson.Types.ToJSON..= postSubscriptionsRequestBodyItems'Metadata obj : "price" Data.Aeson.Types.ToJSON..= postSubscriptionsRequestBodyItems'Price obj : "price_data" Data.Aeson.Types.ToJSON..= postSubscriptionsRequestBodyItems'PriceData obj : "quantity" Data.Aeson.Types.ToJSON..= postSubscriptionsRequestBodyItems'Quantity obj : "tax_rates" Data.Aeson.Types.ToJSON..= postSubscriptionsRequestBodyItems'TaxRates obj : GHC.Base.mempty) toEncoding obj = Data.Aeson.Encoding.Internal.pairs (("billing_thresholds" Data.Aeson.Types.ToJSON..= postSubscriptionsRequestBodyItems'BillingThresholds obj) GHC.Base.<> (("metadata" Data.Aeson.Types.ToJSON..= postSubscriptionsRequestBodyItems'Metadata obj) GHC.Base.<> (("price" Data.Aeson.Types.ToJSON..= postSubscriptionsRequestBodyItems'Price obj) GHC.Base.<> (("price_data" Data.Aeson.Types.ToJSON..= postSubscriptionsRequestBodyItems'PriceData obj) GHC.Base.<> (("quantity" Data.Aeson.Types.ToJSON..= postSubscriptionsRequestBodyItems'Quantity obj) GHC.Base.<> ("tax_rates" Data.Aeson.Types.ToJSON..= postSubscriptionsRequestBodyItems'TaxRates obj)))))) instance Data.Aeson.Types.FromJSON.FromJSON PostSubscriptionsRequestBodyItems' where parseJSON = Data.Aeson.Types.FromJSON.withObject "PostSubscriptionsRequestBodyItems'" (\obj -> (((((GHC.Base.pure PostSubscriptionsRequestBodyItems' 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 'PostSubscriptionsRequestBodyItems'' with all required fields. mkPostSubscriptionsRequestBodyItems' :: PostSubscriptionsRequestBodyItems' mkPostSubscriptionsRequestBodyItems' = PostSubscriptionsRequestBodyItems' { postSubscriptionsRequestBodyItems'BillingThresholds = GHC.Maybe.Nothing, postSubscriptionsRequestBodyItems'Metadata = GHC.Maybe.Nothing, postSubscriptionsRequestBodyItems'Price = GHC.Maybe.Nothing, postSubscriptionsRequestBodyItems'PriceData = GHC.Maybe.Nothing, postSubscriptionsRequestBodyItems'Quantity = GHC.Maybe.Nothing, postSubscriptionsRequestBodyItems'TaxRates = GHC.Maybe.Nothing } -- | Defines the object schema located at @paths.\/v1\/subscriptions.POST.requestBody.content.application\/x-www-form-urlencoded.schema.properties.items.items.properties.billing_thresholds.anyOf@ in the specification. data PostSubscriptionsRequestBodyItems'BillingThresholds'OneOf1 = PostSubscriptionsRequestBodyItems'BillingThresholds'OneOf1 { -- | usage_gte postSubscriptionsRequestBodyItems'BillingThresholds'OneOf1UsageGte :: GHC.Types.Int } deriving ( GHC.Show.Show, GHC.Classes.Eq ) instance Data.Aeson.Types.ToJSON.ToJSON PostSubscriptionsRequestBodyItems'BillingThresholds'OneOf1 where toJSON obj = Data.Aeson.Types.Internal.object ("usage_gte" Data.Aeson.Types.ToJSON..= postSubscriptionsRequestBodyItems'BillingThresholds'OneOf1UsageGte obj : GHC.Base.mempty) toEncoding obj = Data.Aeson.Encoding.Internal.pairs ("usage_gte" Data.Aeson.Types.ToJSON..= postSubscriptionsRequestBodyItems'BillingThresholds'OneOf1UsageGte obj) instance Data.Aeson.Types.FromJSON.FromJSON PostSubscriptionsRequestBodyItems'BillingThresholds'OneOf1 where parseJSON = Data.Aeson.Types.FromJSON.withObject "PostSubscriptionsRequestBodyItems'BillingThresholds'OneOf1" (\obj -> GHC.Base.pure PostSubscriptionsRequestBodyItems'BillingThresholds'OneOf1 GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..: "usage_gte")) -- | Create a new 'PostSubscriptionsRequestBodyItems'BillingThresholds'OneOf1' with all required fields. mkPostSubscriptionsRequestBodyItems'BillingThresholds'OneOf1 :: -- | 'postSubscriptionsRequestBodyItems'BillingThresholds'OneOf1UsageGte' GHC.Types.Int -> PostSubscriptionsRequestBodyItems'BillingThresholds'OneOf1 mkPostSubscriptionsRequestBodyItems'BillingThresholds'OneOf1 postSubscriptionsRequestBodyItems'BillingThresholds'OneOf1UsageGte = PostSubscriptionsRequestBodyItems'BillingThresholds'OneOf1 {postSubscriptionsRequestBodyItems'BillingThresholds'OneOf1UsageGte = postSubscriptionsRequestBodyItems'BillingThresholds'OneOf1UsageGte} -- | Defines the oneOf schema located at @paths.\/v1\/subscriptions.POST.requestBody.content.application\/x-www-form-urlencoded.schema.properties.items.items.properties.billing_thresholds.anyOf@ in the specification. data PostSubscriptionsRequestBodyItems'BillingThresholds'Variants = -- | Represents the JSON value @""@ PostSubscriptionsRequestBodyItems'BillingThresholds'EmptyString | PostSubscriptionsRequestBodyItems'BillingThresholds'PostSubscriptionsRequestBodyItems'BillingThresholds'OneOf1 PostSubscriptionsRequestBodyItems'BillingThresholds'OneOf1 deriving (GHC.Show.Show, GHC.Classes.Eq) instance Data.Aeson.Types.ToJSON.ToJSON PostSubscriptionsRequestBodyItems'BillingThresholds'Variants where toJSON (PostSubscriptionsRequestBodyItems'BillingThresholds'PostSubscriptionsRequestBodyItems'BillingThresholds'OneOf1 a) = Data.Aeson.Types.ToJSON.toJSON a toJSON (PostSubscriptionsRequestBodyItems'BillingThresholds'EmptyString) = "" instance Data.Aeson.Types.FromJSON.FromJSON PostSubscriptionsRequestBodyItems'BillingThresholds'Variants where parseJSON val = if | val GHC.Classes.== "" -> GHC.Base.pure PostSubscriptionsRequestBodyItems'BillingThresholds'EmptyString | GHC.Base.otherwise -> case (PostSubscriptionsRequestBodyItems'BillingThresholds'PostSubscriptionsRequestBodyItems'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\/subscriptions.POST.requestBody.content.application\/x-www-form-urlencoded.schema.properties.items.items.properties.price_data@ in the specification. data PostSubscriptionsRequestBodyItems'PriceData' = PostSubscriptionsRequestBodyItems'PriceData' { -- | currency postSubscriptionsRequestBodyItems'PriceData'Currency :: Data.Text.Internal.Text, -- | product -- -- Constraints: -- -- * Maximum length of 5000 postSubscriptionsRequestBodyItems'PriceData'Product :: Data.Text.Internal.Text, -- | recurring postSubscriptionsRequestBodyItems'PriceData'Recurring :: PostSubscriptionsRequestBodyItems'PriceData'Recurring', -- | tax_behavior postSubscriptionsRequestBodyItems'PriceData'TaxBehavior :: (GHC.Maybe.Maybe PostSubscriptionsRequestBodyItems'PriceData'TaxBehavior'), -- | unit_amount postSubscriptionsRequestBodyItems'PriceData'UnitAmount :: (GHC.Maybe.Maybe GHC.Types.Int), -- | unit_amount_decimal postSubscriptionsRequestBodyItems'PriceData'UnitAmountDecimal :: (GHC.Maybe.Maybe Data.Text.Internal.Text) } deriving ( GHC.Show.Show, GHC.Classes.Eq ) instance Data.Aeson.Types.ToJSON.ToJSON PostSubscriptionsRequestBodyItems'PriceData' where toJSON obj = Data.Aeson.Types.Internal.object ("currency" Data.Aeson.Types.ToJSON..= postSubscriptionsRequestBodyItems'PriceData'Currency obj : "product" Data.Aeson.Types.ToJSON..= postSubscriptionsRequestBodyItems'PriceData'Product obj : "recurring" Data.Aeson.Types.ToJSON..= postSubscriptionsRequestBodyItems'PriceData'Recurring obj : "tax_behavior" Data.Aeson.Types.ToJSON..= postSubscriptionsRequestBodyItems'PriceData'TaxBehavior obj : "unit_amount" Data.Aeson.Types.ToJSON..= postSubscriptionsRequestBodyItems'PriceData'UnitAmount obj : "unit_amount_decimal" Data.Aeson.Types.ToJSON..= postSubscriptionsRequestBodyItems'PriceData'UnitAmountDecimal obj : GHC.Base.mempty) toEncoding obj = Data.Aeson.Encoding.Internal.pairs (("currency" Data.Aeson.Types.ToJSON..= postSubscriptionsRequestBodyItems'PriceData'Currency obj) GHC.Base.<> (("product" Data.Aeson.Types.ToJSON..= postSubscriptionsRequestBodyItems'PriceData'Product obj) GHC.Base.<> (("recurring" Data.Aeson.Types.ToJSON..= postSubscriptionsRequestBodyItems'PriceData'Recurring obj) GHC.Base.<> (("tax_behavior" Data.Aeson.Types.ToJSON..= postSubscriptionsRequestBodyItems'PriceData'TaxBehavior obj) GHC.Base.<> (("unit_amount" Data.Aeson.Types.ToJSON..= postSubscriptionsRequestBodyItems'PriceData'UnitAmount obj) GHC.Base.<> ("unit_amount_decimal" Data.Aeson.Types.ToJSON..= postSubscriptionsRequestBodyItems'PriceData'UnitAmountDecimal obj)))))) instance Data.Aeson.Types.FromJSON.FromJSON PostSubscriptionsRequestBodyItems'PriceData' where parseJSON = Data.Aeson.Types.FromJSON.withObject "PostSubscriptionsRequestBodyItems'PriceData'" (\obj -> (((((GHC.Base.pure PostSubscriptionsRequestBodyItems'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 'PostSubscriptionsRequestBodyItems'PriceData'' with all required fields. mkPostSubscriptionsRequestBodyItems'PriceData' :: -- | 'postSubscriptionsRequestBodyItems'PriceData'Currency' Data.Text.Internal.Text -> -- | 'postSubscriptionsRequestBodyItems'PriceData'Product' Data.Text.Internal.Text -> -- | 'postSubscriptionsRequestBodyItems'PriceData'Recurring' PostSubscriptionsRequestBodyItems'PriceData'Recurring' -> PostSubscriptionsRequestBodyItems'PriceData' mkPostSubscriptionsRequestBodyItems'PriceData' postSubscriptionsRequestBodyItems'PriceData'Currency postSubscriptionsRequestBodyItems'PriceData'Product postSubscriptionsRequestBodyItems'PriceData'Recurring = PostSubscriptionsRequestBodyItems'PriceData' { postSubscriptionsRequestBodyItems'PriceData'Currency = postSubscriptionsRequestBodyItems'PriceData'Currency, postSubscriptionsRequestBodyItems'PriceData'Product = postSubscriptionsRequestBodyItems'PriceData'Product, postSubscriptionsRequestBodyItems'PriceData'Recurring = postSubscriptionsRequestBodyItems'PriceData'Recurring, postSubscriptionsRequestBodyItems'PriceData'TaxBehavior = GHC.Maybe.Nothing, postSubscriptionsRequestBodyItems'PriceData'UnitAmount = GHC.Maybe.Nothing, postSubscriptionsRequestBodyItems'PriceData'UnitAmountDecimal = GHC.Maybe.Nothing } -- | Defines the object schema located at @paths.\/v1\/subscriptions.POST.requestBody.content.application\/x-www-form-urlencoded.schema.properties.items.items.properties.price_data.properties.recurring@ in the specification. data PostSubscriptionsRequestBodyItems'PriceData'Recurring' = PostSubscriptionsRequestBodyItems'PriceData'Recurring' { -- | interval postSubscriptionsRequestBodyItems'PriceData'Recurring'Interval :: PostSubscriptionsRequestBodyItems'PriceData'Recurring'Interval', -- | interval_count postSubscriptionsRequestBodyItems'PriceData'Recurring'IntervalCount :: (GHC.Maybe.Maybe GHC.Types.Int) } deriving ( GHC.Show.Show, GHC.Classes.Eq ) instance Data.Aeson.Types.ToJSON.ToJSON PostSubscriptionsRequestBodyItems'PriceData'Recurring' where toJSON obj = Data.Aeson.Types.Internal.object ("interval" Data.Aeson.Types.ToJSON..= postSubscriptionsRequestBodyItems'PriceData'Recurring'Interval obj : "interval_count" Data.Aeson.Types.ToJSON..= postSubscriptionsRequestBodyItems'PriceData'Recurring'IntervalCount obj : GHC.Base.mempty) toEncoding obj = Data.Aeson.Encoding.Internal.pairs (("interval" Data.Aeson.Types.ToJSON..= postSubscriptionsRequestBodyItems'PriceData'Recurring'Interval obj) GHC.Base.<> ("interval_count" Data.Aeson.Types.ToJSON..= postSubscriptionsRequestBodyItems'PriceData'Recurring'IntervalCount obj)) instance Data.Aeson.Types.FromJSON.FromJSON PostSubscriptionsRequestBodyItems'PriceData'Recurring' where parseJSON = Data.Aeson.Types.FromJSON.withObject "PostSubscriptionsRequestBodyItems'PriceData'Recurring'" (\obj -> (GHC.Base.pure PostSubscriptionsRequestBodyItems'PriceData'Recurring' GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..: "interval")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "interval_count")) -- | Create a new 'PostSubscriptionsRequestBodyItems'PriceData'Recurring'' with all required fields. mkPostSubscriptionsRequestBodyItems'PriceData'Recurring' :: -- | 'postSubscriptionsRequestBodyItems'PriceData'Recurring'Interval' PostSubscriptionsRequestBodyItems'PriceData'Recurring'Interval' -> PostSubscriptionsRequestBodyItems'PriceData'Recurring' mkPostSubscriptionsRequestBodyItems'PriceData'Recurring' postSubscriptionsRequestBodyItems'PriceData'Recurring'Interval = PostSubscriptionsRequestBodyItems'PriceData'Recurring' { postSubscriptionsRequestBodyItems'PriceData'Recurring'Interval = postSubscriptionsRequestBodyItems'PriceData'Recurring'Interval, postSubscriptionsRequestBodyItems'PriceData'Recurring'IntervalCount = GHC.Maybe.Nothing } -- | Defines the enum schema located at @paths.\/v1\/subscriptions.POST.requestBody.content.application\/x-www-form-urlencoded.schema.properties.items.items.properties.price_data.properties.recurring.properties.interval@ in the specification. data PostSubscriptionsRequestBodyItems'PriceData'Recurring'Interval' = -- | This case is used if the value encountered during decoding does not match any of the provided cases in the specification. PostSubscriptionsRequestBodyItems'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. PostSubscriptionsRequestBodyItems'PriceData'Recurring'Interval'Typed Data.Text.Internal.Text | -- | Represents the JSON value @"day"@ PostSubscriptionsRequestBodyItems'PriceData'Recurring'Interval'EnumDay | -- | Represents the JSON value @"month"@ PostSubscriptionsRequestBodyItems'PriceData'Recurring'Interval'EnumMonth | -- | Represents the JSON value @"week"@ PostSubscriptionsRequestBodyItems'PriceData'Recurring'Interval'EnumWeek | -- | Represents the JSON value @"year"@ PostSubscriptionsRequestBodyItems'PriceData'Recurring'Interval'EnumYear deriving (GHC.Show.Show, GHC.Classes.Eq) instance Data.Aeson.Types.ToJSON.ToJSON PostSubscriptionsRequestBodyItems'PriceData'Recurring'Interval' where toJSON (PostSubscriptionsRequestBodyItems'PriceData'Recurring'Interval'Other val) = val toJSON (PostSubscriptionsRequestBodyItems'PriceData'Recurring'Interval'Typed val) = Data.Aeson.Types.ToJSON.toJSON val toJSON (PostSubscriptionsRequestBodyItems'PriceData'Recurring'Interval'EnumDay) = "day" toJSON (PostSubscriptionsRequestBodyItems'PriceData'Recurring'Interval'EnumMonth) = "month" toJSON (PostSubscriptionsRequestBodyItems'PriceData'Recurring'Interval'EnumWeek) = "week" toJSON (PostSubscriptionsRequestBodyItems'PriceData'Recurring'Interval'EnumYear) = "year" instance Data.Aeson.Types.FromJSON.FromJSON PostSubscriptionsRequestBodyItems'PriceData'Recurring'Interval' where parseJSON val = GHC.Base.pure ( if | val GHC.Classes.== "day" -> PostSubscriptionsRequestBodyItems'PriceData'Recurring'Interval'EnumDay | val GHC.Classes.== "month" -> PostSubscriptionsRequestBodyItems'PriceData'Recurring'Interval'EnumMonth | val GHC.Classes.== "week" -> PostSubscriptionsRequestBodyItems'PriceData'Recurring'Interval'EnumWeek | val GHC.Classes.== "year" -> PostSubscriptionsRequestBodyItems'PriceData'Recurring'Interval'EnumYear | GHC.Base.otherwise -> PostSubscriptionsRequestBodyItems'PriceData'Recurring'Interval'Other val ) -- | Defines the enum schema located at @paths.\/v1\/subscriptions.POST.requestBody.content.application\/x-www-form-urlencoded.schema.properties.items.items.properties.price_data.properties.tax_behavior@ in the specification. data PostSubscriptionsRequestBodyItems'PriceData'TaxBehavior' = -- | This case is used if the value encountered during decoding does not match any of the provided cases in the specification. PostSubscriptionsRequestBodyItems'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. PostSubscriptionsRequestBodyItems'PriceData'TaxBehavior'Typed Data.Text.Internal.Text | -- | Represents the JSON value @"exclusive"@ PostSubscriptionsRequestBodyItems'PriceData'TaxBehavior'EnumExclusive | -- | Represents the JSON value @"inclusive"@ PostSubscriptionsRequestBodyItems'PriceData'TaxBehavior'EnumInclusive | -- | Represents the JSON value @"unspecified"@ PostSubscriptionsRequestBodyItems'PriceData'TaxBehavior'EnumUnspecified deriving (GHC.Show.Show, GHC.Classes.Eq) instance Data.Aeson.Types.ToJSON.ToJSON PostSubscriptionsRequestBodyItems'PriceData'TaxBehavior' where toJSON (PostSubscriptionsRequestBodyItems'PriceData'TaxBehavior'Other val) = val toJSON (PostSubscriptionsRequestBodyItems'PriceData'TaxBehavior'Typed val) = Data.Aeson.Types.ToJSON.toJSON val toJSON (PostSubscriptionsRequestBodyItems'PriceData'TaxBehavior'EnumExclusive) = "exclusive" toJSON (PostSubscriptionsRequestBodyItems'PriceData'TaxBehavior'EnumInclusive) = "inclusive" toJSON (PostSubscriptionsRequestBodyItems'PriceData'TaxBehavior'EnumUnspecified) = "unspecified" instance Data.Aeson.Types.FromJSON.FromJSON PostSubscriptionsRequestBodyItems'PriceData'TaxBehavior' where parseJSON val = GHC.Base.pure ( if | val GHC.Classes.== "exclusive" -> PostSubscriptionsRequestBodyItems'PriceData'TaxBehavior'EnumExclusive | val GHC.Classes.== "inclusive" -> PostSubscriptionsRequestBodyItems'PriceData'TaxBehavior'EnumInclusive | val GHC.Classes.== "unspecified" -> PostSubscriptionsRequestBodyItems'PriceData'TaxBehavior'EnumUnspecified | GHC.Base.otherwise -> PostSubscriptionsRequestBodyItems'PriceData'TaxBehavior'Other val ) -- | Defines the oneOf schema located at @paths.\/v1\/subscriptions.POST.requestBody.content.application\/x-www-form-urlencoded.schema.properties.items.items.properties.tax_rates.anyOf@ in the specification. data PostSubscriptionsRequestBodyItems'TaxRates'Variants = -- | Represents the JSON value @""@ PostSubscriptionsRequestBodyItems'TaxRates'EmptyString | PostSubscriptionsRequestBodyItems'TaxRates'ListTText ([Data.Text.Internal.Text]) deriving (GHC.Show.Show, GHC.Classes.Eq) instance Data.Aeson.Types.ToJSON.ToJSON PostSubscriptionsRequestBodyItems'TaxRates'Variants where toJSON (PostSubscriptionsRequestBodyItems'TaxRates'ListTText a) = Data.Aeson.Types.ToJSON.toJSON a toJSON (PostSubscriptionsRequestBodyItems'TaxRates'EmptyString) = "" instance Data.Aeson.Types.FromJSON.FromJSON PostSubscriptionsRequestBodyItems'TaxRates'Variants where parseJSON val = if | val GHC.Classes.== "" -> GHC.Base.pure PostSubscriptionsRequestBodyItems'TaxRates'EmptyString | GHC.Base.otherwise -> case (PostSubscriptionsRequestBodyItems'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\/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 PostSubscriptionsRequestBodyMetadata'Variants = -- | Represents the JSON value @""@ PostSubscriptionsRequestBodyMetadata'EmptyString | PostSubscriptionsRequestBodyMetadata'Object Data.Aeson.Types.Internal.Object deriving (GHC.Show.Show, GHC.Classes.Eq) instance Data.Aeson.Types.ToJSON.ToJSON PostSubscriptionsRequestBodyMetadata'Variants where toJSON (PostSubscriptionsRequestBodyMetadata'Object a) = Data.Aeson.Types.ToJSON.toJSON a toJSON (PostSubscriptionsRequestBodyMetadata'EmptyString) = "" instance Data.Aeson.Types.FromJSON.FromJSON PostSubscriptionsRequestBodyMetadata'Variants where parseJSON val = if | val GHC.Classes.== "" -> GHC.Base.pure PostSubscriptionsRequestBodyMetadata'EmptyString | GHC.Base.otherwise -> case (PostSubscriptionsRequestBodyMetadata'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\/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 PostSubscriptionsRequestBodyPaymentBehavior' = -- | This case is used if the value encountered during decoding does not match any of the provided cases in the specification. PostSubscriptionsRequestBodyPaymentBehavior'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. PostSubscriptionsRequestBodyPaymentBehavior'Typed Data.Text.Internal.Text | -- | Represents the JSON value @"allow_incomplete"@ PostSubscriptionsRequestBodyPaymentBehavior'EnumAllowIncomplete | -- | Represents the JSON value @"default_incomplete"@ PostSubscriptionsRequestBodyPaymentBehavior'EnumDefaultIncomplete | -- | Represents the JSON value @"error_if_incomplete"@ PostSubscriptionsRequestBodyPaymentBehavior'EnumErrorIfIncomplete | -- | Represents the JSON value @"pending_if_incomplete"@ PostSubscriptionsRequestBodyPaymentBehavior'EnumPendingIfIncomplete deriving (GHC.Show.Show, GHC.Classes.Eq) instance Data.Aeson.Types.ToJSON.ToJSON PostSubscriptionsRequestBodyPaymentBehavior' where toJSON (PostSubscriptionsRequestBodyPaymentBehavior'Other val) = val toJSON (PostSubscriptionsRequestBodyPaymentBehavior'Typed val) = Data.Aeson.Types.ToJSON.toJSON val toJSON (PostSubscriptionsRequestBodyPaymentBehavior'EnumAllowIncomplete) = "allow_incomplete" toJSON (PostSubscriptionsRequestBodyPaymentBehavior'EnumDefaultIncomplete) = "default_incomplete" toJSON (PostSubscriptionsRequestBodyPaymentBehavior'EnumErrorIfIncomplete) = "error_if_incomplete" toJSON (PostSubscriptionsRequestBodyPaymentBehavior'EnumPendingIfIncomplete) = "pending_if_incomplete" instance Data.Aeson.Types.FromJSON.FromJSON PostSubscriptionsRequestBodyPaymentBehavior' where parseJSON val = GHC.Base.pure ( if | val GHC.Classes.== "allow_incomplete" -> PostSubscriptionsRequestBodyPaymentBehavior'EnumAllowIncomplete | val GHC.Classes.== "default_incomplete" -> PostSubscriptionsRequestBodyPaymentBehavior'EnumDefaultIncomplete | val GHC.Classes.== "error_if_incomplete" -> PostSubscriptionsRequestBodyPaymentBehavior'EnumErrorIfIncomplete | val GHC.Classes.== "pending_if_incomplete" -> PostSubscriptionsRequestBodyPaymentBehavior'EnumPendingIfIncomplete | GHC.Base.otherwise -> PostSubscriptionsRequestBodyPaymentBehavior'Other val ) -- | Defines the object schema located at @paths.\/v1\/subscriptions.POST.requestBody.content.application\/x-www-form-urlencoded.schema.properties.pending_invoice_item_interval.anyOf@ in the specification. data PostSubscriptionsRequestBodyPendingInvoiceItemInterval'OneOf1 = PostSubscriptionsRequestBodyPendingInvoiceItemInterval'OneOf1 { -- | interval postSubscriptionsRequestBodyPendingInvoiceItemInterval'OneOf1Interval :: PostSubscriptionsRequestBodyPendingInvoiceItemInterval'OneOf1Interval', -- | interval_count postSubscriptionsRequestBodyPendingInvoiceItemInterval'OneOf1IntervalCount :: (GHC.Maybe.Maybe GHC.Types.Int) } deriving ( GHC.Show.Show, GHC.Classes.Eq ) instance Data.Aeson.Types.ToJSON.ToJSON PostSubscriptionsRequestBodyPendingInvoiceItemInterval'OneOf1 where toJSON obj = Data.Aeson.Types.Internal.object ("interval" Data.Aeson.Types.ToJSON..= postSubscriptionsRequestBodyPendingInvoiceItemInterval'OneOf1Interval obj : "interval_count" Data.Aeson.Types.ToJSON..= postSubscriptionsRequestBodyPendingInvoiceItemInterval'OneOf1IntervalCount obj : GHC.Base.mempty) toEncoding obj = Data.Aeson.Encoding.Internal.pairs (("interval" Data.Aeson.Types.ToJSON..= postSubscriptionsRequestBodyPendingInvoiceItemInterval'OneOf1Interval obj) GHC.Base.<> ("interval_count" Data.Aeson.Types.ToJSON..= postSubscriptionsRequestBodyPendingInvoiceItemInterval'OneOf1IntervalCount obj)) instance Data.Aeson.Types.FromJSON.FromJSON PostSubscriptionsRequestBodyPendingInvoiceItemInterval'OneOf1 where parseJSON = Data.Aeson.Types.FromJSON.withObject "PostSubscriptionsRequestBodyPendingInvoiceItemInterval'OneOf1" (\obj -> (GHC.Base.pure PostSubscriptionsRequestBodyPendingInvoiceItemInterval'OneOf1 GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..: "interval")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "interval_count")) -- | Create a new 'PostSubscriptionsRequestBodyPendingInvoiceItemInterval'OneOf1' with all required fields. mkPostSubscriptionsRequestBodyPendingInvoiceItemInterval'OneOf1 :: -- | 'postSubscriptionsRequestBodyPendingInvoiceItemInterval'OneOf1Interval' PostSubscriptionsRequestBodyPendingInvoiceItemInterval'OneOf1Interval' -> PostSubscriptionsRequestBodyPendingInvoiceItemInterval'OneOf1 mkPostSubscriptionsRequestBodyPendingInvoiceItemInterval'OneOf1 postSubscriptionsRequestBodyPendingInvoiceItemInterval'OneOf1Interval = PostSubscriptionsRequestBodyPendingInvoiceItemInterval'OneOf1 { postSubscriptionsRequestBodyPendingInvoiceItemInterval'OneOf1Interval = postSubscriptionsRequestBodyPendingInvoiceItemInterval'OneOf1Interval, postSubscriptionsRequestBodyPendingInvoiceItemInterval'OneOf1IntervalCount = GHC.Maybe.Nothing } -- | Defines the enum schema located at @paths.\/v1\/subscriptions.POST.requestBody.content.application\/x-www-form-urlencoded.schema.properties.pending_invoice_item_interval.anyOf.properties.interval@ in the specification. data PostSubscriptionsRequestBodyPendingInvoiceItemInterval'OneOf1Interval' = -- | This case is used if the value encountered during decoding does not match any of the provided cases in the specification. PostSubscriptionsRequestBodyPendingInvoiceItemInterval'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. PostSubscriptionsRequestBodyPendingInvoiceItemInterval'OneOf1Interval'Typed Data.Text.Internal.Text | -- | Represents the JSON value @"day"@ PostSubscriptionsRequestBodyPendingInvoiceItemInterval'OneOf1Interval'EnumDay | -- | Represents the JSON value @"month"@ PostSubscriptionsRequestBodyPendingInvoiceItemInterval'OneOf1Interval'EnumMonth | -- | Represents the JSON value @"week"@ PostSubscriptionsRequestBodyPendingInvoiceItemInterval'OneOf1Interval'EnumWeek | -- | Represents the JSON value @"year"@ PostSubscriptionsRequestBodyPendingInvoiceItemInterval'OneOf1Interval'EnumYear deriving (GHC.Show.Show, GHC.Classes.Eq) instance Data.Aeson.Types.ToJSON.ToJSON PostSubscriptionsRequestBodyPendingInvoiceItemInterval'OneOf1Interval' where toJSON (PostSubscriptionsRequestBodyPendingInvoiceItemInterval'OneOf1Interval'Other val) = val toJSON (PostSubscriptionsRequestBodyPendingInvoiceItemInterval'OneOf1Interval'Typed val) = Data.Aeson.Types.ToJSON.toJSON val toJSON (PostSubscriptionsRequestBodyPendingInvoiceItemInterval'OneOf1Interval'EnumDay) = "day" toJSON (PostSubscriptionsRequestBodyPendingInvoiceItemInterval'OneOf1Interval'EnumMonth) = "month" toJSON (PostSubscriptionsRequestBodyPendingInvoiceItemInterval'OneOf1Interval'EnumWeek) = "week" toJSON (PostSubscriptionsRequestBodyPendingInvoiceItemInterval'OneOf1Interval'EnumYear) = "year" instance Data.Aeson.Types.FromJSON.FromJSON PostSubscriptionsRequestBodyPendingInvoiceItemInterval'OneOf1Interval' where parseJSON val = GHC.Base.pure ( if | val GHC.Classes.== "day" -> PostSubscriptionsRequestBodyPendingInvoiceItemInterval'OneOf1Interval'EnumDay | val GHC.Classes.== "month" -> PostSubscriptionsRequestBodyPendingInvoiceItemInterval'OneOf1Interval'EnumMonth | val GHC.Classes.== "week" -> PostSubscriptionsRequestBodyPendingInvoiceItemInterval'OneOf1Interval'EnumWeek | val GHC.Classes.== "year" -> PostSubscriptionsRequestBodyPendingInvoiceItemInterval'OneOf1Interval'EnumYear | GHC.Base.otherwise -> PostSubscriptionsRequestBodyPendingInvoiceItemInterval'OneOf1Interval'Other val ) -- | Defines the oneOf schema located at @paths.\/v1\/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 PostSubscriptionsRequestBodyPendingInvoiceItemInterval'Variants = -- | Represents the JSON value @""@ PostSubscriptionsRequestBodyPendingInvoiceItemInterval'EmptyString | PostSubscriptionsRequestBodyPendingInvoiceItemInterval'PostSubscriptionsRequestBodyPendingInvoiceItemInterval'OneOf1 PostSubscriptionsRequestBodyPendingInvoiceItemInterval'OneOf1 deriving (GHC.Show.Show, GHC.Classes.Eq) instance Data.Aeson.Types.ToJSON.ToJSON PostSubscriptionsRequestBodyPendingInvoiceItemInterval'Variants where toJSON (PostSubscriptionsRequestBodyPendingInvoiceItemInterval'PostSubscriptionsRequestBodyPendingInvoiceItemInterval'OneOf1 a) = Data.Aeson.Types.ToJSON.toJSON a toJSON (PostSubscriptionsRequestBodyPendingInvoiceItemInterval'EmptyString) = "" instance Data.Aeson.Types.FromJSON.FromJSON PostSubscriptionsRequestBodyPendingInvoiceItemInterval'Variants where parseJSON val = if | val GHC.Classes.== "" -> GHC.Base.pure PostSubscriptionsRequestBodyPendingInvoiceItemInterval'EmptyString | GHC.Base.otherwise -> case (PostSubscriptionsRequestBodyPendingInvoiceItemInterval'PostSubscriptionsRequestBodyPendingInvoiceItemInterval'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\/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 PostSubscriptionsRequestBodyProrationBehavior' = -- | This case is used if the value encountered during decoding does not match any of the provided cases in the specification. PostSubscriptionsRequestBodyProrationBehavior'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. PostSubscriptionsRequestBodyProrationBehavior'Typed Data.Text.Internal.Text | -- | Represents the JSON value @"always_invoice"@ PostSubscriptionsRequestBodyProrationBehavior'EnumAlwaysInvoice | -- | Represents the JSON value @"create_prorations"@ PostSubscriptionsRequestBodyProrationBehavior'EnumCreateProrations | -- | Represents the JSON value @"none"@ PostSubscriptionsRequestBodyProrationBehavior'EnumNone deriving (GHC.Show.Show, GHC.Classes.Eq) instance Data.Aeson.Types.ToJSON.ToJSON PostSubscriptionsRequestBodyProrationBehavior' where toJSON (PostSubscriptionsRequestBodyProrationBehavior'Other val) = val toJSON (PostSubscriptionsRequestBodyProrationBehavior'Typed val) = Data.Aeson.Types.ToJSON.toJSON val toJSON (PostSubscriptionsRequestBodyProrationBehavior'EnumAlwaysInvoice) = "always_invoice" toJSON (PostSubscriptionsRequestBodyProrationBehavior'EnumCreateProrations) = "create_prorations" toJSON (PostSubscriptionsRequestBodyProrationBehavior'EnumNone) = "none" instance Data.Aeson.Types.FromJSON.FromJSON PostSubscriptionsRequestBodyProrationBehavior' where parseJSON val = GHC.Base.pure ( if | val GHC.Classes.== "always_invoice" -> PostSubscriptionsRequestBodyProrationBehavior'EnumAlwaysInvoice | val GHC.Classes.== "create_prorations" -> PostSubscriptionsRequestBodyProrationBehavior'EnumCreateProrations | val GHC.Classes.== "none" -> PostSubscriptionsRequestBodyProrationBehavior'EnumNone | GHC.Base.otherwise -> PostSubscriptionsRequestBodyProrationBehavior'Other val ) -- | Defines the object schema located at @paths.\/v1\/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 PostSubscriptionsRequestBodyTransferData' = PostSubscriptionsRequestBodyTransferData' { -- | amount_percent postSubscriptionsRequestBodyTransferData'AmountPercent :: (GHC.Maybe.Maybe GHC.Types.Double), -- | destination postSubscriptionsRequestBodyTransferData'Destination :: Data.Text.Internal.Text } deriving ( GHC.Show.Show, GHC.Classes.Eq ) instance Data.Aeson.Types.ToJSON.ToJSON PostSubscriptionsRequestBodyTransferData' where toJSON obj = Data.Aeson.Types.Internal.object ("amount_percent" Data.Aeson.Types.ToJSON..= postSubscriptionsRequestBodyTransferData'AmountPercent obj : "destination" Data.Aeson.Types.ToJSON..= postSubscriptionsRequestBodyTransferData'Destination obj : GHC.Base.mempty) toEncoding obj = Data.Aeson.Encoding.Internal.pairs (("amount_percent" Data.Aeson.Types.ToJSON..= postSubscriptionsRequestBodyTransferData'AmountPercent obj) GHC.Base.<> ("destination" Data.Aeson.Types.ToJSON..= postSubscriptionsRequestBodyTransferData'Destination obj)) instance Data.Aeson.Types.FromJSON.FromJSON PostSubscriptionsRequestBodyTransferData' where parseJSON = Data.Aeson.Types.FromJSON.withObject "PostSubscriptionsRequestBodyTransferData'" (\obj -> (GHC.Base.pure PostSubscriptionsRequestBodyTransferData' GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "amount_percent")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..: "destination")) -- | Create a new 'PostSubscriptionsRequestBodyTransferData'' with all required fields. mkPostSubscriptionsRequestBodyTransferData' :: -- | 'postSubscriptionsRequestBodyTransferData'Destination' Data.Text.Internal.Text -> PostSubscriptionsRequestBodyTransferData' mkPostSubscriptionsRequestBodyTransferData' postSubscriptionsRequestBodyTransferData'Destination = PostSubscriptionsRequestBodyTransferData' { postSubscriptionsRequestBodyTransferData'AmountPercent = GHC.Maybe.Nothing, postSubscriptionsRequestBodyTransferData'Destination = postSubscriptionsRequestBodyTransferData'Destination } -- | Defines the oneOf schema located at @paths.\/v1\/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 PostSubscriptionsRequestBodyTrialEnd'Variants = -- | Represents the JSON value @"now"@ PostSubscriptionsRequestBodyTrialEnd'Now | PostSubscriptionsRequestBodyTrialEnd'Int GHC.Types.Int deriving (GHC.Show.Show, GHC.Classes.Eq) instance Data.Aeson.Types.ToJSON.ToJSON PostSubscriptionsRequestBodyTrialEnd'Variants where toJSON (PostSubscriptionsRequestBodyTrialEnd'Int a) = Data.Aeson.Types.ToJSON.toJSON a toJSON (PostSubscriptionsRequestBodyTrialEnd'Now) = "now" instance Data.Aeson.Types.FromJSON.FromJSON PostSubscriptionsRequestBodyTrialEnd'Variants where parseJSON val = if | val GHC.Classes.== "now" -> GHC.Base.pure PostSubscriptionsRequestBodyTrialEnd'Now | GHC.Base.otherwise -> case (PostSubscriptionsRequestBodyTrialEnd'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 'postSubscriptions'. -- -- 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), 'PostSubscriptionsResponseError' is used. data PostSubscriptionsResponse = -- | Means either no matching case available or a parse error PostSubscriptionsResponseError GHC.Base.String | -- | Successful response. PostSubscriptionsResponse200 Subscription | -- | Error response. PostSubscriptionsResponseDefault Error deriving (GHC.Show.Show, GHC.Classes.Eq)