{-# 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 postSubscriptionSchedules module StripeAPI.Operations.PostSubscriptionSchedules 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/subscription_schedules -- -- \

Creates a new subscription schedule object. Each customer can have up to 500 active or scheduled subscriptions.\<\/p> postSubscriptionSchedules :: forall m. StripeAPI.Common.MonadHTTP m => -- | The request body to send GHC.Maybe.Maybe PostSubscriptionSchedulesRequestBody -> -- | Monadic computation which returns the result of the operation StripeAPI.Common.ClientT m (Network.HTTP.Client.Types.Response PostSubscriptionSchedulesResponse) postSubscriptionSchedules body = GHC.Base.fmap ( \response_0 -> GHC.Base.fmap ( Data.Either.either PostSubscriptionSchedulesResponseError 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) -> PostSubscriptionSchedulesResponse200 Data.Functor.<$> ( Data.Aeson.eitherDecodeStrict body :: Data.Either.Either GHC.Base.String SubscriptionSchedule ) | GHC.Base.const GHC.Types.True (Network.HTTP.Client.Types.responseStatus response) -> PostSubscriptionSchedulesResponseDefault 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/subscription_schedules") GHC.Base.mempty body StripeAPI.Common.RequestBodyEncodingFormData) -- | Defines the object schema located at @paths.\/v1\/subscription_schedules.POST.requestBody.content.application\/x-www-form-urlencoded.schema@ in the specification. data PostSubscriptionSchedulesRequestBody = PostSubscriptionSchedulesRequestBody { -- | customer: The identifier of the customer to create the subscription schedule for. -- -- Constraints: -- -- * Maximum length of 5000 postSubscriptionSchedulesRequestBodyCustomer :: (GHC.Maybe.Maybe Data.Text.Internal.Text), -- | default_settings: Object representing the subscription schedule\'s default settings. postSubscriptionSchedulesRequestBodyDefaultSettings :: (GHC.Maybe.Maybe PostSubscriptionSchedulesRequestBodyDefaultSettings'), -- | end_behavior: Configures how the subscription schedule behaves when it ends. Possible values are \`release\` or \`cancel\` with the default being \`release\`. \`release\` will end the subscription schedule and keep the underlying subscription running.\`cancel\` will end the subscription schedule and cancel the underlying subscription. postSubscriptionSchedulesRequestBodyEndBehavior :: (GHC.Maybe.Maybe PostSubscriptionSchedulesRequestBodyEndBehavior'), -- | expand: Specifies which fields in the response should be expanded. postSubscriptionSchedulesRequestBodyExpand :: (GHC.Maybe.Maybe ([Data.Text.Internal.Text])), -- | from_subscription: Migrate an existing subscription to be managed by a subscription schedule. If this parameter is set, a subscription schedule will be created using the subscription\'s item(s), set to auto-renew using the subscription\'s interval. When using this parameter, other parameters (such as phase values) cannot be set. To create a subscription schedule with other modifications, we recommend making two separate API calls. -- -- Constraints: -- -- * Maximum length of 5000 postSubscriptionSchedulesRequestBodyFromSubscription :: (GHC.Maybe.Maybe Data.Text.Internal.Text), -- | metadata: Set of [key-value pairs](https:\/\/stripe.com\/docs\/api\/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to \`metadata\`. postSubscriptionSchedulesRequestBodyMetadata :: (GHC.Maybe.Maybe PostSubscriptionSchedulesRequestBodyMetadata'Variants), -- | phases: List representing phases of the subscription schedule. Each phase can be customized to have different durations, plans, and coupons. If there are multiple phases, the \`end_date\` of one phase will always equal the \`start_date\` of the next phase. postSubscriptionSchedulesRequestBodyPhases :: (GHC.Maybe.Maybe ([PostSubscriptionSchedulesRequestBodyPhases'])), -- | start_date: When the subscription schedule starts. We recommend using \`now\` so that it starts the subscription immediately. You can also use a Unix timestamp to backdate the subscription so that it starts on a past date, or set a future date for the subscription to start on. postSubscriptionSchedulesRequestBodyStartDate :: (GHC.Maybe.Maybe PostSubscriptionSchedulesRequestBodyStartDate'Variants) } deriving ( GHC.Show.Show, GHC.Classes.Eq ) instance Data.Aeson.Types.ToJSON.ToJSON PostSubscriptionSchedulesRequestBody where toJSON obj = Data.Aeson.Types.Internal.object ("customer" Data.Aeson.Types.ToJSON..= postSubscriptionSchedulesRequestBodyCustomer obj : "default_settings" Data.Aeson.Types.ToJSON..= postSubscriptionSchedulesRequestBodyDefaultSettings obj : "end_behavior" Data.Aeson.Types.ToJSON..= postSubscriptionSchedulesRequestBodyEndBehavior obj : "expand" Data.Aeson.Types.ToJSON..= postSubscriptionSchedulesRequestBodyExpand obj : "from_subscription" Data.Aeson.Types.ToJSON..= postSubscriptionSchedulesRequestBodyFromSubscription obj : "metadata" Data.Aeson.Types.ToJSON..= postSubscriptionSchedulesRequestBodyMetadata obj : "phases" Data.Aeson.Types.ToJSON..= postSubscriptionSchedulesRequestBodyPhases obj : "start_date" Data.Aeson.Types.ToJSON..= postSubscriptionSchedulesRequestBodyStartDate obj : GHC.Base.mempty) toEncoding obj = Data.Aeson.Encoding.Internal.pairs (("customer" Data.Aeson.Types.ToJSON..= postSubscriptionSchedulesRequestBodyCustomer obj) GHC.Base.<> (("default_settings" Data.Aeson.Types.ToJSON..= postSubscriptionSchedulesRequestBodyDefaultSettings obj) GHC.Base.<> (("end_behavior" Data.Aeson.Types.ToJSON..= postSubscriptionSchedulesRequestBodyEndBehavior obj) GHC.Base.<> (("expand" Data.Aeson.Types.ToJSON..= postSubscriptionSchedulesRequestBodyExpand obj) GHC.Base.<> (("from_subscription" Data.Aeson.Types.ToJSON..= postSubscriptionSchedulesRequestBodyFromSubscription obj) GHC.Base.<> (("metadata" Data.Aeson.Types.ToJSON..= postSubscriptionSchedulesRequestBodyMetadata obj) GHC.Base.<> (("phases" Data.Aeson.Types.ToJSON..= postSubscriptionSchedulesRequestBodyPhases obj) GHC.Base.<> ("start_date" Data.Aeson.Types.ToJSON..= postSubscriptionSchedulesRequestBodyStartDate obj)))))))) instance Data.Aeson.Types.FromJSON.FromJSON PostSubscriptionSchedulesRequestBody where parseJSON = Data.Aeson.Types.FromJSON.withObject "PostSubscriptionSchedulesRequestBody" (\obj -> (((((((GHC.Base.pure PostSubscriptionSchedulesRequestBody GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "customer")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "default_settings")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "end_behavior")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "expand")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "from_subscription")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "metadata")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "phases")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "start_date")) -- | Create a new 'PostSubscriptionSchedulesRequestBody' with all required fields. mkPostSubscriptionSchedulesRequestBody :: PostSubscriptionSchedulesRequestBody mkPostSubscriptionSchedulesRequestBody = PostSubscriptionSchedulesRequestBody { postSubscriptionSchedulesRequestBodyCustomer = GHC.Maybe.Nothing, postSubscriptionSchedulesRequestBodyDefaultSettings = GHC.Maybe.Nothing, postSubscriptionSchedulesRequestBodyEndBehavior = GHC.Maybe.Nothing, postSubscriptionSchedulesRequestBodyExpand = GHC.Maybe.Nothing, postSubscriptionSchedulesRequestBodyFromSubscription = GHC.Maybe.Nothing, postSubscriptionSchedulesRequestBodyMetadata = GHC.Maybe.Nothing, postSubscriptionSchedulesRequestBodyPhases = GHC.Maybe.Nothing, postSubscriptionSchedulesRequestBodyStartDate = GHC.Maybe.Nothing } -- | Defines the object schema located at @paths.\/v1\/subscription_schedules.POST.requestBody.content.application\/x-www-form-urlencoded.schema.properties.default_settings@ in the specification. -- -- Object representing the subscription schedule\'s default settings. data PostSubscriptionSchedulesRequestBodyDefaultSettings' = PostSubscriptionSchedulesRequestBodyDefaultSettings' { -- | application_fee_percent postSubscriptionSchedulesRequestBodyDefaultSettings'ApplicationFeePercent :: (GHC.Maybe.Maybe GHC.Types.Double), -- | automatic_tax postSubscriptionSchedulesRequestBodyDefaultSettings'AutomaticTax :: (GHC.Maybe.Maybe PostSubscriptionSchedulesRequestBodyDefaultSettings'AutomaticTax'), -- | billing_cycle_anchor postSubscriptionSchedulesRequestBodyDefaultSettings'BillingCycleAnchor :: (GHC.Maybe.Maybe PostSubscriptionSchedulesRequestBodyDefaultSettings'BillingCycleAnchor'), -- | billing_thresholds postSubscriptionSchedulesRequestBodyDefaultSettings'BillingThresholds :: (GHC.Maybe.Maybe PostSubscriptionSchedulesRequestBodyDefaultSettings'BillingThresholds'Variants), -- | collection_method postSubscriptionSchedulesRequestBodyDefaultSettings'CollectionMethod :: (GHC.Maybe.Maybe PostSubscriptionSchedulesRequestBodyDefaultSettings'CollectionMethod'), -- | default_payment_method -- -- Constraints: -- -- * Maximum length of 5000 postSubscriptionSchedulesRequestBodyDefaultSettings'DefaultPaymentMethod :: (GHC.Maybe.Maybe Data.Text.Internal.Text), -- | invoice_settings postSubscriptionSchedulesRequestBodyDefaultSettings'InvoiceSettings :: (GHC.Maybe.Maybe PostSubscriptionSchedulesRequestBodyDefaultSettings'InvoiceSettings'), -- | transfer_data postSubscriptionSchedulesRequestBodyDefaultSettings'TransferData :: (GHC.Maybe.Maybe PostSubscriptionSchedulesRequestBodyDefaultSettings'TransferData'Variants) } deriving ( GHC.Show.Show, GHC.Classes.Eq ) instance Data.Aeson.Types.ToJSON.ToJSON PostSubscriptionSchedulesRequestBodyDefaultSettings' where toJSON obj = Data.Aeson.Types.Internal.object ("application_fee_percent" Data.Aeson.Types.ToJSON..= postSubscriptionSchedulesRequestBodyDefaultSettings'ApplicationFeePercent obj : "automatic_tax" Data.Aeson.Types.ToJSON..= postSubscriptionSchedulesRequestBodyDefaultSettings'AutomaticTax obj : "billing_cycle_anchor" Data.Aeson.Types.ToJSON..= postSubscriptionSchedulesRequestBodyDefaultSettings'BillingCycleAnchor obj : "billing_thresholds" Data.Aeson.Types.ToJSON..= postSubscriptionSchedulesRequestBodyDefaultSettings'BillingThresholds obj : "collection_method" Data.Aeson.Types.ToJSON..= postSubscriptionSchedulesRequestBodyDefaultSettings'CollectionMethod obj : "default_payment_method" Data.Aeson.Types.ToJSON..= postSubscriptionSchedulesRequestBodyDefaultSettings'DefaultPaymentMethod obj : "invoice_settings" Data.Aeson.Types.ToJSON..= postSubscriptionSchedulesRequestBodyDefaultSettings'InvoiceSettings obj : "transfer_data" Data.Aeson.Types.ToJSON..= postSubscriptionSchedulesRequestBodyDefaultSettings'TransferData obj : GHC.Base.mempty) toEncoding obj = Data.Aeson.Encoding.Internal.pairs (("application_fee_percent" Data.Aeson.Types.ToJSON..= postSubscriptionSchedulesRequestBodyDefaultSettings'ApplicationFeePercent obj) GHC.Base.<> (("automatic_tax" Data.Aeson.Types.ToJSON..= postSubscriptionSchedulesRequestBodyDefaultSettings'AutomaticTax obj) GHC.Base.<> (("billing_cycle_anchor" Data.Aeson.Types.ToJSON..= postSubscriptionSchedulesRequestBodyDefaultSettings'BillingCycleAnchor obj) GHC.Base.<> (("billing_thresholds" Data.Aeson.Types.ToJSON..= postSubscriptionSchedulesRequestBodyDefaultSettings'BillingThresholds obj) GHC.Base.<> (("collection_method" Data.Aeson.Types.ToJSON..= postSubscriptionSchedulesRequestBodyDefaultSettings'CollectionMethod obj) GHC.Base.<> (("default_payment_method" Data.Aeson.Types.ToJSON..= postSubscriptionSchedulesRequestBodyDefaultSettings'DefaultPaymentMethod obj) GHC.Base.<> (("invoice_settings" Data.Aeson.Types.ToJSON..= postSubscriptionSchedulesRequestBodyDefaultSettings'InvoiceSettings obj) GHC.Base.<> ("transfer_data" Data.Aeson.Types.ToJSON..= postSubscriptionSchedulesRequestBodyDefaultSettings'TransferData obj)))))))) instance Data.Aeson.Types.FromJSON.FromJSON PostSubscriptionSchedulesRequestBodyDefaultSettings' where parseJSON = Data.Aeson.Types.FromJSON.withObject "PostSubscriptionSchedulesRequestBodyDefaultSettings'" (\obj -> (((((((GHC.Base.pure PostSubscriptionSchedulesRequestBodyDefaultSettings' 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..:? "billing_cycle_anchor")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "billing_thresholds")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "collection_method")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "default_payment_method")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "invoice_settings")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "transfer_data")) -- | Create a new 'PostSubscriptionSchedulesRequestBodyDefaultSettings'' with all required fields. mkPostSubscriptionSchedulesRequestBodyDefaultSettings' :: PostSubscriptionSchedulesRequestBodyDefaultSettings' mkPostSubscriptionSchedulesRequestBodyDefaultSettings' = PostSubscriptionSchedulesRequestBodyDefaultSettings' { postSubscriptionSchedulesRequestBodyDefaultSettings'ApplicationFeePercent = GHC.Maybe.Nothing, postSubscriptionSchedulesRequestBodyDefaultSettings'AutomaticTax = GHC.Maybe.Nothing, postSubscriptionSchedulesRequestBodyDefaultSettings'BillingCycleAnchor = GHC.Maybe.Nothing, postSubscriptionSchedulesRequestBodyDefaultSettings'BillingThresholds = GHC.Maybe.Nothing, postSubscriptionSchedulesRequestBodyDefaultSettings'CollectionMethod = GHC.Maybe.Nothing, postSubscriptionSchedulesRequestBodyDefaultSettings'DefaultPaymentMethod = GHC.Maybe.Nothing, postSubscriptionSchedulesRequestBodyDefaultSettings'InvoiceSettings = GHC.Maybe.Nothing, postSubscriptionSchedulesRequestBodyDefaultSettings'TransferData = GHC.Maybe.Nothing } -- | Defines the object schema located at @paths.\/v1\/subscription_schedules.POST.requestBody.content.application\/x-www-form-urlencoded.schema.properties.default_settings.properties.automatic_tax@ in the specification. data PostSubscriptionSchedulesRequestBodyDefaultSettings'AutomaticTax' = PostSubscriptionSchedulesRequestBodyDefaultSettings'AutomaticTax' { -- | enabled postSubscriptionSchedulesRequestBodyDefaultSettings'AutomaticTax'Enabled :: GHC.Types.Bool } deriving ( GHC.Show.Show, GHC.Classes.Eq ) instance Data.Aeson.Types.ToJSON.ToJSON PostSubscriptionSchedulesRequestBodyDefaultSettings'AutomaticTax' where toJSON obj = Data.Aeson.Types.Internal.object ("enabled" Data.Aeson.Types.ToJSON..= postSubscriptionSchedulesRequestBodyDefaultSettings'AutomaticTax'Enabled obj : GHC.Base.mempty) toEncoding obj = Data.Aeson.Encoding.Internal.pairs ("enabled" Data.Aeson.Types.ToJSON..= postSubscriptionSchedulesRequestBodyDefaultSettings'AutomaticTax'Enabled obj) instance Data.Aeson.Types.FromJSON.FromJSON PostSubscriptionSchedulesRequestBodyDefaultSettings'AutomaticTax' where parseJSON = Data.Aeson.Types.FromJSON.withObject "PostSubscriptionSchedulesRequestBodyDefaultSettings'AutomaticTax'" (\obj -> GHC.Base.pure PostSubscriptionSchedulesRequestBodyDefaultSettings'AutomaticTax' GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..: "enabled")) -- | Create a new 'PostSubscriptionSchedulesRequestBodyDefaultSettings'AutomaticTax'' with all required fields. mkPostSubscriptionSchedulesRequestBodyDefaultSettings'AutomaticTax' :: -- | 'postSubscriptionSchedulesRequestBodyDefaultSettings'AutomaticTax'Enabled' GHC.Types.Bool -> PostSubscriptionSchedulesRequestBodyDefaultSettings'AutomaticTax' mkPostSubscriptionSchedulesRequestBodyDefaultSettings'AutomaticTax' postSubscriptionSchedulesRequestBodyDefaultSettings'AutomaticTax'Enabled = PostSubscriptionSchedulesRequestBodyDefaultSettings'AutomaticTax' {postSubscriptionSchedulesRequestBodyDefaultSettings'AutomaticTax'Enabled = postSubscriptionSchedulesRequestBodyDefaultSettings'AutomaticTax'Enabled} -- | Defines the enum schema located at @paths.\/v1\/subscription_schedules.POST.requestBody.content.application\/x-www-form-urlencoded.schema.properties.default_settings.properties.billing_cycle_anchor@ in the specification. data PostSubscriptionSchedulesRequestBodyDefaultSettings'BillingCycleAnchor' = -- | This case is used if the value encountered during decoding does not match any of the provided cases in the specification. PostSubscriptionSchedulesRequestBodyDefaultSettings'BillingCycleAnchor'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. PostSubscriptionSchedulesRequestBodyDefaultSettings'BillingCycleAnchor'Typed Data.Text.Internal.Text | -- | Represents the JSON value @"automatic"@ PostSubscriptionSchedulesRequestBodyDefaultSettings'BillingCycleAnchor'EnumAutomatic | -- | Represents the JSON value @"phase_start"@ PostSubscriptionSchedulesRequestBodyDefaultSettings'BillingCycleAnchor'EnumPhaseStart deriving (GHC.Show.Show, GHC.Classes.Eq) instance Data.Aeson.Types.ToJSON.ToJSON PostSubscriptionSchedulesRequestBodyDefaultSettings'BillingCycleAnchor' where toJSON (PostSubscriptionSchedulesRequestBodyDefaultSettings'BillingCycleAnchor'Other val) = val toJSON (PostSubscriptionSchedulesRequestBodyDefaultSettings'BillingCycleAnchor'Typed val) = Data.Aeson.Types.ToJSON.toJSON val toJSON (PostSubscriptionSchedulesRequestBodyDefaultSettings'BillingCycleAnchor'EnumAutomatic) = "automatic" toJSON (PostSubscriptionSchedulesRequestBodyDefaultSettings'BillingCycleAnchor'EnumPhaseStart) = "phase_start" instance Data.Aeson.Types.FromJSON.FromJSON PostSubscriptionSchedulesRequestBodyDefaultSettings'BillingCycleAnchor' where parseJSON val = GHC.Base.pure ( if | val GHC.Classes.== "automatic" -> PostSubscriptionSchedulesRequestBodyDefaultSettings'BillingCycleAnchor'EnumAutomatic | val GHC.Classes.== "phase_start" -> PostSubscriptionSchedulesRequestBodyDefaultSettings'BillingCycleAnchor'EnumPhaseStart | GHC.Base.otherwise -> PostSubscriptionSchedulesRequestBodyDefaultSettings'BillingCycleAnchor'Other val ) -- | Defines the object schema located at @paths.\/v1\/subscription_schedules.POST.requestBody.content.application\/x-www-form-urlencoded.schema.properties.default_settings.properties.billing_thresholds.anyOf@ in the specification. data PostSubscriptionSchedulesRequestBodyDefaultSettings'BillingThresholds'OneOf1 = PostSubscriptionSchedulesRequestBodyDefaultSettings'BillingThresholds'OneOf1 { -- | amount_gte postSubscriptionSchedulesRequestBodyDefaultSettings'BillingThresholds'OneOf1AmountGte :: (GHC.Maybe.Maybe GHC.Types.Int), -- | reset_billing_cycle_anchor postSubscriptionSchedulesRequestBodyDefaultSettings'BillingThresholds'OneOf1ResetBillingCycleAnchor :: (GHC.Maybe.Maybe GHC.Types.Bool) } deriving ( GHC.Show.Show, GHC.Classes.Eq ) instance Data.Aeson.Types.ToJSON.ToJSON PostSubscriptionSchedulesRequestBodyDefaultSettings'BillingThresholds'OneOf1 where toJSON obj = Data.Aeson.Types.Internal.object ("amount_gte" Data.Aeson.Types.ToJSON..= postSubscriptionSchedulesRequestBodyDefaultSettings'BillingThresholds'OneOf1AmountGte obj : "reset_billing_cycle_anchor" Data.Aeson.Types.ToJSON..= postSubscriptionSchedulesRequestBodyDefaultSettings'BillingThresholds'OneOf1ResetBillingCycleAnchor obj : GHC.Base.mempty) toEncoding obj = Data.Aeson.Encoding.Internal.pairs (("amount_gte" Data.Aeson.Types.ToJSON..= postSubscriptionSchedulesRequestBodyDefaultSettings'BillingThresholds'OneOf1AmountGte obj) GHC.Base.<> ("reset_billing_cycle_anchor" Data.Aeson.Types.ToJSON..= postSubscriptionSchedulesRequestBodyDefaultSettings'BillingThresholds'OneOf1ResetBillingCycleAnchor obj)) instance Data.Aeson.Types.FromJSON.FromJSON PostSubscriptionSchedulesRequestBodyDefaultSettings'BillingThresholds'OneOf1 where parseJSON = Data.Aeson.Types.FromJSON.withObject "PostSubscriptionSchedulesRequestBodyDefaultSettings'BillingThresholds'OneOf1" (\obj -> (GHC.Base.pure PostSubscriptionSchedulesRequestBodyDefaultSettings'BillingThresholds'OneOf1 GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "amount_gte")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "reset_billing_cycle_anchor")) -- | Create a new 'PostSubscriptionSchedulesRequestBodyDefaultSettings'BillingThresholds'OneOf1' with all required fields. mkPostSubscriptionSchedulesRequestBodyDefaultSettings'BillingThresholds'OneOf1 :: PostSubscriptionSchedulesRequestBodyDefaultSettings'BillingThresholds'OneOf1 mkPostSubscriptionSchedulesRequestBodyDefaultSettings'BillingThresholds'OneOf1 = PostSubscriptionSchedulesRequestBodyDefaultSettings'BillingThresholds'OneOf1 { postSubscriptionSchedulesRequestBodyDefaultSettings'BillingThresholds'OneOf1AmountGte = GHC.Maybe.Nothing, postSubscriptionSchedulesRequestBodyDefaultSettings'BillingThresholds'OneOf1ResetBillingCycleAnchor = GHC.Maybe.Nothing } -- | Defines the oneOf schema located at @paths.\/v1\/subscription_schedules.POST.requestBody.content.application\/x-www-form-urlencoded.schema.properties.default_settings.properties.billing_thresholds.anyOf@ in the specification. data PostSubscriptionSchedulesRequestBodyDefaultSettings'BillingThresholds'Variants = -- | Represents the JSON value @""@ PostSubscriptionSchedulesRequestBodyDefaultSettings'BillingThresholds'EmptyString | PostSubscriptionSchedulesRequestBodyDefaultSettings'BillingThresholds'PostSubscriptionSchedulesRequestBodyDefaultSettings'BillingThresholds'OneOf1 PostSubscriptionSchedulesRequestBodyDefaultSettings'BillingThresholds'OneOf1 deriving (GHC.Show.Show, GHC.Classes.Eq) instance Data.Aeson.Types.ToJSON.ToJSON PostSubscriptionSchedulesRequestBodyDefaultSettings'BillingThresholds'Variants where toJSON (PostSubscriptionSchedulesRequestBodyDefaultSettings'BillingThresholds'PostSubscriptionSchedulesRequestBodyDefaultSettings'BillingThresholds'OneOf1 a) = Data.Aeson.Types.ToJSON.toJSON a toJSON (PostSubscriptionSchedulesRequestBodyDefaultSettings'BillingThresholds'EmptyString) = "" instance Data.Aeson.Types.FromJSON.FromJSON PostSubscriptionSchedulesRequestBodyDefaultSettings'BillingThresholds'Variants where parseJSON val = if | val GHC.Classes.== "" -> GHC.Base.pure PostSubscriptionSchedulesRequestBodyDefaultSettings'BillingThresholds'EmptyString | GHC.Base.otherwise -> case (PostSubscriptionSchedulesRequestBodyDefaultSettings'BillingThresholds'PostSubscriptionSchedulesRequestBodyDefaultSettings'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 enum schema located at @paths.\/v1\/subscription_schedules.POST.requestBody.content.application\/x-www-form-urlencoded.schema.properties.default_settings.properties.collection_method@ in the specification. data PostSubscriptionSchedulesRequestBodyDefaultSettings'CollectionMethod' = -- | This case is used if the value encountered during decoding does not match any of the provided cases in the specification. PostSubscriptionSchedulesRequestBodyDefaultSettings'CollectionMethod'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. PostSubscriptionSchedulesRequestBodyDefaultSettings'CollectionMethod'Typed Data.Text.Internal.Text | -- | Represents the JSON value @"charge_automatically"@ PostSubscriptionSchedulesRequestBodyDefaultSettings'CollectionMethod'EnumChargeAutomatically | -- | Represents the JSON value @"send_invoice"@ PostSubscriptionSchedulesRequestBodyDefaultSettings'CollectionMethod'EnumSendInvoice deriving (GHC.Show.Show, GHC.Classes.Eq) instance Data.Aeson.Types.ToJSON.ToJSON PostSubscriptionSchedulesRequestBodyDefaultSettings'CollectionMethod' where toJSON (PostSubscriptionSchedulesRequestBodyDefaultSettings'CollectionMethod'Other val) = val toJSON (PostSubscriptionSchedulesRequestBodyDefaultSettings'CollectionMethod'Typed val) = Data.Aeson.Types.ToJSON.toJSON val toJSON (PostSubscriptionSchedulesRequestBodyDefaultSettings'CollectionMethod'EnumChargeAutomatically) = "charge_automatically" toJSON (PostSubscriptionSchedulesRequestBodyDefaultSettings'CollectionMethod'EnumSendInvoice) = "send_invoice" instance Data.Aeson.Types.FromJSON.FromJSON PostSubscriptionSchedulesRequestBodyDefaultSettings'CollectionMethod' where parseJSON val = GHC.Base.pure ( if | val GHC.Classes.== "charge_automatically" -> PostSubscriptionSchedulesRequestBodyDefaultSettings'CollectionMethod'EnumChargeAutomatically | val GHC.Classes.== "send_invoice" -> PostSubscriptionSchedulesRequestBodyDefaultSettings'CollectionMethod'EnumSendInvoice | GHC.Base.otherwise -> PostSubscriptionSchedulesRequestBodyDefaultSettings'CollectionMethod'Other val ) -- | Defines the object schema located at @paths.\/v1\/subscription_schedules.POST.requestBody.content.application\/x-www-form-urlencoded.schema.properties.default_settings.properties.invoice_settings@ in the specification. data PostSubscriptionSchedulesRequestBodyDefaultSettings'InvoiceSettings' = PostSubscriptionSchedulesRequestBodyDefaultSettings'InvoiceSettings' { -- | days_until_due postSubscriptionSchedulesRequestBodyDefaultSettings'InvoiceSettings'DaysUntilDue :: (GHC.Maybe.Maybe GHC.Types.Int) } deriving ( GHC.Show.Show, GHC.Classes.Eq ) instance Data.Aeson.Types.ToJSON.ToJSON PostSubscriptionSchedulesRequestBodyDefaultSettings'InvoiceSettings' where toJSON obj = Data.Aeson.Types.Internal.object ("days_until_due" Data.Aeson.Types.ToJSON..= postSubscriptionSchedulesRequestBodyDefaultSettings'InvoiceSettings'DaysUntilDue obj : GHC.Base.mempty) toEncoding obj = Data.Aeson.Encoding.Internal.pairs ("days_until_due" Data.Aeson.Types.ToJSON..= postSubscriptionSchedulesRequestBodyDefaultSettings'InvoiceSettings'DaysUntilDue obj) instance Data.Aeson.Types.FromJSON.FromJSON PostSubscriptionSchedulesRequestBodyDefaultSettings'InvoiceSettings' where parseJSON = Data.Aeson.Types.FromJSON.withObject "PostSubscriptionSchedulesRequestBodyDefaultSettings'InvoiceSettings'" (\obj -> GHC.Base.pure PostSubscriptionSchedulesRequestBodyDefaultSettings'InvoiceSettings' GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "days_until_due")) -- | Create a new 'PostSubscriptionSchedulesRequestBodyDefaultSettings'InvoiceSettings'' with all required fields. mkPostSubscriptionSchedulesRequestBodyDefaultSettings'InvoiceSettings' :: PostSubscriptionSchedulesRequestBodyDefaultSettings'InvoiceSettings' mkPostSubscriptionSchedulesRequestBodyDefaultSettings'InvoiceSettings' = PostSubscriptionSchedulesRequestBodyDefaultSettings'InvoiceSettings' {postSubscriptionSchedulesRequestBodyDefaultSettings'InvoiceSettings'DaysUntilDue = GHC.Maybe.Nothing} -- | Defines the object schema located at @paths.\/v1\/subscription_schedules.POST.requestBody.content.application\/x-www-form-urlencoded.schema.properties.default_settings.properties.transfer_data.anyOf@ in the specification. data PostSubscriptionSchedulesRequestBodyDefaultSettings'TransferData'OneOf1 = PostSubscriptionSchedulesRequestBodyDefaultSettings'TransferData'OneOf1 { -- | amount_percent postSubscriptionSchedulesRequestBodyDefaultSettings'TransferData'OneOf1AmountPercent :: (GHC.Maybe.Maybe GHC.Types.Double), -- | destination postSubscriptionSchedulesRequestBodyDefaultSettings'TransferData'OneOf1Destination :: Data.Text.Internal.Text } deriving ( GHC.Show.Show, GHC.Classes.Eq ) instance Data.Aeson.Types.ToJSON.ToJSON PostSubscriptionSchedulesRequestBodyDefaultSettings'TransferData'OneOf1 where toJSON obj = Data.Aeson.Types.Internal.object ("amount_percent" Data.Aeson.Types.ToJSON..= postSubscriptionSchedulesRequestBodyDefaultSettings'TransferData'OneOf1AmountPercent obj : "destination" Data.Aeson.Types.ToJSON..= postSubscriptionSchedulesRequestBodyDefaultSettings'TransferData'OneOf1Destination obj : GHC.Base.mempty) toEncoding obj = Data.Aeson.Encoding.Internal.pairs (("amount_percent" Data.Aeson.Types.ToJSON..= postSubscriptionSchedulesRequestBodyDefaultSettings'TransferData'OneOf1AmountPercent obj) GHC.Base.<> ("destination" Data.Aeson.Types.ToJSON..= postSubscriptionSchedulesRequestBodyDefaultSettings'TransferData'OneOf1Destination obj)) instance Data.Aeson.Types.FromJSON.FromJSON PostSubscriptionSchedulesRequestBodyDefaultSettings'TransferData'OneOf1 where parseJSON = Data.Aeson.Types.FromJSON.withObject "PostSubscriptionSchedulesRequestBodyDefaultSettings'TransferData'OneOf1" (\obj -> (GHC.Base.pure PostSubscriptionSchedulesRequestBodyDefaultSettings'TransferData'OneOf1 GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "amount_percent")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..: "destination")) -- | Create a new 'PostSubscriptionSchedulesRequestBodyDefaultSettings'TransferData'OneOf1' with all required fields. mkPostSubscriptionSchedulesRequestBodyDefaultSettings'TransferData'OneOf1 :: -- | 'postSubscriptionSchedulesRequestBodyDefaultSettings'TransferData'OneOf1Destination' Data.Text.Internal.Text -> PostSubscriptionSchedulesRequestBodyDefaultSettings'TransferData'OneOf1 mkPostSubscriptionSchedulesRequestBodyDefaultSettings'TransferData'OneOf1 postSubscriptionSchedulesRequestBodyDefaultSettings'TransferData'OneOf1Destination = PostSubscriptionSchedulesRequestBodyDefaultSettings'TransferData'OneOf1 { postSubscriptionSchedulesRequestBodyDefaultSettings'TransferData'OneOf1AmountPercent = GHC.Maybe.Nothing, postSubscriptionSchedulesRequestBodyDefaultSettings'TransferData'OneOf1Destination = postSubscriptionSchedulesRequestBodyDefaultSettings'TransferData'OneOf1Destination } -- | Defines the oneOf schema located at @paths.\/v1\/subscription_schedules.POST.requestBody.content.application\/x-www-form-urlencoded.schema.properties.default_settings.properties.transfer_data.anyOf@ in the specification. data PostSubscriptionSchedulesRequestBodyDefaultSettings'TransferData'Variants = -- | Represents the JSON value @""@ PostSubscriptionSchedulesRequestBodyDefaultSettings'TransferData'EmptyString | PostSubscriptionSchedulesRequestBodyDefaultSettings'TransferData'PostSubscriptionSchedulesRequestBodyDefaultSettings'TransferData'OneOf1 PostSubscriptionSchedulesRequestBodyDefaultSettings'TransferData'OneOf1 deriving (GHC.Show.Show, GHC.Classes.Eq) instance Data.Aeson.Types.ToJSON.ToJSON PostSubscriptionSchedulesRequestBodyDefaultSettings'TransferData'Variants where toJSON (PostSubscriptionSchedulesRequestBodyDefaultSettings'TransferData'PostSubscriptionSchedulesRequestBodyDefaultSettings'TransferData'OneOf1 a) = Data.Aeson.Types.ToJSON.toJSON a toJSON (PostSubscriptionSchedulesRequestBodyDefaultSettings'TransferData'EmptyString) = "" instance Data.Aeson.Types.FromJSON.FromJSON PostSubscriptionSchedulesRequestBodyDefaultSettings'TransferData'Variants where parseJSON val = if | val GHC.Classes.== "" -> GHC.Base.pure PostSubscriptionSchedulesRequestBodyDefaultSettings'TransferData'EmptyString | GHC.Base.otherwise -> case (PostSubscriptionSchedulesRequestBodyDefaultSettings'TransferData'PostSubscriptionSchedulesRequestBodyDefaultSettings'TransferData'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\/subscription_schedules.POST.requestBody.content.application\/x-www-form-urlencoded.schema.properties.end_behavior@ in the specification. -- -- Configures how the subscription schedule behaves when it ends. Possible values are \`release\` or \`cancel\` with the default being \`release\`. \`release\` will end the subscription schedule and keep the underlying subscription running.\`cancel\` will end the subscription schedule and cancel the underlying subscription. data PostSubscriptionSchedulesRequestBodyEndBehavior' = -- | This case is used if the value encountered during decoding does not match any of the provided cases in the specification. PostSubscriptionSchedulesRequestBodyEndBehavior'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. PostSubscriptionSchedulesRequestBodyEndBehavior'Typed Data.Text.Internal.Text | -- | Represents the JSON value @"cancel"@ PostSubscriptionSchedulesRequestBodyEndBehavior'EnumCancel | -- | Represents the JSON value @"none"@ PostSubscriptionSchedulesRequestBodyEndBehavior'EnumNone | -- | Represents the JSON value @"release"@ PostSubscriptionSchedulesRequestBodyEndBehavior'EnumRelease | -- | Represents the JSON value @"renew"@ PostSubscriptionSchedulesRequestBodyEndBehavior'EnumRenew deriving (GHC.Show.Show, GHC.Classes.Eq) instance Data.Aeson.Types.ToJSON.ToJSON PostSubscriptionSchedulesRequestBodyEndBehavior' where toJSON (PostSubscriptionSchedulesRequestBodyEndBehavior'Other val) = val toJSON (PostSubscriptionSchedulesRequestBodyEndBehavior'Typed val) = Data.Aeson.Types.ToJSON.toJSON val toJSON (PostSubscriptionSchedulesRequestBodyEndBehavior'EnumCancel) = "cancel" toJSON (PostSubscriptionSchedulesRequestBodyEndBehavior'EnumNone) = "none" toJSON (PostSubscriptionSchedulesRequestBodyEndBehavior'EnumRelease) = "release" toJSON (PostSubscriptionSchedulesRequestBodyEndBehavior'EnumRenew) = "renew" instance Data.Aeson.Types.FromJSON.FromJSON PostSubscriptionSchedulesRequestBodyEndBehavior' where parseJSON val = GHC.Base.pure ( if | val GHC.Classes.== "cancel" -> PostSubscriptionSchedulesRequestBodyEndBehavior'EnumCancel | val GHC.Classes.== "none" -> PostSubscriptionSchedulesRequestBodyEndBehavior'EnumNone | val GHC.Classes.== "release" -> PostSubscriptionSchedulesRequestBodyEndBehavior'EnumRelease | val GHC.Classes.== "renew" -> PostSubscriptionSchedulesRequestBodyEndBehavior'EnumRenew | GHC.Base.otherwise -> PostSubscriptionSchedulesRequestBodyEndBehavior'Other val ) -- | Defines the oneOf schema located at @paths.\/v1\/subscription_schedules.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 PostSubscriptionSchedulesRequestBodyMetadata'Variants = -- | Represents the JSON value @""@ PostSubscriptionSchedulesRequestBodyMetadata'EmptyString | PostSubscriptionSchedulesRequestBodyMetadata'Object Data.Aeson.Types.Internal.Object deriving (GHC.Show.Show, GHC.Classes.Eq) instance Data.Aeson.Types.ToJSON.ToJSON PostSubscriptionSchedulesRequestBodyMetadata'Variants where toJSON (PostSubscriptionSchedulesRequestBodyMetadata'Object a) = Data.Aeson.Types.ToJSON.toJSON a toJSON (PostSubscriptionSchedulesRequestBodyMetadata'EmptyString) = "" instance Data.Aeson.Types.FromJSON.FromJSON PostSubscriptionSchedulesRequestBodyMetadata'Variants where parseJSON val = if | val GHC.Classes.== "" -> GHC.Base.pure PostSubscriptionSchedulesRequestBodyMetadata'EmptyString | GHC.Base.otherwise -> case (PostSubscriptionSchedulesRequestBodyMetadata'Object Data.Functor.<$> Data.Aeson.Types.FromJSON.fromJSON val) GHC.Base.<|> Data.Aeson.Types.Internal.Error "No variant matched" of Data.Aeson.Types.Internal.Success a -> GHC.Base.pure a Data.Aeson.Types.Internal.Error a -> Control.Monad.Fail.fail a -- | Defines the object schema located at @paths.\/v1\/subscription_schedules.POST.requestBody.content.application\/x-www-form-urlencoded.schema.properties.phases.items@ in the specification. data PostSubscriptionSchedulesRequestBodyPhases' = PostSubscriptionSchedulesRequestBodyPhases' { -- | add_invoice_items postSubscriptionSchedulesRequestBodyPhases'AddInvoiceItems :: (GHC.Maybe.Maybe ([PostSubscriptionSchedulesRequestBodyPhases'AddInvoiceItems'])), -- | application_fee_percent postSubscriptionSchedulesRequestBodyPhases'ApplicationFeePercent :: (GHC.Maybe.Maybe GHC.Types.Double), -- | automatic_tax postSubscriptionSchedulesRequestBodyPhases'AutomaticTax :: (GHC.Maybe.Maybe PostSubscriptionSchedulesRequestBodyPhases'AutomaticTax'), -- | billing_cycle_anchor postSubscriptionSchedulesRequestBodyPhases'BillingCycleAnchor :: (GHC.Maybe.Maybe PostSubscriptionSchedulesRequestBodyPhases'BillingCycleAnchor'), -- | billing_thresholds postSubscriptionSchedulesRequestBodyPhases'BillingThresholds :: (GHC.Maybe.Maybe PostSubscriptionSchedulesRequestBodyPhases'BillingThresholds'Variants), -- | collection_method postSubscriptionSchedulesRequestBodyPhases'CollectionMethod :: (GHC.Maybe.Maybe PostSubscriptionSchedulesRequestBodyPhases'CollectionMethod'), -- | coupon -- -- Constraints: -- -- * Maximum length of 5000 postSubscriptionSchedulesRequestBodyPhases'Coupon :: (GHC.Maybe.Maybe Data.Text.Internal.Text), -- | default_payment_method -- -- Constraints: -- -- * Maximum length of 5000 postSubscriptionSchedulesRequestBodyPhases'DefaultPaymentMethod :: (GHC.Maybe.Maybe Data.Text.Internal.Text), -- | default_tax_rates postSubscriptionSchedulesRequestBodyPhases'DefaultTaxRates :: (GHC.Maybe.Maybe PostSubscriptionSchedulesRequestBodyPhases'DefaultTaxRates'Variants), -- | end_date postSubscriptionSchedulesRequestBodyPhases'EndDate :: (GHC.Maybe.Maybe GHC.Types.Int), -- | invoice_settings postSubscriptionSchedulesRequestBodyPhases'InvoiceSettings :: (GHC.Maybe.Maybe PostSubscriptionSchedulesRequestBodyPhases'InvoiceSettings'), -- | items postSubscriptionSchedulesRequestBodyPhases'Items :: ([PostSubscriptionSchedulesRequestBodyPhases'Items']), -- | iterations postSubscriptionSchedulesRequestBodyPhases'Iterations :: (GHC.Maybe.Maybe GHC.Types.Int), -- | proration_behavior postSubscriptionSchedulesRequestBodyPhases'ProrationBehavior :: (GHC.Maybe.Maybe PostSubscriptionSchedulesRequestBodyPhases'ProrationBehavior'), -- | transfer_data postSubscriptionSchedulesRequestBodyPhases'TransferData :: (GHC.Maybe.Maybe PostSubscriptionSchedulesRequestBodyPhases'TransferData'), -- | trial postSubscriptionSchedulesRequestBodyPhases'Trial :: (GHC.Maybe.Maybe GHC.Types.Bool), -- | trial_end postSubscriptionSchedulesRequestBodyPhases'TrialEnd :: (GHC.Maybe.Maybe GHC.Types.Int) } deriving ( GHC.Show.Show, GHC.Classes.Eq ) instance Data.Aeson.Types.ToJSON.ToJSON PostSubscriptionSchedulesRequestBodyPhases' where toJSON obj = Data.Aeson.Types.Internal.object ("add_invoice_items" Data.Aeson.Types.ToJSON..= postSubscriptionSchedulesRequestBodyPhases'AddInvoiceItems obj : "application_fee_percent" Data.Aeson.Types.ToJSON..= postSubscriptionSchedulesRequestBodyPhases'ApplicationFeePercent obj : "automatic_tax" Data.Aeson.Types.ToJSON..= postSubscriptionSchedulesRequestBodyPhases'AutomaticTax obj : "billing_cycle_anchor" Data.Aeson.Types.ToJSON..= postSubscriptionSchedulesRequestBodyPhases'BillingCycleAnchor obj : "billing_thresholds" Data.Aeson.Types.ToJSON..= postSubscriptionSchedulesRequestBodyPhases'BillingThresholds obj : "collection_method" Data.Aeson.Types.ToJSON..= postSubscriptionSchedulesRequestBodyPhases'CollectionMethod obj : "coupon" Data.Aeson.Types.ToJSON..= postSubscriptionSchedulesRequestBodyPhases'Coupon obj : "default_payment_method" Data.Aeson.Types.ToJSON..= postSubscriptionSchedulesRequestBodyPhases'DefaultPaymentMethod obj : "default_tax_rates" Data.Aeson.Types.ToJSON..= postSubscriptionSchedulesRequestBodyPhases'DefaultTaxRates obj : "end_date" Data.Aeson.Types.ToJSON..= postSubscriptionSchedulesRequestBodyPhases'EndDate obj : "invoice_settings" Data.Aeson.Types.ToJSON..= postSubscriptionSchedulesRequestBodyPhases'InvoiceSettings obj : "items" Data.Aeson.Types.ToJSON..= postSubscriptionSchedulesRequestBodyPhases'Items obj : "iterations" Data.Aeson.Types.ToJSON..= postSubscriptionSchedulesRequestBodyPhases'Iterations obj : "proration_behavior" Data.Aeson.Types.ToJSON..= postSubscriptionSchedulesRequestBodyPhases'ProrationBehavior obj : "transfer_data" Data.Aeson.Types.ToJSON..= postSubscriptionSchedulesRequestBodyPhases'TransferData obj : "trial" Data.Aeson.Types.ToJSON..= postSubscriptionSchedulesRequestBodyPhases'Trial obj : "trial_end" Data.Aeson.Types.ToJSON..= postSubscriptionSchedulesRequestBodyPhases'TrialEnd obj : GHC.Base.mempty) toEncoding obj = Data.Aeson.Encoding.Internal.pairs (("add_invoice_items" Data.Aeson.Types.ToJSON..= postSubscriptionSchedulesRequestBodyPhases'AddInvoiceItems obj) GHC.Base.<> (("application_fee_percent" Data.Aeson.Types.ToJSON..= postSubscriptionSchedulesRequestBodyPhases'ApplicationFeePercent obj) GHC.Base.<> (("automatic_tax" Data.Aeson.Types.ToJSON..= postSubscriptionSchedulesRequestBodyPhases'AutomaticTax obj) GHC.Base.<> (("billing_cycle_anchor" Data.Aeson.Types.ToJSON..= postSubscriptionSchedulesRequestBodyPhases'BillingCycleAnchor obj) GHC.Base.<> (("billing_thresholds" Data.Aeson.Types.ToJSON..= postSubscriptionSchedulesRequestBodyPhases'BillingThresholds obj) GHC.Base.<> (("collection_method" Data.Aeson.Types.ToJSON..= postSubscriptionSchedulesRequestBodyPhases'CollectionMethod obj) GHC.Base.<> (("coupon" Data.Aeson.Types.ToJSON..= postSubscriptionSchedulesRequestBodyPhases'Coupon obj) GHC.Base.<> (("default_payment_method" Data.Aeson.Types.ToJSON..= postSubscriptionSchedulesRequestBodyPhases'DefaultPaymentMethod obj) GHC.Base.<> (("default_tax_rates" Data.Aeson.Types.ToJSON..= postSubscriptionSchedulesRequestBodyPhases'DefaultTaxRates obj) GHC.Base.<> (("end_date" Data.Aeson.Types.ToJSON..= postSubscriptionSchedulesRequestBodyPhases'EndDate obj) GHC.Base.<> (("invoice_settings" Data.Aeson.Types.ToJSON..= postSubscriptionSchedulesRequestBodyPhases'InvoiceSettings obj) GHC.Base.<> (("items" Data.Aeson.Types.ToJSON..= postSubscriptionSchedulesRequestBodyPhases'Items obj) GHC.Base.<> (("iterations" Data.Aeson.Types.ToJSON..= postSubscriptionSchedulesRequestBodyPhases'Iterations obj) GHC.Base.<> (("proration_behavior" Data.Aeson.Types.ToJSON..= postSubscriptionSchedulesRequestBodyPhases'ProrationBehavior obj) GHC.Base.<> (("transfer_data" Data.Aeson.Types.ToJSON..= postSubscriptionSchedulesRequestBodyPhases'TransferData obj) GHC.Base.<> (("trial" Data.Aeson.Types.ToJSON..= postSubscriptionSchedulesRequestBodyPhases'Trial obj) GHC.Base.<> ("trial_end" Data.Aeson.Types.ToJSON..= postSubscriptionSchedulesRequestBodyPhases'TrialEnd obj))))))))))))))))) instance Data.Aeson.Types.FromJSON.FromJSON PostSubscriptionSchedulesRequestBodyPhases' where parseJSON = Data.Aeson.Types.FromJSON.withObject "PostSubscriptionSchedulesRequestBodyPhases'" (\obj -> ((((((((((((((((GHC.Base.pure PostSubscriptionSchedulesRequestBodyPhases' 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..:? "billing_cycle_anchor")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "billing_thresholds")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "collection_method")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "coupon")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "default_payment_method")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "default_tax_rates")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "end_date")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "invoice_settings")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..: "items")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "iterations")) 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")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "trial_end")) -- | Create a new 'PostSubscriptionSchedulesRequestBodyPhases'' with all required fields. mkPostSubscriptionSchedulesRequestBodyPhases' :: -- | 'postSubscriptionSchedulesRequestBodyPhases'Items' [PostSubscriptionSchedulesRequestBodyPhases'Items'] -> PostSubscriptionSchedulesRequestBodyPhases' mkPostSubscriptionSchedulesRequestBodyPhases' postSubscriptionSchedulesRequestBodyPhases'Items = PostSubscriptionSchedulesRequestBodyPhases' { postSubscriptionSchedulesRequestBodyPhases'AddInvoiceItems = GHC.Maybe.Nothing, postSubscriptionSchedulesRequestBodyPhases'ApplicationFeePercent = GHC.Maybe.Nothing, postSubscriptionSchedulesRequestBodyPhases'AutomaticTax = GHC.Maybe.Nothing, postSubscriptionSchedulesRequestBodyPhases'BillingCycleAnchor = GHC.Maybe.Nothing, postSubscriptionSchedulesRequestBodyPhases'BillingThresholds = GHC.Maybe.Nothing, postSubscriptionSchedulesRequestBodyPhases'CollectionMethod = GHC.Maybe.Nothing, postSubscriptionSchedulesRequestBodyPhases'Coupon = GHC.Maybe.Nothing, postSubscriptionSchedulesRequestBodyPhases'DefaultPaymentMethod = GHC.Maybe.Nothing, postSubscriptionSchedulesRequestBodyPhases'DefaultTaxRates = GHC.Maybe.Nothing, postSubscriptionSchedulesRequestBodyPhases'EndDate = GHC.Maybe.Nothing, postSubscriptionSchedulesRequestBodyPhases'InvoiceSettings = GHC.Maybe.Nothing, postSubscriptionSchedulesRequestBodyPhases'Items = postSubscriptionSchedulesRequestBodyPhases'Items, postSubscriptionSchedulesRequestBodyPhases'Iterations = GHC.Maybe.Nothing, postSubscriptionSchedulesRequestBodyPhases'ProrationBehavior = GHC.Maybe.Nothing, postSubscriptionSchedulesRequestBodyPhases'TransferData = GHC.Maybe.Nothing, postSubscriptionSchedulesRequestBodyPhases'Trial = GHC.Maybe.Nothing, postSubscriptionSchedulesRequestBodyPhases'TrialEnd = GHC.Maybe.Nothing } -- | Defines the object schema located at @paths.\/v1\/subscription_schedules.POST.requestBody.content.application\/x-www-form-urlencoded.schema.properties.phases.items.properties.add_invoice_items.items@ in the specification. data PostSubscriptionSchedulesRequestBodyPhases'AddInvoiceItems' = PostSubscriptionSchedulesRequestBodyPhases'AddInvoiceItems' { -- | price -- -- Constraints: -- -- * Maximum length of 5000 postSubscriptionSchedulesRequestBodyPhases'AddInvoiceItems'Price :: (GHC.Maybe.Maybe Data.Text.Internal.Text), -- | price_data postSubscriptionSchedulesRequestBodyPhases'AddInvoiceItems'PriceData :: (GHC.Maybe.Maybe PostSubscriptionSchedulesRequestBodyPhases'AddInvoiceItems'PriceData'), -- | quantity postSubscriptionSchedulesRequestBodyPhases'AddInvoiceItems'Quantity :: (GHC.Maybe.Maybe GHC.Types.Int), -- | tax_rates postSubscriptionSchedulesRequestBodyPhases'AddInvoiceItems'TaxRates :: (GHC.Maybe.Maybe PostSubscriptionSchedulesRequestBodyPhases'AddInvoiceItems'TaxRates'Variants) } deriving ( GHC.Show.Show, GHC.Classes.Eq ) instance Data.Aeson.Types.ToJSON.ToJSON PostSubscriptionSchedulesRequestBodyPhases'AddInvoiceItems' where toJSON obj = Data.Aeson.Types.Internal.object ("price" Data.Aeson.Types.ToJSON..= postSubscriptionSchedulesRequestBodyPhases'AddInvoiceItems'Price obj : "price_data" Data.Aeson.Types.ToJSON..= postSubscriptionSchedulesRequestBodyPhases'AddInvoiceItems'PriceData obj : "quantity" Data.Aeson.Types.ToJSON..= postSubscriptionSchedulesRequestBodyPhases'AddInvoiceItems'Quantity obj : "tax_rates" Data.Aeson.Types.ToJSON..= postSubscriptionSchedulesRequestBodyPhases'AddInvoiceItems'TaxRates obj : GHC.Base.mempty) toEncoding obj = Data.Aeson.Encoding.Internal.pairs (("price" Data.Aeson.Types.ToJSON..= postSubscriptionSchedulesRequestBodyPhases'AddInvoiceItems'Price obj) GHC.Base.<> (("price_data" Data.Aeson.Types.ToJSON..= postSubscriptionSchedulesRequestBodyPhases'AddInvoiceItems'PriceData obj) GHC.Base.<> (("quantity" Data.Aeson.Types.ToJSON..= postSubscriptionSchedulesRequestBodyPhases'AddInvoiceItems'Quantity obj) GHC.Base.<> ("tax_rates" Data.Aeson.Types.ToJSON..= postSubscriptionSchedulesRequestBodyPhases'AddInvoiceItems'TaxRates obj)))) instance Data.Aeson.Types.FromJSON.FromJSON PostSubscriptionSchedulesRequestBodyPhases'AddInvoiceItems' where parseJSON = Data.Aeson.Types.FromJSON.withObject "PostSubscriptionSchedulesRequestBodyPhases'AddInvoiceItems'" (\obj -> (((GHC.Base.pure PostSubscriptionSchedulesRequestBodyPhases'AddInvoiceItems' 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 'PostSubscriptionSchedulesRequestBodyPhases'AddInvoiceItems'' with all required fields. mkPostSubscriptionSchedulesRequestBodyPhases'AddInvoiceItems' :: PostSubscriptionSchedulesRequestBodyPhases'AddInvoiceItems' mkPostSubscriptionSchedulesRequestBodyPhases'AddInvoiceItems' = PostSubscriptionSchedulesRequestBodyPhases'AddInvoiceItems' { postSubscriptionSchedulesRequestBodyPhases'AddInvoiceItems'Price = GHC.Maybe.Nothing, postSubscriptionSchedulesRequestBodyPhases'AddInvoiceItems'PriceData = GHC.Maybe.Nothing, postSubscriptionSchedulesRequestBodyPhases'AddInvoiceItems'Quantity = GHC.Maybe.Nothing, postSubscriptionSchedulesRequestBodyPhases'AddInvoiceItems'TaxRates = GHC.Maybe.Nothing } -- | Defines the object schema located at @paths.\/v1\/subscription_schedules.POST.requestBody.content.application\/x-www-form-urlencoded.schema.properties.phases.items.properties.add_invoice_items.items.properties.price_data@ in the specification. data PostSubscriptionSchedulesRequestBodyPhases'AddInvoiceItems'PriceData' = PostSubscriptionSchedulesRequestBodyPhases'AddInvoiceItems'PriceData' { -- | currency postSubscriptionSchedulesRequestBodyPhases'AddInvoiceItems'PriceData'Currency :: Data.Text.Internal.Text, -- | product -- -- Constraints: -- -- * Maximum length of 5000 postSubscriptionSchedulesRequestBodyPhases'AddInvoiceItems'PriceData'Product :: Data.Text.Internal.Text, -- | tax_behavior postSubscriptionSchedulesRequestBodyPhases'AddInvoiceItems'PriceData'TaxBehavior :: (GHC.Maybe.Maybe PostSubscriptionSchedulesRequestBodyPhases'AddInvoiceItems'PriceData'TaxBehavior'), -- | unit_amount postSubscriptionSchedulesRequestBodyPhases'AddInvoiceItems'PriceData'UnitAmount :: (GHC.Maybe.Maybe GHC.Types.Int), -- | unit_amount_decimal postSubscriptionSchedulesRequestBodyPhases'AddInvoiceItems'PriceData'UnitAmountDecimal :: (GHC.Maybe.Maybe Data.Text.Internal.Text) } deriving ( GHC.Show.Show, GHC.Classes.Eq ) instance Data.Aeson.Types.ToJSON.ToJSON PostSubscriptionSchedulesRequestBodyPhases'AddInvoiceItems'PriceData' where toJSON obj = Data.Aeson.Types.Internal.object ("currency" Data.Aeson.Types.ToJSON..= postSubscriptionSchedulesRequestBodyPhases'AddInvoiceItems'PriceData'Currency obj : "product" Data.Aeson.Types.ToJSON..= postSubscriptionSchedulesRequestBodyPhases'AddInvoiceItems'PriceData'Product obj : "tax_behavior" Data.Aeson.Types.ToJSON..= postSubscriptionSchedulesRequestBodyPhases'AddInvoiceItems'PriceData'TaxBehavior obj : "unit_amount" Data.Aeson.Types.ToJSON..= postSubscriptionSchedulesRequestBodyPhases'AddInvoiceItems'PriceData'UnitAmount obj : "unit_amount_decimal" Data.Aeson.Types.ToJSON..= postSubscriptionSchedulesRequestBodyPhases'AddInvoiceItems'PriceData'UnitAmountDecimal obj : GHC.Base.mempty) toEncoding obj = Data.Aeson.Encoding.Internal.pairs (("currency" Data.Aeson.Types.ToJSON..= postSubscriptionSchedulesRequestBodyPhases'AddInvoiceItems'PriceData'Currency obj) GHC.Base.<> (("product" Data.Aeson.Types.ToJSON..= postSubscriptionSchedulesRequestBodyPhases'AddInvoiceItems'PriceData'Product obj) GHC.Base.<> (("tax_behavior" Data.Aeson.Types.ToJSON..= postSubscriptionSchedulesRequestBodyPhases'AddInvoiceItems'PriceData'TaxBehavior obj) GHC.Base.<> (("unit_amount" Data.Aeson.Types.ToJSON..= postSubscriptionSchedulesRequestBodyPhases'AddInvoiceItems'PriceData'UnitAmount obj) GHC.Base.<> ("unit_amount_decimal" Data.Aeson.Types.ToJSON..= postSubscriptionSchedulesRequestBodyPhases'AddInvoiceItems'PriceData'UnitAmountDecimal obj))))) instance Data.Aeson.Types.FromJSON.FromJSON PostSubscriptionSchedulesRequestBodyPhases'AddInvoiceItems'PriceData' where parseJSON = Data.Aeson.Types.FromJSON.withObject "PostSubscriptionSchedulesRequestBodyPhases'AddInvoiceItems'PriceData'" (\obj -> ((((GHC.Base.pure PostSubscriptionSchedulesRequestBodyPhases'AddInvoiceItems'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 'PostSubscriptionSchedulesRequestBodyPhases'AddInvoiceItems'PriceData'' with all required fields. mkPostSubscriptionSchedulesRequestBodyPhases'AddInvoiceItems'PriceData' :: -- | 'postSubscriptionSchedulesRequestBodyPhases'AddInvoiceItems'PriceData'Currency' Data.Text.Internal.Text -> -- | 'postSubscriptionSchedulesRequestBodyPhases'AddInvoiceItems'PriceData'Product' Data.Text.Internal.Text -> PostSubscriptionSchedulesRequestBodyPhases'AddInvoiceItems'PriceData' mkPostSubscriptionSchedulesRequestBodyPhases'AddInvoiceItems'PriceData' postSubscriptionSchedulesRequestBodyPhases'AddInvoiceItems'PriceData'Currency postSubscriptionSchedulesRequestBodyPhases'AddInvoiceItems'PriceData'Product = PostSubscriptionSchedulesRequestBodyPhases'AddInvoiceItems'PriceData' { postSubscriptionSchedulesRequestBodyPhases'AddInvoiceItems'PriceData'Currency = postSubscriptionSchedulesRequestBodyPhases'AddInvoiceItems'PriceData'Currency, postSubscriptionSchedulesRequestBodyPhases'AddInvoiceItems'PriceData'Product = postSubscriptionSchedulesRequestBodyPhases'AddInvoiceItems'PriceData'Product, postSubscriptionSchedulesRequestBodyPhases'AddInvoiceItems'PriceData'TaxBehavior = GHC.Maybe.Nothing, postSubscriptionSchedulesRequestBodyPhases'AddInvoiceItems'PriceData'UnitAmount = GHC.Maybe.Nothing, postSubscriptionSchedulesRequestBodyPhases'AddInvoiceItems'PriceData'UnitAmountDecimal = GHC.Maybe.Nothing } -- | Defines the enum schema located at @paths.\/v1\/subscription_schedules.POST.requestBody.content.application\/x-www-form-urlencoded.schema.properties.phases.items.properties.add_invoice_items.items.properties.price_data.properties.tax_behavior@ in the specification. data PostSubscriptionSchedulesRequestBodyPhases'AddInvoiceItems'PriceData'TaxBehavior' = -- | This case is used if the value encountered during decoding does not match any of the provided cases in the specification. PostSubscriptionSchedulesRequestBodyPhases'AddInvoiceItems'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. PostSubscriptionSchedulesRequestBodyPhases'AddInvoiceItems'PriceData'TaxBehavior'Typed Data.Text.Internal.Text | -- | Represents the JSON value @"exclusive"@ PostSubscriptionSchedulesRequestBodyPhases'AddInvoiceItems'PriceData'TaxBehavior'EnumExclusive | -- | Represents the JSON value @"inclusive"@ PostSubscriptionSchedulesRequestBodyPhases'AddInvoiceItems'PriceData'TaxBehavior'EnumInclusive | -- | Represents the JSON value @"unspecified"@ PostSubscriptionSchedulesRequestBodyPhases'AddInvoiceItems'PriceData'TaxBehavior'EnumUnspecified deriving (GHC.Show.Show, GHC.Classes.Eq) instance Data.Aeson.Types.ToJSON.ToJSON PostSubscriptionSchedulesRequestBodyPhases'AddInvoiceItems'PriceData'TaxBehavior' where toJSON (PostSubscriptionSchedulesRequestBodyPhases'AddInvoiceItems'PriceData'TaxBehavior'Other val) = val toJSON (PostSubscriptionSchedulesRequestBodyPhases'AddInvoiceItems'PriceData'TaxBehavior'Typed val) = Data.Aeson.Types.ToJSON.toJSON val toJSON (PostSubscriptionSchedulesRequestBodyPhases'AddInvoiceItems'PriceData'TaxBehavior'EnumExclusive) = "exclusive" toJSON (PostSubscriptionSchedulesRequestBodyPhases'AddInvoiceItems'PriceData'TaxBehavior'EnumInclusive) = "inclusive" toJSON (PostSubscriptionSchedulesRequestBodyPhases'AddInvoiceItems'PriceData'TaxBehavior'EnumUnspecified) = "unspecified" instance Data.Aeson.Types.FromJSON.FromJSON PostSubscriptionSchedulesRequestBodyPhases'AddInvoiceItems'PriceData'TaxBehavior' where parseJSON val = GHC.Base.pure ( if | val GHC.Classes.== "exclusive" -> PostSubscriptionSchedulesRequestBodyPhases'AddInvoiceItems'PriceData'TaxBehavior'EnumExclusive | val GHC.Classes.== "inclusive" -> PostSubscriptionSchedulesRequestBodyPhases'AddInvoiceItems'PriceData'TaxBehavior'EnumInclusive | val GHC.Classes.== "unspecified" -> PostSubscriptionSchedulesRequestBodyPhases'AddInvoiceItems'PriceData'TaxBehavior'EnumUnspecified | GHC.Base.otherwise -> PostSubscriptionSchedulesRequestBodyPhases'AddInvoiceItems'PriceData'TaxBehavior'Other val ) -- | Defines the oneOf schema located at @paths.\/v1\/subscription_schedules.POST.requestBody.content.application\/x-www-form-urlencoded.schema.properties.phases.items.properties.add_invoice_items.items.properties.tax_rates.anyOf@ in the specification. data PostSubscriptionSchedulesRequestBodyPhases'AddInvoiceItems'TaxRates'Variants = -- | Represents the JSON value @""@ PostSubscriptionSchedulesRequestBodyPhases'AddInvoiceItems'TaxRates'EmptyString | PostSubscriptionSchedulesRequestBodyPhases'AddInvoiceItems'TaxRates'ListTText ([Data.Text.Internal.Text]) deriving (GHC.Show.Show, GHC.Classes.Eq) instance Data.Aeson.Types.ToJSON.ToJSON PostSubscriptionSchedulesRequestBodyPhases'AddInvoiceItems'TaxRates'Variants where toJSON (PostSubscriptionSchedulesRequestBodyPhases'AddInvoiceItems'TaxRates'ListTText a) = Data.Aeson.Types.ToJSON.toJSON a toJSON (PostSubscriptionSchedulesRequestBodyPhases'AddInvoiceItems'TaxRates'EmptyString) = "" instance Data.Aeson.Types.FromJSON.FromJSON PostSubscriptionSchedulesRequestBodyPhases'AddInvoiceItems'TaxRates'Variants where parseJSON val = if | val GHC.Classes.== "" -> GHC.Base.pure PostSubscriptionSchedulesRequestBodyPhases'AddInvoiceItems'TaxRates'EmptyString | GHC.Base.otherwise -> case (PostSubscriptionSchedulesRequestBodyPhases'AddInvoiceItems'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\/subscription_schedules.POST.requestBody.content.application\/x-www-form-urlencoded.schema.properties.phases.items.properties.automatic_tax@ in the specification. data PostSubscriptionSchedulesRequestBodyPhases'AutomaticTax' = PostSubscriptionSchedulesRequestBodyPhases'AutomaticTax' { -- | enabled postSubscriptionSchedulesRequestBodyPhases'AutomaticTax'Enabled :: GHC.Types.Bool } deriving ( GHC.Show.Show, GHC.Classes.Eq ) instance Data.Aeson.Types.ToJSON.ToJSON PostSubscriptionSchedulesRequestBodyPhases'AutomaticTax' where toJSON obj = Data.Aeson.Types.Internal.object ("enabled" Data.Aeson.Types.ToJSON..= postSubscriptionSchedulesRequestBodyPhases'AutomaticTax'Enabled obj : GHC.Base.mempty) toEncoding obj = Data.Aeson.Encoding.Internal.pairs ("enabled" Data.Aeson.Types.ToJSON..= postSubscriptionSchedulesRequestBodyPhases'AutomaticTax'Enabled obj) instance Data.Aeson.Types.FromJSON.FromJSON PostSubscriptionSchedulesRequestBodyPhases'AutomaticTax' where parseJSON = Data.Aeson.Types.FromJSON.withObject "PostSubscriptionSchedulesRequestBodyPhases'AutomaticTax'" (\obj -> GHC.Base.pure PostSubscriptionSchedulesRequestBodyPhases'AutomaticTax' GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..: "enabled")) -- | Create a new 'PostSubscriptionSchedulesRequestBodyPhases'AutomaticTax'' with all required fields. mkPostSubscriptionSchedulesRequestBodyPhases'AutomaticTax' :: -- | 'postSubscriptionSchedulesRequestBodyPhases'AutomaticTax'Enabled' GHC.Types.Bool -> PostSubscriptionSchedulesRequestBodyPhases'AutomaticTax' mkPostSubscriptionSchedulesRequestBodyPhases'AutomaticTax' postSubscriptionSchedulesRequestBodyPhases'AutomaticTax'Enabled = PostSubscriptionSchedulesRequestBodyPhases'AutomaticTax' {postSubscriptionSchedulesRequestBodyPhases'AutomaticTax'Enabled = postSubscriptionSchedulesRequestBodyPhases'AutomaticTax'Enabled} -- | Defines the enum schema located at @paths.\/v1\/subscription_schedules.POST.requestBody.content.application\/x-www-form-urlencoded.schema.properties.phases.items.properties.billing_cycle_anchor@ in the specification. data PostSubscriptionSchedulesRequestBodyPhases'BillingCycleAnchor' = -- | This case is used if the value encountered during decoding does not match any of the provided cases in the specification. PostSubscriptionSchedulesRequestBodyPhases'BillingCycleAnchor'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. PostSubscriptionSchedulesRequestBodyPhases'BillingCycleAnchor'Typed Data.Text.Internal.Text | -- | Represents the JSON value @"automatic"@ PostSubscriptionSchedulesRequestBodyPhases'BillingCycleAnchor'EnumAutomatic | -- | Represents the JSON value @"phase_start"@ PostSubscriptionSchedulesRequestBodyPhases'BillingCycleAnchor'EnumPhaseStart deriving (GHC.Show.Show, GHC.Classes.Eq) instance Data.Aeson.Types.ToJSON.ToJSON PostSubscriptionSchedulesRequestBodyPhases'BillingCycleAnchor' where toJSON (PostSubscriptionSchedulesRequestBodyPhases'BillingCycleAnchor'Other val) = val toJSON (PostSubscriptionSchedulesRequestBodyPhases'BillingCycleAnchor'Typed val) = Data.Aeson.Types.ToJSON.toJSON val toJSON (PostSubscriptionSchedulesRequestBodyPhases'BillingCycleAnchor'EnumAutomatic) = "automatic" toJSON (PostSubscriptionSchedulesRequestBodyPhases'BillingCycleAnchor'EnumPhaseStart) = "phase_start" instance Data.Aeson.Types.FromJSON.FromJSON PostSubscriptionSchedulesRequestBodyPhases'BillingCycleAnchor' where parseJSON val = GHC.Base.pure ( if | val GHC.Classes.== "automatic" -> PostSubscriptionSchedulesRequestBodyPhases'BillingCycleAnchor'EnumAutomatic | val GHC.Classes.== "phase_start" -> PostSubscriptionSchedulesRequestBodyPhases'BillingCycleAnchor'EnumPhaseStart | GHC.Base.otherwise -> PostSubscriptionSchedulesRequestBodyPhases'BillingCycleAnchor'Other val ) -- | Defines the object schema located at @paths.\/v1\/subscription_schedules.POST.requestBody.content.application\/x-www-form-urlencoded.schema.properties.phases.items.properties.billing_thresholds.anyOf@ in the specification. data PostSubscriptionSchedulesRequestBodyPhases'BillingThresholds'OneOf1 = PostSubscriptionSchedulesRequestBodyPhases'BillingThresholds'OneOf1 { -- | amount_gte postSubscriptionSchedulesRequestBodyPhases'BillingThresholds'OneOf1AmountGte :: (GHC.Maybe.Maybe GHC.Types.Int), -- | reset_billing_cycle_anchor postSubscriptionSchedulesRequestBodyPhases'BillingThresholds'OneOf1ResetBillingCycleAnchor :: (GHC.Maybe.Maybe GHC.Types.Bool) } deriving ( GHC.Show.Show, GHC.Classes.Eq ) instance Data.Aeson.Types.ToJSON.ToJSON PostSubscriptionSchedulesRequestBodyPhases'BillingThresholds'OneOf1 where toJSON obj = Data.Aeson.Types.Internal.object ("amount_gte" Data.Aeson.Types.ToJSON..= postSubscriptionSchedulesRequestBodyPhases'BillingThresholds'OneOf1AmountGte obj : "reset_billing_cycle_anchor" Data.Aeson.Types.ToJSON..= postSubscriptionSchedulesRequestBodyPhases'BillingThresholds'OneOf1ResetBillingCycleAnchor obj : GHC.Base.mempty) toEncoding obj = Data.Aeson.Encoding.Internal.pairs (("amount_gte" Data.Aeson.Types.ToJSON..= postSubscriptionSchedulesRequestBodyPhases'BillingThresholds'OneOf1AmountGte obj) GHC.Base.<> ("reset_billing_cycle_anchor" Data.Aeson.Types.ToJSON..= postSubscriptionSchedulesRequestBodyPhases'BillingThresholds'OneOf1ResetBillingCycleAnchor obj)) instance Data.Aeson.Types.FromJSON.FromJSON PostSubscriptionSchedulesRequestBodyPhases'BillingThresholds'OneOf1 where parseJSON = Data.Aeson.Types.FromJSON.withObject "PostSubscriptionSchedulesRequestBodyPhases'BillingThresholds'OneOf1" (\obj -> (GHC.Base.pure PostSubscriptionSchedulesRequestBodyPhases'BillingThresholds'OneOf1 GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "amount_gte")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "reset_billing_cycle_anchor")) -- | Create a new 'PostSubscriptionSchedulesRequestBodyPhases'BillingThresholds'OneOf1' with all required fields. mkPostSubscriptionSchedulesRequestBodyPhases'BillingThresholds'OneOf1 :: PostSubscriptionSchedulesRequestBodyPhases'BillingThresholds'OneOf1 mkPostSubscriptionSchedulesRequestBodyPhases'BillingThresholds'OneOf1 = PostSubscriptionSchedulesRequestBodyPhases'BillingThresholds'OneOf1 { postSubscriptionSchedulesRequestBodyPhases'BillingThresholds'OneOf1AmountGte = GHC.Maybe.Nothing, postSubscriptionSchedulesRequestBodyPhases'BillingThresholds'OneOf1ResetBillingCycleAnchor = GHC.Maybe.Nothing } -- | Defines the oneOf schema located at @paths.\/v1\/subscription_schedules.POST.requestBody.content.application\/x-www-form-urlencoded.schema.properties.phases.items.properties.billing_thresholds.anyOf@ in the specification. data PostSubscriptionSchedulesRequestBodyPhases'BillingThresholds'Variants = -- | Represents the JSON value @""@ PostSubscriptionSchedulesRequestBodyPhases'BillingThresholds'EmptyString | PostSubscriptionSchedulesRequestBodyPhases'BillingThresholds'PostSubscriptionSchedulesRequestBodyPhases'BillingThresholds'OneOf1 PostSubscriptionSchedulesRequestBodyPhases'BillingThresholds'OneOf1 deriving (GHC.Show.Show, GHC.Classes.Eq) instance Data.Aeson.Types.ToJSON.ToJSON PostSubscriptionSchedulesRequestBodyPhases'BillingThresholds'Variants where toJSON (PostSubscriptionSchedulesRequestBodyPhases'BillingThresholds'PostSubscriptionSchedulesRequestBodyPhases'BillingThresholds'OneOf1 a) = Data.Aeson.Types.ToJSON.toJSON a toJSON (PostSubscriptionSchedulesRequestBodyPhases'BillingThresholds'EmptyString) = "" instance Data.Aeson.Types.FromJSON.FromJSON PostSubscriptionSchedulesRequestBodyPhases'BillingThresholds'Variants where parseJSON val = if | val GHC.Classes.== "" -> GHC.Base.pure PostSubscriptionSchedulesRequestBodyPhases'BillingThresholds'EmptyString | GHC.Base.otherwise -> case (PostSubscriptionSchedulesRequestBodyPhases'BillingThresholds'PostSubscriptionSchedulesRequestBodyPhases'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 enum schema located at @paths.\/v1\/subscription_schedules.POST.requestBody.content.application\/x-www-form-urlencoded.schema.properties.phases.items.properties.collection_method@ in the specification. data PostSubscriptionSchedulesRequestBodyPhases'CollectionMethod' = -- | This case is used if the value encountered during decoding does not match any of the provided cases in the specification. PostSubscriptionSchedulesRequestBodyPhases'CollectionMethod'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. PostSubscriptionSchedulesRequestBodyPhases'CollectionMethod'Typed Data.Text.Internal.Text | -- | Represents the JSON value @"charge_automatically"@ PostSubscriptionSchedulesRequestBodyPhases'CollectionMethod'EnumChargeAutomatically | -- | Represents the JSON value @"send_invoice"@ PostSubscriptionSchedulesRequestBodyPhases'CollectionMethod'EnumSendInvoice deriving (GHC.Show.Show, GHC.Classes.Eq) instance Data.Aeson.Types.ToJSON.ToJSON PostSubscriptionSchedulesRequestBodyPhases'CollectionMethod' where toJSON (PostSubscriptionSchedulesRequestBodyPhases'CollectionMethod'Other val) = val toJSON (PostSubscriptionSchedulesRequestBodyPhases'CollectionMethod'Typed val) = Data.Aeson.Types.ToJSON.toJSON val toJSON (PostSubscriptionSchedulesRequestBodyPhases'CollectionMethod'EnumChargeAutomatically) = "charge_automatically" toJSON (PostSubscriptionSchedulesRequestBodyPhases'CollectionMethod'EnumSendInvoice) = "send_invoice" instance Data.Aeson.Types.FromJSON.FromJSON PostSubscriptionSchedulesRequestBodyPhases'CollectionMethod' where parseJSON val = GHC.Base.pure ( if | val GHC.Classes.== "charge_automatically" -> PostSubscriptionSchedulesRequestBodyPhases'CollectionMethod'EnumChargeAutomatically | val GHC.Classes.== "send_invoice" -> PostSubscriptionSchedulesRequestBodyPhases'CollectionMethod'EnumSendInvoice | GHC.Base.otherwise -> PostSubscriptionSchedulesRequestBodyPhases'CollectionMethod'Other val ) -- | Defines the oneOf schema located at @paths.\/v1\/subscription_schedules.POST.requestBody.content.application\/x-www-form-urlencoded.schema.properties.phases.items.properties.default_tax_rates.anyOf@ in the specification. data PostSubscriptionSchedulesRequestBodyPhases'DefaultTaxRates'Variants = -- | Represents the JSON value @""@ PostSubscriptionSchedulesRequestBodyPhases'DefaultTaxRates'EmptyString | PostSubscriptionSchedulesRequestBodyPhases'DefaultTaxRates'ListTText ([Data.Text.Internal.Text]) deriving (GHC.Show.Show, GHC.Classes.Eq) instance Data.Aeson.Types.ToJSON.ToJSON PostSubscriptionSchedulesRequestBodyPhases'DefaultTaxRates'Variants where toJSON (PostSubscriptionSchedulesRequestBodyPhases'DefaultTaxRates'ListTText a) = Data.Aeson.Types.ToJSON.toJSON a toJSON (PostSubscriptionSchedulesRequestBodyPhases'DefaultTaxRates'EmptyString) = "" instance Data.Aeson.Types.FromJSON.FromJSON PostSubscriptionSchedulesRequestBodyPhases'DefaultTaxRates'Variants where parseJSON val = if | val GHC.Classes.== "" -> GHC.Base.pure PostSubscriptionSchedulesRequestBodyPhases'DefaultTaxRates'EmptyString | GHC.Base.otherwise -> case (PostSubscriptionSchedulesRequestBodyPhases'DefaultTaxRates'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\/subscription_schedules.POST.requestBody.content.application\/x-www-form-urlencoded.schema.properties.phases.items.properties.invoice_settings@ in the specification. data PostSubscriptionSchedulesRequestBodyPhases'InvoiceSettings' = PostSubscriptionSchedulesRequestBodyPhases'InvoiceSettings' { -- | days_until_due postSubscriptionSchedulesRequestBodyPhases'InvoiceSettings'DaysUntilDue :: (GHC.Maybe.Maybe GHC.Types.Int) } deriving ( GHC.Show.Show, GHC.Classes.Eq ) instance Data.Aeson.Types.ToJSON.ToJSON PostSubscriptionSchedulesRequestBodyPhases'InvoiceSettings' where toJSON obj = Data.Aeson.Types.Internal.object ("days_until_due" Data.Aeson.Types.ToJSON..= postSubscriptionSchedulesRequestBodyPhases'InvoiceSettings'DaysUntilDue obj : GHC.Base.mempty) toEncoding obj = Data.Aeson.Encoding.Internal.pairs ("days_until_due" Data.Aeson.Types.ToJSON..= postSubscriptionSchedulesRequestBodyPhases'InvoiceSettings'DaysUntilDue obj) instance Data.Aeson.Types.FromJSON.FromJSON PostSubscriptionSchedulesRequestBodyPhases'InvoiceSettings' where parseJSON = Data.Aeson.Types.FromJSON.withObject "PostSubscriptionSchedulesRequestBodyPhases'InvoiceSettings'" (\obj -> GHC.Base.pure PostSubscriptionSchedulesRequestBodyPhases'InvoiceSettings' GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "days_until_due")) -- | Create a new 'PostSubscriptionSchedulesRequestBodyPhases'InvoiceSettings'' with all required fields. mkPostSubscriptionSchedulesRequestBodyPhases'InvoiceSettings' :: PostSubscriptionSchedulesRequestBodyPhases'InvoiceSettings' mkPostSubscriptionSchedulesRequestBodyPhases'InvoiceSettings' = PostSubscriptionSchedulesRequestBodyPhases'InvoiceSettings' {postSubscriptionSchedulesRequestBodyPhases'InvoiceSettings'DaysUntilDue = GHC.Maybe.Nothing} -- | Defines the object schema located at @paths.\/v1\/subscription_schedules.POST.requestBody.content.application\/x-www-form-urlencoded.schema.properties.phases.items.properties.items.items@ in the specification. data PostSubscriptionSchedulesRequestBodyPhases'Items' = PostSubscriptionSchedulesRequestBodyPhases'Items' { -- | billing_thresholds postSubscriptionSchedulesRequestBodyPhases'Items'BillingThresholds :: (GHC.Maybe.Maybe PostSubscriptionSchedulesRequestBodyPhases'Items'BillingThresholds'Variants), -- | price -- -- Constraints: -- -- * Maximum length of 5000 postSubscriptionSchedulesRequestBodyPhases'Items'Price :: (GHC.Maybe.Maybe Data.Text.Internal.Text), -- | price_data postSubscriptionSchedulesRequestBodyPhases'Items'PriceData :: (GHC.Maybe.Maybe PostSubscriptionSchedulesRequestBodyPhases'Items'PriceData'), -- | quantity postSubscriptionSchedulesRequestBodyPhases'Items'Quantity :: (GHC.Maybe.Maybe GHC.Types.Int), -- | tax_rates postSubscriptionSchedulesRequestBodyPhases'Items'TaxRates :: (GHC.Maybe.Maybe PostSubscriptionSchedulesRequestBodyPhases'Items'TaxRates'Variants) } deriving ( GHC.Show.Show, GHC.Classes.Eq ) instance Data.Aeson.Types.ToJSON.ToJSON PostSubscriptionSchedulesRequestBodyPhases'Items' where toJSON obj = Data.Aeson.Types.Internal.object ("billing_thresholds" Data.Aeson.Types.ToJSON..= postSubscriptionSchedulesRequestBodyPhases'Items'BillingThresholds obj : "price" Data.Aeson.Types.ToJSON..= postSubscriptionSchedulesRequestBodyPhases'Items'Price obj : "price_data" Data.Aeson.Types.ToJSON..= postSubscriptionSchedulesRequestBodyPhases'Items'PriceData obj : "quantity" Data.Aeson.Types.ToJSON..= postSubscriptionSchedulesRequestBodyPhases'Items'Quantity obj : "tax_rates" Data.Aeson.Types.ToJSON..= postSubscriptionSchedulesRequestBodyPhases'Items'TaxRates obj : GHC.Base.mempty) toEncoding obj = Data.Aeson.Encoding.Internal.pairs (("billing_thresholds" Data.Aeson.Types.ToJSON..= postSubscriptionSchedulesRequestBodyPhases'Items'BillingThresholds obj) GHC.Base.<> (("price" Data.Aeson.Types.ToJSON..= postSubscriptionSchedulesRequestBodyPhases'Items'Price obj) GHC.Base.<> (("price_data" Data.Aeson.Types.ToJSON..= postSubscriptionSchedulesRequestBodyPhases'Items'PriceData obj) GHC.Base.<> (("quantity" Data.Aeson.Types.ToJSON..= postSubscriptionSchedulesRequestBodyPhases'Items'Quantity obj) GHC.Base.<> ("tax_rates" Data.Aeson.Types.ToJSON..= postSubscriptionSchedulesRequestBodyPhases'Items'TaxRates obj))))) instance Data.Aeson.Types.FromJSON.FromJSON PostSubscriptionSchedulesRequestBodyPhases'Items' where parseJSON = Data.Aeson.Types.FromJSON.withObject "PostSubscriptionSchedulesRequestBodyPhases'Items'" (\obj -> ((((GHC.Base.pure PostSubscriptionSchedulesRequestBodyPhases'Items' GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "billing_thresholds")) 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 'PostSubscriptionSchedulesRequestBodyPhases'Items'' with all required fields. mkPostSubscriptionSchedulesRequestBodyPhases'Items' :: PostSubscriptionSchedulesRequestBodyPhases'Items' mkPostSubscriptionSchedulesRequestBodyPhases'Items' = PostSubscriptionSchedulesRequestBodyPhases'Items' { postSubscriptionSchedulesRequestBodyPhases'Items'BillingThresholds = GHC.Maybe.Nothing, postSubscriptionSchedulesRequestBodyPhases'Items'Price = GHC.Maybe.Nothing, postSubscriptionSchedulesRequestBodyPhases'Items'PriceData = GHC.Maybe.Nothing, postSubscriptionSchedulesRequestBodyPhases'Items'Quantity = GHC.Maybe.Nothing, postSubscriptionSchedulesRequestBodyPhases'Items'TaxRates = GHC.Maybe.Nothing } -- | Defines the object schema located at @paths.\/v1\/subscription_schedules.POST.requestBody.content.application\/x-www-form-urlencoded.schema.properties.phases.items.properties.items.items.properties.billing_thresholds.anyOf@ in the specification. data PostSubscriptionSchedulesRequestBodyPhases'Items'BillingThresholds'OneOf1 = PostSubscriptionSchedulesRequestBodyPhases'Items'BillingThresholds'OneOf1 { -- | usage_gte postSubscriptionSchedulesRequestBodyPhases'Items'BillingThresholds'OneOf1UsageGte :: GHC.Types.Int } deriving ( GHC.Show.Show, GHC.Classes.Eq ) instance Data.Aeson.Types.ToJSON.ToJSON PostSubscriptionSchedulesRequestBodyPhases'Items'BillingThresholds'OneOf1 where toJSON obj = Data.Aeson.Types.Internal.object ("usage_gte" Data.Aeson.Types.ToJSON..= postSubscriptionSchedulesRequestBodyPhases'Items'BillingThresholds'OneOf1UsageGte obj : GHC.Base.mempty) toEncoding obj = Data.Aeson.Encoding.Internal.pairs ("usage_gte" Data.Aeson.Types.ToJSON..= postSubscriptionSchedulesRequestBodyPhases'Items'BillingThresholds'OneOf1UsageGte obj) instance Data.Aeson.Types.FromJSON.FromJSON PostSubscriptionSchedulesRequestBodyPhases'Items'BillingThresholds'OneOf1 where parseJSON = Data.Aeson.Types.FromJSON.withObject "PostSubscriptionSchedulesRequestBodyPhases'Items'BillingThresholds'OneOf1" (\obj -> GHC.Base.pure PostSubscriptionSchedulesRequestBodyPhases'Items'BillingThresholds'OneOf1 GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..: "usage_gte")) -- | Create a new 'PostSubscriptionSchedulesRequestBodyPhases'Items'BillingThresholds'OneOf1' with all required fields. mkPostSubscriptionSchedulesRequestBodyPhases'Items'BillingThresholds'OneOf1 :: -- | 'postSubscriptionSchedulesRequestBodyPhases'Items'BillingThresholds'OneOf1UsageGte' GHC.Types.Int -> PostSubscriptionSchedulesRequestBodyPhases'Items'BillingThresholds'OneOf1 mkPostSubscriptionSchedulesRequestBodyPhases'Items'BillingThresholds'OneOf1 postSubscriptionSchedulesRequestBodyPhases'Items'BillingThresholds'OneOf1UsageGte = PostSubscriptionSchedulesRequestBodyPhases'Items'BillingThresholds'OneOf1 {postSubscriptionSchedulesRequestBodyPhases'Items'BillingThresholds'OneOf1UsageGte = postSubscriptionSchedulesRequestBodyPhases'Items'BillingThresholds'OneOf1UsageGte} -- | Defines the oneOf schema located at @paths.\/v1\/subscription_schedules.POST.requestBody.content.application\/x-www-form-urlencoded.schema.properties.phases.items.properties.items.items.properties.billing_thresholds.anyOf@ in the specification. data PostSubscriptionSchedulesRequestBodyPhases'Items'BillingThresholds'Variants = -- | Represents the JSON value @""@ PostSubscriptionSchedulesRequestBodyPhases'Items'BillingThresholds'EmptyString | PostSubscriptionSchedulesRequestBodyPhases'Items'BillingThresholds'PostSubscriptionSchedulesRequestBodyPhases'Items'BillingThresholds'OneOf1 PostSubscriptionSchedulesRequestBodyPhases'Items'BillingThresholds'OneOf1 deriving (GHC.Show.Show, GHC.Classes.Eq) instance Data.Aeson.Types.ToJSON.ToJSON PostSubscriptionSchedulesRequestBodyPhases'Items'BillingThresholds'Variants where toJSON (PostSubscriptionSchedulesRequestBodyPhases'Items'BillingThresholds'PostSubscriptionSchedulesRequestBodyPhases'Items'BillingThresholds'OneOf1 a) = Data.Aeson.Types.ToJSON.toJSON a toJSON (PostSubscriptionSchedulesRequestBodyPhases'Items'BillingThresholds'EmptyString) = "" instance Data.Aeson.Types.FromJSON.FromJSON PostSubscriptionSchedulesRequestBodyPhases'Items'BillingThresholds'Variants where parseJSON val = if | val GHC.Classes.== "" -> GHC.Base.pure PostSubscriptionSchedulesRequestBodyPhases'Items'BillingThresholds'EmptyString | GHC.Base.otherwise -> case (PostSubscriptionSchedulesRequestBodyPhases'Items'BillingThresholds'PostSubscriptionSchedulesRequestBodyPhases'Items'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\/subscription_schedules.POST.requestBody.content.application\/x-www-form-urlencoded.schema.properties.phases.items.properties.items.items.properties.price_data@ in the specification. data PostSubscriptionSchedulesRequestBodyPhases'Items'PriceData' = PostSubscriptionSchedulesRequestBodyPhases'Items'PriceData' { -- | currency postSubscriptionSchedulesRequestBodyPhases'Items'PriceData'Currency :: Data.Text.Internal.Text, -- | product -- -- Constraints: -- -- * Maximum length of 5000 postSubscriptionSchedulesRequestBodyPhases'Items'PriceData'Product :: Data.Text.Internal.Text, -- | recurring postSubscriptionSchedulesRequestBodyPhases'Items'PriceData'Recurring :: PostSubscriptionSchedulesRequestBodyPhases'Items'PriceData'Recurring', -- | tax_behavior postSubscriptionSchedulesRequestBodyPhases'Items'PriceData'TaxBehavior :: (GHC.Maybe.Maybe PostSubscriptionSchedulesRequestBodyPhases'Items'PriceData'TaxBehavior'), -- | unit_amount postSubscriptionSchedulesRequestBodyPhases'Items'PriceData'UnitAmount :: (GHC.Maybe.Maybe GHC.Types.Int), -- | unit_amount_decimal postSubscriptionSchedulesRequestBodyPhases'Items'PriceData'UnitAmountDecimal :: (GHC.Maybe.Maybe Data.Text.Internal.Text) } deriving ( GHC.Show.Show, GHC.Classes.Eq ) instance Data.Aeson.Types.ToJSON.ToJSON PostSubscriptionSchedulesRequestBodyPhases'Items'PriceData' where toJSON obj = Data.Aeson.Types.Internal.object ("currency" Data.Aeson.Types.ToJSON..= postSubscriptionSchedulesRequestBodyPhases'Items'PriceData'Currency obj : "product" Data.Aeson.Types.ToJSON..= postSubscriptionSchedulesRequestBodyPhases'Items'PriceData'Product obj : "recurring" Data.Aeson.Types.ToJSON..= postSubscriptionSchedulesRequestBodyPhases'Items'PriceData'Recurring obj : "tax_behavior" Data.Aeson.Types.ToJSON..= postSubscriptionSchedulesRequestBodyPhases'Items'PriceData'TaxBehavior obj : "unit_amount" Data.Aeson.Types.ToJSON..= postSubscriptionSchedulesRequestBodyPhases'Items'PriceData'UnitAmount obj : "unit_amount_decimal" Data.Aeson.Types.ToJSON..= postSubscriptionSchedulesRequestBodyPhases'Items'PriceData'UnitAmountDecimal obj : GHC.Base.mempty) toEncoding obj = Data.Aeson.Encoding.Internal.pairs (("currency" Data.Aeson.Types.ToJSON..= postSubscriptionSchedulesRequestBodyPhases'Items'PriceData'Currency obj) GHC.Base.<> (("product" Data.Aeson.Types.ToJSON..= postSubscriptionSchedulesRequestBodyPhases'Items'PriceData'Product obj) GHC.Base.<> (("recurring" Data.Aeson.Types.ToJSON..= postSubscriptionSchedulesRequestBodyPhases'Items'PriceData'Recurring obj) GHC.Base.<> (("tax_behavior" Data.Aeson.Types.ToJSON..= postSubscriptionSchedulesRequestBodyPhases'Items'PriceData'TaxBehavior obj) GHC.Base.<> (("unit_amount" Data.Aeson.Types.ToJSON..= postSubscriptionSchedulesRequestBodyPhases'Items'PriceData'UnitAmount obj) GHC.Base.<> ("unit_amount_decimal" Data.Aeson.Types.ToJSON..= postSubscriptionSchedulesRequestBodyPhases'Items'PriceData'UnitAmountDecimal obj)))))) instance Data.Aeson.Types.FromJSON.FromJSON PostSubscriptionSchedulesRequestBodyPhases'Items'PriceData' where parseJSON = Data.Aeson.Types.FromJSON.withObject "PostSubscriptionSchedulesRequestBodyPhases'Items'PriceData'" (\obj -> (((((GHC.Base.pure PostSubscriptionSchedulesRequestBodyPhases'Items'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 'PostSubscriptionSchedulesRequestBodyPhases'Items'PriceData'' with all required fields. mkPostSubscriptionSchedulesRequestBodyPhases'Items'PriceData' :: -- | 'postSubscriptionSchedulesRequestBodyPhases'Items'PriceData'Currency' Data.Text.Internal.Text -> -- | 'postSubscriptionSchedulesRequestBodyPhases'Items'PriceData'Product' Data.Text.Internal.Text -> -- | 'postSubscriptionSchedulesRequestBodyPhases'Items'PriceData'Recurring' PostSubscriptionSchedulesRequestBodyPhases'Items'PriceData'Recurring' -> PostSubscriptionSchedulesRequestBodyPhases'Items'PriceData' mkPostSubscriptionSchedulesRequestBodyPhases'Items'PriceData' postSubscriptionSchedulesRequestBodyPhases'Items'PriceData'Currency postSubscriptionSchedulesRequestBodyPhases'Items'PriceData'Product postSubscriptionSchedulesRequestBodyPhases'Items'PriceData'Recurring = PostSubscriptionSchedulesRequestBodyPhases'Items'PriceData' { postSubscriptionSchedulesRequestBodyPhases'Items'PriceData'Currency = postSubscriptionSchedulesRequestBodyPhases'Items'PriceData'Currency, postSubscriptionSchedulesRequestBodyPhases'Items'PriceData'Product = postSubscriptionSchedulesRequestBodyPhases'Items'PriceData'Product, postSubscriptionSchedulesRequestBodyPhases'Items'PriceData'Recurring = postSubscriptionSchedulesRequestBodyPhases'Items'PriceData'Recurring, postSubscriptionSchedulesRequestBodyPhases'Items'PriceData'TaxBehavior = GHC.Maybe.Nothing, postSubscriptionSchedulesRequestBodyPhases'Items'PriceData'UnitAmount = GHC.Maybe.Nothing, postSubscriptionSchedulesRequestBodyPhases'Items'PriceData'UnitAmountDecimal = GHC.Maybe.Nothing } -- | Defines the object schema located at @paths.\/v1\/subscription_schedules.POST.requestBody.content.application\/x-www-form-urlencoded.schema.properties.phases.items.properties.items.items.properties.price_data.properties.recurring@ in the specification. data PostSubscriptionSchedulesRequestBodyPhases'Items'PriceData'Recurring' = PostSubscriptionSchedulesRequestBodyPhases'Items'PriceData'Recurring' { -- | interval postSubscriptionSchedulesRequestBodyPhases'Items'PriceData'Recurring'Interval :: PostSubscriptionSchedulesRequestBodyPhases'Items'PriceData'Recurring'Interval', -- | interval_count postSubscriptionSchedulesRequestBodyPhases'Items'PriceData'Recurring'IntervalCount :: (GHC.Maybe.Maybe GHC.Types.Int) } deriving ( GHC.Show.Show, GHC.Classes.Eq ) instance Data.Aeson.Types.ToJSON.ToJSON PostSubscriptionSchedulesRequestBodyPhases'Items'PriceData'Recurring' where toJSON obj = Data.Aeson.Types.Internal.object ("interval" Data.Aeson.Types.ToJSON..= postSubscriptionSchedulesRequestBodyPhases'Items'PriceData'Recurring'Interval obj : "interval_count" Data.Aeson.Types.ToJSON..= postSubscriptionSchedulesRequestBodyPhases'Items'PriceData'Recurring'IntervalCount obj : GHC.Base.mempty) toEncoding obj = Data.Aeson.Encoding.Internal.pairs (("interval" Data.Aeson.Types.ToJSON..= postSubscriptionSchedulesRequestBodyPhases'Items'PriceData'Recurring'Interval obj) GHC.Base.<> ("interval_count" Data.Aeson.Types.ToJSON..= postSubscriptionSchedulesRequestBodyPhases'Items'PriceData'Recurring'IntervalCount obj)) instance Data.Aeson.Types.FromJSON.FromJSON PostSubscriptionSchedulesRequestBodyPhases'Items'PriceData'Recurring' where parseJSON = Data.Aeson.Types.FromJSON.withObject "PostSubscriptionSchedulesRequestBodyPhases'Items'PriceData'Recurring'" (\obj -> (GHC.Base.pure PostSubscriptionSchedulesRequestBodyPhases'Items'PriceData'Recurring' GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..: "interval")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "interval_count")) -- | Create a new 'PostSubscriptionSchedulesRequestBodyPhases'Items'PriceData'Recurring'' with all required fields. mkPostSubscriptionSchedulesRequestBodyPhases'Items'PriceData'Recurring' :: -- | 'postSubscriptionSchedulesRequestBodyPhases'Items'PriceData'Recurring'Interval' PostSubscriptionSchedulesRequestBodyPhases'Items'PriceData'Recurring'Interval' -> PostSubscriptionSchedulesRequestBodyPhases'Items'PriceData'Recurring' mkPostSubscriptionSchedulesRequestBodyPhases'Items'PriceData'Recurring' postSubscriptionSchedulesRequestBodyPhases'Items'PriceData'Recurring'Interval = PostSubscriptionSchedulesRequestBodyPhases'Items'PriceData'Recurring' { postSubscriptionSchedulesRequestBodyPhases'Items'PriceData'Recurring'Interval = postSubscriptionSchedulesRequestBodyPhases'Items'PriceData'Recurring'Interval, postSubscriptionSchedulesRequestBodyPhases'Items'PriceData'Recurring'IntervalCount = GHC.Maybe.Nothing } -- | Defines the enum schema located at @paths.\/v1\/subscription_schedules.POST.requestBody.content.application\/x-www-form-urlencoded.schema.properties.phases.items.properties.items.items.properties.price_data.properties.recurring.properties.interval@ in the specification. data PostSubscriptionSchedulesRequestBodyPhases'Items'PriceData'Recurring'Interval' = -- | This case is used if the value encountered during decoding does not match any of the provided cases in the specification. PostSubscriptionSchedulesRequestBodyPhases'Items'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. PostSubscriptionSchedulesRequestBodyPhases'Items'PriceData'Recurring'Interval'Typed Data.Text.Internal.Text | -- | Represents the JSON value @"day"@ PostSubscriptionSchedulesRequestBodyPhases'Items'PriceData'Recurring'Interval'EnumDay | -- | Represents the JSON value @"month"@ PostSubscriptionSchedulesRequestBodyPhases'Items'PriceData'Recurring'Interval'EnumMonth | -- | Represents the JSON value @"week"@ PostSubscriptionSchedulesRequestBodyPhases'Items'PriceData'Recurring'Interval'EnumWeek | -- | Represents the JSON value @"year"@ PostSubscriptionSchedulesRequestBodyPhases'Items'PriceData'Recurring'Interval'EnumYear deriving (GHC.Show.Show, GHC.Classes.Eq) instance Data.Aeson.Types.ToJSON.ToJSON PostSubscriptionSchedulesRequestBodyPhases'Items'PriceData'Recurring'Interval' where toJSON (PostSubscriptionSchedulesRequestBodyPhases'Items'PriceData'Recurring'Interval'Other val) = val toJSON (PostSubscriptionSchedulesRequestBodyPhases'Items'PriceData'Recurring'Interval'Typed val) = Data.Aeson.Types.ToJSON.toJSON val toJSON (PostSubscriptionSchedulesRequestBodyPhases'Items'PriceData'Recurring'Interval'EnumDay) = "day" toJSON (PostSubscriptionSchedulesRequestBodyPhases'Items'PriceData'Recurring'Interval'EnumMonth) = "month" toJSON (PostSubscriptionSchedulesRequestBodyPhases'Items'PriceData'Recurring'Interval'EnumWeek) = "week" toJSON (PostSubscriptionSchedulesRequestBodyPhases'Items'PriceData'Recurring'Interval'EnumYear) = "year" instance Data.Aeson.Types.FromJSON.FromJSON PostSubscriptionSchedulesRequestBodyPhases'Items'PriceData'Recurring'Interval' where parseJSON val = GHC.Base.pure ( if | val GHC.Classes.== "day" -> PostSubscriptionSchedulesRequestBodyPhases'Items'PriceData'Recurring'Interval'EnumDay | val GHC.Classes.== "month" -> PostSubscriptionSchedulesRequestBodyPhases'Items'PriceData'Recurring'Interval'EnumMonth | val GHC.Classes.== "week" -> PostSubscriptionSchedulesRequestBodyPhases'Items'PriceData'Recurring'Interval'EnumWeek | val GHC.Classes.== "year" -> PostSubscriptionSchedulesRequestBodyPhases'Items'PriceData'Recurring'Interval'EnumYear | GHC.Base.otherwise -> PostSubscriptionSchedulesRequestBodyPhases'Items'PriceData'Recurring'Interval'Other val ) -- | Defines the enum schema located at @paths.\/v1\/subscription_schedules.POST.requestBody.content.application\/x-www-form-urlencoded.schema.properties.phases.items.properties.items.items.properties.price_data.properties.tax_behavior@ in the specification. data PostSubscriptionSchedulesRequestBodyPhases'Items'PriceData'TaxBehavior' = -- | This case is used if the value encountered during decoding does not match any of the provided cases in the specification. PostSubscriptionSchedulesRequestBodyPhases'Items'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. PostSubscriptionSchedulesRequestBodyPhases'Items'PriceData'TaxBehavior'Typed Data.Text.Internal.Text | -- | Represents the JSON value @"exclusive"@ PostSubscriptionSchedulesRequestBodyPhases'Items'PriceData'TaxBehavior'EnumExclusive | -- | Represents the JSON value @"inclusive"@ PostSubscriptionSchedulesRequestBodyPhases'Items'PriceData'TaxBehavior'EnumInclusive | -- | Represents the JSON value @"unspecified"@ PostSubscriptionSchedulesRequestBodyPhases'Items'PriceData'TaxBehavior'EnumUnspecified deriving (GHC.Show.Show, GHC.Classes.Eq) instance Data.Aeson.Types.ToJSON.ToJSON PostSubscriptionSchedulesRequestBodyPhases'Items'PriceData'TaxBehavior' where toJSON (PostSubscriptionSchedulesRequestBodyPhases'Items'PriceData'TaxBehavior'Other val) = val toJSON (PostSubscriptionSchedulesRequestBodyPhases'Items'PriceData'TaxBehavior'Typed val) = Data.Aeson.Types.ToJSON.toJSON val toJSON (PostSubscriptionSchedulesRequestBodyPhases'Items'PriceData'TaxBehavior'EnumExclusive) = "exclusive" toJSON (PostSubscriptionSchedulesRequestBodyPhases'Items'PriceData'TaxBehavior'EnumInclusive) = "inclusive" toJSON (PostSubscriptionSchedulesRequestBodyPhases'Items'PriceData'TaxBehavior'EnumUnspecified) = "unspecified" instance Data.Aeson.Types.FromJSON.FromJSON PostSubscriptionSchedulesRequestBodyPhases'Items'PriceData'TaxBehavior' where parseJSON val = GHC.Base.pure ( if | val GHC.Classes.== "exclusive" -> PostSubscriptionSchedulesRequestBodyPhases'Items'PriceData'TaxBehavior'EnumExclusive | val GHC.Classes.== "inclusive" -> PostSubscriptionSchedulesRequestBodyPhases'Items'PriceData'TaxBehavior'EnumInclusive | val GHC.Classes.== "unspecified" -> PostSubscriptionSchedulesRequestBodyPhases'Items'PriceData'TaxBehavior'EnumUnspecified | GHC.Base.otherwise -> PostSubscriptionSchedulesRequestBodyPhases'Items'PriceData'TaxBehavior'Other val ) -- | Defines the oneOf schema located at @paths.\/v1\/subscription_schedules.POST.requestBody.content.application\/x-www-form-urlencoded.schema.properties.phases.items.properties.items.items.properties.tax_rates.anyOf@ in the specification. data PostSubscriptionSchedulesRequestBodyPhases'Items'TaxRates'Variants = -- | Represents the JSON value @""@ PostSubscriptionSchedulesRequestBodyPhases'Items'TaxRates'EmptyString | PostSubscriptionSchedulesRequestBodyPhases'Items'TaxRates'ListTText ([Data.Text.Internal.Text]) deriving (GHC.Show.Show, GHC.Classes.Eq) instance Data.Aeson.Types.ToJSON.ToJSON PostSubscriptionSchedulesRequestBodyPhases'Items'TaxRates'Variants where toJSON (PostSubscriptionSchedulesRequestBodyPhases'Items'TaxRates'ListTText a) = Data.Aeson.Types.ToJSON.toJSON a toJSON (PostSubscriptionSchedulesRequestBodyPhases'Items'TaxRates'EmptyString) = "" instance Data.Aeson.Types.FromJSON.FromJSON PostSubscriptionSchedulesRequestBodyPhases'Items'TaxRates'Variants where parseJSON val = if | val GHC.Classes.== "" -> GHC.Base.pure PostSubscriptionSchedulesRequestBodyPhases'Items'TaxRates'EmptyString | GHC.Base.otherwise -> case (PostSubscriptionSchedulesRequestBodyPhases'Items'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 enum schema located at @paths.\/v1\/subscription_schedules.POST.requestBody.content.application\/x-www-form-urlencoded.schema.properties.phases.items.properties.proration_behavior@ in the specification. data PostSubscriptionSchedulesRequestBodyPhases'ProrationBehavior' = -- | This case is used if the value encountered during decoding does not match any of the provided cases in the specification. PostSubscriptionSchedulesRequestBodyPhases'ProrationBehavior'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. PostSubscriptionSchedulesRequestBodyPhases'ProrationBehavior'Typed Data.Text.Internal.Text | -- | Represents the JSON value @"always_invoice"@ PostSubscriptionSchedulesRequestBodyPhases'ProrationBehavior'EnumAlwaysInvoice | -- | Represents the JSON value @"create_prorations"@ PostSubscriptionSchedulesRequestBodyPhases'ProrationBehavior'EnumCreateProrations | -- | Represents the JSON value @"none"@ PostSubscriptionSchedulesRequestBodyPhases'ProrationBehavior'EnumNone deriving (GHC.Show.Show, GHC.Classes.Eq) instance Data.Aeson.Types.ToJSON.ToJSON PostSubscriptionSchedulesRequestBodyPhases'ProrationBehavior' where toJSON (PostSubscriptionSchedulesRequestBodyPhases'ProrationBehavior'Other val) = val toJSON (PostSubscriptionSchedulesRequestBodyPhases'ProrationBehavior'Typed val) = Data.Aeson.Types.ToJSON.toJSON val toJSON (PostSubscriptionSchedulesRequestBodyPhases'ProrationBehavior'EnumAlwaysInvoice) = "always_invoice" toJSON (PostSubscriptionSchedulesRequestBodyPhases'ProrationBehavior'EnumCreateProrations) = "create_prorations" toJSON (PostSubscriptionSchedulesRequestBodyPhases'ProrationBehavior'EnumNone) = "none" instance Data.Aeson.Types.FromJSON.FromJSON PostSubscriptionSchedulesRequestBodyPhases'ProrationBehavior' where parseJSON val = GHC.Base.pure ( if | val GHC.Classes.== "always_invoice" -> PostSubscriptionSchedulesRequestBodyPhases'ProrationBehavior'EnumAlwaysInvoice | val GHC.Classes.== "create_prorations" -> PostSubscriptionSchedulesRequestBodyPhases'ProrationBehavior'EnumCreateProrations | val GHC.Classes.== "none" -> PostSubscriptionSchedulesRequestBodyPhases'ProrationBehavior'EnumNone | GHC.Base.otherwise -> PostSubscriptionSchedulesRequestBodyPhases'ProrationBehavior'Other val ) -- | Defines the object schema located at @paths.\/v1\/subscription_schedules.POST.requestBody.content.application\/x-www-form-urlencoded.schema.properties.phases.items.properties.transfer_data@ in the specification. data PostSubscriptionSchedulesRequestBodyPhases'TransferData' = PostSubscriptionSchedulesRequestBodyPhases'TransferData' { -- | amount_percent postSubscriptionSchedulesRequestBodyPhases'TransferData'AmountPercent :: (GHC.Maybe.Maybe GHC.Types.Double), -- | destination postSubscriptionSchedulesRequestBodyPhases'TransferData'Destination :: Data.Text.Internal.Text } deriving ( GHC.Show.Show, GHC.Classes.Eq ) instance Data.Aeson.Types.ToJSON.ToJSON PostSubscriptionSchedulesRequestBodyPhases'TransferData' where toJSON obj = Data.Aeson.Types.Internal.object ("amount_percent" Data.Aeson.Types.ToJSON..= postSubscriptionSchedulesRequestBodyPhases'TransferData'AmountPercent obj : "destination" Data.Aeson.Types.ToJSON..= postSubscriptionSchedulesRequestBodyPhases'TransferData'Destination obj : GHC.Base.mempty) toEncoding obj = Data.Aeson.Encoding.Internal.pairs (("amount_percent" Data.Aeson.Types.ToJSON..= postSubscriptionSchedulesRequestBodyPhases'TransferData'AmountPercent obj) GHC.Base.<> ("destination" Data.Aeson.Types.ToJSON..= postSubscriptionSchedulesRequestBodyPhases'TransferData'Destination obj)) instance Data.Aeson.Types.FromJSON.FromJSON PostSubscriptionSchedulesRequestBodyPhases'TransferData' where parseJSON = Data.Aeson.Types.FromJSON.withObject "PostSubscriptionSchedulesRequestBodyPhases'TransferData'" (\obj -> (GHC.Base.pure PostSubscriptionSchedulesRequestBodyPhases'TransferData' GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "amount_percent")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..: "destination")) -- | Create a new 'PostSubscriptionSchedulesRequestBodyPhases'TransferData'' with all required fields. mkPostSubscriptionSchedulesRequestBodyPhases'TransferData' :: -- | 'postSubscriptionSchedulesRequestBodyPhases'TransferData'Destination' Data.Text.Internal.Text -> PostSubscriptionSchedulesRequestBodyPhases'TransferData' mkPostSubscriptionSchedulesRequestBodyPhases'TransferData' postSubscriptionSchedulesRequestBodyPhases'TransferData'Destination = PostSubscriptionSchedulesRequestBodyPhases'TransferData' { postSubscriptionSchedulesRequestBodyPhases'TransferData'AmountPercent = GHC.Maybe.Nothing, postSubscriptionSchedulesRequestBodyPhases'TransferData'Destination = postSubscriptionSchedulesRequestBodyPhases'TransferData'Destination } -- | Defines the oneOf schema located at @paths.\/v1\/subscription_schedules.POST.requestBody.content.application\/x-www-form-urlencoded.schema.properties.start_date.anyOf@ in the specification. -- -- When the subscription schedule starts. We recommend using \`now\` so that it starts the subscription immediately. You can also use a Unix timestamp to backdate the subscription so that it starts on a past date, or set a future date for the subscription to start on. data PostSubscriptionSchedulesRequestBodyStartDate'Variants = -- | Represents the JSON value @"now"@ PostSubscriptionSchedulesRequestBodyStartDate'Now | PostSubscriptionSchedulesRequestBodyStartDate'Int GHC.Types.Int deriving (GHC.Show.Show, GHC.Classes.Eq) instance Data.Aeson.Types.ToJSON.ToJSON PostSubscriptionSchedulesRequestBodyStartDate'Variants where toJSON (PostSubscriptionSchedulesRequestBodyStartDate'Int a) = Data.Aeson.Types.ToJSON.toJSON a toJSON (PostSubscriptionSchedulesRequestBodyStartDate'Now) = "now" instance Data.Aeson.Types.FromJSON.FromJSON PostSubscriptionSchedulesRequestBodyStartDate'Variants where parseJSON val = if | val GHC.Classes.== "now" -> GHC.Base.pure PostSubscriptionSchedulesRequestBodyStartDate'Now | GHC.Base.otherwise -> case (PostSubscriptionSchedulesRequestBodyStartDate'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 'postSubscriptionSchedules'. -- -- 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), 'PostSubscriptionSchedulesResponseError' is used. data PostSubscriptionSchedulesResponse = -- | Means either no matching case available or a parse error PostSubscriptionSchedulesResponseError GHC.Base.String | -- | Successful response. PostSubscriptionSchedulesResponse200 SubscriptionSchedule | -- | Error response. PostSubscriptionSchedulesResponseDefault Error deriving (GHC.Show.Show, GHC.Classes.Eq)