{-# 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 Invoiceitem module StripeAPI.Types.Invoiceitem 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.Foldable import qualified Data.Functor import qualified Data.Maybe 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.CustomUnitAmount import {-# SOURCE #-} StripeAPI.Types.Customer import {-# SOURCE #-} StripeAPI.Types.DeletedCustomer import {-# SOURCE #-} StripeAPI.Types.DeletedProduct import {-# SOURCE #-} StripeAPI.Types.Discount import {-# SOURCE #-} StripeAPI.Types.Invoice import {-# SOURCE #-} StripeAPI.Types.InvoiceLineItemPeriod import {-# SOURCE #-} StripeAPI.Types.Price import {-# SOURCE #-} StripeAPI.Types.PriceTier import {-# SOURCE #-} StripeAPI.Types.Product import {-# SOURCE #-} StripeAPI.Types.Recurring import {-# SOURCE #-} StripeAPI.Types.Subscription import {-# SOURCE #-} StripeAPI.Types.TaxRate import {-# SOURCE #-} StripeAPI.Types.TestHelpers_TestClock import {-# SOURCE #-} StripeAPI.Types.TransformQuantity import qualified Prelude as GHC.Integer.Type import qualified Prelude as GHC.Maybe -- | Defines the object schema located at @components.schemas.invoiceitem@ in the specification. -- -- Sometimes you want to add a charge or credit to a customer, but actually -- charge or credit the customer\'s card only at the end of a regular billing -- cycle. This is useful for combining several charges (to minimize -- per-transaction fees), or for having Stripe tabulate your usage-based billing -- totals. -- -- Related guide: [Subscription Invoices](https:\/\/stripe.com\/docs\/billing\/invoices\/subscription\#adding-upcoming-invoice-items). data Invoiceitem = Invoiceitem { -- | amount: Amount (in the \`currency\` specified) of the invoice item. This should always be equal to \`unit_amount * quantity\`. invoiceitemAmount :: GHC.Types.Int, -- | currency: Three-letter [ISO currency code](https:\/\/www.iso.org\/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https:\/\/stripe.com\/docs\/currencies). invoiceitemCurrency :: Data.Text.Internal.Text, -- | customer: The ID of the customer who will be billed when this invoice item is billed. invoiceitemCustomer :: InvoiceitemCustomer'Variants, -- | date: Time at which the object was created. Measured in seconds since the Unix epoch. invoiceitemDate :: GHC.Types.Int, -- | description: An arbitrary string attached to the object. Often useful for displaying to users. -- -- Constraints: -- -- * Maximum length of 5000 invoiceitemDescription :: (GHC.Maybe.Maybe (StripeAPI.Common.Nullable Data.Text.Internal.Text)), -- | discountable: If true, discounts will apply to this invoice item. Always false for prorations. invoiceitemDiscountable :: GHC.Types.Bool, -- | discounts: The discounts which apply to the invoice item. Item discounts are applied before invoice discounts. Use \`expand[]=discounts\` to expand each discount. invoiceitemDiscounts :: (GHC.Maybe.Maybe (StripeAPI.Common.Nullable ([InvoiceitemDiscounts'NonNullableVariants]))), -- | id: Unique identifier for the object. -- -- Constraints: -- -- * Maximum length of 5000 invoiceitemId :: Data.Text.Internal.Text, -- | invoice: The ID of the invoice this invoice item belongs to. invoiceitemInvoice :: (GHC.Maybe.Maybe (StripeAPI.Common.Nullable InvoiceitemInvoice'NonNullableVariants)), -- | livemode: Has the value \`true\` if the object exists in live mode or the value \`false\` if the object exists in test mode. invoiceitemLivemode :: GHC.Types.Bool, -- | 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. invoiceitemMetadata :: (GHC.Maybe.Maybe (StripeAPI.Common.Nullable Data.Aeson.Types.Internal.Object)), -- | period: invoiceitemPeriod :: InvoiceLineItemPeriod, -- | price: The price of the invoice item. invoiceitemPrice :: (GHC.Maybe.Maybe (StripeAPI.Common.Nullable InvoiceitemPrice'NonNullable)), -- | proration: Whether the invoice item was created automatically as a proration adjustment when the customer switched plans. invoiceitemProration :: GHC.Types.Bool, -- | quantity: Quantity of units for the invoice item. If the invoice item is a proration, the quantity of the subscription that the proration was computed for. invoiceitemQuantity :: GHC.Types.Int, -- | subscription: The subscription that this invoice item has been created for, if any. invoiceitemSubscription :: (GHC.Maybe.Maybe (StripeAPI.Common.Nullable InvoiceitemSubscription'NonNullableVariants)), -- | subscription_item: The subscription item that this invoice item has been created for, if any. -- -- Constraints: -- -- * Maximum length of 5000 invoiceitemSubscriptionItem :: (GHC.Maybe.Maybe Data.Text.Internal.Text), -- | tax_rates: The tax rates which apply to the invoice item. When set, the \`default_tax_rates\` on the invoice do not apply to this invoice item. invoiceitemTaxRates :: (GHC.Maybe.Maybe (StripeAPI.Common.Nullable ([TaxRate]))), -- | test_clock: ID of the test clock this invoice item belongs to. invoiceitemTestClock :: (GHC.Maybe.Maybe (StripeAPI.Common.Nullable InvoiceitemTestClock'NonNullableVariants)), -- | unit_amount: Unit amount (in the \`currency\` specified) of the invoice item. invoiceitemUnitAmount :: (GHC.Maybe.Maybe (StripeAPI.Common.Nullable GHC.Types.Int)), -- | unit_amount_decimal: Same as \`unit_amount\`, but contains a decimal value with at most 12 decimal places. invoiceitemUnitAmountDecimal :: (GHC.Maybe.Maybe (StripeAPI.Common.Nullable Data.Text.Internal.Text)) } deriving ( GHC.Show.Show, GHC.Classes.Eq ) instance Data.Aeson.Types.ToJSON.ToJSON Invoiceitem where toJSON obj = Data.Aeson.Types.Internal.object (Data.Foldable.concat (["amount" Data.Aeson.Types.ToJSON..= invoiceitemAmount obj] : ["currency" Data.Aeson.Types.ToJSON..= invoiceitemCurrency obj] : ["customer" Data.Aeson.Types.ToJSON..= invoiceitemCustomer obj] : ["date" Data.Aeson.Types.ToJSON..= invoiceitemDate obj] : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("description" Data.Aeson.Types.ToJSON..=)) (invoiceitemDescription obj) : ["discountable" Data.Aeson.Types.ToJSON..= invoiceitemDiscountable obj] : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("discounts" Data.Aeson.Types.ToJSON..=)) (invoiceitemDiscounts obj) : ["id" Data.Aeson.Types.ToJSON..= invoiceitemId obj] : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("invoice" Data.Aeson.Types.ToJSON..=)) (invoiceitemInvoice obj) : ["livemode" Data.Aeson.Types.ToJSON..= invoiceitemLivemode obj] : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("metadata" Data.Aeson.Types.ToJSON..=)) (invoiceitemMetadata obj) : ["period" Data.Aeson.Types.ToJSON..= invoiceitemPeriod obj] : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("price" Data.Aeson.Types.ToJSON..=)) (invoiceitemPrice obj) : ["proration" Data.Aeson.Types.ToJSON..= invoiceitemProration obj] : ["quantity" Data.Aeson.Types.ToJSON..= invoiceitemQuantity obj] : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("subscription" Data.Aeson.Types.ToJSON..=)) (invoiceitemSubscription obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("subscription_item" Data.Aeson.Types.ToJSON..=)) (invoiceitemSubscriptionItem obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("tax_rates" Data.Aeson.Types.ToJSON..=)) (invoiceitemTaxRates obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("test_clock" Data.Aeson.Types.ToJSON..=)) (invoiceitemTestClock obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("unit_amount" Data.Aeson.Types.ToJSON..=)) (invoiceitemUnitAmount obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("unit_amount_decimal" Data.Aeson.Types.ToJSON..=)) (invoiceitemUnitAmountDecimal obj) : ["object" Data.Aeson.Types.ToJSON..= Data.Aeson.Types.Internal.String "invoiceitem"] : GHC.Base.mempty)) toEncoding obj = Data.Aeson.Encoding.Internal.pairs (GHC.Base.mconcat (Data.Foldable.concat (["amount" Data.Aeson.Types.ToJSON..= invoiceitemAmount obj] : ["currency" Data.Aeson.Types.ToJSON..= invoiceitemCurrency obj] : ["customer" Data.Aeson.Types.ToJSON..= invoiceitemCustomer obj] : ["date" Data.Aeson.Types.ToJSON..= invoiceitemDate obj] : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("description" Data.Aeson.Types.ToJSON..=)) (invoiceitemDescription obj) : ["discountable" Data.Aeson.Types.ToJSON..= invoiceitemDiscountable obj] : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("discounts" Data.Aeson.Types.ToJSON..=)) (invoiceitemDiscounts obj) : ["id" Data.Aeson.Types.ToJSON..= invoiceitemId obj] : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("invoice" Data.Aeson.Types.ToJSON..=)) (invoiceitemInvoice obj) : ["livemode" Data.Aeson.Types.ToJSON..= invoiceitemLivemode obj] : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("metadata" Data.Aeson.Types.ToJSON..=)) (invoiceitemMetadata obj) : ["period" Data.Aeson.Types.ToJSON..= invoiceitemPeriod obj] : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("price" Data.Aeson.Types.ToJSON..=)) (invoiceitemPrice obj) : ["proration" Data.Aeson.Types.ToJSON..= invoiceitemProration obj] : ["quantity" Data.Aeson.Types.ToJSON..= invoiceitemQuantity obj] : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("subscription" Data.Aeson.Types.ToJSON..=)) (invoiceitemSubscription obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("subscription_item" Data.Aeson.Types.ToJSON..=)) (invoiceitemSubscriptionItem obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("tax_rates" Data.Aeson.Types.ToJSON..=)) (invoiceitemTaxRates obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("test_clock" Data.Aeson.Types.ToJSON..=)) (invoiceitemTestClock obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("unit_amount" Data.Aeson.Types.ToJSON..=)) (invoiceitemUnitAmount obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("unit_amount_decimal" Data.Aeson.Types.ToJSON..=)) (invoiceitemUnitAmountDecimal obj) : ["object" Data.Aeson.Types.ToJSON..= Data.Aeson.Types.Internal.String "invoiceitem"] : GHC.Base.mempty))) instance Data.Aeson.Types.FromJSON.FromJSON Invoiceitem where parseJSON = Data.Aeson.Types.FromJSON.withObject "Invoiceitem" (\obj -> ((((((((((((((((((((GHC.Base.pure Invoiceitem GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..: "amount")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..: "currency")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..: "customer")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..: "date")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "description")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..: "discountable")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "discounts")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..: "id")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "invoice")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..: "livemode")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "metadata")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..: "period")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "price")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..: "proration")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..: "quantity")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "subscription")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "subscription_item")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "tax_rates")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "test_clock")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "unit_amount")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "unit_amount_decimal")) -- | Create a new 'Invoiceitem' with all required fields. mkInvoiceitem :: -- | 'invoiceitemAmount' GHC.Types.Int -> -- | 'invoiceitemCurrency' Data.Text.Internal.Text -> -- | 'invoiceitemCustomer' InvoiceitemCustomer'Variants -> -- | 'invoiceitemDate' GHC.Types.Int -> -- | 'invoiceitemDiscountable' GHC.Types.Bool -> -- | 'invoiceitemId' Data.Text.Internal.Text -> -- | 'invoiceitemLivemode' GHC.Types.Bool -> -- | 'invoiceitemPeriod' InvoiceLineItemPeriod -> -- | 'invoiceitemProration' GHC.Types.Bool -> -- | 'invoiceitemQuantity' GHC.Types.Int -> Invoiceitem mkInvoiceitem invoiceitemAmount invoiceitemCurrency invoiceitemCustomer invoiceitemDate invoiceitemDiscountable invoiceitemId invoiceitemLivemode invoiceitemPeriod invoiceitemProration invoiceitemQuantity = Invoiceitem { invoiceitemAmount = invoiceitemAmount, invoiceitemCurrency = invoiceitemCurrency, invoiceitemCustomer = invoiceitemCustomer, invoiceitemDate = invoiceitemDate, invoiceitemDescription = GHC.Maybe.Nothing, invoiceitemDiscountable = invoiceitemDiscountable, invoiceitemDiscounts = GHC.Maybe.Nothing, invoiceitemId = invoiceitemId, invoiceitemInvoice = GHC.Maybe.Nothing, invoiceitemLivemode = invoiceitemLivemode, invoiceitemMetadata = GHC.Maybe.Nothing, invoiceitemPeriod = invoiceitemPeriod, invoiceitemPrice = GHC.Maybe.Nothing, invoiceitemProration = invoiceitemProration, invoiceitemQuantity = invoiceitemQuantity, invoiceitemSubscription = GHC.Maybe.Nothing, invoiceitemSubscriptionItem = GHC.Maybe.Nothing, invoiceitemTaxRates = GHC.Maybe.Nothing, invoiceitemTestClock = GHC.Maybe.Nothing, invoiceitemUnitAmount = GHC.Maybe.Nothing, invoiceitemUnitAmountDecimal = GHC.Maybe.Nothing } -- | Defines the oneOf schema located at @components.schemas.invoiceitem.properties.customer.anyOf@ in the specification. -- -- The ID of the customer who will be billed when this invoice item is billed. data InvoiceitemCustomer'Variants = InvoiceitemCustomer'Text Data.Text.Internal.Text | InvoiceitemCustomer'Customer Customer | InvoiceitemCustomer'DeletedCustomer DeletedCustomer deriving (GHC.Show.Show, GHC.Classes.Eq) instance Data.Aeson.Types.ToJSON.ToJSON InvoiceitemCustomer'Variants where toJSON (InvoiceitemCustomer'Text a) = Data.Aeson.Types.ToJSON.toJSON a toJSON (InvoiceitemCustomer'Customer a) = Data.Aeson.Types.ToJSON.toJSON a toJSON (InvoiceitemCustomer'DeletedCustomer a) = Data.Aeson.Types.ToJSON.toJSON a instance Data.Aeson.Types.FromJSON.FromJSON InvoiceitemCustomer'Variants where parseJSON val = case (InvoiceitemCustomer'Text Data.Functor.<$> Data.Aeson.Types.FromJSON.fromJSON val) GHC.Base.<|> ((InvoiceitemCustomer'Customer Data.Functor.<$> Data.Aeson.Types.FromJSON.fromJSON val) GHC.Base.<|> ((InvoiceitemCustomer'DeletedCustomer Data.Functor.<$> Data.Aeson.Types.FromJSON.fromJSON val) GHC.Base.<|> Data.Aeson.Types.Internal.Error "No variant matched")) of Data.Aeson.Types.Internal.Success a -> GHC.Base.pure a Data.Aeson.Types.Internal.Error a -> Control.Monad.Fail.fail a -- | Defines the oneOf schema located at @components.schemas.invoiceitem.properties.discounts.items.anyOf@ in the specification. data InvoiceitemDiscounts'NonNullableVariants = InvoiceitemDiscounts'NonNullableText Data.Text.Internal.Text | InvoiceitemDiscounts'NonNullableDiscount Discount deriving (GHC.Show.Show, GHC.Classes.Eq) instance Data.Aeson.Types.ToJSON.ToJSON InvoiceitemDiscounts'NonNullableVariants where toJSON (InvoiceitemDiscounts'NonNullableText a) = Data.Aeson.Types.ToJSON.toJSON a toJSON (InvoiceitemDiscounts'NonNullableDiscount a) = Data.Aeson.Types.ToJSON.toJSON a instance Data.Aeson.Types.FromJSON.FromJSON InvoiceitemDiscounts'NonNullableVariants where parseJSON val = case (InvoiceitemDiscounts'NonNullableText Data.Functor.<$> Data.Aeson.Types.FromJSON.fromJSON val) GHC.Base.<|> ((InvoiceitemDiscounts'NonNullableDiscount Data.Functor.<$> Data.Aeson.Types.FromJSON.fromJSON val) GHC.Base.<|> Data.Aeson.Types.Internal.Error "No variant matched") of Data.Aeson.Types.Internal.Success a -> GHC.Base.pure a Data.Aeson.Types.Internal.Error a -> Control.Monad.Fail.fail a -- | Defines the oneOf schema located at @components.schemas.invoiceitem.properties.invoice.anyOf@ in the specification. -- -- The ID of the invoice this invoice item belongs to. data InvoiceitemInvoice'NonNullableVariants = InvoiceitemInvoice'NonNullableText Data.Text.Internal.Text | InvoiceitemInvoice'NonNullableInvoice Invoice deriving (GHC.Show.Show, GHC.Classes.Eq) instance Data.Aeson.Types.ToJSON.ToJSON InvoiceitemInvoice'NonNullableVariants where toJSON (InvoiceitemInvoice'NonNullableText a) = Data.Aeson.Types.ToJSON.toJSON a toJSON (InvoiceitemInvoice'NonNullableInvoice a) = Data.Aeson.Types.ToJSON.toJSON a instance Data.Aeson.Types.FromJSON.FromJSON InvoiceitemInvoice'NonNullableVariants where parseJSON val = case (InvoiceitemInvoice'NonNullableText Data.Functor.<$> Data.Aeson.Types.FromJSON.fromJSON val) GHC.Base.<|> ((InvoiceitemInvoice'NonNullableInvoice 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.invoiceitem.properties.price.anyOf@ in the specification. -- -- The price of the invoice item. data InvoiceitemPrice'NonNullable = InvoiceitemPrice'NonNullable { -- | active: Whether the price can be used for new purchases. invoiceitemPrice'NonNullableActive :: (GHC.Maybe.Maybe GHC.Types.Bool), -- | billing_scheme: Describes how to compute the price per period. Either \`per_unit\` or \`tiered\`. \`per_unit\` indicates that the fixed amount (specified in \`unit_amount\` or \`unit_amount_decimal\`) will be charged per unit in \`quantity\` (for prices with \`usage_type=licensed\`), or per unit of total usage (for prices with \`usage_type=metered\`). \`tiered\` indicates that the unit pricing will be computed using a tiering strategy as defined using the \`tiers\` and \`tiers_mode\` attributes. invoiceitemPrice'NonNullableBillingScheme :: (GHC.Maybe.Maybe InvoiceitemPrice'NonNullableBillingScheme'), -- | created: Time at which the object was created. Measured in seconds since the Unix epoch. invoiceitemPrice'NonNullableCreated :: (GHC.Maybe.Maybe GHC.Types.Int), -- | currency: Three-letter [ISO currency code](https:\/\/www.iso.org\/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https:\/\/stripe.com\/docs\/currencies). invoiceitemPrice'NonNullableCurrency :: (GHC.Maybe.Maybe Data.Text.Internal.Text), -- | custom_unit_amount: When set, provides configuration for the amount to be adjusted by the customer during Checkout Sessions and Payment Links. invoiceitemPrice'NonNullableCustomUnitAmount :: (GHC.Maybe.Maybe (StripeAPI.Common.Nullable InvoiceitemPrice'NonNullableCustomUnitAmount'NonNullable)), -- | id: Unique identifier for the object. -- -- Constraints: -- -- * Maximum length of 5000 invoiceitemPrice'NonNullableId :: (GHC.Maybe.Maybe Data.Text.Internal.Text), -- | livemode: Has the value \`true\` if the object exists in live mode or the value \`false\` if the object exists in test mode. invoiceitemPrice'NonNullableLivemode :: (GHC.Maybe.Maybe GHC.Types.Bool), -- | lookup_key: A lookup key used to retrieve prices dynamically from a static string. This may be up to 200 characters. -- -- Constraints: -- -- * Maximum length of 5000 invoiceitemPrice'NonNullableLookupKey :: (GHC.Maybe.Maybe (StripeAPI.Common.Nullable 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. invoiceitemPrice'NonNullableMetadata :: (GHC.Maybe.Maybe Data.Aeson.Types.Internal.Object), -- | nickname: A brief description of the price, hidden from customers. -- -- Constraints: -- -- * Maximum length of 5000 invoiceitemPrice'NonNullableNickname :: (GHC.Maybe.Maybe (StripeAPI.Common.Nullable Data.Text.Internal.Text)), -- | object: String representing the object\'s type. Objects of the same type share the same value. invoiceitemPrice'NonNullableObject :: (GHC.Maybe.Maybe InvoiceitemPrice'NonNullableObject'), -- | product: The ID of the product this price is associated with. invoiceitemPrice'NonNullableProduct :: (GHC.Maybe.Maybe InvoiceitemPrice'NonNullableProduct'Variants), -- | recurring: The recurring components of a price such as \`interval\` and \`usage_type\`. invoiceitemPrice'NonNullableRecurring :: (GHC.Maybe.Maybe (StripeAPI.Common.Nullable InvoiceitemPrice'NonNullableRecurring'NonNullable)), -- | tax_behavior: Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of \`inclusive\`, \`exclusive\`, or \`unspecified\`. Once specified as either \`inclusive\` or \`exclusive\`, it cannot be changed. invoiceitemPrice'NonNullableTaxBehavior :: (GHC.Maybe.Maybe (StripeAPI.Common.Nullable InvoiceitemPrice'NonNullableTaxBehavior'NonNullable)), -- | tiers: Each element represents a pricing tier. This parameter requires \`billing_scheme\` to be set to \`tiered\`. See also the documentation for \`billing_scheme\`. invoiceitemPrice'NonNullableTiers :: (GHC.Maybe.Maybe ([PriceTier])), -- | tiers_mode: Defines if the tiering price should be \`graduated\` or \`volume\` based. In \`volume\`-based tiering, the maximum quantity within a period determines the per unit price. In \`graduated\` tiering, pricing can change as the quantity grows. invoiceitemPrice'NonNullableTiersMode :: (GHC.Maybe.Maybe (StripeAPI.Common.Nullable InvoiceitemPrice'NonNullableTiersMode'NonNullable)), -- | transform_quantity: Apply a transformation to the reported usage or set quantity before computing the amount billed. Cannot be combined with \`tiers\`. invoiceitemPrice'NonNullableTransformQuantity :: (GHC.Maybe.Maybe (StripeAPI.Common.Nullable InvoiceitemPrice'NonNullableTransformQuantity'NonNullable)), -- | type: One of \`one_time\` or \`recurring\` depending on whether the price is for a one-time purchase or a recurring (subscription) purchase. invoiceitemPrice'NonNullableType :: (GHC.Maybe.Maybe InvoiceitemPrice'NonNullableType'), -- | unit_amount: The unit amount in %s to be charged, represented as a whole integer if possible. Only set if \`billing_scheme=per_unit\`. invoiceitemPrice'NonNullableUnitAmount :: (GHC.Maybe.Maybe (StripeAPI.Common.Nullable GHC.Types.Int)), -- | unit_amount_decimal: The unit amount in %s to be charged, represented as a decimal string with at most 12 decimal places. Only set if \`billing_scheme=per_unit\`. invoiceitemPrice'NonNullableUnitAmountDecimal :: (GHC.Maybe.Maybe (StripeAPI.Common.Nullable Data.Text.Internal.Text)) } deriving ( GHC.Show.Show, GHC.Classes.Eq ) instance Data.Aeson.Types.ToJSON.ToJSON InvoiceitemPrice'NonNullable where toJSON obj = Data.Aeson.Types.Internal.object (Data.Foldable.concat (Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("active" Data.Aeson.Types.ToJSON..=)) (invoiceitemPrice'NonNullableActive obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("billing_scheme" Data.Aeson.Types.ToJSON..=)) (invoiceitemPrice'NonNullableBillingScheme obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("created" Data.Aeson.Types.ToJSON..=)) (invoiceitemPrice'NonNullableCreated obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("currency" Data.Aeson.Types.ToJSON..=)) (invoiceitemPrice'NonNullableCurrency obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("custom_unit_amount" Data.Aeson.Types.ToJSON..=)) (invoiceitemPrice'NonNullableCustomUnitAmount obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("id" Data.Aeson.Types.ToJSON..=)) (invoiceitemPrice'NonNullableId obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("livemode" Data.Aeson.Types.ToJSON..=)) (invoiceitemPrice'NonNullableLivemode obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("lookup_key" Data.Aeson.Types.ToJSON..=)) (invoiceitemPrice'NonNullableLookupKey obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("metadata" Data.Aeson.Types.ToJSON..=)) (invoiceitemPrice'NonNullableMetadata obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("nickname" Data.Aeson.Types.ToJSON..=)) (invoiceitemPrice'NonNullableNickname obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("object" Data.Aeson.Types.ToJSON..=)) (invoiceitemPrice'NonNullableObject obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("product" Data.Aeson.Types.ToJSON..=)) (invoiceitemPrice'NonNullableProduct obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("recurring" Data.Aeson.Types.ToJSON..=)) (invoiceitemPrice'NonNullableRecurring obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("tax_behavior" Data.Aeson.Types.ToJSON..=)) (invoiceitemPrice'NonNullableTaxBehavior obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("tiers" Data.Aeson.Types.ToJSON..=)) (invoiceitemPrice'NonNullableTiers obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("tiers_mode" Data.Aeson.Types.ToJSON..=)) (invoiceitemPrice'NonNullableTiersMode obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("transform_quantity" Data.Aeson.Types.ToJSON..=)) (invoiceitemPrice'NonNullableTransformQuantity obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("type" Data.Aeson.Types.ToJSON..=)) (invoiceitemPrice'NonNullableType obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("unit_amount" Data.Aeson.Types.ToJSON..=)) (invoiceitemPrice'NonNullableUnitAmount obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("unit_amount_decimal" Data.Aeson.Types.ToJSON..=)) (invoiceitemPrice'NonNullableUnitAmountDecimal obj) : GHC.Base.mempty)) toEncoding obj = Data.Aeson.Encoding.Internal.pairs (GHC.Base.mconcat (Data.Foldable.concat (Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("active" Data.Aeson.Types.ToJSON..=)) (invoiceitemPrice'NonNullableActive obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("billing_scheme" Data.Aeson.Types.ToJSON..=)) (invoiceitemPrice'NonNullableBillingScheme obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("created" Data.Aeson.Types.ToJSON..=)) (invoiceitemPrice'NonNullableCreated obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("currency" Data.Aeson.Types.ToJSON..=)) (invoiceitemPrice'NonNullableCurrency obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("custom_unit_amount" Data.Aeson.Types.ToJSON..=)) (invoiceitemPrice'NonNullableCustomUnitAmount obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("id" Data.Aeson.Types.ToJSON..=)) (invoiceitemPrice'NonNullableId obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("livemode" Data.Aeson.Types.ToJSON..=)) (invoiceitemPrice'NonNullableLivemode obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("lookup_key" Data.Aeson.Types.ToJSON..=)) (invoiceitemPrice'NonNullableLookupKey obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("metadata" Data.Aeson.Types.ToJSON..=)) (invoiceitemPrice'NonNullableMetadata obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("nickname" Data.Aeson.Types.ToJSON..=)) (invoiceitemPrice'NonNullableNickname obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("object" Data.Aeson.Types.ToJSON..=)) (invoiceitemPrice'NonNullableObject obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("product" Data.Aeson.Types.ToJSON..=)) (invoiceitemPrice'NonNullableProduct obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("recurring" Data.Aeson.Types.ToJSON..=)) (invoiceitemPrice'NonNullableRecurring obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("tax_behavior" Data.Aeson.Types.ToJSON..=)) (invoiceitemPrice'NonNullableTaxBehavior obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("tiers" Data.Aeson.Types.ToJSON..=)) (invoiceitemPrice'NonNullableTiers obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("tiers_mode" Data.Aeson.Types.ToJSON..=)) (invoiceitemPrice'NonNullableTiersMode obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("transform_quantity" Data.Aeson.Types.ToJSON..=)) (invoiceitemPrice'NonNullableTransformQuantity obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("type" Data.Aeson.Types.ToJSON..=)) (invoiceitemPrice'NonNullableType obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("unit_amount" Data.Aeson.Types.ToJSON..=)) (invoiceitemPrice'NonNullableUnitAmount obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("unit_amount_decimal" Data.Aeson.Types.ToJSON..=)) (invoiceitemPrice'NonNullableUnitAmountDecimal obj) : GHC.Base.mempty))) instance Data.Aeson.Types.FromJSON.FromJSON InvoiceitemPrice'NonNullable where parseJSON = Data.Aeson.Types.FromJSON.withObject "InvoiceitemPrice'NonNullable" (\obj -> (((((((((((((((((((GHC.Base.pure InvoiceitemPrice'NonNullable GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "active")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "billing_scheme")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "created")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "currency")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "custom_unit_amount")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "id")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "livemode")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "lookup_key")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "metadata")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "nickname")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "object")) 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..:! "tiers")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "tiers_mode")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "transform_quantity")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "type")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "unit_amount")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "unit_amount_decimal")) -- | Create a new 'InvoiceitemPrice'NonNullable' with all required fields. mkInvoiceitemPrice'NonNullable :: InvoiceitemPrice'NonNullable mkInvoiceitemPrice'NonNullable = InvoiceitemPrice'NonNullable { invoiceitemPrice'NonNullableActive = GHC.Maybe.Nothing, invoiceitemPrice'NonNullableBillingScheme = GHC.Maybe.Nothing, invoiceitemPrice'NonNullableCreated = GHC.Maybe.Nothing, invoiceitemPrice'NonNullableCurrency = GHC.Maybe.Nothing, invoiceitemPrice'NonNullableCustomUnitAmount = GHC.Maybe.Nothing, invoiceitemPrice'NonNullableId = GHC.Maybe.Nothing, invoiceitemPrice'NonNullableLivemode = GHC.Maybe.Nothing, invoiceitemPrice'NonNullableLookupKey = GHC.Maybe.Nothing, invoiceitemPrice'NonNullableMetadata = GHC.Maybe.Nothing, invoiceitemPrice'NonNullableNickname = GHC.Maybe.Nothing, invoiceitemPrice'NonNullableObject = GHC.Maybe.Nothing, invoiceitemPrice'NonNullableProduct = GHC.Maybe.Nothing, invoiceitemPrice'NonNullableRecurring = GHC.Maybe.Nothing, invoiceitemPrice'NonNullableTaxBehavior = GHC.Maybe.Nothing, invoiceitemPrice'NonNullableTiers = GHC.Maybe.Nothing, invoiceitemPrice'NonNullableTiersMode = GHC.Maybe.Nothing, invoiceitemPrice'NonNullableTransformQuantity = GHC.Maybe.Nothing, invoiceitemPrice'NonNullableType = GHC.Maybe.Nothing, invoiceitemPrice'NonNullableUnitAmount = GHC.Maybe.Nothing, invoiceitemPrice'NonNullableUnitAmountDecimal = GHC.Maybe.Nothing } -- | Defines the enum schema located at @components.schemas.invoiceitem.properties.price.anyOf.properties.billing_scheme@ in the specification. -- -- Describes how to compute the price per period. Either \`per_unit\` or \`tiered\`. \`per_unit\` indicates that the fixed amount (specified in \`unit_amount\` or \`unit_amount_decimal\`) will be charged per unit in \`quantity\` (for prices with \`usage_type=licensed\`), or per unit of total usage (for prices with \`usage_type=metered\`). \`tiered\` indicates that the unit pricing will be computed using a tiering strategy as defined using the \`tiers\` and \`tiers_mode\` attributes. data InvoiceitemPrice'NonNullableBillingScheme' = -- | This case is used if the value encountered during decoding does not match any of the provided cases in the specification. InvoiceitemPrice'NonNullableBillingScheme'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. InvoiceitemPrice'NonNullableBillingScheme'Typed Data.Text.Internal.Text | -- | Represents the JSON value @"per_unit"@ InvoiceitemPrice'NonNullableBillingScheme'EnumPerUnit | -- | Represents the JSON value @"tiered"@ InvoiceitemPrice'NonNullableBillingScheme'EnumTiered deriving (GHC.Show.Show, GHC.Classes.Eq) instance Data.Aeson.Types.ToJSON.ToJSON InvoiceitemPrice'NonNullableBillingScheme' where toJSON (InvoiceitemPrice'NonNullableBillingScheme'Other val) = val toJSON (InvoiceitemPrice'NonNullableBillingScheme'Typed val) = Data.Aeson.Types.ToJSON.toJSON val toJSON (InvoiceitemPrice'NonNullableBillingScheme'EnumPerUnit) = "per_unit" toJSON (InvoiceitemPrice'NonNullableBillingScheme'EnumTiered) = "tiered" instance Data.Aeson.Types.FromJSON.FromJSON InvoiceitemPrice'NonNullableBillingScheme' where parseJSON val = GHC.Base.pure ( if | val GHC.Classes.== "per_unit" -> InvoiceitemPrice'NonNullableBillingScheme'EnumPerUnit | val GHC.Classes.== "tiered" -> InvoiceitemPrice'NonNullableBillingScheme'EnumTiered | GHC.Base.otherwise -> InvoiceitemPrice'NonNullableBillingScheme'Other val ) -- | Defines the object schema located at @components.schemas.invoiceitem.properties.price.anyOf.properties.custom_unit_amount.anyOf@ in the specification. -- -- When set, provides configuration for the amount to be adjusted by the customer during Checkout Sessions and Payment Links. data InvoiceitemPrice'NonNullableCustomUnitAmount'NonNullable = InvoiceitemPrice'NonNullableCustomUnitAmount'NonNullable { -- | maximum: The maximum unit amount the customer can specify for this item. invoiceitemPrice'NonNullableCustomUnitAmount'NonNullableMaximum :: (GHC.Maybe.Maybe (StripeAPI.Common.Nullable GHC.Types.Int)), -- | minimum: The minimum unit amount the customer can specify for this item. Must be at least the minimum charge amount. invoiceitemPrice'NonNullableCustomUnitAmount'NonNullableMinimum :: (GHC.Maybe.Maybe (StripeAPI.Common.Nullable GHC.Types.Int)), -- | preset: The starting unit amount which can be updated by the customer. invoiceitemPrice'NonNullableCustomUnitAmount'NonNullablePreset :: (GHC.Maybe.Maybe (StripeAPI.Common.Nullable GHC.Types.Int)) } deriving ( GHC.Show.Show, GHC.Classes.Eq ) instance Data.Aeson.Types.ToJSON.ToJSON InvoiceitemPrice'NonNullableCustomUnitAmount'NonNullable where toJSON obj = Data.Aeson.Types.Internal.object (Data.Foldable.concat (Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("maximum" Data.Aeson.Types.ToJSON..=)) (invoiceitemPrice'NonNullableCustomUnitAmount'NonNullableMaximum obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("minimum" Data.Aeson.Types.ToJSON..=)) (invoiceitemPrice'NonNullableCustomUnitAmount'NonNullableMinimum obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("preset" Data.Aeson.Types.ToJSON..=)) (invoiceitemPrice'NonNullableCustomUnitAmount'NonNullablePreset obj) : GHC.Base.mempty)) toEncoding obj = Data.Aeson.Encoding.Internal.pairs (GHC.Base.mconcat (Data.Foldable.concat (Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("maximum" Data.Aeson.Types.ToJSON..=)) (invoiceitemPrice'NonNullableCustomUnitAmount'NonNullableMaximum obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("minimum" Data.Aeson.Types.ToJSON..=)) (invoiceitemPrice'NonNullableCustomUnitAmount'NonNullableMinimum obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("preset" Data.Aeson.Types.ToJSON..=)) (invoiceitemPrice'NonNullableCustomUnitAmount'NonNullablePreset obj) : GHC.Base.mempty))) instance Data.Aeson.Types.FromJSON.FromJSON InvoiceitemPrice'NonNullableCustomUnitAmount'NonNullable where parseJSON = Data.Aeson.Types.FromJSON.withObject "InvoiceitemPrice'NonNullableCustomUnitAmount'NonNullable" (\obj -> ((GHC.Base.pure InvoiceitemPrice'NonNullableCustomUnitAmount'NonNullable GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "maximum")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "minimum")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "preset")) -- | Create a new 'InvoiceitemPrice'NonNullableCustomUnitAmount'NonNullable' with all required fields. mkInvoiceitemPrice'NonNullableCustomUnitAmount'NonNullable :: InvoiceitemPrice'NonNullableCustomUnitAmount'NonNullable mkInvoiceitemPrice'NonNullableCustomUnitAmount'NonNullable = InvoiceitemPrice'NonNullableCustomUnitAmount'NonNullable { invoiceitemPrice'NonNullableCustomUnitAmount'NonNullableMaximum = GHC.Maybe.Nothing, invoiceitemPrice'NonNullableCustomUnitAmount'NonNullableMinimum = GHC.Maybe.Nothing, invoiceitemPrice'NonNullableCustomUnitAmount'NonNullablePreset = GHC.Maybe.Nothing } -- | Defines the enum schema located at @components.schemas.invoiceitem.properties.price.anyOf.properties.object@ in the specification. -- -- String representing the object\'s type. Objects of the same type share the same value. data InvoiceitemPrice'NonNullableObject' = -- | This case is used if the value encountered during decoding does not match any of the provided cases in the specification. InvoiceitemPrice'NonNullableObject'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. InvoiceitemPrice'NonNullableObject'Typed Data.Text.Internal.Text | -- | Represents the JSON value @"price"@ InvoiceitemPrice'NonNullableObject'EnumPrice deriving (GHC.Show.Show, GHC.Classes.Eq) instance Data.Aeson.Types.ToJSON.ToJSON InvoiceitemPrice'NonNullableObject' where toJSON (InvoiceitemPrice'NonNullableObject'Other val) = val toJSON (InvoiceitemPrice'NonNullableObject'Typed val) = Data.Aeson.Types.ToJSON.toJSON val toJSON (InvoiceitemPrice'NonNullableObject'EnumPrice) = "price" instance Data.Aeson.Types.FromJSON.FromJSON InvoiceitemPrice'NonNullableObject' where parseJSON val = GHC.Base.pure ( if | val GHC.Classes.== "price" -> InvoiceitemPrice'NonNullableObject'EnumPrice | GHC.Base.otherwise -> InvoiceitemPrice'NonNullableObject'Other val ) -- | Defines the oneOf schema located at @components.schemas.invoiceitem.properties.price.anyOf.properties.product.anyOf@ in the specification. -- -- The ID of the product this price is associated with. data InvoiceitemPrice'NonNullableProduct'Variants = InvoiceitemPrice'NonNullableProduct'Text Data.Text.Internal.Text | InvoiceitemPrice'NonNullableProduct'Product Product | InvoiceitemPrice'NonNullableProduct'DeletedProduct DeletedProduct deriving (GHC.Show.Show, GHC.Classes.Eq) instance Data.Aeson.Types.ToJSON.ToJSON InvoiceitemPrice'NonNullableProduct'Variants where toJSON (InvoiceitemPrice'NonNullableProduct'Text a) = Data.Aeson.Types.ToJSON.toJSON a toJSON (InvoiceitemPrice'NonNullableProduct'Product a) = Data.Aeson.Types.ToJSON.toJSON a toJSON (InvoiceitemPrice'NonNullableProduct'DeletedProduct a) = Data.Aeson.Types.ToJSON.toJSON a instance Data.Aeson.Types.FromJSON.FromJSON InvoiceitemPrice'NonNullableProduct'Variants where parseJSON val = case (InvoiceitemPrice'NonNullableProduct'Text Data.Functor.<$> Data.Aeson.Types.FromJSON.fromJSON val) GHC.Base.<|> ((InvoiceitemPrice'NonNullableProduct'Product Data.Functor.<$> Data.Aeson.Types.FromJSON.fromJSON val) GHC.Base.<|> ((InvoiceitemPrice'NonNullableProduct'DeletedProduct 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.invoiceitem.properties.price.anyOf.properties.recurring.anyOf@ in the specification. -- -- The recurring components of a price such as \\\`interval\\\` and \\\`usage_type\\\`. data InvoiceitemPrice'NonNullableRecurring'NonNullable = InvoiceitemPrice'NonNullableRecurring'NonNullable { -- | aggregate_usage: Specifies a usage aggregation strategy for prices of \`usage_type=metered\`. Allowed values are \`sum\` for summing up all usage during a period, \`last_during_period\` for using the last usage record reported within a period, \`last_ever\` for using the last usage record ever (across period bounds) or \`max\` which uses the usage record with the maximum reported usage during a period. Defaults to \`sum\`. invoiceitemPrice'NonNullableRecurring'NonNullableAggregateUsage :: (GHC.Maybe.Maybe (StripeAPI.Common.Nullable InvoiceitemPrice'NonNullableRecurring'NonNullableAggregateUsage'NonNullable)), -- | interval: The frequency at which a subscription is billed. One of \`day\`, \`week\`, \`month\` or \`year\`. invoiceitemPrice'NonNullableRecurring'NonNullableInterval :: (GHC.Maybe.Maybe InvoiceitemPrice'NonNullableRecurring'NonNullableInterval'), -- | interval_count: The number of intervals (specified in the \`interval\` attribute) between subscription billings. For example, \`interval=month\` and \`interval_count=3\` bills every 3 months. invoiceitemPrice'NonNullableRecurring'NonNullableIntervalCount :: (GHC.Maybe.Maybe GHC.Types.Int), -- | usage_type: Configures how the quantity per period should be determined. Can be either \`metered\` or \`licensed\`. \`licensed\` automatically bills the \`quantity\` set when adding it to a subscription. \`metered\` aggregates the total usage based on usage records. Defaults to \`licensed\`. invoiceitemPrice'NonNullableRecurring'NonNullableUsageType :: (GHC.Maybe.Maybe InvoiceitemPrice'NonNullableRecurring'NonNullableUsageType') } deriving ( GHC.Show.Show, GHC.Classes.Eq ) instance Data.Aeson.Types.ToJSON.ToJSON InvoiceitemPrice'NonNullableRecurring'NonNullable where toJSON obj = Data.Aeson.Types.Internal.object (Data.Foldable.concat (Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("aggregate_usage" Data.Aeson.Types.ToJSON..=)) (invoiceitemPrice'NonNullableRecurring'NonNullableAggregateUsage obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("interval" Data.Aeson.Types.ToJSON..=)) (invoiceitemPrice'NonNullableRecurring'NonNullableInterval obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("interval_count" Data.Aeson.Types.ToJSON..=)) (invoiceitemPrice'NonNullableRecurring'NonNullableIntervalCount obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("usage_type" Data.Aeson.Types.ToJSON..=)) (invoiceitemPrice'NonNullableRecurring'NonNullableUsageType obj) : GHC.Base.mempty)) toEncoding obj = Data.Aeson.Encoding.Internal.pairs (GHC.Base.mconcat (Data.Foldable.concat (Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("aggregate_usage" Data.Aeson.Types.ToJSON..=)) (invoiceitemPrice'NonNullableRecurring'NonNullableAggregateUsage obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("interval" Data.Aeson.Types.ToJSON..=)) (invoiceitemPrice'NonNullableRecurring'NonNullableInterval obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("interval_count" Data.Aeson.Types.ToJSON..=)) (invoiceitemPrice'NonNullableRecurring'NonNullableIntervalCount obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("usage_type" Data.Aeson.Types.ToJSON..=)) (invoiceitemPrice'NonNullableRecurring'NonNullableUsageType obj) : GHC.Base.mempty))) instance Data.Aeson.Types.FromJSON.FromJSON InvoiceitemPrice'NonNullableRecurring'NonNullable where parseJSON = Data.Aeson.Types.FromJSON.withObject "InvoiceitemPrice'NonNullableRecurring'NonNullable" (\obj -> (((GHC.Base.pure InvoiceitemPrice'NonNullableRecurring'NonNullable GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "aggregate_usage")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "interval")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "interval_count")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "usage_type")) -- | Create a new 'InvoiceitemPrice'NonNullableRecurring'NonNullable' with all required fields. mkInvoiceitemPrice'NonNullableRecurring'NonNullable :: InvoiceitemPrice'NonNullableRecurring'NonNullable mkInvoiceitemPrice'NonNullableRecurring'NonNullable = InvoiceitemPrice'NonNullableRecurring'NonNullable { invoiceitemPrice'NonNullableRecurring'NonNullableAggregateUsage = GHC.Maybe.Nothing, invoiceitemPrice'NonNullableRecurring'NonNullableInterval = GHC.Maybe.Nothing, invoiceitemPrice'NonNullableRecurring'NonNullableIntervalCount = GHC.Maybe.Nothing, invoiceitemPrice'NonNullableRecurring'NonNullableUsageType = GHC.Maybe.Nothing } -- | Defines the enum schema located at @components.schemas.invoiceitem.properties.price.anyOf.properties.recurring.anyOf.properties.aggregate_usage@ in the specification. -- -- Specifies a usage aggregation strategy for prices of \`usage_type=metered\`. Allowed values are \`sum\` for summing up all usage during a period, \`last_during_period\` for using the last usage record reported within a period, \`last_ever\` for using the last usage record ever (across period bounds) or \`max\` which uses the usage record with the maximum reported usage during a period. Defaults to \`sum\`. data InvoiceitemPrice'NonNullableRecurring'NonNullableAggregateUsage'NonNullable = -- | This case is used if the value encountered during decoding does not match any of the provided cases in the specification. InvoiceitemPrice'NonNullableRecurring'NonNullableAggregateUsage'NonNullableOther Data.Aeson.Types.Internal.Value | -- | This constructor can be used to send values to the server which are not present in the specification yet. InvoiceitemPrice'NonNullableRecurring'NonNullableAggregateUsage'NonNullableTyped Data.Text.Internal.Text | -- | Represents the JSON value @"last_during_period"@ InvoiceitemPrice'NonNullableRecurring'NonNullableAggregateUsage'NonNullableEnumLastDuringPeriod | -- | Represents the JSON value @"last_ever"@ InvoiceitemPrice'NonNullableRecurring'NonNullableAggregateUsage'NonNullableEnumLastEver | -- | Represents the JSON value @"max"@ InvoiceitemPrice'NonNullableRecurring'NonNullableAggregateUsage'NonNullableEnumMax | -- | Represents the JSON value @"sum"@ InvoiceitemPrice'NonNullableRecurring'NonNullableAggregateUsage'NonNullableEnumSum deriving (GHC.Show.Show, GHC.Classes.Eq) instance Data.Aeson.Types.ToJSON.ToJSON InvoiceitemPrice'NonNullableRecurring'NonNullableAggregateUsage'NonNullable where toJSON (InvoiceitemPrice'NonNullableRecurring'NonNullableAggregateUsage'NonNullableOther val) = val toJSON (InvoiceitemPrice'NonNullableRecurring'NonNullableAggregateUsage'NonNullableTyped val) = Data.Aeson.Types.ToJSON.toJSON val toJSON (InvoiceitemPrice'NonNullableRecurring'NonNullableAggregateUsage'NonNullableEnumLastDuringPeriod) = "last_during_period" toJSON (InvoiceitemPrice'NonNullableRecurring'NonNullableAggregateUsage'NonNullableEnumLastEver) = "last_ever" toJSON (InvoiceitemPrice'NonNullableRecurring'NonNullableAggregateUsage'NonNullableEnumMax) = "max" toJSON (InvoiceitemPrice'NonNullableRecurring'NonNullableAggregateUsage'NonNullableEnumSum) = "sum" instance Data.Aeson.Types.FromJSON.FromJSON InvoiceitemPrice'NonNullableRecurring'NonNullableAggregateUsage'NonNullable where parseJSON val = GHC.Base.pure ( if | val GHC.Classes.== "last_during_period" -> InvoiceitemPrice'NonNullableRecurring'NonNullableAggregateUsage'NonNullableEnumLastDuringPeriod | val GHC.Classes.== "last_ever" -> InvoiceitemPrice'NonNullableRecurring'NonNullableAggregateUsage'NonNullableEnumLastEver | val GHC.Classes.== "max" -> InvoiceitemPrice'NonNullableRecurring'NonNullableAggregateUsage'NonNullableEnumMax | val GHC.Classes.== "sum" -> InvoiceitemPrice'NonNullableRecurring'NonNullableAggregateUsage'NonNullableEnumSum | GHC.Base.otherwise -> InvoiceitemPrice'NonNullableRecurring'NonNullableAggregateUsage'NonNullableOther val ) -- | Defines the enum schema located at @components.schemas.invoiceitem.properties.price.anyOf.properties.recurring.anyOf.properties.interval@ in the specification. -- -- The frequency at which a subscription is billed. One of \`day\`, \`week\`, \`month\` or \`year\`. data InvoiceitemPrice'NonNullableRecurring'NonNullableInterval' = -- | This case is used if the value encountered during decoding does not match any of the provided cases in the specification. InvoiceitemPrice'NonNullableRecurring'NonNullableInterval'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. InvoiceitemPrice'NonNullableRecurring'NonNullableInterval'Typed Data.Text.Internal.Text | -- | Represents the JSON value @"day"@ InvoiceitemPrice'NonNullableRecurring'NonNullableInterval'EnumDay | -- | Represents the JSON value @"month"@ InvoiceitemPrice'NonNullableRecurring'NonNullableInterval'EnumMonth | -- | Represents the JSON value @"week"@ InvoiceitemPrice'NonNullableRecurring'NonNullableInterval'EnumWeek | -- | Represents the JSON value @"year"@ InvoiceitemPrice'NonNullableRecurring'NonNullableInterval'EnumYear deriving (GHC.Show.Show, GHC.Classes.Eq) instance Data.Aeson.Types.ToJSON.ToJSON InvoiceitemPrice'NonNullableRecurring'NonNullableInterval' where toJSON (InvoiceitemPrice'NonNullableRecurring'NonNullableInterval'Other val) = val toJSON (InvoiceitemPrice'NonNullableRecurring'NonNullableInterval'Typed val) = Data.Aeson.Types.ToJSON.toJSON val toJSON (InvoiceitemPrice'NonNullableRecurring'NonNullableInterval'EnumDay) = "day" toJSON (InvoiceitemPrice'NonNullableRecurring'NonNullableInterval'EnumMonth) = "month" toJSON (InvoiceitemPrice'NonNullableRecurring'NonNullableInterval'EnumWeek) = "week" toJSON (InvoiceitemPrice'NonNullableRecurring'NonNullableInterval'EnumYear) = "year" instance Data.Aeson.Types.FromJSON.FromJSON InvoiceitemPrice'NonNullableRecurring'NonNullableInterval' where parseJSON val = GHC.Base.pure ( if | val GHC.Classes.== "day" -> InvoiceitemPrice'NonNullableRecurring'NonNullableInterval'EnumDay | val GHC.Classes.== "month" -> InvoiceitemPrice'NonNullableRecurring'NonNullableInterval'EnumMonth | val GHC.Classes.== "week" -> InvoiceitemPrice'NonNullableRecurring'NonNullableInterval'EnumWeek | val GHC.Classes.== "year" -> InvoiceitemPrice'NonNullableRecurring'NonNullableInterval'EnumYear | GHC.Base.otherwise -> InvoiceitemPrice'NonNullableRecurring'NonNullableInterval'Other val ) -- | Defines the enum schema located at @components.schemas.invoiceitem.properties.price.anyOf.properties.recurring.anyOf.properties.usage_type@ in the specification. -- -- Configures how the quantity per period should be determined. Can be either \`metered\` or \`licensed\`. \`licensed\` automatically bills the \`quantity\` set when adding it to a subscription. \`metered\` aggregates the total usage based on usage records. Defaults to \`licensed\`. data InvoiceitemPrice'NonNullableRecurring'NonNullableUsageType' = -- | This case is used if the value encountered during decoding does not match any of the provided cases in the specification. InvoiceitemPrice'NonNullableRecurring'NonNullableUsageType'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. InvoiceitemPrice'NonNullableRecurring'NonNullableUsageType'Typed Data.Text.Internal.Text | -- | Represents the JSON value @"licensed"@ InvoiceitemPrice'NonNullableRecurring'NonNullableUsageType'EnumLicensed | -- | Represents the JSON value @"metered"@ InvoiceitemPrice'NonNullableRecurring'NonNullableUsageType'EnumMetered deriving (GHC.Show.Show, GHC.Classes.Eq) instance Data.Aeson.Types.ToJSON.ToJSON InvoiceitemPrice'NonNullableRecurring'NonNullableUsageType' where toJSON (InvoiceitemPrice'NonNullableRecurring'NonNullableUsageType'Other val) = val toJSON (InvoiceitemPrice'NonNullableRecurring'NonNullableUsageType'Typed val) = Data.Aeson.Types.ToJSON.toJSON val toJSON (InvoiceitemPrice'NonNullableRecurring'NonNullableUsageType'EnumLicensed) = "licensed" toJSON (InvoiceitemPrice'NonNullableRecurring'NonNullableUsageType'EnumMetered) = "metered" instance Data.Aeson.Types.FromJSON.FromJSON InvoiceitemPrice'NonNullableRecurring'NonNullableUsageType' where parseJSON val = GHC.Base.pure ( if | val GHC.Classes.== "licensed" -> InvoiceitemPrice'NonNullableRecurring'NonNullableUsageType'EnumLicensed | val GHC.Classes.== "metered" -> InvoiceitemPrice'NonNullableRecurring'NonNullableUsageType'EnumMetered | GHC.Base.otherwise -> InvoiceitemPrice'NonNullableRecurring'NonNullableUsageType'Other val ) -- | Defines the enum schema located at @components.schemas.invoiceitem.properties.price.anyOf.properties.tax_behavior@ in the specification. -- -- Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of \`inclusive\`, \`exclusive\`, or \`unspecified\`. Once specified as either \`inclusive\` or \`exclusive\`, it cannot be changed. data InvoiceitemPrice'NonNullableTaxBehavior'NonNullable = -- | This case is used if the value encountered during decoding does not match any of the provided cases in the specification. InvoiceitemPrice'NonNullableTaxBehavior'NonNullableOther Data.Aeson.Types.Internal.Value | -- | This constructor can be used to send values to the server which are not present in the specification yet. InvoiceitemPrice'NonNullableTaxBehavior'NonNullableTyped Data.Text.Internal.Text | -- | Represents the JSON value @"exclusive"@ InvoiceitemPrice'NonNullableTaxBehavior'NonNullableEnumExclusive | -- | Represents the JSON value @"inclusive"@ InvoiceitemPrice'NonNullableTaxBehavior'NonNullableEnumInclusive | -- | Represents the JSON value @"unspecified"@ InvoiceitemPrice'NonNullableTaxBehavior'NonNullableEnumUnspecified deriving (GHC.Show.Show, GHC.Classes.Eq) instance Data.Aeson.Types.ToJSON.ToJSON InvoiceitemPrice'NonNullableTaxBehavior'NonNullable where toJSON (InvoiceitemPrice'NonNullableTaxBehavior'NonNullableOther val) = val toJSON (InvoiceitemPrice'NonNullableTaxBehavior'NonNullableTyped val) = Data.Aeson.Types.ToJSON.toJSON val toJSON (InvoiceitemPrice'NonNullableTaxBehavior'NonNullableEnumExclusive) = "exclusive" toJSON (InvoiceitemPrice'NonNullableTaxBehavior'NonNullableEnumInclusive) = "inclusive" toJSON (InvoiceitemPrice'NonNullableTaxBehavior'NonNullableEnumUnspecified) = "unspecified" instance Data.Aeson.Types.FromJSON.FromJSON InvoiceitemPrice'NonNullableTaxBehavior'NonNullable where parseJSON val = GHC.Base.pure ( if | val GHC.Classes.== "exclusive" -> InvoiceitemPrice'NonNullableTaxBehavior'NonNullableEnumExclusive | val GHC.Classes.== "inclusive" -> InvoiceitemPrice'NonNullableTaxBehavior'NonNullableEnumInclusive | val GHC.Classes.== "unspecified" -> InvoiceitemPrice'NonNullableTaxBehavior'NonNullableEnumUnspecified | GHC.Base.otherwise -> InvoiceitemPrice'NonNullableTaxBehavior'NonNullableOther val ) -- | Defines the enum schema located at @components.schemas.invoiceitem.properties.price.anyOf.properties.tiers_mode@ in the specification. -- -- Defines if the tiering price should be \`graduated\` or \`volume\` based. In \`volume\`-based tiering, the maximum quantity within a period determines the per unit price. In \`graduated\` tiering, pricing can change as the quantity grows. data InvoiceitemPrice'NonNullableTiersMode'NonNullable = -- | This case is used if the value encountered during decoding does not match any of the provided cases in the specification. InvoiceitemPrice'NonNullableTiersMode'NonNullableOther Data.Aeson.Types.Internal.Value | -- | This constructor can be used to send values to the server which are not present in the specification yet. InvoiceitemPrice'NonNullableTiersMode'NonNullableTyped Data.Text.Internal.Text | -- | Represents the JSON value @"graduated"@ InvoiceitemPrice'NonNullableTiersMode'NonNullableEnumGraduated | -- | Represents the JSON value @"volume"@ InvoiceitemPrice'NonNullableTiersMode'NonNullableEnumVolume deriving (GHC.Show.Show, GHC.Classes.Eq) instance Data.Aeson.Types.ToJSON.ToJSON InvoiceitemPrice'NonNullableTiersMode'NonNullable where toJSON (InvoiceitemPrice'NonNullableTiersMode'NonNullableOther val) = val toJSON (InvoiceitemPrice'NonNullableTiersMode'NonNullableTyped val) = Data.Aeson.Types.ToJSON.toJSON val toJSON (InvoiceitemPrice'NonNullableTiersMode'NonNullableEnumGraduated) = "graduated" toJSON (InvoiceitemPrice'NonNullableTiersMode'NonNullableEnumVolume) = "volume" instance Data.Aeson.Types.FromJSON.FromJSON InvoiceitemPrice'NonNullableTiersMode'NonNullable where parseJSON val = GHC.Base.pure ( if | val GHC.Classes.== "graduated" -> InvoiceitemPrice'NonNullableTiersMode'NonNullableEnumGraduated | val GHC.Classes.== "volume" -> InvoiceitemPrice'NonNullableTiersMode'NonNullableEnumVolume | GHC.Base.otherwise -> InvoiceitemPrice'NonNullableTiersMode'NonNullableOther val ) -- | Defines the object schema located at @components.schemas.invoiceitem.properties.price.anyOf.properties.transform_quantity.anyOf@ in the specification. -- -- Apply a transformation to the reported usage or set quantity before computing the amount billed. Cannot be combined with \\\`tiers\\\`. data InvoiceitemPrice'NonNullableTransformQuantity'NonNullable = InvoiceitemPrice'NonNullableTransformQuantity'NonNullable { -- | divide_by: Divide usage by this number. invoiceitemPrice'NonNullableTransformQuantity'NonNullableDivideBy :: (GHC.Maybe.Maybe GHC.Types.Int), -- | round: After division, either round the result \`up\` or \`down\`. invoiceitemPrice'NonNullableTransformQuantity'NonNullableRound :: (GHC.Maybe.Maybe InvoiceitemPrice'NonNullableTransformQuantity'NonNullableRound') } deriving ( GHC.Show.Show, GHC.Classes.Eq ) instance Data.Aeson.Types.ToJSON.ToJSON InvoiceitemPrice'NonNullableTransformQuantity'NonNullable where toJSON obj = Data.Aeson.Types.Internal.object (Data.Foldable.concat (Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("divide_by" Data.Aeson.Types.ToJSON..=)) (invoiceitemPrice'NonNullableTransformQuantity'NonNullableDivideBy obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("round" Data.Aeson.Types.ToJSON..=)) (invoiceitemPrice'NonNullableTransformQuantity'NonNullableRound obj) : GHC.Base.mempty)) toEncoding obj = Data.Aeson.Encoding.Internal.pairs (GHC.Base.mconcat (Data.Foldable.concat (Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("divide_by" Data.Aeson.Types.ToJSON..=)) (invoiceitemPrice'NonNullableTransformQuantity'NonNullableDivideBy obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("round" Data.Aeson.Types.ToJSON..=)) (invoiceitemPrice'NonNullableTransformQuantity'NonNullableRound obj) : GHC.Base.mempty))) instance Data.Aeson.Types.FromJSON.FromJSON InvoiceitemPrice'NonNullableTransformQuantity'NonNullable where parseJSON = Data.Aeson.Types.FromJSON.withObject "InvoiceitemPrice'NonNullableTransformQuantity'NonNullable" (\obj -> (GHC.Base.pure InvoiceitemPrice'NonNullableTransformQuantity'NonNullable GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "divide_by")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "round")) -- | Create a new 'InvoiceitemPrice'NonNullableTransformQuantity'NonNullable' with all required fields. mkInvoiceitemPrice'NonNullableTransformQuantity'NonNullable :: InvoiceitemPrice'NonNullableTransformQuantity'NonNullable mkInvoiceitemPrice'NonNullableTransformQuantity'NonNullable = InvoiceitemPrice'NonNullableTransformQuantity'NonNullable { invoiceitemPrice'NonNullableTransformQuantity'NonNullableDivideBy = GHC.Maybe.Nothing, invoiceitemPrice'NonNullableTransformQuantity'NonNullableRound = GHC.Maybe.Nothing } -- | Defines the enum schema located at @components.schemas.invoiceitem.properties.price.anyOf.properties.transform_quantity.anyOf.properties.round@ in the specification. -- -- After division, either round the result \`up\` or \`down\`. data InvoiceitemPrice'NonNullableTransformQuantity'NonNullableRound' = -- | This case is used if the value encountered during decoding does not match any of the provided cases in the specification. InvoiceitemPrice'NonNullableTransformQuantity'NonNullableRound'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. InvoiceitemPrice'NonNullableTransformQuantity'NonNullableRound'Typed Data.Text.Internal.Text | -- | Represents the JSON value @"down"@ InvoiceitemPrice'NonNullableTransformQuantity'NonNullableRound'EnumDown | -- | Represents the JSON value @"up"@ InvoiceitemPrice'NonNullableTransformQuantity'NonNullableRound'EnumUp deriving (GHC.Show.Show, GHC.Classes.Eq) instance Data.Aeson.Types.ToJSON.ToJSON InvoiceitemPrice'NonNullableTransformQuantity'NonNullableRound' where toJSON (InvoiceitemPrice'NonNullableTransformQuantity'NonNullableRound'Other val) = val toJSON (InvoiceitemPrice'NonNullableTransformQuantity'NonNullableRound'Typed val) = Data.Aeson.Types.ToJSON.toJSON val toJSON (InvoiceitemPrice'NonNullableTransformQuantity'NonNullableRound'EnumDown) = "down" toJSON (InvoiceitemPrice'NonNullableTransformQuantity'NonNullableRound'EnumUp) = "up" instance Data.Aeson.Types.FromJSON.FromJSON InvoiceitemPrice'NonNullableTransformQuantity'NonNullableRound' where parseJSON val = GHC.Base.pure ( if | val GHC.Classes.== "down" -> InvoiceitemPrice'NonNullableTransformQuantity'NonNullableRound'EnumDown | val GHC.Classes.== "up" -> InvoiceitemPrice'NonNullableTransformQuantity'NonNullableRound'EnumUp | GHC.Base.otherwise -> InvoiceitemPrice'NonNullableTransformQuantity'NonNullableRound'Other val ) -- | Defines the enum schema located at @components.schemas.invoiceitem.properties.price.anyOf.properties.type@ in the specification. -- -- One of \`one_time\` or \`recurring\` depending on whether the price is for a one-time purchase or a recurring (subscription) purchase. data InvoiceitemPrice'NonNullableType' = -- | This case is used if the value encountered during decoding does not match any of the provided cases in the specification. InvoiceitemPrice'NonNullableType'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. InvoiceitemPrice'NonNullableType'Typed Data.Text.Internal.Text | -- | Represents the JSON value @"one_time"@ InvoiceitemPrice'NonNullableType'EnumOneTime | -- | Represents the JSON value @"recurring"@ InvoiceitemPrice'NonNullableType'EnumRecurring deriving (GHC.Show.Show, GHC.Classes.Eq) instance Data.Aeson.Types.ToJSON.ToJSON InvoiceitemPrice'NonNullableType' where toJSON (InvoiceitemPrice'NonNullableType'Other val) = val toJSON (InvoiceitemPrice'NonNullableType'Typed val) = Data.Aeson.Types.ToJSON.toJSON val toJSON (InvoiceitemPrice'NonNullableType'EnumOneTime) = "one_time" toJSON (InvoiceitemPrice'NonNullableType'EnumRecurring) = "recurring" instance Data.Aeson.Types.FromJSON.FromJSON InvoiceitemPrice'NonNullableType' where parseJSON val = GHC.Base.pure ( if | val GHC.Classes.== "one_time" -> InvoiceitemPrice'NonNullableType'EnumOneTime | val GHC.Classes.== "recurring" -> InvoiceitemPrice'NonNullableType'EnumRecurring | GHC.Base.otherwise -> InvoiceitemPrice'NonNullableType'Other val ) -- | Defines the oneOf schema located at @components.schemas.invoiceitem.properties.subscription.anyOf@ in the specification. -- -- The subscription that this invoice item has been created for, if any. data InvoiceitemSubscription'NonNullableVariants = InvoiceitemSubscription'NonNullableText Data.Text.Internal.Text | InvoiceitemSubscription'NonNullableSubscription Subscription deriving (GHC.Show.Show, GHC.Classes.Eq) instance Data.Aeson.Types.ToJSON.ToJSON InvoiceitemSubscription'NonNullableVariants where toJSON (InvoiceitemSubscription'NonNullableText a) = Data.Aeson.Types.ToJSON.toJSON a toJSON (InvoiceitemSubscription'NonNullableSubscription a) = Data.Aeson.Types.ToJSON.toJSON a instance Data.Aeson.Types.FromJSON.FromJSON InvoiceitemSubscription'NonNullableVariants where parseJSON val = case (InvoiceitemSubscription'NonNullableText Data.Functor.<$> Data.Aeson.Types.FromJSON.fromJSON val) GHC.Base.<|> ((InvoiceitemSubscription'NonNullableSubscription Data.Functor.<$> Data.Aeson.Types.FromJSON.fromJSON val) GHC.Base.<|> Data.Aeson.Types.Internal.Error "No variant matched") of Data.Aeson.Types.Internal.Success a -> GHC.Base.pure a Data.Aeson.Types.Internal.Error a -> Control.Monad.Fail.fail a -- | Defines the oneOf schema located at @components.schemas.invoiceitem.properties.test_clock.anyOf@ in the specification. -- -- ID of the test clock this invoice item belongs to. data InvoiceitemTestClock'NonNullableVariants = InvoiceitemTestClock'NonNullableText Data.Text.Internal.Text | InvoiceitemTestClock'NonNullableTestHelpers'testClock TestHelpers'testClock deriving (GHC.Show.Show, GHC.Classes.Eq) instance Data.Aeson.Types.ToJSON.ToJSON InvoiceitemTestClock'NonNullableVariants where toJSON (InvoiceitemTestClock'NonNullableText a) = Data.Aeson.Types.ToJSON.toJSON a toJSON (InvoiceitemTestClock'NonNullableTestHelpers'testClock a) = Data.Aeson.Types.ToJSON.toJSON a instance Data.Aeson.Types.FromJSON.FromJSON InvoiceitemTestClock'NonNullableVariants where parseJSON val = case (InvoiceitemTestClock'NonNullableText Data.Functor.<$> Data.Aeson.Types.FromJSON.fromJSON val) GHC.Base.<|> ((InvoiceitemTestClock'NonNullableTestHelpers'testClock 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