{-# 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.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.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.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 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 ([InvoiceitemDiscounts'Variants])), -- | 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 InvoiceitemInvoice'Variants), -- | 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 Data.Aeson.Types.Internal.Object), -- | period: invoiceitemPeriod :: InvoiceLineItemPeriod, -- | price: The price of the invoice item. invoiceitemPrice :: (GHC.Maybe.Maybe InvoiceitemPrice'), -- | 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 InvoiceitemSubscription'Variants), -- | 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 ([TaxRate])), -- | unit_amount: Unit amount (in the \`currency\` specified) of the invoice item. invoiceitemUnitAmount :: (GHC.Maybe.Maybe 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 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 ("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 : "description" Data.Aeson.Types.ToJSON..= invoiceitemDescription obj : "discountable" Data.Aeson.Types.ToJSON..= invoiceitemDiscountable obj : "discounts" Data.Aeson.Types.ToJSON..= invoiceitemDiscounts obj : "id" Data.Aeson.Types.ToJSON..= invoiceitemId obj : "invoice" Data.Aeson.Types.ToJSON..= invoiceitemInvoice obj : "livemode" Data.Aeson.Types.ToJSON..= invoiceitemLivemode obj : "metadata" Data.Aeson.Types.ToJSON..= invoiceitemMetadata obj : "period" Data.Aeson.Types.ToJSON..= invoiceitemPeriod obj : "price" Data.Aeson.Types.ToJSON..= invoiceitemPrice obj : "proration" Data.Aeson.Types.ToJSON..= invoiceitemProration obj : "quantity" Data.Aeson.Types.ToJSON..= invoiceitemQuantity obj : "subscription" Data.Aeson.Types.ToJSON..= invoiceitemSubscription obj : "subscription_item" Data.Aeson.Types.ToJSON..= invoiceitemSubscriptionItem obj : "tax_rates" Data.Aeson.Types.ToJSON..= invoiceitemTaxRates obj : "unit_amount" Data.Aeson.Types.ToJSON..= invoiceitemUnitAmount obj : "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 (("amount" Data.Aeson.Types.ToJSON..= invoiceitemAmount obj) GHC.Base.<> (("currency" Data.Aeson.Types.ToJSON..= invoiceitemCurrency obj) GHC.Base.<> (("customer" Data.Aeson.Types.ToJSON..= invoiceitemCustomer obj) GHC.Base.<> (("date" Data.Aeson.Types.ToJSON..= invoiceitemDate obj) GHC.Base.<> (("description" Data.Aeson.Types.ToJSON..= invoiceitemDescription obj) GHC.Base.<> (("discountable" Data.Aeson.Types.ToJSON..= invoiceitemDiscountable obj) GHC.Base.<> (("discounts" Data.Aeson.Types.ToJSON..= invoiceitemDiscounts obj) GHC.Base.<> (("id" Data.Aeson.Types.ToJSON..= invoiceitemId obj) GHC.Base.<> (("invoice" Data.Aeson.Types.ToJSON..= invoiceitemInvoice obj) GHC.Base.<> (("livemode" Data.Aeson.Types.ToJSON..= invoiceitemLivemode obj) GHC.Base.<> (("metadata" Data.Aeson.Types.ToJSON..= invoiceitemMetadata obj) GHC.Base.<> (("period" Data.Aeson.Types.ToJSON..= invoiceitemPeriod obj) GHC.Base.<> (("price" Data.Aeson.Types.ToJSON..= invoiceitemPrice obj) GHC.Base.<> (("proration" Data.Aeson.Types.ToJSON..= invoiceitemProration obj) GHC.Base.<> (("quantity" Data.Aeson.Types.ToJSON..= invoiceitemQuantity obj) GHC.Base.<> (("subscription" Data.Aeson.Types.ToJSON..= invoiceitemSubscription obj) GHC.Base.<> (("subscription_item" Data.Aeson.Types.ToJSON..= invoiceitemSubscriptionItem obj) GHC.Base.<> (("tax_rates" Data.Aeson.Types.ToJSON..= invoiceitemTaxRates obj) GHC.Base.<> (("unit_amount" Data.Aeson.Types.ToJSON..= invoiceitemUnitAmount obj) GHC.Base.<> (("unit_amount_decimal" Data.Aeson.Types.ToJSON..= invoiceitemUnitAmountDecimal obj) GHC.Base.<> ("object" Data.Aeson.Types.ToJSON..= Data.Aeson.Types.Internal.String "invoiceitem"))))))))))))))))))))) 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..:? "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, 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'Variants = InvoiceitemDiscounts'Text Data.Text.Internal.Text | InvoiceitemDiscounts'Discount Discount deriving (GHC.Show.Show, GHC.Classes.Eq) instance Data.Aeson.Types.ToJSON.ToJSON InvoiceitemDiscounts'Variants where toJSON (InvoiceitemDiscounts'Text a) = Data.Aeson.Types.ToJSON.toJSON a toJSON (InvoiceitemDiscounts'Discount a) = Data.Aeson.Types.ToJSON.toJSON a instance Data.Aeson.Types.FromJSON.FromJSON InvoiceitemDiscounts'Variants where parseJSON val = case (InvoiceitemDiscounts'Text Data.Functor.<$> Data.Aeson.Types.FromJSON.fromJSON val) GHC.Base.<|> ((InvoiceitemDiscounts'Discount 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'Variants = InvoiceitemInvoice'Text Data.Text.Internal.Text | InvoiceitemInvoice'Invoice Invoice deriving (GHC.Show.Show, GHC.Classes.Eq) instance Data.Aeson.Types.ToJSON.ToJSON InvoiceitemInvoice'Variants where toJSON (InvoiceitemInvoice'Text a) = Data.Aeson.Types.ToJSON.toJSON a toJSON (InvoiceitemInvoice'Invoice a) = Data.Aeson.Types.ToJSON.toJSON a instance Data.Aeson.Types.FromJSON.FromJSON InvoiceitemInvoice'Variants where parseJSON val = case (InvoiceitemInvoice'Text Data.Functor.<$> Data.Aeson.Types.FromJSON.fromJSON val) GHC.Base.<|> ((InvoiceitemInvoice'Invoice 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' = InvoiceitemPrice' { -- | active: Whether the price can be used for new purchases. invoiceitemPrice'Active :: (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'BillingScheme :: (GHC.Maybe.Maybe InvoiceitemPrice'BillingScheme'), -- | created: Time at which the object was created. Measured in seconds since the Unix epoch. invoiceitemPrice'Created :: (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'Currency :: (GHC.Maybe.Maybe Data.Text.Internal.Text), -- | id: Unique identifier for the object. -- -- Constraints: -- -- * Maximum length of 5000 invoiceitemPrice'Id :: (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'Livemode :: (GHC.Maybe.Maybe GHC.Types.Bool), -- | lookup_key: A lookup key used to retrieve prices dynamically from a static string. -- -- Constraints: -- -- * Maximum length of 5000 invoiceitemPrice'LookupKey :: (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. invoiceitemPrice'Metadata :: (GHC.Maybe.Maybe Data.Aeson.Types.Internal.Object), -- | nickname: A brief description of the price, hidden from customers. -- -- Constraints: -- -- * Maximum length of 5000 invoiceitemPrice'Nickname :: (GHC.Maybe.Maybe Data.Text.Internal.Text), -- | object: String representing the object\'s type. Objects of the same type share the same value. invoiceitemPrice'Object :: (GHC.Maybe.Maybe InvoiceitemPrice'Object'), -- | product: The ID of the product this price is associated with. invoiceitemPrice'Product :: (GHC.Maybe.Maybe InvoiceitemPrice'Product'Variants), -- | recurring: The recurring components of a price such as \`interval\` and \`usage_type\`. invoiceitemPrice'Recurring :: (GHC.Maybe.Maybe InvoiceitemPrice'Recurring'), -- | 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'TaxBehavior :: (GHC.Maybe.Maybe InvoiceitemPrice'TaxBehavior'), -- | 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'Tiers :: (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'TiersMode :: (GHC.Maybe.Maybe InvoiceitemPrice'TiersMode'), -- | transform_quantity: Apply a transformation to the reported usage or set quantity before computing the amount billed. Cannot be combined with \`tiers\`. invoiceitemPrice'TransformQuantity :: (GHC.Maybe.Maybe InvoiceitemPrice'TransformQuantity'), -- | type: One of \`one_time\` or \`recurring\` depending on whether the price is for a one-time purchase or a recurring (subscription) purchase. invoiceitemPrice'Type :: (GHC.Maybe.Maybe InvoiceitemPrice'Type'), -- | 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'UnitAmount :: (GHC.Maybe.Maybe 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'UnitAmountDecimal :: (GHC.Maybe.Maybe Data.Text.Internal.Text) } deriving ( GHC.Show.Show, GHC.Classes.Eq ) instance Data.Aeson.Types.ToJSON.ToJSON InvoiceitemPrice' where toJSON obj = Data.Aeson.Types.Internal.object ("active" Data.Aeson.Types.ToJSON..= invoiceitemPrice'Active obj : "billing_scheme" Data.Aeson.Types.ToJSON..= invoiceitemPrice'BillingScheme obj : "created" Data.Aeson.Types.ToJSON..= invoiceitemPrice'Created obj : "currency" Data.Aeson.Types.ToJSON..= invoiceitemPrice'Currency obj : "id" Data.Aeson.Types.ToJSON..= invoiceitemPrice'Id obj : "livemode" Data.Aeson.Types.ToJSON..= invoiceitemPrice'Livemode obj : "lookup_key" Data.Aeson.Types.ToJSON..= invoiceitemPrice'LookupKey obj : "metadata" Data.Aeson.Types.ToJSON..= invoiceitemPrice'Metadata obj : "nickname" Data.Aeson.Types.ToJSON..= invoiceitemPrice'Nickname obj : "object" Data.Aeson.Types.ToJSON..= invoiceitemPrice'Object obj : "product" Data.Aeson.Types.ToJSON..= invoiceitemPrice'Product obj : "recurring" Data.Aeson.Types.ToJSON..= invoiceitemPrice'Recurring obj : "tax_behavior" Data.Aeson.Types.ToJSON..= invoiceitemPrice'TaxBehavior obj : "tiers" Data.Aeson.Types.ToJSON..= invoiceitemPrice'Tiers obj : "tiers_mode" Data.Aeson.Types.ToJSON..= invoiceitemPrice'TiersMode obj : "transform_quantity" Data.Aeson.Types.ToJSON..= invoiceitemPrice'TransformQuantity obj : "type" Data.Aeson.Types.ToJSON..= invoiceitemPrice'Type obj : "unit_amount" Data.Aeson.Types.ToJSON..= invoiceitemPrice'UnitAmount obj : "unit_amount_decimal" Data.Aeson.Types.ToJSON..= invoiceitemPrice'UnitAmountDecimal obj : GHC.Base.mempty) toEncoding obj = Data.Aeson.Encoding.Internal.pairs (("active" Data.Aeson.Types.ToJSON..= invoiceitemPrice'Active obj) GHC.Base.<> (("billing_scheme" Data.Aeson.Types.ToJSON..= invoiceitemPrice'BillingScheme obj) GHC.Base.<> (("created" Data.Aeson.Types.ToJSON..= invoiceitemPrice'Created obj) GHC.Base.<> (("currency" Data.Aeson.Types.ToJSON..= invoiceitemPrice'Currency obj) GHC.Base.<> (("id" Data.Aeson.Types.ToJSON..= invoiceitemPrice'Id obj) GHC.Base.<> (("livemode" Data.Aeson.Types.ToJSON..= invoiceitemPrice'Livemode obj) GHC.Base.<> (("lookup_key" Data.Aeson.Types.ToJSON..= invoiceitemPrice'LookupKey obj) GHC.Base.<> (("metadata" Data.Aeson.Types.ToJSON..= invoiceitemPrice'Metadata obj) GHC.Base.<> (("nickname" Data.Aeson.Types.ToJSON..= invoiceitemPrice'Nickname obj) GHC.Base.<> (("object" Data.Aeson.Types.ToJSON..= invoiceitemPrice'Object obj) GHC.Base.<> (("product" Data.Aeson.Types.ToJSON..= invoiceitemPrice'Product obj) GHC.Base.<> (("recurring" Data.Aeson.Types.ToJSON..= invoiceitemPrice'Recurring obj) GHC.Base.<> (("tax_behavior" Data.Aeson.Types.ToJSON..= invoiceitemPrice'TaxBehavior obj) GHC.Base.<> (("tiers" Data.Aeson.Types.ToJSON..= invoiceitemPrice'Tiers obj) GHC.Base.<> (("tiers_mode" Data.Aeson.Types.ToJSON..= invoiceitemPrice'TiersMode obj) GHC.Base.<> (("transform_quantity" Data.Aeson.Types.ToJSON..= invoiceitemPrice'TransformQuantity obj) GHC.Base.<> (("type" Data.Aeson.Types.ToJSON..= invoiceitemPrice'Type obj) GHC.Base.<> (("unit_amount" Data.Aeson.Types.ToJSON..= invoiceitemPrice'UnitAmount obj) GHC.Base.<> ("unit_amount_decimal" Data.Aeson.Types.ToJSON..= invoiceitemPrice'UnitAmountDecimal obj))))))))))))))))))) instance Data.Aeson.Types.FromJSON.FromJSON InvoiceitemPrice' where parseJSON = Data.Aeson.Types.FromJSON.withObject "InvoiceitemPrice'" (\obj -> ((((((((((((((((((GHC.Base.pure InvoiceitemPrice' 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..:? "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'' with all required fields. mkInvoiceitemPrice' :: InvoiceitemPrice' mkInvoiceitemPrice' = InvoiceitemPrice' { invoiceitemPrice'Active = GHC.Maybe.Nothing, invoiceitemPrice'BillingScheme = GHC.Maybe.Nothing, invoiceitemPrice'Created = GHC.Maybe.Nothing, invoiceitemPrice'Currency = GHC.Maybe.Nothing, invoiceitemPrice'Id = GHC.Maybe.Nothing, invoiceitemPrice'Livemode = GHC.Maybe.Nothing, invoiceitemPrice'LookupKey = GHC.Maybe.Nothing, invoiceitemPrice'Metadata = GHC.Maybe.Nothing, invoiceitemPrice'Nickname = GHC.Maybe.Nothing, invoiceitemPrice'Object = GHC.Maybe.Nothing, invoiceitemPrice'Product = GHC.Maybe.Nothing, invoiceitemPrice'Recurring = GHC.Maybe.Nothing, invoiceitemPrice'TaxBehavior = GHC.Maybe.Nothing, invoiceitemPrice'Tiers = GHC.Maybe.Nothing, invoiceitemPrice'TiersMode = GHC.Maybe.Nothing, invoiceitemPrice'TransformQuantity = GHC.Maybe.Nothing, invoiceitemPrice'Type = GHC.Maybe.Nothing, invoiceitemPrice'UnitAmount = GHC.Maybe.Nothing, invoiceitemPrice'UnitAmountDecimal = 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'BillingScheme' = -- | This case is used if the value encountered during decoding does not match any of the provided cases in the specification. InvoiceitemPrice'BillingScheme'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'BillingScheme'Typed Data.Text.Internal.Text | -- | Represents the JSON value @"per_unit"@ InvoiceitemPrice'BillingScheme'EnumPerUnit | -- | Represents the JSON value @"tiered"@ InvoiceitemPrice'BillingScheme'EnumTiered deriving (GHC.Show.Show, GHC.Classes.Eq) instance Data.Aeson.Types.ToJSON.ToJSON InvoiceitemPrice'BillingScheme' where toJSON (InvoiceitemPrice'BillingScheme'Other val) = val toJSON (InvoiceitemPrice'BillingScheme'Typed val) = Data.Aeson.Types.ToJSON.toJSON val toJSON (InvoiceitemPrice'BillingScheme'EnumPerUnit) = "per_unit" toJSON (InvoiceitemPrice'BillingScheme'EnumTiered) = "tiered" instance Data.Aeson.Types.FromJSON.FromJSON InvoiceitemPrice'BillingScheme' where parseJSON val = GHC.Base.pure ( if | val GHC.Classes.== "per_unit" -> InvoiceitemPrice'BillingScheme'EnumPerUnit | val GHC.Classes.== "tiered" -> InvoiceitemPrice'BillingScheme'EnumTiered | GHC.Base.otherwise -> InvoiceitemPrice'BillingScheme'Other val ) -- | 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'Object' = -- | This case is used if the value encountered during decoding does not match any of the provided cases in the specification. InvoiceitemPrice'Object'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'Object'Typed Data.Text.Internal.Text | -- | Represents the JSON value @"price"@ InvoiceitemPrice'Object'EnumPrice deriving (GHC.Show.Show, GHC.Classes.Eq) instance Data.Aeson.Types.ToJSON.ToJSON InvoiceitemPrice'Object' where toJSON (InvoiceitemPrice'Object'Other val) = val toJSON (InvoiceitemPrice'Object'Typed val) = Data.Aeson.Types.ToJSON.toJSON val toJSON (InvoiceitemPrice'Object'EnumPrice) = "price" instance Data.Aeson.Types.FromJSON.FromJSON InvoiceitemPrice'Object' where parseJSON val = GHC.Base.pure ( if | val GHC.Classes.== "price" -> InvoiceitemPrice'Object'EnumPrice | GHC.Base.otherwise -> InvoiceitemPrice'Object'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'Product'Variants = InvoiceitemPrice'Product'Text Data.Text.Internal.Text | InvoiceitemPrice'Product'Product Product | InvoiceitemPrice'Product'DeletedProduct DeletedProduct deriving (GHC.Show.Show, GHC.Classes.Eq) instance Data.Aeson.Types.ToJSON.ToJSON InvoiceitemPrice'Product'Variants where toJSON (InvoiceitemPrice'Product'Text a) = Data.Aeson.Types.ToJSON.toJSON a toJSON (InvoiceitemPrice'Product'Product a) = Data.Aeson.Types.ToJSON.toJSON a toJSON (InvoiceitemPrice'Product'DeletedProduct a) = Data.Aeson.Types.ToJSON.toJSON a instance Data.Aeson.Types.FromJSON.FromJSON InvoiceitemPrice'Product'Variants where parseJSON val = case (InvoiceitemPrice'Product'Text Data.Functor.<$> Data.Aeson.Types.FromJSON.fromJSON val) GHC.Base.<|> ((InvoiceitemPrice'Product'Product Data.Functor.<$> Data.Aeson.Types.FromJSON.fromJSON val) GHC.Base.<|> ((InvoiceitemPrice'Product'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'Recurring' = InvoiceitemPrice'Recurring' { -- | 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'Recurring'AggregateUsage :: (GHC.Maybe.Maybe InvoiceitemPrice'Recurring'AggregateUsage'), -- | interval: The frequency at which a subscription is billed. One of \`day\`, \`week\`, \`month\` or \`year\`. invoiceitemPrice'Recurring'Interval :: (GHC.Maybe.Maybe InvoiceitemPrice'Recurring'Interval'), -- | 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'Recurring'IntervalCount :: (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'Recurring'UsageType :: (GHC.Maybe.Maybe InvoiceitemPrice'Recurring'UsageType') } deriving ( GHC.Show.Show, GHC.Classes.Eq ) instance Data.Aeson.Types.ToJSON.ToJSON InvoiceitemPrice'Recurring' where toJSON obj = Data.Aeson.Types.Internal.object ("aggregate_usage" Data.Aeson.Types.ToJSON..= invoiceitemPrice'Recurring'AggregateUsage obj : "interval" Data.Aeson.Types.ToJSON..= invoiceitemPrice'Recurring'Interval obj : "interval_count" Data.Aeson.Types.ToJSON..= invoiceitemPrice'Recurring'IntervalCount obj : "usage_type" Data.Aeson.Types.ToJSON..= invoiceitemPrice'Recurring'UsageType obj : GHC.Base.mempty) toEncoding obj = Data.Aeson.Encoding.Internal.pairs (("aggregate_usage" Data.Aeson.Types.ToJSON..= invoiceitemPrice'Recurring'AggregateUsage obj) GHC.Base.<> (("interval" Data.Aeson.Types.ToJSON..= invoiceitemPrice'Recurring'Interval obj) GHC.Base.<> (("interval_count" Data.Aeson.Types.ToJSON..= invoiceitemPrice'Recurring'IntervalCount obj) GHC.Base.<> ("usage_type" Data.Aeson.Types.ToJSON..= invoiceitemPrice'Recurring'UsageType obj)))) instance Data.Aeson.Types.FromJSON.FromJSON InvoiceitemPrice'Recurring' where parseJSON = Data.Aeson.Types.FromJSON.withObject "InvoiceitemPrice'Recurring'" (\obj -> (((GHC.Base.pure InvoiceitemPrice'Recurring' 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'Recurring'' with all required fields. mkInvoiceitemPrice'Recurring' :: InvoiceitemPrice'Recurring' mkInvoiceitemPrice'Recurring' = InvoiceitemPrice'Recurring' { invoiceitemPrice'Recurring'AggregateUsage = GHC.Maybe.Nothing, invoiceitemPrice'Recurring'Interval = GHC.Maybe.Nothing, invoiceitemPrice'Recurring'IntervalCount = GHC.Maybe.Nothing, invoiceitemPrice'Recurring'UsageType = 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'Recurring'AggregateUsage' = -- | This case is used if the value encountered during decoding does not match any of the provided cases in the specification. InvoiceitemPrice'Recurring'AggregateUsage'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'Recurring'AggregateUsage'Typed Data.Text.Internal.Text | -- | Represents the JSON value @"last_during_period"@ InvoiceitemPrice'Recurring'AggregateUsage'EnumLastDuringPeriod | -- | Represents the JSON value @"last_ever"@ InvoiceitemPrice'Recurring'AggregateUsage'EnumLastEver | -- | Represents the JSON value @"max"@ InvoiceitemPrice'Recurring'AggregateUsage'EnumMax | -- | Represents the JSON value @"sum"@ InvoiceitemPrice'Recurring'AggregateUsage'EnumSum deriving (GHC.Show.Show, GHC.Classes.Eq) instance Data.Aeson.Types.ToJSON.ToJSON InvoiceitemPrice'Recurring'AggregateUsage' where toJSON (InvoiceitemPrice'Recurring'AggregateUsage'Other val) = val toJSON (InvoiceitemPrice'Recurring'AggregateUsage'Typed val) = Data.Aeson.Types.ToJSON.toJSON val toJSON (InvoiceitemPrice'Recurring'AggregateUsage'EnumLastDuringPeriod) = "last_during_period" toJSON (InvoiceitemPrice'Recurring'AggregateUsage'EnumLastEver) = "last_ever" toJSON (InvoiceitemPrice'Recurring'AggregateUsage'EnumMax) = "max" toJSON (InvoiceitemPrice'Recurring'AggregateUsage'EnumSum) = "sum" instance Data.Aeson.Types.FromJSON.FromJSON InvoiceitemPrice'Recurring'AggregateUsage' where parseJSON val = GHC.Base.pure ( if | val GHC.Classes.== "last_during_period" -> InvoiceitemPrice'Recurring'AggregateUsage'EnumLastDuringPeriod | val GHC.Classes.== "last_ever" -> InvoiceitemPrice'Recurring'AggregateUsage'EnumLastEver | val GHC.Classes.== "max" -> InvoiceitemPrice'Recurring'AggregateUsage'EnumMax | val GHC.Classes.== "sum" -> InvoiceitemPrice'Recurring'AggregateUsage'EnumSum | GHC.Base.otherwise -> InvoiceitemPrice'Recurring'AggregateUsage'Other 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'Recurring'Interval' = -- | This case is used if the value encountered during decoding does not match any of the provided cases in the specification. InvoiceitemPrice'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. InvoiceitemPrice'Recurring'Interval'Typed Data.Text.Internal.Text | -- | Represents the JSON value @"day"@ InvoiceitemPrice'Recurring'Interval'EnumDay | -- | Represents the JSON value @"month"@ InvoiceitemPrice'Recurring'Interval'EnumMonth | -- | Represents the JSON value @"week"@ InvoiceitemPrice'Recurring'Interval'EnumWeek | -- | Represents the JSON value @"year"@ InvoiceitemPrice'Recurring'Interval'EnumYear deriving (GHC.Show.Show, GHC.Classes.Eq) instance Data.Aeson.Types.ToJSON.ToJSON InvoiceitemPrice'Recurring'Interval' where toJSON (InvoiceitemPrice'Recurring'Interval'Other val) = val toJSON (InvoiceitemPrice'Recurring'Interval'Typed val) = Data.Aeson.Types.ToJSON.toJSON val toJSON (InvoiceitemPrice'Recurring'Interval'EnumDay) = "day" toJSON (InvoiceitemPrice'Recurring'Interval'EnumMonth) = "month" toJSON (InvoiceitemPrice'Recurring'Interval'EnumWeek) = "week" toJSON (InvoiceitemPrice'Recurring'Interval'EnumYear) = "year" instance Data.Aeson.Types.FromJSON.FromJSON InvoiceitemPrice'Recurring'Interval' where parseJSON val = GHC.Base.pure ( if | val GHC.Classes.== "day" -> InvoiceitemPrice'Recurring'Interval'EnumDay | val GHC.Classes.== "month" -> InvoiceitemPrice'Recurring'Interval'EnumMonth | val GHC.Classes.== "week" -> InvoiceitemPrice'Recurring'Interval'EnumWeek | val GHC.Classes.== "year" -> InvoiceitemPrice'Recurring'Interval'EnumYear | GHC.Base.otherwise -> InvoiceitemPrice'Recurring'Interval'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'Recurring'UsageType' = -- | This case is used if the value encountered during decoding does not match any of the provided cases in the specification. InvoiceitemPrice'Recurring'UsageType'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'Recurring'UsageType'Typed Data.Text.Internal.Text | -- | Represents the JSON value @"licensed"@ InvoiceitemPrice'Recurring'UsageType'EnumLicensed | -- | Represents the JSON value @"metered"@ InvoiceitemPrice'Recurring'UsageType'EnumMetered deriving (GHC.Show.Show, GHC.Classes.Eq) instance Data.Aeson.Types.ToJSON.ToJSON InvoiceitemPrice'Recurring'UsageType' where toJSON (InvoiceitemPrice'Recurring'UsageType'Other val) = val toJSON (InvoiceitemPrice'Recurring'UsageType'Typed val) = Data.Aeson.Types.ToJSON.toJSON val toJSON (InvoiceitemPrice'Recurring'UsageType'EnumLicensed) = "licensed" toJSON (InvoiceitemPrice'Recurring'UsageType'EnumMetered) = "metered" instance Data.Aeson.Types.FromJSON.FromJSON InvoiceitemPrice'Recurring'UsageType' where parseJSON val = GHC.Base.pure ( if | val GHC.Classes.== "licensed" -> InvoiceitemPrice'Recurring'UsageType'EnumLicensed | val GHC.Classes.== "metered" -> InvoiceitemPrice'Recurring'UsageType'EnumMetered | GHC.Base.otherwise -> InvoiceitemPrice'Recurring'UsageType'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'TaxBehavior' = -- | This case is used if the value encountered during decoding does not match any of the provided cases in the specification. InvoiceitemPrice'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. InvoiceitemPrice'TaxBehavior'Typed Data.Text.Internal.Text | -- | Represents the JSON value @"exclusive"@ InvoiceitemPrice'TaxBehavior'EnumExclusive | -- | Represents the JSON value @"inclusive"@ InvoiceitemPrice'TaxBehavior'EnumInclusive | -- | Represents the JSON value @"unspecified"@ InvoiceitemPrice'TaxBehavior'EnumUnspecified deriving (GHC.Show.Show, GHC.Classes.Eq) instance Data.Aeson.Types.ToJSON.ToJSON InvoiceitemPrice'TaxBehavior' where toJSON (InvoiceitemPrice'TaxBehavior'Other val) = val toJSON (InvoiceitemPrice'TaxBehavior'Typed val) = Data.Aeson.Types.ToJSON.toJSON val toJSON (InvoiceitemPrice'TaxBehavior'EnumExclusive) = "exclusive" toJSON (InvoiceitemPrice'TaxBehavior'EnumInclusive) = "inclusive" toJSON (InvoiceitemPrice'TaxBehavior'EnumUnspecified) = "unspecified" instance Data.Aeson.Types.FromJSON.FromJSON InvoiceitemPrice'TaxBehavior' where parseJSON val = GHC.Base.pure ( if | val GHC.Classes.== "exclusive" -> InvoiceitemPrice'TaxBehavior'EnumExclusive | val GHC.Classes.== "inclusive" -> InvoiceitemPrice'TaxBehavior'EnumInclusive | val GHC.Classes.== "unspecified" -> InvoiceitemPrice'TaxBehavior'EnumUnspecified | GHC.Base.otherwise -> InvoiceitemPrice'TaxBehavior'Other 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'TiersMode' = -- | This case is used if the value encountered during decoding does not match any of the provided cases in the specification. InvoiceitemPrice'TiersMode'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'TiersMode'Typed Data.Text.Internal.Text | -- | Represents the JSON value @"graduated"@ InvoiceitemPrice'TiersMode'EnumGraduated | -- | Represents the JSON value @"volume"@ InvoiceitemPrice'TiersMode'EnumVolume deriving (GHC.Show.Show, GHC.Classes.Eq) instance Data.Aeson.Types.ToJSON.ToJSON InvoiceitemPrice'TiersMode' where toJSON (InvoiceitemPrice'TiersMode'Other val) = val toJSON (InvoiceitemPrice'TiersMode'Typed val) = Data.Aeson.Types.ToJSON.toJSON val toJSON (InvoiceitemPrice'TiersMode'EnumGraduated) = "graduated" toJSON (InvoiceitemPrice'TiersMode'EnumVolume) = "volume" instance Data.Aeson.Types.FromJSON.FromJSON InvoiceitemPrice'TiersMode' where parseJSON val = GHC.Base.pure ( if | val GHC.Classes.== "graduated" -> InvoiceitemPrice'TiersMode'EnumGraduated | val GHC.Classes.== "volume" -> InvoiceitemPrice'TiersMode'EnumVolume | GHC.Base.otherwise -> InvoiceitemPrice'TiersMode'Other 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'TransformQuantity' = InvoiceitemPrice'TransformQuantity' { -- | divide_by: Divide usage by this number. invoiceitemPrice'TransformQuantity'DivideBy :: (GHC.Maybe.Maybe GHC.Types.Int), -- | round: After division, either round the result \`up\` or \`down\`. invoiceitemPrice'TransformQuantity'Round :: (GHC.Maybe.Maybe InvoiceitemPrice'TransformQuantity'Round') } deriving ( GHC.Show.Show, GHC.Classes.Eq ) instance Data.Aeson.Types.ToJSON.ToJSON InvoiceitemPrice'TransformQuantity' where toJSON obj = Data.Aeson.Types.Internal.object ("divide_by" Data.Aeson.Types.ToJSON..= invoiceitemPrice'TransformQuantity'DivideBy obj : "round" Data.Aeson.Types.ToJSON..= invoiceitemPrice'TransformQuantity'Round obj : GHC.Base.mempty) toEncoding obj = Data.Aeson.Encoding.Internal.pairs (("divide_by" Data.Aeson.Types.ToJSON..= invoiceitemPrice'TransformQuantity'DivideBy obj) GHC.Base.<> ("round" Data.Aeson.Types.ToJSON..= invoiceitemPrice'TransformQuantity'Round obj)) instance Data.Aeson.Types.FromJSON.FromJSON InvoiceitemPrice'TransformQuantity' where parseJSON = Data.Aeson.Types.FromJSON.withObject "InvoiceitemPrice'TransformQuantity'" (\obj -> (GHC.Base.pure InvoiceitemPrice'TransformQuantity' GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "divide_by")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "round")) -- | Create a new 'InvoiceitemPrice'TransformQuantity'' with all required fields. mkInvoiceitemPrice'TransformQuantity' :: InvoiceitemPrice'TransformQuantity' mkInvoiceitemPrice'TransformQuantity' = InvoiceitemPrice'TransformQuantity' { invoiceitemPrice'TransformQuantity'DivideBy = GHC.Maybe.Nothing, invoiceitemPrice'TransformQuantity'Round = 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'TransformQuantity'Round' = -- | This case is used if the value encountered during decoding does not match any of the provided cases in the specification. InvoiceitemPrice'TransformQuantity'Round'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'TransformQuantity'Round'Typed Data.Text.Internal.Text | -- | Represents the JSON value @"down"@ InvoiceitemPrice'TransformQuantity'Round'EnumDown | -- | Represents the JSON value @"up"@ InvoiceitemPrice'TransformQuantity'Round'EnumUp deriving (GHC.Show.Show, GHC.Classes.Eq) instance Data.Aeson.Types.ToJSON.ToJSON InvoiceitemPrice'TransformQuantity'Round' where toJSON (InvoiceitemPrice'TransformQuantity'Round'Other val) = val toJSON (InvoiceitemPrice'TransformQuantity'Round'Typed val) = Data.Aeson.Types.ToJSON.toJSON val toJSON (InvoiceitemPrice'TransformQuantity'Round'EnumDown) = "down" toJSON (InvoiceitemPrice'TransformQuantity'Round'EnumUp) = "up" instance Data.Aeson.Types.FromJSON.FromJSON InvoiceitemPrice'TransformQuantity'Round' where parseJSON val = GHC.Base.pure ( if | val GHC.Classes.== "down" -> InvoiceitemPrice'TransformQuantity'Round'EnumDown | val GHC.Classes.== "up" -> InvoiceitemPrice'TransformQuantity'Round'EnumUp | GHC.Base.otherwise -> InvoiceitemPrice'TransformQuantity'Round'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'Type' = -- | This case is used if the value encountered during decoding does not match any of the provided cases in the specification. InvoiceitemPrice'Type'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'Type'Typed Data.Text.Internal.Text | -- | Represents the JSON value @"one_time"@ InvoiceitemPrice'Type'EnumOneTime | -- | Represents the JSON value @"recurring"@ InvoiceitemPrice'Type'EnumRecurring deriving (GHC.Show.Show, GHC.Classes.Eq) instance Data.Aeson.Types.ToJSON.ToJSON InvoiceitemPrice'Type' where toJSON (InvoiceitemPrice'Type'Other val) = val toJSON (InvoiceitemPrice'Type'Typed val) = Data.Aeson.Types.ToJSON.toJSON val toJSON (InvoiceitemPrice'Type'EnumOneTime) = "one_time" toJSON (InvoiceitemPrice'Type'EnumRecurring) = "recurring" instance Data.Aeson.Types.FromJSON.FromJSON InvoiceitemPrice'Type' where parseJSON val = GHC.Base.pure ( if | val GHC.Classes.== "one_time" -> InvoiceitemPrice'Type'EnumOneTime | val GHC.Classes.== "recurring" -> InvoiceitemPrice'Type'EnumRecurring | GHC.Base.otherwise -> InvoiceitemPrice'Type'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'Variants = InvoiceitemSubscription'Text Data.Text.Internal.Text | InvoiceitemSubscription'Subscription Subscription deriving (GHC.Show.Show, GHC.Classes.Eq) instance Data.Aeson.Types.ToJSON.ToJSON InvoiceitemSubscription'Variants where toJSON (InvoiceitemSubscription'Text a) = Data.Aeson.Types.ToJSON.toJSON a toJSON (InvoiceitemSubscription'Subscription a) = Data.Aeson.Types.ToJSON.toJSON a instance Data.Aeson.Types.FromJSON.FromJSON InvoiceitemSubscription'Variants where parseJSON val = case (InvoiceitemSubscription'Text Data.Functor.<$> Data.Aeson.Types.FromJSON.fromJSON val) GHC.Base.<|> ((InvoiceitemSubscription'Subscription 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