{-# LANGUAGE MultiWayIf #-} -- CHANGE WITH CAUTION: This is a generated code file generated by https://github.com/Haskell-OpenAPI-Code-Generator/Haskell-OpenAPI-Client-Code-Generator. {-# LANGUAGE OverloadedStrings #-} -- | Contains the types generated from the schema SubscriptionSchedulesResourceDefaultSettings module StripeAPI.Types.SubscriptionSchedulesResourceDefaultSettings where import qualified Control.Monad.Fail import qualified Data.Aeson import qualified Data.Aeson as Data.Aeson.Encoding.Internal import qualified Data.Aeson as Data.Aeson.Types import qualified Data.Aeson as Data.Aeson.Types.FromJSON import qualified Data.Aeson as Data.Aeson.Types.Internal import qualified Data.Aeson as Data.Aeson.Types.ToJSON import qualified Data.ByteString.Char8 import qualified Data.ByteString.Char8 as Data.ByteString.Internal import qualified Data.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 GHC.Base import qualified GHC.Classes import qualified GHC.Int import qualified GHC.Show import qualified GHC.Types import qualified StripeAPI.Common import StripeAPI.TypeAlias import {-# SOURCE #-} StripeAPI.Types.Account import {-# SOURCE #-} StripeAPI.Types.InvoiceSettingSubscriptionScheduleSetting import {-# SOURCE #-} StripeAPI.Types.PaymentMethod import {-# SOURCE #-} StripeAPI.Types.SubscriptionBillingThresholds import {-# SOURCE #-} StripeAPI.Types.SubscriptionSchedulesResourceDefaultSettingsAutomaticTax import {-# SOURCE #-} StripeAPI.Types.SubscriptionTransferData import qualified Prelude as GHC.Integer.Type import qualified Prelude as GHC.Maybe -- | Defines the object schema located at @components.schemas.subscription_schedules_resource_default_settings@ in the specification. data SubscriptionSchedulesResourceDefaultSettings = SubscriptionSchedulesResourceDefaultSettings { -- | application_fee_percent: A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice subtotal that will be transferred to the application owner\'s Stripe account during this phase of the schedule. subscriptionSchedulesResourceDefaultSettingsApplicationFeePercent :: (GHC.Maybe.Maybe GHC.Types.Double), -- | automatic_tax: subscriptionSchedulesResourceDefaultSettingsAutomaticTax :: (GHC.Maybe.Maybe SubscriptionSchedulesResourceDefaultSettingsAutomaticTax), -- | billing_cycle_anchor: Possible values are \`phase_start\` or \`automatic\`. If \`phase_start\` then billing cycle anchor of the subscription is set to the start of the phase when entering the phase. If \`automatic\` then the billing cycle anchor is automatically modified as needed when entering the phase. For more information, see the billing cycle [documentation](https:\/\/stripe.com\/docs\/billing\/subscriptions\/billing-cycle). subscriptionSchedulesResourceDefaultSettingsBillingCycleAnchor :: SubscriptionSchedulesResourceDefaultSettingsBillingCycleAnchor', -- | billing_thresholds: Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period subscriptionSchedulesResourceDefaultSettingsBillingThresholds :: (GHC.Maybe.Maybe SubscriptionSchedulesResourceDefaultSettingsBillingThresholds'), -- | collection_method: Either \`charge_automatically\`, or \`send_invoice\`. When charging automatically, Stripe will attempt to pay the underlying subscription at the end of each billing cycle using the default source attached to the customer. When sending an invoice, Stripe will email your customer an invoice with payment instructions. subscriptionSchedulesResourceDefaultSettingsCollectionMethod :: (GHC.Maybe.Maybe SubscriptionSchedulesResourceDefaultSettingsCollectionMethod'), -- | default_payment_method: ID of the default payment method for the subscription schedule. If not set, invoices will use the default payment method in the customer\'s invoice settings. subscriptionSchedulesResourceDefaultSettingsDefaultPaymentMethod :: (GHC.Maybe.Maybe SubscriptionSchedulesResourceDefaultSettingsDefaultPaymentMethod'Variants), -- | invoice_settings: The subscription schedule\'s default invoice settings. subscriptionSchedulesResourceDefaultSettingsInvoiceSettings :: (GHC.Maybe.Maybe SubscriptionSchedulesResourceDefaultSettingsInvoiceSettings'), -- | transfer_data: The account (if any) the associated subscription\'s payments will be attributed to for tax reporting, and where funds from each payment will be transferred to for each of the subscription\'s invoices. subscriptionSchedulesResourceDefaultSettingsTransferData :: (GHC.Maybe.Maybe SubscriptionSchedulesResourceDefaultSettingsTransferData') } deriving ( GHC.Show.Show, GHC.Classes.Eq ) instance Data.Aeson.Types.ToJSON.ToJSON SubscriptionSchedulesResourceDefaultSettings where toJSON obj = Data.Aeson.Types.Internal.object ("application_fee_percent" Data.Aeson.Types.ToJSON..= subscriptionSchedulesResourceDefaultSettingsApplicationFeePercent obj : "automatic_tax" Data.Aeson.Types.ToJSON..= subscriptionSchedulesResourceDefaultSettingsAutomaticTax obj : "billing_cycle_anchor" Data.Aeson.Types.ToJSON..= subscriptionSchedulesResourceDefaultSettingsBillingCycleAnchor obj : "billing_thresholds" Data.Aeson.Types.ToJSON..= subscriptionSchedulesResourceDefaultSettingsBillingThresholds obj : "collection_method" Data.Aeson.Types.ToJSON..= subscriptionSchedulesResourceDefaultSettingsCollectionMethod obj : "default_payment_method" Data.Aeson.Types.ToJSON..= subscriptionSchedulesResourceDefaultSettingsDefaultPaymentMethod obj : "invoice_settings" Data.Aeson.Types.ToJSON..= subscriptionSchedulesResourceDefaultSettingsInvoiceSettings obj : "transfer_data" Data.Aeson.Types.ToJSON..= subscriptionSchedulesResourceDefaultSettingsTransferData obj : GHC.Base.mempty) toEncoding obj = Data.Aeson.Encoding.Internal.pairs (("application_fee_percent" Data.Aeson.Types.ToJSON..= subscriptionSchedulesResourceDefaultSettingsApplicationFeePercent obj) GHC.Base.<> (("automatic_tax" Data.Aeson.Types.ToJSON..= subscriptionSchedulesResourceDefaultSettingsAutomaticTax obj) GHC.Base.<> (("billing_cycle_anchor" Data.Aeson.Types.ToJSON..= subscriptionSchedulesResourceDefaultSettingsBillingCycleAnchor obj) GHC.Base.<> (("billing_thresholds" Data.Aeson.Types.ToJSON..= subscriptionSchedulesResourceDefaultSettingsBillingThresholds obj) GHC.Base.<> (("collection_method" Data.Aeson.Types.ToJSON..= subscriptionSchedulesResourceDefaultSettingsCollectionMethod obj) GHC.Base.<> (("default_payment_method" Data.Aeson.Types.ToJSON..= subscriptionSchedulesResourceDefaultSettingsDefaultPaymentMethod obj) GHC.Base.<> (("invoice_settings" Data.Aeson.Types.ToJSON..= subscriptionSchedulesResourceDefaultSettingsInvoiceSettings obj) GHC.Base.<> ("transfer_data" Data.Aeson.Types.ToJSON..= subscriptionSchedulesResourceDefaultSettingsTransferData obj)))))))) instance Data.Aeson.Types.FromJSON.FromJSON SubscriptionSchedulesResourceDefaultSettings where parseJSON = Data.Aeson.Types.FromJSON.withObject "SubscriptionSchedulesResourceDefaultSettings" (\obj -> (((((((GHC.Base.pure SubscriptionSchedulesResourceDefaultSettings 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 'SubscriptionSchedulesResourceDefaultSettings' with all required fields. mkSubscriptionSchedulesResourceDefaultSettings :: -- | 'subscriptionSchedulesResourceDefaultSettingsBillingCycleAnchor' SubscriptionSchedulesResourceDefaultSettingsBillingCycleAnchor' -> SubscriptionSchedulesResourceDefaultSettings mkSubscriptionSchedulesResourceDefaultSettings subscriptionSchedulesResourceDefaultSettingsBillingCycleAnchor = SubscriptionSchedulesResourceDefaultSettings { subscriptionSchedulesResourceDefaultSettingsApplicationFeePercent = GHC.Maybe.Nothing, subscriptionSchedulesResourceDefaultSettingsAutomaticTax = GHC.Maybe.Nothing, subscriptionSchedulesResourceDefaultSettingsBillingCycleAnchor = subscriptionSchedulesResourceDefaultSettingsBillingCycleAnchor, subscriptionSchedulesResourceDefaultSettingsBillingThresholds = GHC.Maybe.Nothing, subscriptionSchedulesResourceDefaultSettingsCollectionMethod = GHC.Maybe.Nothing, subscriptionSchedulesResourceDefaultSettingsDefaultPaymentMethod = GHC.Maybe.Nothing, subscriptionSchedulesResourceDefaultSettingsInvoiceSettings = GHC.Maybe.Nothing, subscriptionSchedulesResourceDefaultSettingsTransferData = GHC.Maybe.Nothing } -- | Defines the enum schema located at @components.schemas.subscription_schedules_resource_default_settings.properties.billing_cycle_anchor@ in the specification. -- -- Possible values are \`phase_start\` or \`automatic\`. If \`phase_start\` then billing cycle anchor of the subscription is set to the start of the phase when entering the phase. If \`automatic\` then the billing cycle anchor is automatically modified as needed when entering the phase. For more information, see the billing cycle [documentation](https:\/\/stripe.com\/docs\/billing\/subscriptions\/billing-cycle). data SubscriptionSchedulesResourceDefaultSettingsBillingCycleAnchor' = -- | This case is used if the value encountered during decoding does not match any of the provided cases in the specification. SubscriptionSchedulesResourceDefaultSettingsBillingCycleAnchor'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. SubscriptionSchedulesResourceDefaultSettingsBillingCycleAnchor'Typed Data.Text.Internal.Text | -- | Represents the JSON value @"automatic"@ SubscriptionSchedulesResourceDefaultSettingsBillingCycleAnchor'EnumAutomatic | -- | Represents the JSON value @"phase_start"@ SubscriptionSchedulesResourceDefaultSettingsBillingCycleAnchor'EnumPhaseStart deriving (GHC.Show.Show, GHC.Classes.Eq) instance Data.Aeson.Types.ToJSON.ToJSON SubscriptionSchedulesResourceDefaultSettingsBillingCycleAnchor' where toJSON (SubscriptionSchedulesResourceDefaultSettingsBillingCycleAnchor'Other val) = val toJSON (SubscriptionSchedulesResourceDefaultSettingsBillingCycleAnchor'Typed val) = Data.Aeson.Types.ToJSON.toJSON val toJSON (SubscriptionSchedulesResourceDefaultSettingsBillingCycleAnchor'EnumAutomatic) = "automatic" toJSON (SubscriptionSchedulesResourceDefaultSettingsBillingCycleAnchor'EnumPhaseStart) = "phase_start" instance Data.Aeson.Types.FromJSON.FromJSON SubscriptionSchedulesResourceDefaultSettingsBillingCycleAnchor' where parseJSON val = GHC.Base.pure ( if | val GHC.Classes.== "automatic" -> SubscriptionSchedulesResourceDefaultSettingsBillingCycleAnchor'EnumAutomatic | val GHC.Classes.== "phase_start" -> SubscriptionSchedulesResourceDefaultSettingsBillingCycleAnchor'EnumPhaseStart | GHC.Base.otherwise -> SubscriptionSchedulesResourceDefaultSettingsBillingCycleAnchor'Other val ) -- | Defines the object schema located at @components.schemas.subscription_schedules_resource_default_settings.properties.billing_thresholds.anyOf@ in the specification. -- -- Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period data SubscriptionSchedulesResourceDefaultSettingsBillingThresholds' = SubscriptionSchedulesResourceDefaultSettingsBillingThresholds' { -- | amount_gte: Monetary threshold that triggers the subscription to create an invoice subscriptionSchedulesResourceDefaultSettingsBillingThresholds'AmountGte :: (GHC.Maybe.Maybe GHC.Types.Int), -- | reset_billing_cycle_anchor: Indicates if the \`billing_cycle_anchor\` should be reset when a threshold is reached. If true, \`billing_cycle_anchor\` will be updated to the date\/time the threshold was last reached; otherwise, the value will remain unchanged. This value may not be \`true\` if the subscription contains items with plans that have \`aggregate_usage=last_ever\`. subscriptionSchedulesResourceDefaultSettingsBillingThresholds'ResetBillingCycleAnchor :: (GHC.Maybe.Maybe GHC.Types.Bool) } deriving ( GHC.Show.Show, GHC.Classes.Eq ) instance Data.Aeson.Types.ToJSON.ToJSON SubscriptionSchedulesResourceDefaultSettingsBillingThresholds' where toJSON obj = Data.Aeson.Types.Internal.object ("amount_gte" Data.Aeson.Types.ToJSON..= subscriptionSchedulesResourceDefaultSettingsBillingThresholds'AmountGte obj : "reset_billing_cycle_anchor" Data.Aeson.Types.ToJSON..= subscriptionSchedulesResourceDefaultSettingsBillingThresholds'ResetBillingCycleAnchor obj : GHC.Base.mempty) toEncoding obj = Data.Aeson.Encoding.Internal.pairs (("amount_gte" Data.Aeson.Types.ToJSON..= subscriptionSchedulesResourceDefaultSettingsBillingThresholds'AmountGte obj) GHC.Base.<> ("reset_billing_cycle_anchor" Data.Aeson.Types.ToJSON..= subscriptionSchedulesResourceDefaultSettingsBillingThresholds'ResetBillingCycleAnchor obj)) instance Data.Aeson.Types.FromJSON.FromJSON SubscriptionSchedulesResourceDefaultSettingsBillingThresholds' where parseJSON = Data.Aeson.Types.FromJSON.withObject "SubscriptionSchedulesResourceDefaultSettingsBillingThresholds'" (\obj -> (GHC.Base.pure SubscriptionSchedulesResourceDefaultSettingsBillingThresholds' GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "amount_gte")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "reset_billing_cycle_anchor")) -- | Create a new 'SubscriptionSchedulesResourceDefaultSettingsBillingThresholds'' with all required fields. mkSubscriptionSchedulesResourceDefaultSettingsBillingThresholds' :: SubscriptionSchedulesResourceDefaultSettingsBillingThresholds' mkSubscriptionSchedulesResourceDefaultSettingsBillingThresholds' = SubscriptionSchedulesResourceDefaultSettingsBillingThresholds' { subscriptionSchedulesResourceDefaultSettingsBillingThresholds'AmountGte = GHC.Maybe.Nothing, subscriptionSchedulesResourceDefaultSettingsBillingThresholds'ResetBillingCycleAnchor = GHC.Maybe.Nothing } -- | Defines the enum schema located at @components.schemas.subscription_schedules_resource_default_settings.properties.collection_method@ in the specification. -- -- Either \`charge_automatically\`, or \`send_invoice\`. When charging automatically, Stripe will attempt to pay the underlying subscription at the end of each billing cycle using the default source attached to the customer. When sending an invoice, Stripe will email your customer an invoice with payment instructions. data SubscriptionSchedulesResourceDefaultSettingsCollectionMethod' = -- | This case is used if the value encountered during decoding does not match any of the provided cases in the specification. SubscriptionSchedulesResourceDefaultSettingsCollectionMethod'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. SubscriptionSchedulesResourceDefaultSettingsCollectionMethod'Typed Data.Text.Internal.Text | -- | Represents the JSON value @"charge_automatically"@ SubscriptionSchedulesResourceDefaultSettingsCollectionMethod'EnumChargeAutomatically | -- | Represents the JSON value @"send_invoice"@ SubscriptionSchedulesResourceDefaultSettingsCollectionMethod'EnumSendInvoice deriving (GHC.Show.Show, GHC.Classes.Eq) instance Data.Aeson.Types.ToJSON.ToJSON SubscriptionSchedulesResourceDefaultSettingsCollectionMethod' where toJSON (SubscriptionSchedulesResourceDefaultSettingsCollectionMethod'Other val) = val toJSON (SubscriptionSchedulesResourceDefaultSettingsCollectionMethod'Typed val) = Data.Aeson.Types.ToJSON.toJSON val toJSON (SubscriptionSchedulesResourceDefaultSettingsCollectionMethod'EnumChargeAutomatically) = "charge_automatically" toJSON (SubscriptionSchedulesResourceDefaultSettingsCollectionMethod'EnumSendInvoice) = "send_invoice" instance Data.Aeson.Types.FromJSON.FromJSON SubscriptionSchedulesResourceDefaultSettingsCollectionMethod' where parseJSON val = GHC.Base.pure ( if | val GHC.Classes.== "charge_automatically" -> SubscriptionSchedulesResourceDefaultSettingsCollectionMethod'EnumChargeAutomatically | val GHC.Classes.== "send_invoice" -> SubscriptionSchedulesResourceDefaultSettingsCollectionMethod'EnumSendInvoice | GHC.Base.otherwise -> SubscriptionSchedulesResourceDefaultSettingsCollectionMethod'Other val ) -- | Defines the oneOf schema located at @components.schemas.subscription_schedules_resource_default_settings.properties.default_payment_method.anyOf@ in the specification. -- -- ID of the default payment method for the subscription schedule. If not set, invoices will use the default payment method in the customer\'s invoice settings. data SubscriptionSchedulesResourceDefaultSettingsDefaultPaymentMethod'Variants = SubscriptionSchedulesResourceDefaultSettingsDefaultPaymentMethod'Text Data.Text.Internal.Text | SubscriptionSchedulesResourceDefaultSettingsDefaultPaymentMethod'PaymentMethod PaymentMethod deriving (GHC.Show.Show, GHC.Classes.Eq) instance Data.Aeson.Types.ToJSON.ToJSON SubscriptionSchedulesResourceDefaultSettingsDefaultPaymentMethod'Variants where toJSON (SubscriptionSchedulesResourceDefaultSettingsDefaultPaymentMethod'Text a) = Data.Aeson.Types.ToJSON.toJSON a toJSON (SubscriptionSchedulesResourceDefaultSettingsDefaultPaymentMethod'PaymentMethod a) = Data.Aeson.Types.ToJSON.toJSON a instance Data.Aeson.Types.FromJSON.FromJSON SubscriptionSchedulesResourceDefaultSettingsDefaultPaymentMethod'Variants where parseJSON val = case (SubscriptionSchedulesResourceDefaultSettingsDefaultPaymentMethod'Text Data.Functor.<$> Data.Aeson.Types.FromJSON.fromJSON val) GHC.Base.<|> ((SubscriptionSchedulesResourceDefaultSettingsDefaultPaymentMethod'PaymentMethod 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 @components.schemas.subscription_schedules_resource_default_settings.properties.invoice_settings.anyOf@ in the specification. -- -- The subscription schedule\\\'s default invoice settings. data SubscriptionSchedulesResourceDefaultSettingsInvoiceSettings' = SubscriptionSchedulesResourceDefaultSettingsInvoiceSettings' { -- | days_until_due: Number of days within which a customer must pay invoices generated by this subscription schedule. This value will be \`null\` for subscription schedules where \`billing=charge_automatically\`. subscriptionSchedulesResourceDefaultSettingsInvoiceSettings'DaysUntilDue :: (GHC.Maybe.Maybe GHC.Types.Int) } deriving ( GHC.Show.Show, GHC.Classes.Eq ) instance Data.Aeson.Types.ToJSON.ToJSON SubscriptionSchedulesResourceDefaultSettingsInvoiceSettings' where toJSON obj = Data.Aeson.Types.Internal.object ("days_until_due" Data.Aeson.Types.ToJSON..= subscriptionSchedulesResourceDefaultSettingsInvoiceSettings'DaysUntilDue obj : GHC.Base.mempty) toEncoding obj = Data.Aeson.Encoding.Internal.pairs ("days_until_due" Data.Aeson.Types.ToJSON..= subscriptionSchedulesResourceDefaultSettingsInvoiceSettings'DaysUntilDue obj) instance Data.Aeson.Types.FromJSON.FromJSON SubscriptionSchedulesResourceDefaultSettingsInvoiceSettings' where parseJSON = Data.Aeson.Types.FromJSON.withObject "SubscriptionSchedulesResourceDefaultSettingsInvoiceSettings'" (\obj -> GHC.Base.pure SubscriptionSchedulesResourceDefaultSettingsInvoiceSettings' GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "days_until_due")) -- | Create a new 'SubscriptionSchedulesResourceDefaultSettingsInvoiceSettings'' with all required fields. mkSubscriptionSchedulesResourceDefaultSettingsInvoiceSettings' :: SubscriptionSchedulesResourceDefaultSettingsInvoiceSettings' mkSubscriptionSchedulesResourceDefaultSettingsInvoiceSettings' = SubscriptionSchedulesResourceDefaultSettingsInvoiceSettings' {subscriptionSchedulesResourceDefaultSettingsInvoiceSettings'DaysUntilDue = GHC.Maybe.Nothing} -- | Defines the object schema located at @components.schemas.subscription_schedules_resource_default_settings.properties.transfer_data.anyOf@ in the specification. -- -- The account (if any) the associated subscription\\\'s payments will be attributed to for tax reporting, and where funds from each payment will be transferred to for each of the subscription\\\'s invoices. data SubscriptionSchedulesResourceDefaultSettingsTransferData' = SubscriptionSchedulesResourceDefaultSettingsTransferData' { -- | amount_percent: A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice subtotal that will be transferred to the destination account. By default, the entire amount is transferred to the destination. subscriptionSchedulesResourceDefaultSettingsTransferData'AmountPercent :: (GHC.Maybe.Maybe GHC.Types.Double), -- | destination: The account where funds from the payment will be transferred to upon payment success. subscriptionSchedulesResourceDefaultSettingsTransferData'Destination :: (GHC.Maybe.Maybe SubscriptionSchedulesResourceDefaultSettingsTransferData'Destination'Variants) } deriving ( GHC.Show.Show, GHC.Classes.Eq ) instance Data.Aeson.Types.ToJSON.ToJSON SubscriptionSchedulesResourceDefaultSettingsTransferData' where toJSON obj = Data.Aeson.Types.Internal.object ("amount_percent" Data.Aeson.Types.ToJSON..= subscriptionSchedulesResourceDefaultSettingsTransferData'AmountPercent obj : "destination" Data.Aeson.Types.ToJSON..= subscriptionSchedulesResourceDefaultSettingsTransferData'Destination obj : GHC.Base.mempty) toEncoding obj = Data.Aeson.Encoding.Internal.pairs (("amount_percent" Data.Aeson.Types.ToJSON..= subscriptionSchedulesResourceDefaultSettingsTransferData'AmountPercent obj) GHC.Base.<> ("destination" Data.Aeson.Types.ToJSON..= subscriptionSchedulesResourceDefaultSettingsTransferData'Destination obj)) instance Data.Aeson.Types.FromJSON.FromJSON SubscriptionSchedulesResourceDefaultSettingsTransferData' where parseJSON = Data.Aeson.Types.FromJSON.withObject "SubscriptionSchedulesResourceDefaultSettingsTransferData'" (\obj -> (GHC.Base.pure SubscriptionSchedulesResourceDefaultSettingsTransferData' GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "amount_percent")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "destination")) -- | Create a new 'SubscriptionSchedulesResourceDefaultSettingsTransferData'' with all required fields. mkSubscriptionSchedulesResourceDefaultSettingsTransferData' :: SubscriptionSchedulesResourceDefaultSettingsTransferData' mkSubscriptionSchedulesResourceDefaultSettingsTransferData' = SubscriptionSchedulesResourceDefaultSettingsTransferData' { subscriptionSchedulesResourceDefaultSettingsTransferData'AmountPercent = GHC.Maybe.Nothing, subscriptionSchedulesResourceDefaultSettingsTransferData'Destination = GHC.Maybe.Nothing } -- | Defines the oneOf schema located at @components.schemas.subscription_schedules_resource_default_settings.properties.transfer_data.anyOf.properties.destination.anyOf@ in the specification. -- -- The account where funds from the payment will be transferred to upon payment success. data SubscriptionSchedulesResourceDefaultSettingsTransferData'Destination'Variants = SubscriptionSchedulesResourceDefaultSettingsTransferData'Destination'Text Data.Text.Internal.Text | SubscriptionSchedulesResourceDefaultSettingsTransferData'Destination'Account Account deriving (GHC.Show.Show, GHC.Classes.Eq) instance Data.Aeson.Types.ToJSON.ToJSON SubscriptionSchedulesResourceDefaultSettingsTransferData'Destination'Variants where toJSON (SubscriptionSchedulesResourceDefaultSettingsTransferData'Destination'Text a) = Data.Aeson.Types.ToJSON.toJSON a toJSON (SubscriptionSchedulesResourceDefaultSettingsTransferData'Destination'Account a) = Data.Aeson.Types.ToJSON.toJSON a instance Data.Aeson.Types.FromJSON.FromJSON SubscriptionSchedulesResourceDefaultSettingsTransferData'Destination'Variants where parseJSON val = case (SubscriptionSchedulesResourceDefaultSettingsTransferData'Destination'Text Data.Functor.<$> Data.Aeson.Types.FromJSON.fromJSON val) GHC.Base.<|> ((SubscriptionSchedulesResourceDefaultSettingsTransferData'Destination'Account 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