{-# 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 LineItem module StripeAPI.Types.LineItem 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.DeletedProduct import {-# SOURCE #-} StripeAPI.Types.Discount import {-# SOURCE #-} StripeAPI.Types.DiscountsResourceDiscountAmount import {-# SOURCE #-} StripeAPI.Types.InvoiceLineItemPeriod import {-# SOURCE #-} StripeAPI.Types.InvoiceTaxAmount import {-# SOURCE #-} StripeAPI.Types.Price import {-# SOURCE #-} StripeAPI.Types.PriceTier import {-# SOURCE #-} StripeAPI.Types.Product import {-# SOURCE #-} StripeAPI.Types.Recurring 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.line_item@ in the specification. data LineItem = LineItem { -- | amount: The amount, in %s. lineItemAmount :: 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). lineItemCurrency :: Data.Text.Internal.Text, -- | description: An arbitrary string attached to the object. Often useful for displaying to users. -- -- Constraints: -- -- * Maximum length of 5000 lineItemDescription :: (GHC.Maybe.Maybe Data.Text.Internal.Text), -- | discount_amounts: The amount of discount calculated per discount for this line item. lineItemDiscountAmounts :: (GHC.Maybe.Maybe ([DiscountsResourceDiscountAmount])), -- | discountable: If true, discounts will apply to this line item. Always false for prorations. lineItemDiscountable :: GHC.Types.Bool, -- | discounts: The discounts applied to the invoice line item. Line item discounts are applied before invoice discounts. Use \`expand[]=discounts\` to expand each discount. lineItemDiscounts :: (GHC.Maybe.Maybe ([LineItemDiscounts'Variants])), -- | id: Unique identifier for the object. -- -- Constraints: -- -- * Maximum length of 5000 lineItemId :: Data.Text.Internal.Text, -- | invoice_item: The ID of the [invoice item](https:\/\/stripe.com\/docs\/api\/invoiceitems) associated with this line item if any. -- -- Constraints: -- -- * Maximum length of 5000 lineItemInvoiceItem :: (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. lineItemLivemode :: 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. Note that for line items with \`type=subscription\` this will reflect the metadata of the subscription that caused the line item to be created. lineItemMetadata :: Data.Aeson.Types.Internal.Object, -- | period: lineItemPeriod :: InvoiceLineItemPeriod, -- | price: The price of the line item. lineItemPrice :: (GHC.Maybe.Maybe LineItemPrice'), -- | proration: Whether this is a proration. lineItemProration :: GHC.Types.Bool, -- | quantity: The quantity of the subscription, if the line item is a subscription or a proration. lineItemQuantity :: (GHC.Maybe.Maybe GHC.Types.Int), -- | subscription: The subscription that the invoice item pertains to, if any. -- -- Constraints: -- -- * Maximum length of 5000 lineItemSubscription :: (GHC.Maybe.Maybe Data.Text.Internal.Text), -- | subscription_item: The subscription item that generated this invoice item. Left empty if the line item is not an explicit result of a subscription. -- -- Constraints: -- -- * Maximum length of 5000 lineItemSubscriptionItem :: (GHC.Maybe.Maybe Data.Text.Internal.Text), -- | tax_amounts: The amount of tax calculated per tax rate for this line item lineItemTaxAmounts :: (GHC.Maybe.Maybe ([InvoiceTaxAmount])), -- | tax_rates: The tax rates which apply to the line item. lineItemTaxRates :: (GHC.Maybe.Maybe ([TaxRate])), -- | type: A string identifying the type of the source of this line item, either an \`invoiceitem\` or a \`subscription\`. lineItemType :: LineItemType' } deriving ( GHC.Show.Show, GHC.Classes.Eq ) instance Data.Aeson.Types.ToJSON.ToJSON LineItem where toJSON obj = Data.Aeson.Types.Internal.object ("amount" Data.Aeson.Types.ToJSON..= lineItemAmount obj : "currency" Data.Aeson.Types.ToJSON..= lineItemCurrency obj : "description" Data.Aeson.Types.ToJSON..= lineItemDescription obj : "discount_amounts" Data.Aeson.Types.ToJSON..= lineItemDiscountAmounts obj : "discountable" Data.Aeson.Types.ToJSON..= lineItemDiscountable obj : "discounts" Data.Aeson.Types.ToJSON..= lineItemDiscounts obj : "id" Data.Aeson.Types.ToJSON..= lineItemId obj : "invoice_item" Data.Aeson.Types.ToJSON..= lineItemInvoiceItem obj : "livemode" Data.Aeson.Types.ToJSON..= lineItemLivemode obj : "metadata" Data.Aeson.Types.ToJSON..= lineItemMetadata obj : "period" Data.Aeson.Types.ToJSON..= lineItemPeriod obj : "price" Data.Aeson.Types.ToJSON..= lineItemPrice obj : "proration" Data.Aeson.Types.ToJSON..= lineItemProration obj : "quantity" Data.Aeson.Types.ToJSON..= lineItemQuantity obj : "subscription" Data.Aeson.Types.ToJSON..= lineItemSubscription obj : "subscription_item" Data.Aeson.Types.ToJSON..= lineItemSubscriptionItem obj : "tax_amounts" Data.Aeson.Types.ToJSON..= lineItemTaxAmounts obj : "tax_rates" Data.Aeson.Types.ToJSON..= lineItemTaxRates obj : "type" Data.Aeson.Types.ToJSON..= lineItemType obj : "object" Data.Aeson.Types.ToJSON..= Data.Aeson.Types.Internal.String "line_item" : GHC.Base.mempty) toEncoding obj = Data.Aeson.Encoding.Internal.pairs (("amount" Data.Aeson.Types.ToJSON..= lineItemAmount obj) GHC.Base.<> (("currency" Data.Aeson.Types.ToJSON..= lineItemCurrency obj) GHC.Base.<> (("description" Data.Aeson.Types.ToJSON..= lineItemDescription obj) GHC.Base.<> (("discount_amounts" Data.Aeson.Types.ToJSON..= lineItemDiscountAmounts obj) GHC.Base.<> (("discountable" Data.Aeson.Types.ToJSON..= lineItemDiscountable obj) GHC.Base.<> (("discounts" Data.Aeson.Types.ToJSON..= lineItemDiscounts obj) GHC.Base.<> (("id" Data.Aeson.Types.ToJSON..= lineItemId obj) GHC.Base.<> (("invoice_item" Data.Aeson.Types.ToJSON..= lineItemInvoiceItem obj) GHC.Base.<> (("livemode" Data.Aeson.Types.ToJSON..= lineItemLivemode obj) GHC.Base.<> (("metadata" Data.Aeson.Types.ToJSON..= lineItemMetadata obj) GHC.Base.<> (("period" Data.Aeson.Types.ToJSON..= lineItemPeriod obj) GHC.Base.<> (("price" Data.Aeson.Types.ToJSON..= lineItemPrice obj) GHC.Base.<> (("proration" Data.Aeson.Types.ToJSON..= lineItemProration obj) GHC.Base.<> (("quantity" Data.Aeson.Types.ToJSON..= lineItemQuantity obj) GHC.Base.<> (("subscription" Data.Aeson.Types.ToJSON..= lineItemSubscription obj) GHC.Base.<> (("subscription_item" Data.Aeson.Types.ToJSON..= lineItemSubscriptionItem obj) GHC.Base.<> (("tax_amounts" Data.Aeson.Types.ToJSON..= lineItemTaxAmounts obj) GHC.Base.<> (("tax_rates" Data.Aeson.Types.ToJSON..= lineItemTaxRates obj) GHC.Base.<> (("type" Data.Aeson.Types.ToJSON..= lineItemType obj) GHC.Base.<> ("object" Data.Aeson.Types.ToJSON..= Data.Aeson.Types.Internal.String "line_item")))))))))))))))))))) instance Data.Aeson.Types.FromJSON.FromJSON LineItem where parseJSON = Data.Aeson.Types.FromJSON.withObject "LineItem" (\obj -> ((((((((((((((((((GHC.Base.pure LineItem GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..: "amount")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..: "currency")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "description")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "discount_amounts")) 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_item")) 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_amounts")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "tax_rates")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..: "type")) -- | Create a new 'LineItem' with all required fields. mkLineItem :: -- | 'lineItemAmount' GHC.Types.Int -> -- | 'lineItemCurrency' Data.Text.Internal.Text -> -- | 'lineItemDiscountable' GHC.Types.Bool -> -- | 'lineItemId' Data.Text.Internal.Text -> -- | 'lineItemLivemode' GHC.Types.Bool -> -- | 'lineItemMetadata' Data.Aeson.Types.Internal.Object -> -- | 'lineItemPeriod' InvoiceLineItemPeriod -> -- | 'lineItemProration' GHC.Types.Bool -> -- | 'lineItemType' LineItemType' -> LineItem mkLineItem lineItemAmount lineItemCurrency lineItemDiscountable lineItemId lineItemLivemode lineItemMetadata lineItemPeriod lineItemProration lineItemType = LineItem { lineItemAmount = lineItemAmount, lineItemCurrency = lineItemCurrency, lineItemDescription = GHC.Maybe.Nothing, lineItemDiscountAmounts = GHC.Maybe.Nothing, lineItemDiscountable = lineItemDiscountable, lineItemDiscounts = GHC.Maybe.Nothing, lineItemId = lineItemId, lineItemInvoiceItem = GHC.Maybe.Nothing, lineItemLivemode = lineItemLivemode, lineItemMetadata = lineItemMetadata, lineItemPeriod = lineItemPeriod, lineItemPrice = GHC.Maybe.Nothing, lineItemProration = lineItemProration, lineItemQuantity = GHC.Maybe.Nothing, lineItemSubscription = GHC.Maybe.Nothing, lineItemSubscriptionItem = GHC.Maybe.Nothing, lineItemTaxAmounts = GHC.Maybe.Nothing, lineItemTaxRates = GHC.Maybe.Nothing, lineItemType = lineItemType } -- | Defines the oneOf schema located at @components.schemas.line_item.properties.discounts.items.anyOf@ in the specification. data LineItemDiscounts'Variants = LineItemDiscounts'Text Data.Text.Internal.Text | LineItemDiscounts'Discount Discount deriving (GHC.Show.Show, GHC.Classes.Eq) instance Data.Aeson.Types.ToJSON.ToJSON LineItemDiscounts'Variants where toJSON (LineItemDiscounts'Text a) = Data.Aeson.Types.ToJSON.toJSON a toJSON (LineItemDiscounts'Discount a) = Data.Aeson.Types.ToJSON.toJSON a instance Data.Aeson.Types.FromJSON.FromJSON LineItemDiscounts'Variants where parseJSON val = case (LineItemDiscounts'Text Data.Functor.<$> Data.Aeson.Types.FromJSON.fromJSON val) GHC.Base.<|> ((LineItemDiscounts'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 object schema located at @components.schemas.line_item.properties.price.anyOf@ in the specification. -- -- The price of the line item. data LineItemPrice' = LineItemPrice' { -- | active: Whether the price can be used for new purchases. lineItemPrice'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. lineItemPrice'BillingScheme :: (GHC.Maybe.Maybe LineItemPrice'BillingScheme'), -- | created: Time at which the object was created. Measured in seconds since the Unix epoch. lineItemPrice'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). lineItemPrice'Currency :: (GHC.Maybe.Maybe Data.Text.Internal.Text), -- | id: Unique identifier for the object. -- -- Constraints: -- -- * Maximum length of 5000 lineItemPrice'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. lineItemPrice'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 lineItemPrice'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. lineItemPrice'Metadata :: (GHC.Maybe.Maybe Data.Aeson.Types.Internal.Object), -- | nickname: A brief description of the price, hidden from customers. -- -- Constraints: -- -- * Maximum length of 5000 lineItemPrice'Nickname :: (GHC.Maybe.Maybe Data.Text.Internal.Text), -- | object: String representing the object\'s type. Objects of the same type share the same value. lineItemPrice'Object :: (GHC.Maybe.Maybe LineItemPrice'Object'), -- | product: The ID of the product this price is associated with. lineItemPrice'Product :: (GHC.Maybe.Maybe LineItemPrice'Product'Variants), -- | recurring: The recurring components of a price such as \`interval\` and \`usage_type\`. lineItemPrice'Recurring :: (GHC.Maybe.Maybe LineItemPrice'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. lineItemPrice'TaxBehavior :: (GHC.Maybe.Maybe LineItemPrice'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\`. lineItemPrice'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. lineItemPrice'TiersMode :: (GHC.Maybe.Maybe LineItemPrice'TiersMode'), -- | transform_quantity: Apply a transformation to the reported usage or set quantity before computing the amount billed. Cannot be combined with \`tiers\`. lineItemPrice'TransformQuantity :: (GHC.Maybe.Maybe LineItemPrice'TransformQuantity'), -- | type: One of \`one_time\` or \`recurring\` depending on whether the price is for a one-time purchase or a recurring (subscription) purchase. lineItemPrice'Type :: (GHC.Maybe.Maybe LineItemPrice'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\`. lineItemPrice'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\`. lineItemPrice'UnitAmountDecimal :: (GHC.Maybe.Maybe Data.Text.Internal.Text) } deriving ( GHC.Show.Show, GHC.Classes.Eq ) instance Data.Aeson.Types.ToJSON.ToJSON LineItemPrice' where toJSON obj = Data.Aeson.Types.Internal.object ("active" Data.Aeson.Types.ToJSON..= lineItemPrice'Active obj : "billing_scheme" Data.Aeson.Types.ToJSON..= lineItemPrice'BillingScheme obj : "created" Data.Aeson.Types.ToJSON..= lineItemPrice'Created obj : "currency" Data.Aeson.Types.ToJSON..= lineItemPrice'Currency obj : "id" Data.Aeson.Types.ToJSON..= lineItemPrice'Id obj : "livemode" Data.Aeson.Types.ToJSON..= lineItemPrice'Livemode obj : "lookup_key" Data.Aeson.Types.ToJSON..= lineItemPrice'LookupKey obj : "metadata" Data.Aeson.Types.ToJSON..= lineItemPrice'Metadata obj : "nickname" Data.Aeson.Types.ToJSON..= lineItemPrice'Nickname obj : "object" Data.Aeson.Types.ToJSON..= lineItemPrice'Object obj : "product" Data.Aeson.Types.ToJSON..= lineItemPrice'Product obj : "recurring" Data.Aeson.Types.ToJSON..= lineItemPrice'Recurring obj : "tax_behavior" Data.Aeson.Types.ToJSON..= lineItemPrice'TaxBehavior obj : "tiers" Data.Aeson.Types.ToJSON..= lineItemPrice'Tiers obj : "tiers_mode" Data.Aeson.Types.ToJSON..= lineItemPrice'TiersMode obj : "transform_quantity" Data.Aeson.Types.ToJSON..= lineItemPrice'TransformQuantity obj : "type" Data.Aeson.Types.ToJSON..= lineItemPrice'Type obj : "unit_amount" Data.Aeson.Types.ToJSON..= lineItemPrice'UnitAmount obj : "unit_amount_decimal" Data.Aeson.Types.ToJSON..= lineItemPrice'UnitAmountDecimal obj : GHC.Base.mempty) toEncoding obj = Data.Aeson.Encoding.Internal.pairs (("active" Data.Aeson.Types.ToJSON..= lineItemPrice'Active obj) GHC.Base.<> (("billing_scheme" Data.Aeson.Types.ToJSON..= lineItemPrice'BillingScheme obj) GHC.Base.<> (("created" Data.Aeson.Types.ToJSON..= lineItemPrice'Created obj) GHC.Base.<> (("currency" Data.Aeson.Types.ToJSON..= lineItemPrice'Currency obj) GHC.Base.<> (("id" Data.Aeson.Types.ToJSON..= lineItemPrice'Id obj) GHC.Base.<> (("livemode" Data.Aeson.Types.ToJSON..= lineItemPrice'Livemode obj) GHC.Base.<> (("lookup_key" Data.Aeson.Types.ToJSON..= lineItemPrice'LookupKey obj) GHC.Base.<> (("metadata" Data.Aeson.Types.ToJSON..= lineItemPrice'Metadata obj) GHC.Base.<> (("nickname" Data.Aeson.Types.ToJSON..= lineItemPrice'Nickname obj) GHC.Base.<> (("object" Data.Aeson.Types.ToJSON..= lineItemPrice'Object obj) GHC.Base.<> (("product" Data.Aeson.Types.ToJSON..= lineItemPrice'Product obj) GHC.Base.<> (("recurring" Data.Aeson.Types.ToJSON..= lineItemPrice'Recurring obj) GHC.Base.<> (("tax_behavior" Data.Aeson.Types.ToJSON..= lineItemPrice'TaxBehavior obj) GHC.Base.<> (("tiers" Data.Aeson.Types.ToJSON..= lineItemPrice'Tiers obj) GHC.Base.<> (("tiers_mode" Data.Aeson.Types.ToJSON..= lineItemPrice'TiersMode obj) GHC.Base.<> (("transform_quantity" Data.Aeson.Types.ToJSON..= lineItemPrice'TransformQuantity obj) GHC.Base.<> (("type" Data.Aeson.Types.ToJSON..= lineItemPrice'Type obj) GHC.Base.<> (("unit_amount" Data.Aeson.Types.ToJSON..= lineItemPrice'UnitAmount obj) GHC.Base.<> ("unit_amount_decimal" Data.Aeson.Types.ToJSON..= lineItemPrice'UnitAmountDecimal obj))))))))))))))))))) instance Data.Aeson.Types.FromJSON.FromJSON LineItemPrice' where parseJSON = Data.Aeson.Types.FromJSON.withObject "LineItemPrice'" (\obj -> ((((((((((((((((((GHC.Base.pure LineItemPrice' 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 'LineItemPrice'' with all required fields. mkLineItemPrice' :: LineItemPrice' mkLineItemPrice' = LineItemPrice' { lineItemPrice'Active = GHC.Maybe.Nothing, lineItemPrice'BillingScheme = GHC.Maybe.Nothing, lineItemPrice'Created = GHC.Maybe.Nothing, lineItemPrice'Currency = GHC.Maybe.Nothing, lineItemPrice'Id = GHC.Maybe.Nothing, lineItemPrice'Livemode = GHC.Maybe.Nothing, lineItemPrice'LookupKey = GHC.Maybe.Nothing, lineItemPrice'Metadata = GHC.Maybe.Nothing, lineItemPrice'Nickname = GHC.Maybe.Nothing, lineItemPrice'Object = GHC.Maybe.Nothing, lineItemPrice'Product = GHC.Maybe.Nothing, lineItemPrice'Recurring = GHC.Maybe.Nothing, lineItemPrice'TaxBehavior = GHC.Maybe.Nothing, lineItemPrice'Tiers = GHC.Maybe.Nothing, lineItemPrice'TiersMode = GHC.Maybe.Nothing, lineItemPrice'TransformQuantity = GHC.Maybe.Nothing, lineItemPrice'Type = GHC.Maybe.Nothing, lineItemPrice'UnitAmount = GHC.Maybe.Nothing, lineItemPrice'UnitAmountDecimal = GHC.Maybe.Nothing } -- | Defines the enum schema located at @components.schemas.line_item.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 LineItemPrice'BillingScheme' = -- | This case is used if the value encountered during decoding does not match any of the provided cases in the specification. LineItemPrice'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. LineItemPrice'BillingScheme'Typed Data.Text.Internal.Text | -- | Represents the JSON value @"per_unit"@ LineItemPrice'BillingScheme'EnumPerUnit | -- | Represents the JSON value @"tiered"@ LineItemPrice'BillingScheme'EnumTiered deriving (GHC.Show.Show, GHC.Classes.Eq) instance Data.Aeson.Types.ToJSON.ToJSON LineItemPrice'BillingScheme' where toJSON (LineItemPrice'BillingScheme'Other val) = val toJSON (LineItemPrice'BillingScheme'Typed val) = Data.Aeson.Types.ToJSON.toJSON val toJSON (LineItemPrice'BillingScheme'EnumPerUnit) = "per_unit" toJSON (LineItemPrice'BillingScheme'EnumTiered) = "tiered" instance Data.Aeson.Types.FromJSON.FromJSON LineItemPrice'BillingScheme' where parseJSON val = GHC.Base.pure ( if | val GHC.Classes.== "per_unit" -> LineItemPrice'BillingScheme'EnumPerUnit | val GHC.Classes.== "tiered" -> LineItemPrice'BillingScheme'EnumTiered | GHC.Base.otherwise -> LineItemPrice'BillingScheme'Other val ) -- | Defines the enum schema located at @components.schemas.line_item.properties.price.anyOf.properties.object@ in the specification. -- -- String representing the object\'s type. Objects of the same type share the same value. data LineItemPrice'Object' = -- | This case is used if the value encountered during decoding does not match any of the provided cases in the specification. LineItemPrice'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. LineItemPrice'Object'Typed Data.Text.Internal.Text | -- | Represents the JSON value @"price"@ LineItemPrice'Object'EnumPrice deriving (GHC.Show.Show, GHC.Classes.Eq) instance Data.Aeson.Types.ToJSON.ToJSON LineItemPrice'Object' where toJSON (LineItemPrice'Object'Other val) = val toJSON (LineItemPrice'Object'Typed val) = Data.Aeson.Types.ToJSON.toJSON val toJSON (LineItemPrice'Object'EnumPrice) = "price" instance Data.Aeson.Types.FromJSON.FromJSON LineItemPrice'Object' where parseJSON val = GHC.Base.pure ( if | val GHC.Classes.== "price" -> LineItemPrice'Object'EnumPrice | GHC.Base.otherwise -> LineItemPrice'Object'Other val ) -- | Defines the oneOf schema located at @components.schemas.line_item.properties.price.anyOf.properties.product.anyOf@ in the specification. -- -- The ID of the product this price is associated with. data LineItemPrice'Product'Variants = LineItemPrice'Product'Text Data.Text.Internal.Text | LineItemPrice'Product'Product Product | LineItemPrice'Product'DeletedProduct DeletedProduct deriving (GHC.Show.Show, GHC.Classes.Eq) instance Data.Aeson.Types.ToJSON.ToJSON LineItemPrice'Product'Variants where toJSON (LineItemPrice'Product'Text a) = Data.Aeson.Types.ToJSON.toJSON a toJSON (LineItemPrice'Product'Product a) = Data.Aeson.Types.ToJSON.toJSON a toJSON (LineItemPrice'Product'DeletedProduct a) = Data.Aeson.Types.ToJSON.toJSON a instance Data.Aeson.Types.FromJSON.FromJSON LineItemPrice'Product'Variants where parseJSON val = case (LineItemPrice'Product'Text Data.Functor.<$> Data.Aeson.Types.FromJSON.fromJSON val) GHC.Base.<|> ((LineItemPrice'Product'Product Data.Functor.<$> Data.Aeson.Types.FromJSON.fromJSON val) GHC.Base.<|> ((LineItemPrice'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.line_item.properties.price.anyOf.properties.recurring.anyOf@ in the specification. -- -- The recurring components of a price such as \\\`interval\\\` and \\\`usage_type\\\`. data LineItemPrice'Recurring' = LineItemPrice'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\`. lineItemPrice'Recurring'AggregateUsage :: (GHC.Maybe.Maybe LineItemPrice'Recurring'AggregateUsage'), -- | interval: The frequency at which a subscription is billed. One of \`day\`, \`week\`, \`month\` or \`year\`. lineItemPrice'Recurring'Interval :: (GHC.Maybe.Maybe LineItemPrice'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. lineItemPrice'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\`. lineItemPrice'Recurring'UsageType :: (GHC.Maybe.Maybe LineItemPrice'Recurring'UsageType') } deriving ( GHC.Show.Show, GHC.Classes.Eq ) instance Data.Aeson.Types.ToJSON.ToJSON LineItemPrice'Recurring' where toJSON obj = Data.Aeson.Types.Internal.object ("aggregate_usage" Data.Aeson.Types.ToJSON..= lineItemPrice'Recurring'AggregateUsage obj : "interval" Data.Aeson.Types.ToJSON..= lineItemPrice'Recurring'Interval obj : "interval_count" Data.Aeson.Types.ToJSON..= lineItemPrice'Recurring'IntervalCount obj : "usage_type" Data.Aeson.Types.ToJSON..= lineItemPrice'Recurring'UsageType obj : GHC.Base.mempty) toEncoding obj = Data.Aeson.Encoding.Internal.pairs (("aggregate_usage" Data.Aeson.Types.ToJSON..= lineItemPrice'Recurring'AggregateUsage obj) GHC.Base.<> (("interval" Data.Aeson.Types.ToJSON..= lineItemPrice'Recurring'Interval obj) GHC.Base.<> (("interval_count" Data.Aeson.Types.ToJSON..= lineItemPrice'Recurring'IntervalCount obj) GHC.Base.<> ("usage_type" Data.Aeson.Types.ToJSON..= lineItemPrice'Recurring'UsageType obj)))) instance Data.Aeson.Types.FromJSON.FromJSON LineItemPrice'Recurring' where parseJSON = Data.Aeson.Types.FromJSON.withObject "LineItemPrice'Recurring'" (\obj -> (((GHC.Base.pure LineItemPrice'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 'LineItemPrice'Recurring'' with all required fields. mkLineItemPrice'Recurring' :: LineItemPrice'Recurring' mkLineItemPrice'Recurring' = LineItemPrice'Recurring' { lineItemPrice'Recurring'AggregateUsage = GHC.Maybe.Nothing, lineItemPrice'Recurring'Interval = GHC.Maybe.Nothing, lineItemPrice'Recurring'IntervalCount = GHC.Maybe.Nothing, lineItemPrice'Recurring'UsageType = GHC.Maybe.Nothing } -- | Defines the enum schema located at @components.schemas.line_item.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 LineItemPrice'Recurring'AggregateUsage' = -- | This case is used if the value encountered during decoding does not match any of the provided cases in the specification. LineItemPrice'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. LineItemPrice'Recurring'AggregateUsage'Typed Data.Text.Internal.Text | -- | Represents the JSON value @"last_during_period"@ LineItemPrice'Recurring'AggregateUsage'EnumLastDuringPeriod | -- | Represents the JSON value @"last_ever"@ LineItemPrice'Recurring'AggregateUsage'EnumLastEver | -- | Represents the JSON value @"max"@ LineItemPrice'Recurring'AggregateUsage'EnumMax | -- | Represents the JSON value @"sum"@ LineItemPrice'Recurring'AggregateUsage'EnumSum deriving (GHC.Show.Show, GHC.Classes.Eq) instance Data.Aeson.Types.ToJSON.ToJSON LineItemPrice'Recurring'AggregateUsage' where toJSON (LineItemPrice'Recurring'AggregateUsage'Other val) = val toJSON (LineItemPrice'Recurring'AggregateUsage'Typed val) = Data.Aeson.Types.ToJSON.toJSON val toJSON (LineItemPrice'Recurring'AggregateUsage'EnumLastDuringPeriod) = "last_during_period" toJSON (LineItemPrice'Recurring'AggregateUsage'EnumLastEver) = "last_ever" toJSON (LineItemPrice'Recurring'AggregateUsage'EnumMax) = "max" toJSON (LineItemPrice'Recurring'AggregateUsage'EnumSum) = "sum" instance Data.Aeson.Types.FromJSON.FromJSON LineItemPrice'Recurring'AggregateUsage' where parseJSON val = GHC.Base.pure ( if | val GHC.Classes.== "last_during_period" -> LineItemPrice'Recurring'AggregateUsage'EnumLastDuringPeriod | val GHC.Classes.== "last_ever" -> LineItemPrice'Recurring'AggregateUsage'EnumLastEver | val GHC.Classes.== "max" -> LineItemPrice'Recurring'AggregateUsage'EnumMax | val GHC.Classes.== "sum" -> LineItemPrice'Recurring'AggregateUsage'EnumSum | GHC.Base.otherwise -> LineItemPrice'Recurring'AggregateUsage'Other val ) -- | Defines the enum schema located at @components.schemas.line_item.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 LineItemPrice'Recurring'Interval' = -- | This case is used if the value encountered during decoding does not match any of the provided cases in the specification. LineItemPrice'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. LineItemPrice'Recurring'Interval'Typed Data.Text.Internal.Text | -- | Represents the JSON value @"day"@ LineItemPrice'Recurring'Interval'EnumDay | -- | Represents the JSON value @"month"@ LineItemPrice'Recurring'Interval'EnumMonth | -- | Represents the JSON value @"week"@ LineItemPrice'Recurring'Interval'EnumWeek | -- | Represents the JSON value @"year"@ LineItemPrice'Recurring'Interval'EnumYear deriving (GHC.Show.Show, GHC.Classes.Eq) instance Data.Aeson.Types.ToJSON.ToJSON LineItemPrice'Recurring'Interval' where toJSON (LineItemPrice'Recurring'Interval'Other val) = val toJSON (LineItemPrice'Recurring'Interval'Typed val) = Data.Aeson.Types.ToJSON.toJSON val toJSON (LineItemPrice'Recurring'Interval'EnumDay) = "day" toJSON (LineItemPrice'Recurring'Interval'EnumMonth) = "month" toJSON (LineItemPrice'Recurring'Interval'EnumWeek) = "week" toJSON (LineItemPrice'Recurring'Interval'EnumYear) = "year" instance Data.Aeson.Types.FromJSON.FromJSON LineItemPrice'Recurring'Interval' where parseJSON val = GHC.Base.pure ( if | val GHC.Classes.== "day" -> LineItemPrice'Recurring'Interval'EnumDay | val GHC.Classes.== "month" -> LineItemPrice'Recurring'Interval'EnumMonth | val GHC.Classes.== "week" -> LineItemPrice'Recurring'Interval'EnumWeek | val GHC.Classes.== "year" -> LineItemPrice'Recurring'Interval'EnumYear | GHC.Base.otherwise -> LineItemPrice'Recurring'Interval'Other val ) -- | Defines the enum schema located at @components.schemas.line_item.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 LineItemPrice'Recurring'UsageType' = -- | This case is used if the value encountered during decoding does not match any of the provided cases in the specification. LineItemPrice'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. LineItemPrice'Recurring'UsageType'Typed Data.Text.Internal.Text | -- | Represents the JSON value @"licensed"@ LineItemPrice'Recurring'UsageType'EnumLicensed | -- | Represents the JSON value @"metered"@ LineItemPrice'Recurring'UsageType'EnumMetered deriving (GHC.Show.Show, GHC.Classes.Eq) instance Data.Aeson.Types.ToJSON.ToJSON LineItemPrice'Recurring'UsageType' where toJSON (LineItemPrice'Recurring'UsageType'Other val) = val toJSON (LineItemPrice'Recurring'UsageType'Typed val) = Data.Aeson.Types.ToJSON.toJSON val toJSON (LineItemPrice'Recurring'UsageType'EnumLicensed) = "licensed" toJSON (LineItemPrice'Recurring'UsageType'EnumMetered) = "metered" instance Data.Aeson.Types.FromJSON.FromJSON LineItemPrice'Recurring'UsageType' where parseJSON val = GHC.Base.pure ( if | val GHC.Classes.== "licensed" -> LineItemPrice'Recurring'UsageType'EnumLicensed | val GHC.Classes.== "metered" -> LineItemPrice'Recurring'UsageType'EnumMetered | GHC.Base.otherwise -> LineItemPrice'Recurring'UsageType'Other val ) -- | Defines the enum schema located at @components.schemas.line_item.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 LineItemPrice'TaxBehavior' = -- | This case is used if the value encountered during decoding does not match any of the provided cases in the specification. LineItemPrice'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. LineItemPrice'TaxBehavior'Typed Data.Text.Internal.Text | -- | Represents the JSON value @"exclusive"@ LineItemPrice'TaxBehavior'EnumExclusive | -- | Represents the JSON value @"inclusive"@ LineItemPrice'TaxBehavior'EnumInclusive | -- | Represents the JSON value @"unspecified"@ LineItemPrice'TaxBehavior'EnumUnspecified deriving (GHC.Show.Show, GHC.Classes.Eq) instance Data.Aeson.Types.ToJSON.ToJSON LineItemPrice'TaxBehavior' where toJSON (LineItemPrice'TaxBehavior'Other val) = val toJSON (LineItemPrice'TaxBehavior'Typed val) = Data.Aeson.Types.ToJSON.toJSON val toJSON (LineItemPrice'TaxBehavior'EnumExclusive) = "exclusive" toJSON (LineItemPrice'TaxBehavior'EnumInclusive) = "inclusive" toJSON (LineItemPrice'TaxBehavior'EnumUnspecified) = "unspecified" instance Data.Aeson.Types.FromJSON.FromJSON LineItemPrice'TaxBehavior' where parseJSON val = GHC.Base.pure ( if | val GHC.Classes.== "exclusive" -> LineItemPrice'TaxBehavior'EnumExclusive | val GHC.Classes.== "inclusive" -> LineItemPrice'TaxBehavior'EnumInclusive | val GHC.Classes.== "unspecified" -> LineItemPrice'TaxBehavior'EnumUnspecified | GHC.Base.otherwise -> LineItemPrice'TaxBehavior'Other val ) -- | Defines the enum schema located at @components.schemas.line_item.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 LineItemPrice'TiersMode' = -- | This case is used if the value encountered during decoding does not match any of the provided cases in the specification. LineItemPrice'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. LineItemPrice'TiersMode'Typed Data.Text.Internal.Text | -- | Represents the JSON value @"graduated"@ LineItemPrice'TiersMode'EnumGraduated | -- | Represents the JSON value @"volume"@ LineItemPrice'TiersMode'EnumVolume deriving (GHC.Show.Show, GHC.Classes.Eq) instance Data.Aeson.Types.ToJSON.ToJSON LineItemPrice'TiersMode' where toJSON (LineItemPrice'TiersMode'Other val) = val toJSON (LineItemPrice'TiersMode'Typed val) = Data.Aeson.Types.ToJSON.toJSON val toJSON (LineItemPrice'TiersMode'EnumGraduated) = "graduated" toJSON (LineItemPrice'TiersMode'EnumVolume) = "volume" instance Data.Aeson.Types.FromJSON.FromJSON LineItemPrice'TiersMode' where parseJSON val = GHC.Base.pure ( if | val GHC.Classes.== "graduated" -> LineItemPrice'TiersMode'EnumGraduated | val GHC.Classes.== "volume" -> LineItemPrice'TiersMode'EnumVolume | GHC.Base.otherwise -> LineItemPrice'TiersMode'Other val ) -- | Defines the object schema located at @components.schemas.line_item.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 LineItemPrice'TransformQuantity' = LineItemPrice'TransformQuantity' { -- | divide_by: Divide usage by this number. lineItemPrice'TransformQuantity'DivideBy :: (GHC.Maybe.Maybe GHC.Types.Int), -- | round: After division, either round the result \`up\` or \`down\`. lineItemPrice'TransformQuantity'Round :: (GHC.Maybe.Maybe LineItemPrice'TransformQuantity'Round') } deriving ( GHC.Show.Show, GHC.Classes.Eq ) instance Data.Aeson.Types.ToJSON.ToJSON LineItemPrice'TransformQuantity' where toJSON obj = Data.Aeson.Types.Internal.object ("divide_by" Data.Aeson.Types.ToJSON..= lineItemPrice'TransformQuantity'DivideBy obj : "round" Data.Aeson.Types.ToJSON..= lineItemPrice'TransformQuantity'Round obj : GHC.Base.mempty) toEncoding obj = Data.Aeson.Encoding.Internal.pairs (("divide_by" Data.Aeson.Types.ToJSON..= lineItemPrice'TransformQuantity'DivideBy obj) GHC.Base.<> ("round" Data.Aeson.Types.ToJSON..= lineItemPrice'TransformQuantity'Round obj)) instance Data.Aeson.Types.FromJSON.FromJSON LineItemPrice'TransformQuantity' where parseJSON = Data.Aeson.Types.FromJSON.withObject "LineItemPrice'TransformQuantity'" (\obj -> (GHC.Base.pure LineItemPrice'TransformQuantity' GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "divide_by")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "round")) -- | Create a new 'LineItemPrice'TransformQuantity'' with all required fields. mkLineItemPrice'TransformQuantity' :: LineItemPrice'TransformQuantity' mkLineItemPrice'TransformQuantity' = LineItemPrice'TransformQuantity' { lineItemPrice'TransformQuantity'DivideBy = GHC.Maybe.Nothing, lineItemPrice'TransformQuantity'Round = GHC.Maybe.Nothing } -- | Defines the enum schema located at @components.schemas.line_item.properties.price.anyOf.properties.transform_quantity.anyOf.properties.round@ in the specification. -- -- After division, either round the result \`up\` or \`down\`. data LineItemPrice'TransformQuantity'Round' = -- | This case is used if the value encountered during decoding does not match any of the provided cases in the specification. LineItemPrice'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. LineItemPrice'TransformQuantity'Round'Typed Data.Text.Internal.Text | -- | Represents the JSON value @"down"@ LineItemPrice'TransformQuantity'Round'EnumDown | -- | Represents the JSON value @"up"@ LineItemPrice'TransformQuantity'Round'EnumUp deriving (GHC.Show.Show, GHC.Classes.Eq) instance Data.Aeson.Types.ToJSON.ToJSON LineItemPrice'TransformQuantity'Round' where toJSON (LineItemPrice'TransformQuantity'Round'Other val) = val toJSON (LineItemPrice'TransformQuantity'Round'Typed val) = Data.Aeson.Types.ToJSON.toJSON val toJSON (LineItemPrice'TransformQuantity'Round'EnumDown) = "down" toJSON (LineItemPrice'TransformQuantity'Round'EnumUp) = "up" instance Data.Aeson.Types.FromJSON.FromJSON LineItemPrice'TransformQuantity'Round' where parseJSON val = GHC.Base.pure ( if | val GHC.Classes.== "down" -> LineItemPrice'TransformQuantity'Round'EnumDown | val GHC.Classes.== "up" -> LineItemPrice'TransformQuantity'Round'EnumUp | GHC.Base.otherwise -> LineItemPrice'TransformQuantity'Round'Other val ) -- | Defines the enum schema located at @components.schemas.line_item.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 LineItemPrice'Type' = -- | This case is used if the value encountered during decoding does not match any of the provided cases in the specification. LineItemPrice'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. LineItemPrice'Type'Typed Data.Text.Internal.Text | -- | Represents the JSON value @"one_time"@ LineItemPrice'Type'EnumOneTime | -- | Represents the JSON value @"recurring"@ LineItemPrice'Type'EnumRecurring deriving (GHC.Show.Show, GHC.Classes.Eq) instance Data.Aeson.Types.ToJSON.ToJSON LineItemPrice'Type' where toJSON (LineItemPrice'Type'Other val) = val toJSON (LineItemPrice'Type'Typed val) = Data.Aeson.Types.ToJSON.toJSON val toJSON (LineItemPrice'Type'EnumOneTime) = "one_time" toJSON (LineItemPrice'Type'EnumRecurring) = "recurring" instance Data.Aeson.Types.FromJSON.FromJSON LineItemPrice'Type' where parseJSON val = GHC.Base.pure ( if | val GHC.Classes.== "one_time" -> LineItemPrice'Type'EnumOneTime | val GHC.Classes.== "recurring" -> LineItemPrice'Type'EnumRecurring | GHC.Base.otherwise -> LineItemPrice'Type'Other val ) -- | Defines the enum schema located at @components.schemas.line_item.properties.type@ in the specification. -- -- A string identifying the type of the source of this line item, either an \`invoiceitem\` or a \`subscription\`. data LineItemType' = -- | This case is used if the value encountered during decoding does not match any of the provided cases in the specification. LineItemType'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. LineItemType'Typed Data.Text.Internal.Text | -- | Represents the JSON value @"invoiceitem"@ LineItemType'EnumInvoiceitem | -- | Represents the JSON value @"subscription"@ LineItemType'EnumSubscription deriving (GHC.Show.Show, GHC.Classes.Eq) instance Data.Aeson.Types.ToJSON.ToJSON LineItemType' where toJSON (LineItemType'Other val) = val toJSON (LineItemType'Typed val) = Data.Aeson.Types.ToJSON.toJSON val toJSON (LineItemType'EnumInvoiceitem) = "invoiceitem" toJSON (LineItemType'EnumSubscription) = "subscription" instance Data.Aeson.Types.FromJSON.FromJSON LineItemType' where parseJSON val = GHC.Base.pure ( if | val GHC.Classes.== "invoiceitem" -> LineItemType'EnumInvoiceitem | val GHC.Classes.== "subscription" -> LineItemType'EnumSubscription | GHC.Base.otherwise -> LineItemType'Other val )