{-# 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 AddOn
module RecurlyClient.Types.AddOn 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
import qualified Data.ByteString as Data.ByteString.Internal
import qualified Data.Foldable
import qualified Data.Functor
import qualified Data.Maybe
import qualified Data.Scientific
import qualified Data.Text
import qualified Data.Text as 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 RecurlyClient.Common
import RecurlyClient.TypeAlias
import {-# SOURCE #-} RecurlyClient.Types.AddOnPricing
import {-# SOURCE #-} RecurlyClient.Types.ItemMini
import {-# SOURCE #-} RecurlyClient.Types.PercentageTiersByCurrency
import {-# SOURCE #-} RecurlyClient.Types.Tier
import qualified Prelude as GHC.Integer.Type
import qualified Prelude as GHC.Maybe

{- | Defines the object schema located at @components.schemas.AddOn@ in the specification.

Full add-on details.
-}
data AddOn = AddOn
    { AddOn -> Maybe Text
addOnAccounting_code :: (GHC.Maybe.Maybe Data.Text.Internal.Text)
    -- ^ accounting_code: Accounting code for invoice line items for this add-on. If no value is provided, it defaults to add-on\'s code.
    --
    -- Constraints:
    --
    -- * Maximum length of 20
    -- * Must match pattern \'\/^[a-z0-9_+-]+\$\/\'
    , AddOn -> Maybe AddOnAdd_on_type
addOnAdd_on_type :: (GHC.Maybe.Maybe AddOnAdd_on_type)
    -- ^ add_on_type: Whether the add-on type is fixed, or usage-based.
    , AddOn -> Maybe Int
addOnAvalara_service_type :: (GHC.Maybe.Maybe GHC.Types.Int)
    -- ^ avalara_service_type: Used by Avalara for Communications taxes. The transaction type in combination with the service type describe how the add-on is taxed. Refer to [the documentation](https:\/\/help.avalara.com\/AvaTax_for_Communications\/Tax_Calculation\/AvaTax_for_Communications_Tax_Engine\/Mapping_Resources\/TM_00115_AFC_Modules_Corresponding_Transaction_Types) for more available t\/s types.
    --
    -- Constraints:
    --
    -- * Minimum  of 0.0
    , AddOn -> Maybe Int
addOnAvalara_transaction_type :: (GHC.Maybe.Maybe GHC.Types.Int)
    -- ^ avalara_transaction_type: Used by Avalara for Communications taxes. The transaction type in combination with the service type describe how the add-on is taxed. Refer to [the documentation](https:\/\/help.avalara.com\/AvaTax_for_Communications\/Tax_Calculation\/AvaTax_for_Communications_Tax_Engine\/Mapping_Resources\/TM_00115_AFC_Modules_Corresponding_Transaction_Types) for more available t\/s types.
    --
    -- Constraints:
    --
    -- * Minimum  of 0.0
    , AddOn -> Text
addOnCode :: Data.Text.Internal.Text
    -- ^ code: The unique identifier for the add-on within its plan.
    --
    -- Constraints:
    --
    -- * Maximum length of 50
    , AddOn -> Maybe JsonDateTime
addOnCreated_at :: (GHC.Maybe.Maybe RecurlyClient.Common.JsonDateTime)
    -- ^ created_at
    , AddOn -> Maybe (NonEmpty AddOnPricing)
addOnCurrencies :: (GHC.Maybe.Maybe (GHC.Base.NonEmpty AddOnPricing))
    -- ^ currencies
    --
    -- Constraints:
    --
    -- * Must have a minimum of 1 items
    , AddOn -> Maybe Int
addOnDefault_quantity :: (GHC.Maybe.Maybe GHC.Types.Int)
    -- ^ default_quantity: Default quantity for the hosted pages.
    , AddOn -> Maybe JsonDateTime
addOnDeleted_at :: (GHC.Maybe.Maybe RecurlyClient.Common.JsonDateTime)
    -- ^ deleted_at
    , AddOn -> Maybe Bool
addOnDisplay_quantity :: (GHC.Maybe.Maybe GHC.Types.Bool)
    -- ^ display_quantity: Determines if the quantity field is displayed on the hosted pages for the add-on.
    , AddOn -> Maybe Text
addOnExternal_sku :: (GHC.Maybe.Maybe Data.Text.Internal.Text)
    -- ^ external_sku: Optional, stock keeping unit to link the item to other inventory systems.
    --
    -- Constraints:
    --
    -- * Maximum length of 50
    , AddOn -> Maybe Text
addOnId :: (GHC.Maybe.Maybe Data.Text.Internal.Text)
    -- ^ id
    --
    -- Constraints:
    --
    -- * Maximum length of 13
    , AddOn -> Maybe ItemMini
addOnItem :: (GHC.Maybe.Maybe ItemMini)
    -- ^ item: Just the important parts.
    , AddOn -> Maybe Text
addOnLiability_gl_account_id :: (GHC.Maybe.Maybe Data.Text.Internal.Text)
    -- ^ liability_gl_account_id: The ID of a general ledger account. General ledger accounts are
    -- only accessible as a part of the Recurly RevRec Standard and
    -- Recurly RevRec Advanced features.
    --
    --
    -- Constraints:
    --
    -- * Maximum length of 13
    , AddOn -> Maybe Text
addOnMeasured_unit_id :: (GHC.Maybe.Maybe Data.Text.Internal.Text)
    -- ^ measured_unit_id: System-generated unique identifier for an measured unit associated with the add-on.
    --
    -- Constraints:
    --
    -- * Maximum length of 13
    , AddOn -> Text
addOnName :: Data.Text.Internal.Text
    -- ^ name: Describes your add-on and will appear in subscribers\' invoices.
    --
    -- Constraints:
    --
    -- * Maximum length of 255
    , AddOn -> Maybe Text
addOnObject :: (GHC.Maybe.Maybe Data.Text.Internal.Text)
    -- ^ object
    , AddOn -> Maybe Bool
addOnOptional :: (GHC.Maybe.Maybe GHC.Types.Bool)
    -- ^ optional: Whether the add-on is optional for the customer to include in their purchase on the hosted payment page. If false, the add-on will be included when a subscription is created through the Recurly UI. However, the add-on will not be included when a subscription is created through the API.
    , AddOn -> Maybe [PercentageTiersByCurrency]
addOnPercentage_tiers :: (GHC.Maybe.Maybe [PercentageTiersByCurrency])
    -- ^ percentage_tiers: This feature is currently in development and requires approval and enablement, please contact support.
    , AddOn -> Maybe Text
addOnPerformance_obligation_id :: (GHC.Maybe.Maybe Data.Text.Internal.Text)
    -- ^ performance_obligation_id: The ID of a performance obligation. Performance obligations are
    -- only accessible as a part of the Recurly RevRec Standard and
    -- Recurly RevRec Advanced features.
    --
    --
    -- Constraints:
    --
    -- * Maximum length of 13
    , AddOn -> Maybe Text
addOnPlan_id :: (GHC.Maybe.Maybe Data.Text.Internal.Text)
    -- ^ plan_id
    --
    -- Constraints:
    --
    -- * Maximum length of 13
    , AddOn -> Maybe Text
addOnRevenue_gl_account_id :: (GHC.Maybe.Maybe Data.Text.Internal.Text)
    -- ^ revenue_gl_account_id: The ID of a general ledger account. General ledger accounts are
    -- only accessible as a part of the Recurly RevRec Standard and
    -- Recurly RevRec Advanced features.
    --
    --
    -- Constraints:
    --
    -- * Maximum length of 13
    , AddOn -> Maybe AddOnRevenue_schedule_type
addOnRevenue_schedule_type :: (GHC.Maybe.Maybe AddOnRevenue_schedule_type)
    -- ^ revenue_schedule_type: When this add-on is invoiced, the line item will use this revenue schedule. If \`item_code\`\/\`item_id\` is part of the request then \`revenue_schedule_type\` must be absent in the request as the value will be set from the item.
    , AddOn -> Maybe AddOnState
addOnState :: (GHC.Maybe.Maybe AddOnState)
    -- ^ state: Add-ons can be either active or inactive.
    , AddOn -> Maybe Text
addOnTax_code :: (GHC.Maybe.Maybe Data.Text.Internal.Text)
    -- ^ tax_code: Optional field used by Avalara, Vertex, and Recurly\'s In-the-Box tax solution to determine taxation rules. You can pass in specific tax codes using any of these tax integrations. For Recurly\'s In-the-Box tax offering you can also choose to instead use simple values of \`unknown\`, \`physical\`, or \`digital\` tax codes. If \`item_code\`\/\`item_id\` is part of the request then \`tax_code\` must be absent.
    --
    -- Constraints:
    --
    -- * Maximum length of 50
    , AddOn -> Maybe AddOnTier_type
addOnTier_type :: (GHC.Maybe.Maybe AddOnTier_type)
    -- ^ tier_type: The pricing model for the add-on.  For more information,
    -- [click here](https:\/\/docs.recurly.com\/docs\/billing-models\#section-quantity-based). See our
    -- [Guide](https:\/\/recurly.com\/developers\/guides\/item-addon-guide.html) for an overview of how
    -- to configure quantity-based pricing models.
    , AddOn -> Maybe [Tier]
addOnTiers :: (GHC.Maybe.Maybe [Tier])
    -- ^ tiers
    , AddOn -> Maybe JsonDateTime
addOnUpdated_at :: (GHC.Maybe.Maybe RecurlyClient.Common.JsonDateTime)
    -- ^ updated_at
    , AddOn -> Maybe AddOnUsage_calculation_type
addOnUsage_calculation_type :: (GHC.Maybe.Maybe AddOnUsage_calculation_type)
    -- ^ usage_calculation_type: The type of calculation to be employed for an add-on.  Cumulative billing will sum all usage records created in the current billing cycle.  Last-in-period billing will apply only the most recent usage record in the billing period.  If no value is specified, cumulative billing will be used.
    , AddOn -> Maybe Float
addOnUsage_percentage :: (GHC.Maybe.Maybe GHC.Types.Float)
    -- ^ usage_percentage: The percentage taken of the monetary amount of usage tracked. This can be up to 4 decimal places. A value between 0.0 and 100.0.
    , AddOn -> Maybe AddOnUsage_timeframe
addOnUsage_timeframe :: (GHC.Maybe.Maybe AddOnUsage_timeframe)
    -- ^ usage_timeframe: The time at which usage totals are reset for billing purposes.
    , AddOn -> Maybe AddOnUsage_type
addOnUsage_type :: (GHC.Maybe.Maybe AddOnUsage_type)
    -- ^ usage_type: Type of usage, returns usage type if \`add_on_type\` is \`usage\`.
    }
    deriving
        ( Int -> AddOn -> ShowS
[AddOn] -> ShowS
AddOn -> String
(Int -> AddOn -> ShowS)
-> (AddOn -> String) -> ([AddOn] -> ShowS) -> Show AddOn
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> AddOn -> ShowS
showsPrec :: Int -> AddOn -> ShowS
$cshow :: AddOn -> String
show :: AddOn -> String
$cshowList :: [AddOn] -> ShowS
showList :: [AddOn] -> ShowS
GHC.Show.Show
        , AddOn -> AddOn -> Bool
(AddOn -> AddOn -> Bool) -> (AddOn -> AddOn -> Bool) -> Eq AddOn
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: AddOn -> AddOn -> Bool
== :: AddOn -> AddOn -> Bool
$c/= :: AddOn -> AddOn -> Bool
/= :: AddOn -> AddOn -> Bool
GHC.Classes.Eq
        )

instance Data.Aeson.Types.ToJSON.ToJSON AddOn where
    toJSON :: AddOn -> Value
toJSON AddOn
obj = [Pair] -> Value
Data.Aeson.Types.Internal.object ([[Pair]] -> [Pair]
forall (t :: * -> *) a. Foldable t => t [a] -> [a]
Data.Foldable.concat ([Pair] -> (Text -> [Pair]) -> Maybe Text -> [Pair]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Pair]
forall a. Monoid a => a
GHC.Base.mempty (Pair -> [Pair]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Pair -> [Pair]) -> (Text -> Pair) -> Text -> [Pair]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"accounting_code" Key -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (AddOn -> Maybe Text
addOnAccounting_code AddOn
obj) [Pair] -> [[Pair]] -> [[Pair]]
forall a. a -> [a] -> [a]
: [Pair]
-> (AddOnAdd_on_type -> [Pair]) -> Maybe AddOnAdd_on_type -> [Pair]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Pair]
forall a. Monoid a => a
GHC.Base.mempty (Pair -> [Pair]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Pair -> [Pair])
-> (AddOnAdd_on_type -> Pair) -> AddOnAdd_on_type -> [Pair]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"add_on_type" Key -> AddOnAdd_on_type -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (AddOn -> Maybe AddOnAdd_on_type
addOnAdd_on_type AddOn
obj) [Pair] -> [[Pair]] -> [[Pair]]
forall a. a -> [a] -> [a]
: [Pair] -> (Int -> [Pair]) -> Maybe Int -> [Pair]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Pair]
forall a. Monoid a => a
GHC.Base.mempty (Pair -> [Pair]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Pair -> [Pair]) -> (Int -> Pair) -> Int -> [Pair]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"avalara_service_type" Key -> Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (AddOn -> Maybe Int
addOnAvalara_service_type AddOn
obj) [Pair] -> [[Pair]] -> [[Pair]]
forall a. a -> [a] -> [a]
: [Pair] -> (Int -> [Pair]) -> Maybe Int -> [Pair]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Pair]
forall a. Monoid a => a
GHC.Base.mempty (Pair -> [Pair]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Pair -> [Pair]) -> (Int -> Pair) -> Int -> [Pair]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"avalara_transaction_type" Key -> Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (AddOn -> Maybe Int
addOnAvalara_transaction_type AddOn
obj) [Pair] -> [[Pair]] -> [[Pair]]
forall a. a -> [a] -> [a]
: [Key
"code" Key -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..= AddOn -> Text
addOnCode AddOn
obj] [Pair] -> [[Pair]] -> [[Pair]]
forall a. a -> [a] -> [a]
: [Pair] -> (JsonDateTime -> [Pair]) -> Maybe JsonDateTime -> [Pair]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Pair]
forall a. Monoid a => a
GHC.Base.mempty (Pair -> [Pair]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Pair -> [Pair])
-> (JsonDateTime -> Pair) -> JsonDateTime -> [Pair]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"created_at" Key -> JsonDateTime -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (AddOn -> Maybe JsonDateTime
addOnCreated_at AddOn
obj) [Pair] -> [[Pair]] -> [[Pair]]
forall a. a -> [a] -> [a]
: [Pair]
-> (NonEmpty AddOnPricing -> [Pair])
-> Maybe (NonEmpty AddOnPricing)
-> [Pair]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Pair]
forall a. Monoid a => a
GHC.Base.mempty (Pair -> [Pair]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Pair -> [Pair])
-> (NonEmpty AddOnPricing -> Pair)
-> NonEmpty AddOnPricing
-> [Pair]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"currencies" Key -> NonEmpty AddOnPricing -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (AddOn -> Maybe (NonEmpty AddOnPricing)
addOnCurrencies AddOn
obj) [Pair] -> [[Pair]] -> [[Pair]]
forall a. a -> [a] -> [a]
: [Pair] -> (Int -> [Pair]) -> Maybe Int -> [Pair]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Pair]
forall a. Monoid a => a
GHC.Base.mempty (Pair -> [Pair]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Pair -> [Pair]) -> (Int -> Pair) -> Int -> [Pair]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"default_quantity" Key -> Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (AddOn -> Maybe Int
addOnDefault_quantity AddOn
obj) [Pair] -> [[Pair]] -> [[Pair]]
forall a. a -> [a] -> [a]
: [Pair] -> (JsonDateTime -> [Pair]) -> Maybe JsonDateTime -> [Pair]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Pair]
forall a. Monoid a => a
GHC.Base.mempty (Pair -> [Pair]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Pair -> [Pair])
-> (JsonDateTime -> Pair) -> JsonDateTime -> [Pair]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"deleted_at" Key -> JsonDateTime -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (AddOn -> Maybe JsonDateTime
addOnDeleted_at AddOn
obj) [Pair] -> [[Pair]] -> [[Pair]]
forall a. a -> [a] -> [a]
: [Pair] -> (Bool -> [Pair]) -> Maybe Bool -> [Pair]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Pair]
forall a. Monoid a => a
GHC.Base.mempty (Pair -> [Pair]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Pair -> [Pair]) -> (Bool -> Pair) -> Bool -> [Pair]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"display_quantity" Key -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (AddOn -> Maybe Bool
addOnDisplay_quantity AddOn
obj) [Pair] -> [[Pair]] -> [[Pair]]
forall a. a -> [a] -> [a]
: [Pair] -> (Text -> [Pair]) -> Maybe Text -> [Pair]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Pair]
forall a. Monoid a => a
GHC.Base.mempty (Pair -> [Pair]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Pair -> [Pair]) -> (Text -> Pair) -> Text -> [Pair]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"external_sku" Key -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (AddOn -> Maybe Text
addOnExternal_sku AddOn
obj) [Pair] -> [[Pair]] -> [[Pair]]
forall a. a -> [a] -> [a]
: [Pair] -> (Text -> [Pair]) -> Maybe Text -> [Pair]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Pair]
forall a. Monoid a => a
GHC.Base.mempty (Pair -> [Pair]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Pair -> [Pair]) -> (Text -> Pair) -> Text -> [Pair]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"id" Key -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (AddOn -> Maybe Text
addOnId AddOn
obj) [Pair] -> [[Pair]] -> [[Pair]]
forall a. a -> [a] -> [a]
: [Pair] -> (ItemMini -> [Pair]) -> Maybe ItemMini -> [Pair]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Pair]
forall a. Monoid a => a
GHC.Base.mempty (Pair -> [Pair]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Pair -> [Pair]) -> (ItemMini -> Pair) -> ItemMini -> [Pair]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"item" Key -> ItemMini -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (AddOn -> Maybe ItemMini
addOnItem AddOn
obj) [Pair] -> [[Pair]] -> [[Pair]]
forall a. a -> [a] -> [a]
: [Pair] -> (Text -> [Pair]) -> Maybe Text -> [Pair]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Pair]
forall a. Monoid a => a
GHC.Base.mempty (Pair -> [Pair]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Pair -> [Pair]) -> (Text -> Pair) -> Text -> [Pair]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"liability_gl_account_id" Key -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (AddOn -> Maybe Text
addOnLiability_gl_account_id AddOn
obj) [Pair] -> [[Pair]] -> [[Pair]]
forall a. a -> [a] -> [a]
: [Pair] -> (Text -> [Pair]) -> Maybe Text -> [Pair]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Pair]
forall a. Monoid a => a
GHC.Base.mempty (Pair -> [Pair]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Pair -> [Pair]) -> (Text -> Pair) -> Text -> [Pair]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"measured_unit_id" Key -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (AddOn -> Maybe Text
addOnMeasured_unit_id AddOn
obj) [Pair] -> [[Pair]] -> [[Pair]]
forall a. a -> [a] -> [a]
: [Key
"name" Key -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..= AddOn -> Text
addOnName AddOn
obj] [Pair] -> [[Pair]] -> [[Pair]]
forall a. a -> [a] -> [a]
: [Pair] -> (Text -> [Pair]) -> Maybe Text -> [Pair]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Pair]
forall a. Monoid a => a
GHC.Base.mempty (Pair -> [Pair]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Pair -> [Pair]) -> (Text -> Pair) -> Text -> [Pair]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"object" Key -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (AddOn -> Maybe Text
addOnObject AddOn
obj) [Pair] -> [[Pair]] -> [[Pair]]
forall a. a -> [a] -> [a]
: [Pair] -> (Bool -> [Pair]) -> Maybe Bool -> [Pair]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Pair]
forall a. Monoid a => a
GHC.Base.mempty (Pair -> [Pair]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Pair -> [Pair]) -> (Bool -> Pair) -> Bool -> [Pair]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"optional" Key -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (AddOn -> Maybe Bool
addOnOptional AddOn
obj) [Pair] -> [[Pair]] -> [[Pair]]
forall a. a -> [a] -> [a]
: [Pair]
-> ([PercentageTiersByCurrency] -> [Pair])
-> Maybe [PercentageTiersByCurrency]
-> [Pair]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Pair]
forall a. Monoid a => a
GHC.Base.mempty (Pair -> [Pair]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Pair -> [Pair])
-> ([PercentageTiersByCurrency] -> Pair)
-> [PercentageTiersByCurrency]
-> [Pair]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"percentage_tiers" Key -> [PercentageTiersByCurrency] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (AddOn -> Maybe [PercentageTiersByCurrency]
addOnPercentage_tiers AddOn
obj) [Pair] -> [[Pair]] -> [[Pair]]
forall a. a -> [a] -> [a]
: [Pair] -> (Text -> [Pair]) -> Maybe Text -> [Pair]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Pair]
forall a. Monoid a => a
GHC.Base.mempty (Pair -> [Pair]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Pair -> [Pair]) -> (Text -> Pair) -> Text -> [Pair]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"performance_obligation_id" Key -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (AddOn -> Maybe Text
addOnPerformance_obligation_id AddOn
obj) [Pair] -> [[Pair]] -> [[Pair]]
forall a. a -> [a] -> [a]
: [Pair] -> (Text -> [Pair]) -> Maybe Text -> [Pair]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Pair]
forall a. Monoid a => a
GHC.Base.mempty (Pair -> [Pair]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Pair -> [Pair]) -> (Text -> Pair) -> Text -> [Pair]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"plan_id" Key -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (AddOn -> Maybe Text
addOnPlan_id AddOn
obj) [Pair] -> [[Pair]] -> [[Pair]]
forall a. a -> [a] -> [a]
: [Pair] -> (Text -> [Pair]) -> Maybe Text -> [Pair]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Pair]
forall a. Monoid a => a
GHC.Base.mempty (Pair -> [Pair]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Pair -> [Pair]) -> (Text -> Pair) -> Text -> [Pair]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"revenue_gl_account_id" Key -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (AddOn -> Maybe Text
addOnRevenue_gl_account_id AddOn
obj) [Pair] -> [[Pair]] -> [[Pair]]
forall a. a -> [a] -> [a]
: [Pair]
-> (AddOnRevenue_schedule_type -> [Pair])
-> Maybe AddOnRevenue_schedule_type
-> [Pair]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Pair]
forall a. Monoid a => a
GHC.Base.mempty (Pair -> [Pair]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Pair -> [Pair])
-> (AddOnRevenue_schedule_type -> Pair)
-> AddOnRevenue_schedule_type
-> [Pair]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"revenue_schedule_type" Key -> AddOnRevenue_schedule_type -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (AddOn -> Maybe AddOnRevenue_schedule_type
addOnRevenue_schedule_type AddOn
obj) [Pair] -> [[Pair]] -> [[Pair]]
forall a. a -> [a] -> [a]
: [Pair] -> (AddOnState -> [Pair]) -> Maybe AddOnState -> [Pair]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Pair]
forall a. Monoid a => a
GHC.Base.mempty (Pair -> [Pair]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Pair -> [Pair]) -> (AddOnState -> Pair) -> AddOnState -> [Pair]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"state" Key -> AddOnState -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (AddOn -> Maybe AddOnState
addOnState AddOn
obj) [Pair] -> [[Pair]] -> [[Pair]]
forall a. a -> [a] -> [a]
: [Pair] -> (Text -> [Pair]) -> Maybe Text -> [Pair]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Pair]
forall a. Monoid a => a
GHC.Base.mempty (Pair -> [Pair]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Pair -> [Pair]) -> (Text -> Pair) -> Text -> [Pair]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"tax_code" Key -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (AddOn -> Maybe Text
addOnTax_code AddOn
obj) [Pair] -> [[Pair]] -> [[Pair]]
forall a. a -> [a] -> [a]
: [Pair]
-> (AddOnTier_type -> [Pair]) -> Maybe AddOnTier_type -> [Pair]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Pair]
forall a. Monoid a => a
GHC.Base.mempty (Pair -> [Pair]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Pair -> [Pair])
-> (AddOnTier_type -> Pair) -> AddOnTier_type -> [Pair]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"tier_type" Key -> AddOnTier_type -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (AddOn -> Maybe AddOnTier_type
addOnTier_type AddOn
obj) [Pair] -> [[Pair]] -> [[Pair]]
forall a. a -> [a] -> [a]
: [Pair] -> ([Tier] -> [Pair]) -> Maybe [Tier] -> [Pair]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Pair]
forall a. Monoid a => a
GHC.Base.mempty (Pair -> [Pair]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Pair -> [Pair]) -> ([Tier] -> Pair) -> [Tier] -> [Pair]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"tiers" Key -> [Tier] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (AddOn -> Maybe [Tier]
addOnTiers AddOn
obj) [Pair] -> [[Pair]] -> [[Pair]]
forall a. a -> [a] -> [a]
: [Pair] -> (JsonDateTime -> [Pair]) -> Maybe JsonDateTime -> [Pair]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Pair]
forall a. Monoid a => a
GHC.Base.mempty (Pair -> [Pair]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Pair -> [Pair])
-> (JsonDateTime -> Pair) -> JsonDateTime -> [Pair]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"updated_at" Key -> JsonDateTime -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (AddOn -> Maybe JsonDateTime
addOnUpdated_at AddOn
obj) [Pair] -> [[Pair]] -> [[Pair]]
forall a. a -> [a] -> [a]
: [Pair]
-> (AddOnUsage_calculation_type -> [Pair])
-> Maybe AddOnUsage_calculation_type
-> [Pair]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Pair]
forall a. Monoid a => a
GHC.Base.mempty (Pair -> [Pair]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Pair -> [Pair])
-> (AddOnUsage_calculation_type -> Pair)
-> AddOnUsage_calculation_type
-> [Pair]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"usage_calculation_type" Key -> AddOnUsage_calculation_type -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (AddOn -> Maybe AddOnUsage_calculation_type
addOnUsage_calculation_type AddOn
obj) [Pair] -> [[Pair]] -> [[Pair]]
forall a. a -> [a] -> [a]
: [Pair] -> (Float -> [Pair]) -> Maybe Float -> [Pair]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Pair]
forall a. Monoid a => a
GHC.Base.mempty (Pair -> [Pair]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Pair -> [Pair]) -> (Float -> Pair) -> Float -> [Pair]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"usage_percentage" Key -> Float -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (AddOn -> Maybe Float
addOnUsage_percentage AddOn
obj) [Pair] -> [[Pair]] -> [[Pair]]
forall a. a -> [a] -> [a]
: [Pair]
-> (AddOnUsage_timeframe -> [Pair])
-> Maybe AddOnUsage_timeframe
-> [Pair]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Pair]
forall a. Monoid a => a
GHC.Base.mempty (Pair -> [Pair]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Pair -> [Pair])
-> (AddOnUsage_timeframe -> Pair) -> AddOnUsage_timeframe -> [Pair]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"usage_timeframe" Key -> AddOnUsage_timeframe -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (AddOn -> Maybe AddOnUsage_timeframe
addOnUsage_timeframe AddOn
obj) [Pair] -> [[Pair]] -> [[Pair]]
forall a. a -> [a] -> [a]
: [Pair]
-> (AddOnUsage_type -> [Pair]) -> Maybe AddOnUsage_type -> [Pair]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Pair]
forall a. Monoid a => a
GHC.Base.mempty (Pair -> [Pair]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Pair -> [Pair])
-> (AddOnUsage_type -> Pair) -> AddOnUsage_type -> [Pair]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"usage_type" Key -> AddOnUsage_type -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (AddOn -> Maybe AddOnUsage_type
addOnUsage_type AddOn
obj) [Pair] -> [[Pair]] -> [[Pair]]
forall a. a -> [a] -> [a]
: [[Pair]]
forall a. Monoid a => a
GHC.Base.mempty))
    toEncoding :: AddOn -> Encoding
toEncoding AddOn
obj = Series -> Encoding
Data.Aeson.Encoding.Internal.pairs ([Series] -> Series
forall a. Monoid a => [a] -> a
GHC.Base.mconcat ([[Series]] -> [Series]
forall (t :: * -> *) a. Foldable t => t [a] -> [a]
Data.Foldable.concat ([Series] -> (Text -> [Series]) -> Maybe Text -> [Series]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Series]
forall a. Monoid a => a
GHC.Base.mempty (Series -> [Series]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Series -> [Series]) -> (Text -> Series) -> Text -> [Series]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"accounting_code" Key -> Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (AddOn -> Maybe Text
addOnAccounting_code AddOn
obj) [Series] -> [[Series]] -> [[Series]]
forall a. a -> [a] -> [a]
: [Series]
-> (AddOnAdd_on_type -> [Series])
-> Maybe AddOnAdd_on_type
-> [Series]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Series]
forall a. Monoid a => a
GHC.Base.mempty (Series -> [Series]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Series -> [Series])
-> (AddOnAdd_on_type -> Series) -> AddOnAdd_on_type -> [Series]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"add_on_type" Key -> AddOnAdd_on_type -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (AddOn -> Maybe AddOnAdd_on_type
addOnAdd_on_type AddOn
obj) [Series] -> [[Series]] -> [[Series]]
forall a. a -> [a] -> [a]
: [Series] -> (Int -> [Series]) -> Maybe Int -> [Series]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Series]
forall a. Monoid a => a
GHC.Base.mempty (Series -> [Series]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Series -> [Series]) -> (Int -> Series) -> Int -> [Series]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"avalara_service_type" Key -> Int -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (AddOn -> Maybe Int
addOnAvalara_service_type AddOn
obj) [Series] -> [[Series]] -> [[Series]]
forall a. a -> [a] -> [a]
: [Series] -> (Int -> [Series]) -> Maybe Int -> [Series]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Series]
forall a. Monoid a => a
GHC.Base.mempty (Series -> [Series]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Series -> [Series]) -> (Int -> Series) -> Int -> [Series]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"avalara_transaction_type" Key -> Int -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (AddOn -> Maybe Int
addOnAvalara_transaction_type AddOn
obj) [Series] -> [[Series]] -> [[Series]]
forall a. a -> [a] -> [a]
: [Key
"code" Key -> Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..= AddOn -> Text
addOnCode AddOn
obj] [Series] -> [[Series]] -> [[Series]]
forall a. a -> [a] -> [a]
: [Series]
-> (JsonDateTime -> [Series]) -> Maybe JsonDateTime -> [Series]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Series]
forall a. Monoid a => a
GHC.Base.mempty (Series -> [Series]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Series -> [Series])
-> (JsonDateTime -> Series) -> JsonDateTime -> [Series]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"created_at" Key -> JsonDateTime -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (AddOn -> Maybe JsonDateTime
addOnCreated_at AddOn
obj) [Series] -> [[Series]] -> [[Series]]
forall a. a -> [a] -> [a]
: [Series]
-> (NonEmpty AddOnPricing -> [Series])
-> Maybe (NonEmpty AddOnPricing)
-> [Series]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Series]
forall a. Monoid a => a
GHC.Base.mempty (Series -> [Series]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Series -> [Series])
-> (NonEmpty AddOnPricing -> Series)
-> NonEmpty AddOnPricing
-> [Series]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"currencies" Key -> NonEmpty AddOnPricing -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (AddOn -> Maybe (NonEmpty AddOnPricing)
addOnCurrencies AddOn
obj) [Series] -> [[Series]] -> [[Series]]
forall a. a -> [a] -> [a]
: [Series] -> (Int -> [Series]) -> Maybe Int -> [Series]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Series]
forall a. Monoid a => a
GHC.Base.mempty (Series -> [Series]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Series -> [Series]) -> (Int -> Series) -> Int -> [Series]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"default_quantity" Key -> Int -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (AddOn -> Maybe Int
addOnDefault_quantity AddOn
obj) [Series] -> [[Series]] -> [[Series]]
forall a. a -> [a] -> [a]
: [Series]
-> (JsonDateTime -> [Series]) -> Maybe JsonDateTime -> [Series]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Series]
forall a. Monoid a => a
GHC.Base.mempty (Series -> [Series]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Series -> [Series])
-> (JsonDateTime -> Series) -> JsonDateTime -> [Series]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"deleted_at" Key -> JsonDateTime -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (AddOn -> Maybe JsonDateTime
addOnDeleted_at AddOn
obj) [Series] -> [[Series]] -> [[Series]]
forall a. a -> [a] -> [a]
: [Series] -> (Bool -> [Series]) -> Maybe Bool -> [Series]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Series]
forall a. Monoid a => a
GHC.Base.mempty (Series -> [Series]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Series -> [Series]) -> (Bool -> Series) -> Bool -> [Series]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"display_quantity" Key -> Bool -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (AddOn -> Maybe Bool
addOnDisplay_quantity AddOn
obj) [Series] -> [[Series]] -> [[Series]]
forall a. a -> [a] -> [a]
: [Series] -> (Text -> [Series]) -> Maybe Text -> [Series]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Series]
forall a. Monoid a => a
GHC.Base.mempty (Series -> [Series]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Series -> [Series]) -> (Text -> Series) -> Text -> [Series]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"external_sku" Key -> Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (AddOn -> Maybe Text
addOnExternal_sku AddOn
obj) [Series] -> [[Series]] -> [[Series]]
forall a. a -> [a] -> [a]
: [Series] -> (Text -> [Series]) -> Maybe Text -> [Series]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Series]
forall a. Monoid a => a
GHC.Base.mempty (Series -> [Series]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Series -> [Series]) -> (Text -> Series) -> Text -> [Series]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"id" Key -> Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (AddOn -> Maybe Text
addOnId AddOn
obj) [Series] -> [[Series]] -> [[Series]]
forall a. a -> [a] -> [a]
: [Series] -> (ItemMini -> [Series]) -> Maybe ItemMini -> [Series]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Series]
forall a. Monoid a => a
GHC.Base.mempty (Series -> [Series]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Series -> [Series])
-> (ItemMini -> Series) -> ItemMini -> [Series]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"item" Key -> ItemMini -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (AddOn -> Maybe ItemMini
addOnItem AddOn
obj) [Series] -> [[Series]] -> [[Series]]
forall a. a -> [a] -> [a]
: [Series] -> (Text -> [Series]) -> Maybe Text -> [Series]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Series]
forall a. Monoid a => a
GHC.Base.mempty (Series -> [Series]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Series -> [Series]) -> (Text -> Series) -> Text -> [Series]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"liability_gl_account_id" Key -> Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (AddOn -> Maybe Text
addOnLiability_gl_account_id AddOn
obj) [Series] -> [[Series]] -> [[Series]]
forall a. a -> [a] -> [a]
: [Series] -> (Text -> [Series]) -> Maybe Text -> [Series]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Series]
forall a. Monoid a => a
GHC.Base.mempty (Series -> [Series]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Series -> [Series]) -> (Text -> Series) -> Text -> [Series]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"measured_unit_id" Key -> Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (AddOn -> Maybe Text
addOnMeasured_unit_id AddOn
obj) [Series] -> [[Series]] -> [[Series]]
forall a. a -> [a] -> [a]
: [Key
"name" Key -> Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..= AddOn -> Text
addOnName AddOn
obj] [Series] -> [[Series]] -> [[Series]]
forall a. a -> [a] -> [a]
: [Series] -> (Text -> [Series]) -> Maybe Text -> [Series]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Series]
forall a. Monoid a => a
GHC.Base.mempty (Series -> [Series]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Series -> [Series]) -> (Text -> Series) -> Text -> [Series]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"object" Key -> Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (AddOn -> Maybe Text
addOnObject AddOn
obj) [Series] -> [[Series]] -> [[Series]]
forall a. a -> [a] -> [a]
: [Series] -> (Bool -> [Series]) -> Maybe Bool -> [Series]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Series]
forall a. Monoid a => a
GHC.Base.mempty (Series -> [Series]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Series -> [Series]) -> (Bool -> Series) -> Bool -> [Series]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"optional" Key -> Bool -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (AddOn -> Maybe Bool
addOnOptional AddOn
obj) [Series] -> [[Series]] -> [[Series]]
forall a. a -> [a] -> [a]
: [Series]
-> ([PercentageTiersByCurrency] -> [Series])
-> Maybe [PercentageTiersByCurrency]
-> [Series]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Series]
forall a. Monoid a => a
GHC.Base.mempty (Series -> [Series]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Series -> [Series])
-> ([PercentageTiersByCurrency] -> Series)
-> [PercentageTiersByCurrency]
-> [Series]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"percentage_tiers" Key -> [PercentageTiersByCurrency] -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (AddOn -> Maybe [PercentageTiersByCurrency]
addOnPercentage_tiers AddOn
obj) [Series] -> [[Series]] -> [[Series]]
forall a. a -> [a] -> [a]
: [Series] -> (Text -> [Series]) -> Maybe Text -> [Series]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Series]
forall a. Monoid a => a
GHC.Base.mempty (Series -> [Series]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Series -> [Series]) -> (Text -> Series) -> Text -> [Series]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"performance_obligation_id" Key -> Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (AddOn -> Maybe Text
addOnPerformance_obligation_id AddOn
obj) [Series] -> [[Series]] -> [[Series]]
forall a. a -> [a] -> [a]
: [Series] -> (Text -> [Series]) -> Maybe Text -> [Series]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Series]
forall a. Monoid a => a
GHC.Base.mempty (Series -> [Series]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Series -> [Series]) -> (Text -> Series) -> Text -> [Series]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"plan_id" Key -> Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (AddOn -> Maybe Text
addOnPlan_id AddOn
obj) [Series] -> [[Series]] -> [[Series]]
forall a. a -> [a] -> [a]
: [Series] -> (Text -> [Series]) -> Maybe Text -> [Series]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Series]
forall a. Monoid a => a
GHC.Base.mempty (Series -> [Series]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Series -> [Series]) -> (Text -> Series) -> Text -> [Series]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"revenue_gl_account_id" Key -> Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (AddOn -> Maybe Text
addOnRevenue_gl_account_id AddOn
obj) [Series] -> [[Series]] -> [[Series]]
forall a. a -> [a] -> [a]
: [Series]
-> (AddOnRevenue_schedule_type -> [Series])
-> Maybe AddOnRevenue_schedule_type
-> [Series]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Series]
forall a. Monoid a => a
GHC.Base.mempty (Series -> [Series]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Series -> [Series])
-> (AddOnRevenue_schedule_type -> Series)
-> AddOnRevenue_schedule_type
-> [Series]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"revenue_schedule_type" Key -> AddOnRevenue_schedule_type -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (AddOn -> Maybe AddOnRevenue_schedule_type
addOnRevenue_schedule_type AddOn
obj) [Series] -> [[Series]] -> [[Series]]
forall a. a -> [a] -> [a]
: [Series]
-> (AddOnState -> [Series]) -> Maybe AddOnState -> [Series]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Series]
forall a. Monoid a => a
GHC.Base.mempty (Series -> [Series]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Series -> [Series])
-> (AddOnState -> Series) -> AddOnState -> [Series]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"state" Key -> AddOnState -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (AddOn -> Maybe AddOnState
addOnState AddOn
obj) [Series] -> [[Series]] -> [[Series]]
forall a. a -> [a] -> [a]
: [Series] -> (Text -> [Series]) -> Maybe Text -> [Series]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Series]
forall a. Monoid a => a
GHC.Base.mempty (Series -> [Series]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Series -> [Series]) -> (Text -> Series) -> Text -> [Series]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"tax_code" Key -> Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (AddOn -> Maybe Text
addOnTax_code AddOn
obj) [Series] -> [[Series]] -> [[Series]]
forall a. a -> [a] -> [a]
: [Series]
-> (AddOnTier_type -> [Series]) -> Maybe AddOnTier_type -> [Series]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Series]
forall a. Monoid a => a
GHC.Base.mempty (Series -> [Series]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Series -> [Series])
-> (AddOnTier_type -> Series) -> AddOnTier_type -> [Series]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"tier_type" Key -> AddOnTier_type -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (AddOn -> Maybe AddOnTier_type
addOnTier_type AddOn
obj) [Series] -> [[Series]] -> [[Series]]
forall a. a -> [a] -> [a]
: [Series] -> ([Tier] -> [Series]) -> Maybe [Tier] -> [Series]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Series]
forall a. Monoid a => a
GHC.Base.mempty (Series -> [Series]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Series -> [Series]) -> ([Tier] -> Series) -> [Tier] -> [Series]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"tiers" Key -> [Tier] -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (AddOn -> Maybe [Tier]
addOnTiers AddOn
obj) [Series] -> [[Series]] -> [[Series]]
forall a. a -> [a] -> [a]
: [Series]
-> (JsonDateTime -> [Series]) -> Maybe JsonDateTime -> [Series]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Series]
forall a. Monoid a => a
GHC.Base.mempty (Series -> [Series]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Series -> [Series])
-> (JsonDateTime -> Series) -> JsonDateTime -> [Series]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"updated_at" Key -> JsonDateTime -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (AddOn -> Maybe JsonDateTime
addOnUpdated_at AddOn
obj) [Series] -> [[Series]] -> [[Series]]
forall a. a -> [a] -> [a]
: [Series]
-> (AddOnUsage_calculation_type -> [Series])
-> Maybe AddOnUsage_calculation_type
-> [Series]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Series]
forall a. Monoid a => a
GHC.Base.mempty (Series -> [Series]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Series -> [Series])
-> (AddOnUsage_calculation_type -> Series)
-> AddOnUsage_calculation_type
-> [Series]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"usage_calculation_type" Key -> AddOnUsage_calculation_type -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (AddOn -> Maybe AddOnUsage_calculation_type
addOnUsage_calculation_type AddOn
obj) [Series] -> [[Series]] -> [[Series]]
forall a. a -> [a] -> [a]
: [Series] -> (Float -> [Series]) -> Maybe Float -> [Series]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Series]
forall a. Monoid a => a
GHC.Base.mempty (Series -> [Series]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Series -> [Series]) -> (Float -> Series) -> Float -> [Series]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"usage_percentage" Key -> Float -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (AddOn -> Maybe Float
addOnUsage_percentage AddOn
obj) [Series] -> [[Series]] -> [[Series]]
forall a. a -> [a] -> [a]
: [Series]
-> (AddOnUsage_timeframe -> [Series])
-> Maybe AddOnUsage_timeframe
-> [Series]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Series]
forall a. Monoid a => a
GHC.Base.mempty (Series -> [Series]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Series -> [Series])
-> (AddOnUsage_timeframe -> Series)
-> AddOnUsage_timeframe
-> [Series]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"usage_timeframe" Key -> AddOnUsage_timeframe -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (AddOn -> Maybe AddOnUsage_timeframe
addOnUsage_timeframe AddOn
obj) [Series] -> [[Series]] -> [[Series]]
forall a. a -> [a] -> [a]
: [Series]
-> (AddOnUsage_type -> [Series])
-> Maybe AddOnUsage_type
-> [Series]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Series]
forall a. Monoid a => a
GHC.Base.mempty (Series -> [Series]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Series -> [Series])
-> (AddOnUsage_type -> Series) -> AddOnUsage_type -> [Series]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"usage_type" Key -> AddOnUsage_type -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (AddOn -> Maybe AddOnUsage_type
addOnUsage_type AddOn
obj) [Series] -> [[Series]] -> [[Series]]
forall a. a -> [a] -> [a]
: [[Series]]
forall a. Monoid a => a
GHC.Base.mempty)))
instance Data.Aeson.Types.FromJSON.FromJSON AddOn where
    parseJSON :: Value -> Parser AddOn
parseJSON = String -> (Object -> Parser AddOn) -> Value -> Parser AddOn
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.Aeson.Types.FromJSON.withObject String
"AddOn" (\Object
obj -> ((((((((((((((((((((((((((((((((Maybe Text
 -> Maybe AddOnAdd_on_type
 -> Maybe Int
 -> Maybe Int
 -> Text
 -> Maybe JsonDateTime
 -> Maybe (NonEmpty AddOnPricing)
 -> Maybe Int
 -> Maybe JsonDateTime
 -> Maybe Bool
 -> Maybe Text
 -> Maybe Text
 -> Maybe ItemMini
 -> Maybe Text
 -> Maybe Text
 -> Text
 -> Maybe Text
 -> Maybe Bool
 -> Maybe [PercentageTiersByCurrency]
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe AddOnRevenue_schedule_type
 -> Maybe AddOnState
 -> Maybe Text
 -> Maybe AddOnTier_type
 -> Maybe [Tier]
 -> Maybe JsonDateTime
 -> Maybe AddOnUsage_calculation_type
 -> Maybe Float
 -> Maybe AddOnUsage_timeframe
 -> Maybe AddOnUsage_type
 -> AddOn)
-> Parser
     (Maybe Text
      -> Maybe AddOnAdd_on_type
      -> Maybe Int
      -> Maybe Int
      -> Text
      -> Maybe JsonDateTime
      -> Maybe (NonEmpty AddOnPricing)
      -> Maybe Int
      -> Maybe JsonDateTime
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Text
      -> Maybe ItemMini
      -> Maybe Text
      -> Maybe Text
      -> Text
      -> Maybe Text
      -> Maybe Bool
      -> Maybe [PercentageTiersByCurrency]
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe AddOnRevenue_schedule_type
      -> Maybe AddOnState
      -> Maybe Text
      -> Maybe AddOnTier_type
      -> Maybe [Tier]
      -> Maybe JsonDateTime
      -> Maybe AddOnUsage_calculation_type
      -> Maybe Float
      -> Maybe AddOnUsage_timeframe
      -> Maybe AddOnUsage_type
      -> AddOn)
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure Maybe Text
-> Maybe AddOnAdd_on_type
-> Maybe Int
-> Maybe Int
-> Text
-> Maybe JsonDateTime
-> Maybe (NonEmpty AddOnPricing)
-> Maybe Int
-> Maybe JsonDateTime
-> Maybe Bool
-> Maybe Text
-> Maybe Text
-> Maybe ItemMini
-> Maybe Text
-> Maybe Text
-> Text
-> Maybe Text
-> Maybe Bool
-> Maybe [PercentageTiersByCurrency]
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe AddOnRevenue_schedule_type
-> Maybe AddOnState
-> Maybe Text
-> Maybe AddOnTier_type
-> Maybe [Tier]
-> Maybe JsonDateTime
-> Maybe AddOnUsage_calculation_type
-> Maybe Float
-> Maybe AddOnUsage_timeframe
-> Maybe AddOnUsage_type
-> AddOn
AddOn Parser
  (Maybe Text
   -> Maybe AddOnAdd_on_type
   -> Maybe Int
   -> Maybe Int
   -> Text
   -> Maybe JsonDateTime
   -> Maybe (NonEmpty AddOnPricing)
   -> Maybe Int
   -> Maybe JsonDateTime
   -> Maybe Bool
   -> Maybe Text
   -> Maybe Text
   -> Maybe ItemMini
   -> Maybe Text
   -> Maybe Text
   -> Text
   -> Maybe Text
   -> Maybe Bool
   -> Maybe [PercentageTiersByCurrency]
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe AddOnRevenue_schedule_type
   -> Maybe AddOnState
   -> Maybe Text
   -> Maybe AddOnTier_type
   -> Maybe [Tier]
   -> Maybe JsonDateTime
   -> Maybe AddOnUsage_calculation_type
   -> Maybe Float
   -> Maybe AddOnUsage_timeframe
   -> Maybe AddOnUsage_type
   -> AddOn)
-> Parser (Maybe Text)
-> Parser
     (Maybe AddOnAdd_on_type
      -> Maybe Int
      -> Maybe Int
      -> Text
      -> Maybe JsonDateTime
      -> Maybe (NonEmpty AddOnPricing)
      -> Maybe Int
      -> Maybe JsonDateTime
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Text
      -> Maybe ItemMini
      -> Maybe Text
      -> Maybe Text
      -> Text
      -> Maybe Text
      -> Maybe Bool
      -> Maybe [PercentageTiersByCurrency]
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe AddOnRevenue_schedule_type
      -> Maybe AddOnState
      -> Maybe Text
      -> Maybe AddOnTier_type
      -> Maybe [Tier]
      -> Maybe JsonDateTime
      -> Maybe AddOnUsage_calculation_type
      -> Maybe Float
      -> Maybe AddOnUsage_timeframe
      -> Maybe AddOnUsage_type
      -> AddOn)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Key
"accounting_code")) Parser
  (Maybe AddOnAdd_on_type
   -> Maybe Int
   -> Maybe Int
   -> Text
   -> Maybe JsonDateTime
   -> Maybe (NonEmpty AddOnPricing)
   -> Maybe Int
   -> Maybe JsonDateTime
   -> Maybe Bool
   -> Maybe Text
   -> Maybe Text
   -> Maybe ItemMini
   -> Maybe Text
   -> Maybe Text
   -> Text
   -> Maybe Text
   -> Maybe Bool
   -> Maybe [PercentageTiersByCurrency]
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe AddOnRevenue_schedule_type
   -> Maybe AddOnState
   -> Maybe Text
   -> Maybe AddOnTier_type
   -> Maybe [Tier]
   -> Maybe JsonDateTime
   -> Maybe AddOnUsage_calculation_type
   -> Maybe Float
   -> Maybe AddOnUsage_timeframe
   -> Maybe AddOnUsage_type
   -> AddOn)
-> Parser (Maybe AddOnAdd_on_type)
-> Parser
     (Maybe Int
      -> Maybe Int
      -> Text
      -> Maybe JsonDateTime
      -> Maybe (NonEmpty AddOnPricing)
      -> Maybe Int
      -> Maybe JsonDateTime
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Text
      -> Maybe ItemMini
      -> Maybe Text
      -> Maybe Text
      -> Text
      -> Maybe Text
      -> Maybe Bool
      -> Maybe [PercentageTiersByCurrency]
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe AddOnRevenue_schedule_type
      -> Maybe AddOnState
      -> Maybe Text
      -> Maybe AddOnTier_type
      -> Maybe [Tier]
      -> Maybe JsonDateTime
      -> Maybe AddOnUsage_calculation_type
      -> Maybe Float
      -> Maybe AddOnUsage_timeframe
      -> Maybe AddOnUsage_type
      -> AddOn)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Key -> Parser (Maybe AddOnAdd_on_type)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Key
"add_on_type")) Parser
  (Maybe Int
   -> Maybe Int
   -> Text
   -> Maybe JsonDateTime
   -> Maybe (NonEmpty AddOnPricing)
   -> Maybe Int
   -> Maybe JsonDateTime
   -> Maybe Bool
   -> Maybe Text
   -> Maybe Text
   -> Maybe ItemMini
   -> Maybe Text
   -> Maybe Text
   -> Text
   -> Maybe Text
   -> Maybe Bool
   -> Maybe [PercentageTiersByCurrency]
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe AddOnRevenue_schedule_type
   -> Maybe AddOnState
   -> Maybe Text
   -> Maybe AddOnTier_type
   -> Maybe [Tier]
   -> Maybe JsonDateTime
   -> Maybe AddOnUsage_calculation_type
   -> Maybe Float
   -> Maybe AddOnUsage_timeframe
   -> Maybe AddOnUsage_type
   -> AddOn)
-> Parser (Maybe Int)
-> Parser
     (Maybe Int
      -> Text
      -> Maybe JsonDateTime
      -> Maybe (NonEmpty AddOnPricing)
      -> Maybe Int
      -> Maybe JsonDateTime
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Text
      -> Maybe ItemMini
      -> Maybe Text
      -> Maybe Text
      -> Text
      -> Maybe Text
      -> Maybe Bool
      -> Maybe [PercentageTiersByCurrency]
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe AddOnRevenue_schedule_type
      -> Maybe AddOnState
      -> Maybe Text
      -> Maybe AddOnTier_type
      -> Maybe [Tier]
      -> Maybe JsonDateTime
      -> Maybe AddOnUsage_calculation_type
      -> Maybe Float
      -> Maybe AddOnUsage_timeframe
      -> Maybe AddOnUsage_type
      -> AddOn)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Key
"avalara_service_type")) Parser
  (Maybe Int
   -> Text
   -> Maybe JsonDateTime
   -> Maybe (NonEmpty AddOnPricing)
   -> Maybe Int
   -> Maybe JsonDateTime
   -> Maybe Bool
   -> Maybe Text
   -> Maybe Text
   -> Maybe ItemMini
   -> Maybe Text
   -> Maybe Text
   -> Text
   -> Maybe Text
   -> Maybe Bool
   -> Maybe [PercentageTiersByCurrency]
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe AddOnRevenue_schedule_type
   -> Maybe AddOnState
   -> Maybe Text
   -> Maybe AddOnTier_type
   -> Maybe [Tier]
   -> Maybe JsonDateTime
   -> Maybe AddOnUsage_calculation_type
   -> Maybe Float
   -> Maybe AddOnUsage_timeframe
   -> Maybe AddOnUsage_type
   -> AddOn)
-> Parser (Maybe Int)
-> Parser
     (Text
      -> Maybe JsonDateTime
      -> Maybe (NonEmpty AddOnPricing)
      -> Maybe Int
      -> Maybe JsonDateTime
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Text
      -> Maybe ItemMini
      -> Maybe Text
      -> Maybe Text
      -> Text
      -> Maybe Text
      -> Maybe Bool
      -> Maybe [PercentageTiersByCurrency]
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe AddOnRevenue_schedule_type
      -> Maybe AddOnState
      -> Maybe Text
      -> Maybe AddOnTier_type
      -> Maybe [Tier]
      -> Maybe JsonDateTime
      -> Maybe AddOnUsage_calculation_type
      -> Maybe Float
      -> Maybe AddOnUsage_timeframe
      -> Maybe AddOnUsage_type
      -> AddOn)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Key
"avalara_transaction_type")) Parser
  (Text
   -> Maybe JsonDateTime
   -> Maybe (NonEmpty AddOnPricing)
   -> Maybe Int
   -> Maybe JsonDateTime
   -> Maybe Bool
   -> Maybe Text
   -> Maybe Text
   -> Maybe ItemMini
   -> Maybe Text
   -> Maybe Text
   -> Text
   -> Maybe Text
   -> Maybe Bool
   -> Maybe [PercentageTiersByCurrency]
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe AddOnRevenue_schedule_type
   -> Maybe AddOnState
   -> Maybe Text
   -> Maybe AddOnTier_type
   -> Maybe [Tier]
   -> Maybe JsonDateTime
   -> Maybe AddOnUsage_calculation_type
   -> Maybe Float
   -> Maybe AddOnUsage_timeframe
   -> Maybe AddOnUsage_type
   -> AddOn)
-> Parser Text
-> Parser
     (Maybe JsonDateTime
      -> Maybe (NonEmpty AddOnPricing)
      -> Maybe Int
      -> Maybe JsonDateTime
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Text
      -> Maybe ItemMini
      -> Maybe Text
      -> Maybe Text
      -> Text
      -> Maybe Text
      -> Maybe Bool
      -> Maybe [PercentageTiersByCurrency]
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe AddOnRevenue_schedule_type
      -> Maybe AddOnState
      -> Maybe Text
      -> Maybe AddOnTier_type
      -> Maybe [Tier]
      -> Maybe JsonDateTime
      -> Maybe AddOnUsage_calculation_type
      -> Maybe Float
      -> Maybe AddOnUsage_timeframe
      -> Maybe AddOnUsage_type
      -> AddOn)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Key -> Parser Text
forall a. FromJSON a => Object -> Key -> Parser a
Data.Aeson.Types.FromJSON..: Key
"code")) Parser
  (Maybe JsonDateTime
   -> Maybe (NonEmpty AddOnPricing)
   -> Maybe Int
   -> Maybe JsonDateTime
   -> Maybe Bool
   -> Maybe Text
   -> Maybe Text
   -> Maybe ItemMini
   -> Maybe Text
   -> Maybe Text
   -> Text
   -> Maybe Text
   -> Maybe Bool
   -> Maybe [PercentageTiersByCurrency]
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe AddOnRevenue_schedule_type
   -> Maybe AddOnState
   -> Maybe Text
   -> Maybe AddOnTier_type
   -> Maybe [Tier]
   -> Maybe JsonDateTime
   -> Maybe AddOnUsage_calculation_type
   -> Maybe Float
   -> Maybe AddOnUsage_timeframe
   -> Maybe AddOnUsage_type
   -> AddOn)
-> Parser (Maybe JsonDateTime)
-> Parser
     (Maybe (NonEmpty AddOnPricing)
      -> Maybe Int
      -> Maybe JsonDateTime
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Text
      -> Maybe ItemMini
      -> Maybe Text
      -> Maybe Text
      -> Text
      -> Maybe Text
      -> Maybe Bool
      -> Maybe [PercentageTiersByCurrency]
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe AddOnRevenue_schedule_type
      -> Maybe AddOnState
      -> Maybe Text
      -> Maybe AddOnTier_type
      -> Maybe [Tier]
      -> Maybe JsonDateTime
      -> Maybe AddOnUsage_calculation_type
      -> Maybe Float
      -> Maybe AddOnUsage_timeframe
      -> Maybe AddOnUsage_type
      -> AddOn)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Key -> Parser (Maybe JsonDateTime)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Key
"created_at")) Parser
  (Maybe (NonEmpty AddOnPricing)
   -> Maybe Int
   -> Maybe JsonDateTime
   -> Maybe Bool
   -> Maybe Text
   -> Maybe Text
   -> Maybe ItemMini
   -> Maybe Text
   -> Maybe Text
   -> Text
   -> Maybe Text
   -> Maybe Bool
   -> Maybe [PercentageTiersByCurrency]
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe AddOnRevenue_schedule_type
   -> Maybe AddOnState
   -> Maybe Text
   -> Maybe AddOnTier_type
   -> Maybe [Tier]
   -> Maybe JsonDateTime
   -> Maybe AddOnUsage_calculation_type
   -> Maybe Float
   -> Maybe AddOnUsage_timeframe
   -> Maybe AddOnUsage_type
   -> AddOn)
-> Parser (Maybe (NonEmpty AddOnPricing))
-> Parser
     (Maybe Int
      -> Maybe JsonDateTime
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Text
      -> Maybe ItemMini
      -> Maybe Text
      -> Maybe Text
      -> Text
      -> Maybe Text
      -> Maybe Bool
      -> Maybe [PercentageTiersByCurrency]
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe AddOnRevenue_schedule_type
      -> Maybe AddOnState
      -> Maybe Text
      -> Maybe AddOnTier_type
      -> Maybe [Tier]
      -> Maybe JsonDateTime
      -> Maybe AddOnUsage_calculation_type
      -> Maybe Float
      -> Maybe AddOnUsage_timeframe
      -> Maybe AddOnUsage_type
      -> AddOn)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Key -> Parser (Maybe (NonEmpty AddOnPricing))
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Key
"currencies")) Parser
  (Maybe Int
   -> Maybe JsonDateTime
   -> Maybe Bool
   -> Maybe Text
   -> Maybe Text
   -> Maybe ItemMini
   -> Maybe Text
   -> Maybe Text
   -> Text
   -> Maybe Text
   -> Maybe Bool
   -> Maybe [PercentageTiersByCurrency]
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe AddOnRevenue_schedule_type
   -> Maybe AddOnState
   -> Maybe Text
   -> Maybe AddOnTier_type
   -> Maybe [Tier]
   -> Maybe JsonDateTime
   -> Maybe AddOnUsage_calculation_type
   -> Maybe Float
   -> Maybe AddOnUsage_timeframe
   -> Maybe AddOnUsage_type
   -> AddOn)
-> Parser (Maybe Int)
-> Parser
     (Maybe JsonDateTime
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Text
      -> Maybe ItemMini
      -> Maybe Text
      -> Maybe Text
      -> Text
      -> Maybe Text
      -> Maybe Bool
      -> Maybe [PercentageTiersByCurrency]
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe AddOnRevenue_schedule_type
      -> Maybe AddOnState
      -> Maybe Text
      -> Maybe AddOnTier_type
      -> Maybe [Tier]
      -> Maybe JsonDateTime
      -> Maybe AddOnUsage_calculation_type
      -> Maybe Float
      -> Maybe AddOnUsage_timeframe
      -> Maybe AddOnUsage_type
      -> AddOn)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Key
"default_quantity")) Parser
  (Maybe JsonDateTime
   -> Maybe Bool
   -> Maybe Text
   -> Maybe Text
   -> Maybe ItemMini
   -> Maybe Text
   -> Maybe Text
   -> Text
   -> Maybe Text
   -> Maybe Bool
   -> Maybe [PercentageTiersByCurrency]
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe AddOnRevenue_schedule_type
   -> Maybe AddOnState
   -> Maybe Text
   -> Maybe AddOnTier_type
   -> Maybe [Tier]
   -> Maybe JsonDateTime
   -> Maybe AddOnUsage_calculation_type
   -> Maybe Float
   -> Maybe AddOnUsage_timeframe
   -> Maybe AddOnUsage_type
   -> AddOn)
-> Parser (Maybe JsonDateTime)
-> Parser
     (Maybe Bool
      -> Maybe Text
      -> Maybe Text
      -> Maybe ItemMini
      -> Maybe Text
      -> Maybe Text
      -> Text
      -> Maybe Text
      -> Maybe Bool
      -> Maybe [PercentageTiersByCurrency]
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe AddOnRevenue_schedule_type
      -> Maybe AddOnState
      -> Maybe Text
      -> Maybe AddOnTier_type
      -> Maybe [Tier]
      -> Maybe JsonDateTime
      -> Maybe AddOnUsage_calculation_type
      -> Maybe Float
      -> Maybe AddOnUsage_timeframe
      -> Maybe AddOnUsage_type
      -> AddOn)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Key -> Parser (Maybe JsonDateTime)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Key
"deleted_at")) Parser
  (Maybe Bool
   -> Maybe Text
   -> Maybe Text
   -> Maybe ItemMini
   -> Maybe Text
   -> Maybe Text
   -> Text
   -> Maybe Text
   -> Maybe Bool
   -> Maybe [PercentageTiersByCurrency]
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe AddOnRevenue_schedule_type
   -> Maybe AddOnState
   -> Maybe Text
   -> Maybe AddOnTier_type
   -> Maybe [Tier]
   -> Maybe JsonDateTime
   -> Maybe AddOnUsage_calculation_type
   -> Maybe Float
   -> Maybe AddOnUsage_timeframe
   -> Maybe AddOnUsage_type
   -> AddOn)
-> Parser (Maybe Bool)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe ItemMini
      -> Maybe Text
      -> Maybe Text
      -> Text
      -> Maybe Text
      -> Maybe Bool
      -> Maybe [PercentageTiersByCurrency]
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe AddOnRevenue_schedule_type
      -> Maybe AddOnState
      -> Maybe Text
      -> Maybe AddOnTier_type
      -> Maybe [Tier]
      -> Maybe JsonDateTime
      -> Maybe AddOnUsage_calculation_type
      -> Maybe Float
      -> Maybe AddOnUsage_timeframe
      -> Maybe AddOnUsage_type
      -> AddOn)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Key -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Key
"display_quantity")) Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe ItemMini
   -> Maybe Text
   -> Maybe Text
   -> Text
   -> Maybe Text
   -> Maybe Bool
   -> Maybe [PercentageTiersByCurrency]
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe AddOnRevenue_schedule_type
   -> Maybe AddOnState
   -> Maybe Text
   -> Maybe AddOnTier_type
   -> Maybe [Tier]
   -> Maybe JsonDateTime
   -> Maybe AddOnUsage_calculation_type
   -> Maybe Float
   -> Maybe AddOnUsage_timeframe
   -> Maybe AddOnUsage_type
   -> AddOn)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe ItemMini
      -> Maybe Text
      -> Maybe Text
      -> Text
      -> Maybe Text
      -> Maybe Bool
      -> Maybe [PercentageTiersByCurrency]
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe AddOnRevenue_schedule_type
      -> Maybe AddOnState
      -> Maybe Text
      -> Maybe AddOnTier_type
      -> Maybe [Tier]
      -> Maybe JsonDateTime
      -> Maybe AddOnUsage_calculation_type
      -> Maybe Float
      -> Maybe AddOnUsage_timeframe
      -> Maybe AddOnUsage_type
      -> AddOn)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Key
"external_sku")) Parser
  (Maybe Text
   -> Maybe ItemMini
   -> Maybe Text
   -> Maybe Text
   -> Text
   -> Maybe Text
   -> Maybe Bool
   -> Maybe [PercentageTiersByCurrency]
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe AddOnRevenue_schedule_type
   -> Maybe AddOnState
   -> Maybe Text
   -> Maybe AddOnTier_type
   -> Maybe [Tier]
   -> Maybe JsonDateTime
   -> Maybe AddOnUsage_calculation_type
   -> Maybe Float
   -> Maybe AddOnUsage_timeframe
   -> Maybe AddOnUsage_type
   -> AddOn)
-> Parser (Maybe Text)
-> Parser
     (Maybe ItemMini
      -> Maybe Text
      -> Maybe Text
      -> Text
      -> Maybe Text
      -> Maybe Bool
      -> Maybe [PercentageTiersByCurrency]
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe AddOnRevenue_schedule_type
      -> Maybe AddOnState
      -> Maybe Text
      -> Maybe AddOnTier_type
      -> Maybe [Tier]
      -> Maybe JsonDateTime
      -> Maybe AddOnUsage_calculation_type
      -> Maybe Float
      -> Maybe AddOnUsage_timeframe
      -> Maybe AddOnUsage_type
      -> AddOn)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Key
"id")) Parser
  (Maybe ItemMini
   -> Maybe Text
   -> Maybe Text
   -> Text
   -> Maybe Text
   -> Maybe Bool
   -> Maybe [PercentageTiersByCurrency]
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe AddOnRevenue_schedule_type
   -> Maybe AddOnState
   -> Maybe Text
   -> Maybe AddOnTier_type
   -> Maybe [Tier]
   -> Maybe JsonDateTime
   -> Maybe AddOnUsage_calculation_type
   -> Maybe Float
   -> Maybe AddOnUsage_timeframe
   -> Maybe AddOnUsage_type
   -> AddOn)
-> Parser (Maybe ItemMini)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Text
      -> Maybe Text
      -> Maybe Bool
      -> Maybe [PercentageTiersByCurrency]
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe AddOnRevenue_schedule_type
      -> Maybe AddOnState
      -> Maybe Text
      -> Maybe AddOnTier_type
      -> Maybe [Tier]
      -> Maybe JsonDateTime
      -> Maybe AddOnUsage_calculation_type
      -> Maybe Float
      -> Maybe AddOnUsage_timeframe
      -> Maybe AddOnUsage_type
      -> AddOn)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Key -> Parser (Maybe ItemMini)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Key
"item")) Parser
  (Maybe Text
   -> Maybe Text
   -> Text
   -> Maybe Text
   -> Maybe Bool
   -> Maybe [PercentageTiersByCurrency]
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe AddOnRevenue_schedule_type
   -> Maybe AddOnState
   -> Maybe Text
   -> Maybe AddOnTier_type
   -> Maybe [Tier]
   -> Maybe JsonDateTime
   -> Maybe AddOnUsage_calculation_type
   -> Maybe Float
   -> Maybe AddOnUsage_timeframe
   -> Maybe AddOnUsage_type
   -> AddOn)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Text
      -> Maybe Text
      -> Maybe Bool
      -> Maybe [PercentageTiersByCurrency]
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe AddOnRevenue_schedule_type
      -> Maybe AddOnState
      -> Maybe Text
      -> Maybe AddOnTier_type
      -> Maybe [Tier]
      -> Maybe JsonDateTime
      -> Maybe AddOnUsage_calculation_type
      -> Maybe Float
      -> Maybe AddOnUsage_timeframe
      -> Maybe AddOnUsage_type
      -> AddOn)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Key
"liability_gl_account_id")) Parser
  (Maybe Text
   -> Text
   -> Maybe Text
   -> Maybe Bool
   -> Maybe [PercentageTiersByCurrency]
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe AddOnRevenue_schedule_type
   -> Maybe AddOnState
   -> Maybe Text
   -> Maybe AddOnTier_type
   -> Maybe [Tier]
   -> Maybe JsonDateTime
   -> Maybe AddOnUsage_calculation_type
   -> Maybe Float
   -> Maybe AddOnUsage_timeframe
   -> Maybe AddOnUsage_type
   -> AddOn)
-> Parser (Maybe Text)
-> Parser
     (Text
      -> Maybe Text
      -> Maybe Bool
      -> Maybe [PercentageTiersByCurrency]
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe AddOnRevenue_schedule_type
      -> Maybe AddOnState
      -> Maybe Text
      -> Maybe AddOnTier_type
      -> Maybe [Tier]
      -> Maybe JsonDateTime
      -> Maybe AddOnUsage_calculation_type
      -> Maybe Float
      -> Maybe AddOnUsage_timeframe
      -> Maybe AddOnUsage_type
      -> AddOn)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Key
"measured_unit_id")) Parser
  (Text
   -> Maybe Text
   -> Maybe Bool
   -> Maybe [PercentageTiersByCurrency]
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe AddOnRevenue_schedule_type
   -> Maybe AddOnState
   -> Maybe Text
   -> Maybe AddOnTier_type
   -> Maybe [Tier]
   -> Maybe JsonDateTime
   -> Maybe AddOnUsage_calculation_type
   -> Maybe Float
   -> Maybe AddOnUsage_timeframe
   -> Maybe AddOnUsage_type
   -> AddOn)
-> Parser Text
-> Parser
     (Maybe Text
      -> Maybe Bool
      -> Maybe [PercentageTiersByCurrency]
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe AddOnRevenue_schedule_type
      -> Maybe AddOnState
      -> Maybe Text
      -> Maybe AddOnTier_type
      -> Maybe [Tier]
      -> Maybe JsonDateTime
      -> Maybe AddOnUsage_calculation_type
      -> Maybe Float
      -> Maybe AddOnUsage_timeframe
      -> Maybe AddOnUsage_type
      -> AddOn)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Key -> Parser Text
forall a. FromJSON a => Object -> Key -> Parser a
Data.Aeson.Types.FromJSON..: Key
"name")) Parser
  (Maybe Text
   -> Maybe Bool
   -> Maybe [PercentageTiersByCurrency]
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe AddOnRevenue_schedule_type
   -> Maybe AddOnState
   -> Maybe Text
   -> Maybe AddOnTier_type
   -> Maybe [Tier]
   -> Maybe JsonDateTime
   -> Maybe AddOnUsage_calculation_type
   -> Maybe Float
   -> Maybe AddOnUsage_timeframe
   -> Maybe AddOnUsage_type
   -> AddOn)
-> Parser (Maybe Text)
-> Parser
     (Maybe Bool
      -> Maybe [PercentageTiersByCurrency]
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe AddOnRevenue_schedule_type
      -> Maybe AddOnState
      -> Maybe Text
      -> Maybe AddOnTier_type
      -> Maybe [Tier]
      -> Maybe JsonDateTime
      -> Maybe AddOnUsage_calculation_type
      -> Maybe Float
      -> Maybe AddOnUsage_timeframe
      -> Maybe AddOnUsage_type
      -> AddOn)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Key
"object")) Parser
  (Maybe Bool
   -> Maybe [PercentageTiersByCurrency]
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe AddOnRevenue_schedule_type
   -> Maybe AddOnState
   -> Maybe Text
   -> Maybe AddOnTier_type
   -> Maybe [Tier]
   -> Maybe JsonDateTime
   -> Maybe AddOnUsage_calculation_type
   -> Maybe Float
   -> Maybe AddOnUsage_timeframe
   -> Maybe AddOnUsage_type
   -> AddOn)
-> Parser (Maybe Bool)
-> Parser
     (Maybe [PercentageTiersByCurrency]
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe AddOnRevenue_schedule_type
      -> Maybe AddOnState
      -> Maybe Text
      -> Maybe AddOnTier_type
      -> Maybe [Tier]
      -> Maybe JsonDateTime
      -> Maybe AddOnUsage_calculation_type
      -> Maybe Float
      -> Maybe AddOnUsage_timeframe
      -> Maybe AddOnUsage_type
      -> AddOn)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Key -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Key
"optional")) Parser
  (Maybe [PercentageTiersByCurrency]
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe AddOnRevenue_schedule_type
   -> Maybe AddOnState
   -> Maybe Text
   -> Maybe AddOnTier_type
   -> Maybe [Tier]
   -> Maybe JsonDateTime
   -> Maybe AddOnUsage_calculation_type
   -> Maybe Float
   -> Maybe AddOnUsage_timeframe
   -> Maybe AddOnUsage_type
   -> AddOn)
-> Parser (Maybe [PercentageTiersByCurrency])
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe AddOnRevenue_schedule_type
      -> Maybe AddOnState
      -> Maybe Text
      -> Maybe AddOnTier_type
      -> Maybe [Tier]
      -> Maybe JsonDateTime
      -> Maybe AddOnUsage_calculation_type
      -> Maybe Float
      -> Maybe AddOnUsage_timeframe
      -> Maybe AddOnUsage_type
      -> AddOn)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Key -> Parser (Maybe [PercentageTiersByCurrency])
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Key
"percentage_tiers")) Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe AddOnRevenue_schedule_type
   -> Maybe AddOnState
   -> Maybe Text
   -> Maybe AddOnTier_type
   -> Maybe [Tier]
   -> Maybe JsonDateTime
   -> Maybe AddOnUsage_calculation_type
   -> Maybe Float
   -> Maybe AddOnUsage_timeframe
   -> Maybe AddOnUsage_type
   -> AddOn)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe AddOnRevenue_schedule_type
      -> Maybe AddOnState
      -> Maybe Text
      -> Maybe AddOnTier_type
      -> Maybe [Tier]
      -> Maybe JsonDateTime
      -> Maybe AddOnUsage_calculation_type
      -> Maybe Float
      -> Maybe AddOnUsage_timeframe
      -> Maybe AddOnUsage_type
      -> AddOn)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Key
"performance_obligation_id")) Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe AddOnRevenue_schedule_type
   -> Maybe AddOnState
   -> Maybe Text
   -> Maybe AddOnTier_type
   -> Maybe [Tier]
   -> Maybe JsonDateTime
   -> Maybe AddOnUsage_calculation_type
   -> Maybe Float
   -> Maybe AddOnUsage_timeframe
   -> Maybe AddOnUsage_type
   -> AddOn)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe AddOnRevenue_schedule_type
      -> Maybe AddOnState
      -> Maybe Text
      -> Maybe AddOnTier_type
      -> Maybe [Tier]
      -> Maybe JsonDateTime
      -> Maybe AddOnUsage_calculation_type
      -> Maybe Float
      -> Maybe AddOnUsage_timeframe
      -> Maybe AddOnUsage_type
      -> AddOn)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Key
"plan_id")) Parser
  (Maybe Text
   -> Maybe AddOnRevenue_schedule_type
   -> Maybe AddOnState
   -> Maybe Text
   -> Maybe AddOnTier_type
   -> Maybe [Tier]
   -> Maybe JsonDateTime
   -> Maybe AddOnUsage_calculation_type
   -> Maybe Float
   -> Maybe AddOnUsage_timeframe
   -> Maybe AddOnUsage_type
   -> AddOn)
-> Parser (Maybe Text)
-> Parser
     (Maybe AddOnRevenue_schedule_type
      -> Maybe AddOnState
      -> Maybe Text
      -> Maybe AddOnTier_type
      -> Maybe [Tier]
      -> Maybe JsonDateTime
      -> Maybe AddOnUsage_calculation_type
      -> Maybe Float
      -> Maybe AddOnUsage_timeframe
      -> Maybe AddOnUsage_type
      -> AddOn)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Key
"revenue_gl_account_id")) Parser
  (Maybe AddOnRevenue_schedule_type
   -> Maybe AddOnState
   -> Maybe Text
   -> Maybe AddOnTier_type
   -> Maybe [Tier]
   -> Maybe JsonDateTime
   -> Maybe AddOnUsage_calculation_type
   -> Maybe Float
   -> Maybe AddOnUsage_timeframe
   -> Maybe AddOnUsage_type
   -> AddOn)
-> Parser (Maybe AddOnRevenue_schedule_type)
-> Parser
     (Maybe AddOnState
      -> Maybe Text
      -> Maybe AddOnTier_type
      -> Maybe [Tier]
      -> Maybe JsonDateTime
      -> Maybe AddOnUsage_calculation_type
      -> Maybe Float
      -> Maybe AddOnUsage_timeframe
      -> Maybe AddOnUsage_type
      -> AddOn)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Key -> Parser (Maybe AddOnRevenue_schedule_type)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Key
"revenue_schedule_type")) Parser
  (Maybe AddOnState
   -> Maybe Text
   -> Maybe AddOnTier_type
   -> Maybe [Tier]
   -> Maybe JsonDateTime
   -> Maybe AddOnUsage_calculation_type
   -> Maybe Float
   -> Maybe AddOnUsage_timeframe
   -> Maybe AddOnUsage_type
   -> AddOn)
-> Parser (Maybe AddOnState)
-> Parser
     (Maybe Text
      -> Maybe AddOnTier_type
      -> Maybe [Tier]
      -> Maybe JsonDateTime
      -> Maybe AddOnUsage_calculation_type
      -> Maybe Float
      -> Maybe AddOnUsage_timeframe
      -> Maybe AddOnUsage_type
      -> AddOn)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Key -> Parser (Maybe AddOnState)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Key
"state")) Parser
  (Maybe Text
   -> Maybe AddOnTier_type
   -> Maybe [Tier]
   -> Maybe JsonDateTime
   -> Maybe AddOnUsage_calculation_type
   -> Maybe Float
   -> Maybe AddOnUsage_timeframe
   -> Maybe AddOnUsage_type
   -> AddOn)
-> Parser (Maybe Text)
-> Parser
     (Maybe AddOnTier_type
      -> Maybe [Tier]
      -> Maybe JsonDateTime
      -> Maybe AddOnUsage_calculation_type
      -> Maybe Float
      -> Maybe AddOnUsage_timeframe
      -> Maybe AddOnUsage_type
      -> AddOn)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Key
"tax_code")) Parser
  (Maybe AddOnTier_type
   -> Maybe [Tier]
   -> Maybe JsonDateTime
   -> Maybe AddOnUsage_calculation_type
   -> Maybe Float
   -> Maybe AddOnUsage_timeframe
   -> Maybe AddOnUsage_type
   -> AddOn)
-> Parser (Maybe AddOnTier_type)
-> Parser
     (Maybe [Tier]
      -> Maybe JsonDateTime
      -> Maybe AddOnUsage_calculation_type
      -> Maybe Float
      -> Maybe AddOnUsage_timeframe
      -> Maybe AddOnUsage_type
      -> AddOn)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Key -> Parser (Maybe AddOnTier_type)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Key
"tier_type")) Parser
  (Maybe [Tier]
   -> Maybe JsonDateTime
   -> Maybe AddOnUsage_calculation_type
   -> Maybe Float
   -> Maybe AddOnUsage_timeframe
   -> Maybe AddOnUsage_type
   -> AddOn)
-> Parser (Maybe [Tier])
-> Parser
     (Maybe JsonDateTime
      -> Maybe AddOnUsage_calculation_type
      -> Maybe Float
      -> Maybe AddOnUsage_timeframe
      -> Maybe AddOnUsage_type
      -> AddOn)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Key -> Parser (Maybe [Tier])
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Key
"tiers")) Parser
  (Maybe JsonDateTime
   -> Maybe AddOnUsage_calculation_type
   -> Maybe Float
   -> Maybe AddOnUsage_timeframe
   -> Maybe AddOnUsage_type
   -> AddOn)
-> Parser (Maybe JsonDateTime)
-> Parser
     (Maybe AddOnUsage_calculation_type
      -> Maybe Float
      -> Maybe AddOnUsage_timeframe
      -> Maybe AddOnUsage_type
      -> AddOn)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Key -> Parser (Maybe JsonDateTime)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Key
"updated_at")) Parser
  (Maybe AddOnUsage_calculation_type
   -> Maybe Float
   -> Maybe AddOnUsage_timeframe
   -> Maybe AddOnUsage_type
   -> AddOn)
-> Parser (Maybe AddOnUsage_calculation_type)
-> Parser
     (Maybe Float
      -> Maybe AddOnUsage_timeframe -> Maybe AddOnUsage_type -> AddOn)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Key -> Parser (Maybe AddOnUsage_calculation_type)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Key
"usage_calculation_type")) Parser
  (Maybe Float
   -> Maybe AddOnUsage_timeframe -> Maybe AddOnUsage_type -> AddOn)
-> Parser (Maybe Float)
-> Parser
     (Maybe AddOnUsage_timeframe -> Maybe AddOnUsage_type -> AddOn)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Key -> Parser (Maybe Float)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Key
"usage_percentage")) Parser
  (Maybe AddOnUsage_timeframe -> Maybe AddOnUsage_type -> AddOn)
-> Parser (Maybe AddOnUsage_timeframe)
-> Parser (Maybe AddOnUsage_type -> AddOn)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Key -> Parser (Maybe AddOnUsage_timeframe)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Key
"usage_timeframe")) Parser (Maybe AddOnUsage_type -> AddOn)
-> Parser (Maybe AddOnUsage_type) -> Parser AddOn
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Key -> Parser (Maybe AddOnUsage_type)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Key
"usage_type"))

-- | Create a new 'AddOn' with all required fields.
mkAddOn ::
    -- | 'addOnCode'
    Data.Text.Internal.Text ->
    -- | 'addOnName'
    Data.Text.Internal.Text ->
    AddOn
mkAddOn :: Text -> Text -> AddOn
mkAddOn Text
addOnCode Text
addOnName =
    AddOn
        { addOnAccounting_code :: Maybe Text
addOnAccounting_code = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing
        , addOnAdd_on_type :: Maybe AddOnAdd_on_type
addOnAdd_on_type = Maybe AddOnAdd_on_type
forall a. Maybe a
GHC.Maybe.Nothing
        , addOnAvalara_service_type :: Maybe Int
addOnAvalara_service_type = Maybe Int
forall a. Maybe a
GHC.Maybe.Nothing
        , addOnAvalara_transaction_type :: Maybe Int
addOnAvalara_transaction_type = Maybe Int
forall a. Maybe a
GHC.Maybe.Nothing
        , addOnCode :: Text
addOnCode = Text
addOnCode
        , addOnCreated_at :: Maybe JsonDateTime
addOnCreated_at = Maybe JsonDateTime
forall a. Maybe a
GHC.Maybe.Nothing
        , addOnCurrencies :: Maybe (NonEmpty AddOnPricing)
addOnCurrencies = Maybe (NonEmpty AddOnPricing)
forall a. Maybe a
GHC.Maybe.Nothing
        , addOnDefault_quantity :: Maybe Int
addOnDefault_quantity = Maybe Int
forall a. Maybe a
GHC.Maybe.Nothing
        , addOnDeleted_at :: Maybe JsonDateTime
addOnDeleted_at = Maybe JsonDateTime
forall a. Maybe a
GHC.Maybe.Nothing
        , addOnDisplay_quantity :: Maybe Bool
addOnDisplay_quantity = Maybe Bool
forall a. Maybe a
GHC.Maybe.Nothing
        , addOnExternal_sku :: Maybe Text
addOnExternal_sku = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing
        , addOnId :: Maybe Text
addOnId = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing
        , addOnItem :: Maybe ItemMini
addOnItem = Maybe ItemMini
forall a. Maybe a
GHC.Maybe.Nothing
        , addOnLiability_gl_account_id :: Maybe Text
addOnLiability_gl_account_id = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing
        , addOnMeasured_unit_id :: Maybe Text
addOnMeasured_unit_id = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing
        , addOnName :: Text
addOnName = Text
addOnName
        , addOnObject :: Maybe Text
addOnObject = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing
        , addOnOptional :: Maybe Bool
addOnOptional = Maybe Bool
forall a. Maybe a
GHC.Maybe.Nothing
        , addOnPercentage_tiers :: Maybe [PercentageTiersByCurrency]
addOnPercentage_tiers = Maybe [PercentageTiersByCurrency]
forall a. Maybe a
GHC.Maybe.Nothing
        , addOnPerformance_obligation_id :: Maybe Text
addOnPerformance_obligation_id = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing
        , addOnPlan_id :: Maybe Text
addOnPlan_id = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing
        , addOnRevenue_gl_account_id :: Maybe Text
addOnRevenue_gl_account_id = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing
        , addOnRevenue_schedule_type :: Maybe AddOnRevenue_schedule_type
addOnRevenue_schedule_type = Maybe AddOnRevenue_schedule_type
forall a. Maybe a
GHC.Maybe.Nothing
        , addOnState :: Maybe AddOnState
addOnState = Maybe AddOnState
forall a. Maybe a
GHC.Maybe.Nothing
        , addOnTax_code :: Maybe Text
addOnTax_code = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing
        , addOnTier_type :: Maybe AddOnTier_type
addOnTier_type = Maybe AddOnTier_type
forall a. Maybe a
GHC.Maybe.Nothing
        , addOnTiers :: Maybe [Tier]
addOnTiers = Maybe [Tier]
forall a. Maybe a
GHC.Maybe.Nothing
        , addOnUpdated_at :: Maybe JsonDateTime
addOnUpdated_at = Maybe JsonDateTime
forall a. Maybe a
GHC.Maybe.Nothing
        , addOnUsage_calculation_type :: Maybe AddOnUsage_calculation_type
addOnUsage_calculation_type = Maybe AddOnUsage_calculation_type
forall a. Maybe a
GHC.Maybe.Nothing
        , addOnUsage_percentage :: Maybe Float
addOnUsage_percentage = Maybe Float
forall a. Maybe a
GHC.Maybe.Nothing
        , addOnUsage_timeframe :: Maybe AddOnUsage_timeframe
addOnUsage_timeframe = Maybe AddOnUsage_timeframe
forall a. Maybe a
GHC.Maybe.Nothing
        , addOnUsage_type :: Maybe AddOnUsage_type
addOnUsage_type = Maybe AddOnUsage_type
forall a. Maybe a
GHC.Maybe.Nothing
        }

{- | Defines the enum schema located at @components.schemas.AddOn.properties.add_on_type@ in the specification.

Whether the add-on type is fixed, or usage-based.
-}
data AddOnAdd_on_type
    = -- | This case is used if the value encountered during decoding does not match any of the provided cases in the specification.
      AddOnAdd_on_typeOther Data.Aeson.Types.Internal.Value
    | -- | This constructor can be used to send values to the server which are not present in the specification yet.
      AddOnAdd_on_typeTyped Data.Text.Internal.Text
    | -- | Represents the JSON value @"fixed"@
      AddOnAdd_on_typeEnumFixed
    | -- | Represents the JSON value @"usage"@
      AddOnAdd_on_typeEnumUsage
    deriving (Int -> AddOnAdd_on_type -> ShowS
[AddOnAdd_on_type] -> ShowS
AddOnAdd_on_type -> String
(Int -> AddOnAdd_on_type -> ShowS)
-> (AddOnAdd_on_type -> String)
-> ([AddOnAdd_on_type] -> ShowS)
-> Show AddOnAdd_on_type
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> AddOnAdd_on_type -> ShowS
showsPrec :: Int -> AddOnAdd_on_type -> ShowS
$cshow :: AddOnAdd_on_type -> String
show :: AddOnAdd_on_type -> String
$cshowList :: [AddOnAdd_on_type] -> ShowS
showList :: [AddOnAdd_on_type] -> ShowS
GHC.Show.Show, AddOnAdd_on_type -> AddOnAdd_on_type -> Bool
(AddOnAdd_on_type -> AddOnAdd_on_type -> Bool)
-> (AddOnAdd_on_type -> AddOnAdd_on_type -> Bool)
-> Eq AddOnAdd_on_type
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: AddOnAdd_on_type -> AddOnAdd_on_type -> Bool
== :: AddOnAdd_on_type -> AddOnAdd_on_type -> Bool
$c/= :: AddOnAdd_on_type -> AddOnAdd_on_type -> Bool
/= :: AddOnAdd_on_type -> AddOnAdd_on_type -> Bool
GHC.Classes.Eq)

instance Data.Aeson.Types.ToJSON.ToJSON AddOnAdd_on_type where
    toJSON :: AddOnAdd_on_type -> Value
toJSON (AddOnAdd_on_typeOther Value
val) = Value
val
    toJSON (AddOnAdd_on_typeTyped Text
val) = Text -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON Text
val
    toJSON (AddOnAdd_on_type
AddOnAdd_on_typeEnumFixed) = Value
"fixed"
    toJSON (AddOnAdd_on_type
AddOnAdd_on_typeEnumUsage) = Value
"usage"
instance Data.Aeson.Types.FromJSON.FromJSON AddOnAdd_on_type where
    parseJSON :: Value -> Parser AddOnAdd_on_type
parseJSON Value
val =
        AddOnAdd_on_type -> Parser AddOnAdd_on_type
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure
            ( if
                | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"fixed" -> AddOnAdd_on_type
AddOnAdd_on_typeEnumFixed
                | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"usage" -> AddOnAdd_on_type
AddOnAdd_on_typeEnumUsage
                | Bool
GHC.Base.otherwise -> Value -> AddOnAdd_on_type
AddOnAdd_on_typeOther Value
val
            )

{- | Defines the enum schema located at @components.schemas.AddOn.properties.revenue_schedule_type@ in the specification.

When this add-on is invoiced, the line item will use this revenue schedule. If \`item_code\`\/\`item_id\` is part of the request then \`revenue_schedule_type\` must be absent in the request as the value will be set from the item.
-}
data AddOnRevenue_schedule_type
    = -- | This case is used if the value encountered during decoding does not match any of the provided cases in the specification.
      AddOnRevenue_schedule_typeOther Data.Aeson.Types.Internal.Value
    | -- | This constructor can be used to send values to the server which are not present in the specification yet.
      AddOnRevenue_schedule_typeTyped Data.Text.Internal.Text
    | -- | Represents the JSON value @"at_range_end"@
      AddOnRevenue_schedule_typeEnumAt_range_end
    | -- | Represents the JSON value @"at_range_start"@
      AddOnRevenue_schedule_typeEnumAt_range_start
    | -- | Represents the JSON value @"evenly"@
      AddOnRevenue_schedule_typeEnumEvenly
    | -- | Represents the JSON value @"never"@
      AddOnRevenue_schedule_typeEnumNever
    deriving (Int -> AddOnRevenue_schedule_type -> ShowS
[AddOnRevenue_schedule_type] -> ShowS
AddOnRevenue_schedule_type -> String
(Int -> AddOnRevenue_schedule_type -> ShowS)
-> (AddOnRevenue_schedule_type -> String)
-> ([AddOnRevenue_schedule_type] -> ShowS)
-> Show AddOnRevenue_schedule_type
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> AddOnRevenue_schedule_type -> ShowS
showsPrec :: Int -> AddOnRevenue_schedule_type -> ShowS
$cshow :: AddOnRevenue_schedule_type -> String
show :: AddOnRevenue_schedule_type -> String
$cshowList :: [AddOnRevenue_schedule_type] -> ShowS
showList :: [AddOnRevenue_schedule_type] -> ShowS
GHC.Show.Show, AddOnRevenue_schedule_type -> AddOnRevenue_schedule_type -> Bool
(AddOnRevenue_schedule_type -> AddOnRevenue_schedule_type -> Bool)
-> (AddOnRevenue_schedule_type
    -> AddOnRevenue_schedule_type -> Bool)
-> Eq AddOnRevenue_schedule_type
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: AddOnRevenue_schedule_type -> AddOnRevenue_schedule_type -> Bool
== :: AddOnRevenue_schedule_type -> AddOnRevenue_schedule_type -> Bool
$c/= :: AddOnRevenue_schedule_type -> AddOnRevenue_schedule_type -> Bool
/= :: AddOnRevenue_schedule_type -> AddOnRevenue_schedule_type -> Bool
GHC.Classes.Eq)

instance Data.Aeson.Types.ToJSON.ToJSON AddOnRevenue_schedule_type where
    toJSON :: AddOnRevenue_schedule_type -> Value
toJSON (AddOnRevenue_schedule_typeOther Value
val) = Value
val
    toJSON (AddOnRevenue_schedule_typeTyped Text
val) = Text -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON Text
val
    toJSON (AddOnRevenue_schedule_type
AddOnRevenue_schedule_typeEnumAt_range_end) = Value
"at_range_end"
    toJSON (AddOnRevenue_schedule_type
AddOnRevenue_schedule_typeEnumAt_range_start) = Value
"at_range_start"
    toJSON (AddOnRevenue_schedule_type
AddOnRevenue_schedule_typeEnumEvenly) = Value
"evenly"
    toJSON (AddOnRevenue_schedule_type
AddOnRevenue_schedule_typeEnumNever) = Value
"never"
instance Data.Aeson.Types.FromJSON.FromJSON AddOnRevenue_schedule_type where
    parseJSON :: Value -> Parser AddOnRevenue_schedule_type
parseJSON Value
val =
        AddOnRevenue_schedule_type -> Parser AddOnRevenue_schedule_type
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure
            ( if
                | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"at_range_end" -> AddOnRevenue_schedule_type
AddOnRevenue_schedule_typeEnumAt_range_end
                | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"at_range_start" -> AddOnRevenue_schedule_type
AddOnRevenue_schedule_typeEnumAt_range_start
                | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"evenly" -> AddOnRevenue_schedule_type
AddOnRevenue_schedule_typeEnumEvenly
                | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"never" -> AddOnRevenue_schedule_type
AddOnRevenue_schedule_typeEnumNever
                | Bool
GHC.Base.otherwise -> Value -> AddOnRevenue_schedule_type
AddOnRevenue_schedule_typeOther Value
val
            )

{- | Defines the enum schema located at @components.schemas.AddOn.properties.state@ in the specification.

Add-ons can be either active or inactive.
-}
data AddOnState
    = -- | This case is used if the value encountered during decoding does not match any of the provided cases in the specification.
      AddOnStateOther Data.Aeson.Types.Internal.Value
    | -- | This constructor can be used to send values to the server which are not present in the specification yet.
      AddOnStateTyped Data.Text.Internal.Text
    | -- | Represents the JSON value @"active"@
      AddOnStateEnumActive
    | -- | Represents the JSON value @"inactive"@
      AddOnStateEnumInactive
    deriving (Int -> AddOnState -> ShowS
[AddOnState] -> ShowS
AddOnState -> String
(Int -> AddOnState -> ShowS)
-> (AddOnState -> String)
-> ([AddOnState] -> ShowS)
-> Show AddOnState
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> AddOnState -> ShowS
showsPrec :: Int -> AddOnState -> ShowS
$cshow :: AddOnState -> String
show :: AddOnState -> String
$cshowList :: [AddOnState] -> ShowS
showList :: [AddOnState] -> ShowS
GHC.Show.Show, AddOnState -> AddOnState -> Bool
(AddOnState -> AddOnState -> Bool)
-> (AddOnState -> AddOnState -> Bool) -> Eq AddOnState
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: AddOnState -> AddOnState -> Bool
== :: AddOnState -> AddOnState -> Bool
$c/= :: AddOnState -> AddOnState -> Bool
/= :: AddOnState -> AddOnState -> Bool
GHC.Classes.Eq)

instance Data.Aeson.Types.ToJSON.ToJSON AddOnState where
    toJSON :: AddOnState -> Value
toJSON (AddOnStateOther Value
val) = Value
val
    toJSON (AddOnStateTyped Text
val) = Text -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON Text
val
    toJSON (AddOnState
AddOnStateEnumActive) = Value
"active"
    toJSON (AddOnState
AddOnStateEnumInactive) = Value
"inactive"
instance Data.Aeson.Types.FromJSON.FromJSON AddOnState where
    parseJSON :: Value -> Parser AddOnState
parseJSON Value
val =
        AddOnState -> Parser AddOnState
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure
            ( if
                | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"active" -> AddOnState
AddOnStateEnumActive
                | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"inactive" -> AddOnState
AddOnStateEnumInactive
                | Bool
GHC.Base.otherwise -> Value -> AddOnState
AddOnStateOther Value
val
            )

{- | Defines the enum schema located at @components.schemas.AddOn.properties.tier_type@ in the specification.

The pricing model for the add-on.  For more information,
[click here](https:\/\/docs.recurly.com\/docs\/billing-models\#section-quantity-based). See our
[Guide](https:\/\/recurly.com\/developers\/guides\/item-addon-guide.html) for an overview of how
to configure quantity-based pricing models.
-}
data AddOnTier_type
    = -- | This case is used if the value encountered during decoding does not match any of the provided cases in the specification.
      AddOnTier_typeOther Data.Aeson.Types.Internal.Value
    | -- | This constructor can be used to send values to the server which are not present in the specification yet.
      AddOnTier_typeTyped Data.Text.Internal.Text
    | -- | Represents the JSON value @"flat"@
      AddOnTier_typeEnumFlat
    | -- | Represents the JSON value @"tiered"@
      AddOnTier_typeEnumTiered
    | -- | Represents the JSON value @"stairstep"@
      AddOnTier_typeEnumStairstep
    | -- | Represents the JSON value @"volume"@
      AddOnTier_typeEnumVolume
    deriving (Int -> AddOnTier_type -> ShowS
[AddOnTier_type] -> ShowS
AddOnTier_type -> String
(Int -> AddOnTier_type -> ShowS)
-> (AddOnTier_type -> String)
-> ([AddOnTier_type] -> ShowS)
-> Show AddOnTier_type
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> AddOnTier_type -> ShowS
showsPrec :: Int -> AddOnTier_type -> ShowS
$cshow :: AddOnTier_type -> String
show :: AddOnTier_type -> String
$cshowList :: [AddOnTier_type] -> ShowS
showList :: [AddOnTier_type] -> ShowS
GHC.Show.Show, AddOnTier_type -> AddOnTier_type -> Bool
(AddOnTier_type -> AddOnTier_type -> Bool)
-> (AddOnTier_type -> AddOnTier_type -> Bool) -> Eq AddOnTier_type
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: AddOnTier_type -> AddOnTier_type -> Bool
== :: AddOnTier_type -> AddOnTier_type -> Bool
$c/= :: AddOnTier_type -> AddOnTier_type -> Bool
/= :: AddOnTier_type -> AddOnTier_type -> Bool
GHC.Classes.Eq)

instance Data.Aeson.Types.ToJSON.ToJSON AddOnTier_type where
    toJSON :: AddOnTier_type -> Value
toJSON (AddOnTier_typeOther Value
val) = Value
val
    toJSON (AddOnTier_typeTyped Text
val) = Text -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON Text
val
    toJSON (AddOnTier_type
AddOnTier_typeEnumFlat) = Value
"flat"
    toJSON (AddOnTier_type
AddOnTier_typeEnumTiered) = Value
"tiered"
    toJSON (AddOnTier_type
AddOnTier_typeEnumStairstep) = Value
"stairstep"
    toJSON (AddOnTier_type
AddOnTier_typeEnumVolume) = Value
"volume"
instance Data.Aeson.Types.FromJSON.FromJSON AddOnTier_type where
    parseJSON :: Value -> Parser AddOnTier_type
parseJSON Value
val =
        AddOnTier_type -> Parser AddOnTier_type
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure
            ( if
                | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"flat" -> AddOnTier_type
AddOnTier_typeEnumFlat
                | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"tiered" -> AddOnTier_type
AddOnTier_typeEnumTiered
                | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"stairstep" -> AddOnTier_type
AddOnTier_typeEnumStairstep
                | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"volume" -> AddOnTier_type
AddOnTier_typeEnumVolume
                | Bool
GHC.Base.otherwise -> Value -> AddOnTier_type
AddOnTier_typeOther Value
val
            )

{- | Defines the enum schema located at @components.schemas.AddOn.properties.usage_calculation_type@ in the specification.

The type of calculation to be employed for an add-on.  Cumulative billing will sum all usage records created in the current billing cycle.  Last-in-period billing will apply only the most recent usage record in the billing period.  If no value is specified, cumulative billing will be used.
-}
data AddOnUsage_calculation_type
    = -- | This case is used if the value encountered during decoding does not match any of the provided cases in the specification.
      AddOnUsage_calculation_typeOther Data.Aeson.Types.Internal.Value
    | -- | This constructor can be used to send values to the server which are not present in the specification yet.
      AddOnUsage_calculation_typeTyped Data.Text.Internal.Text
    | -- | Represents the JSON value @"cumulative"@
      AddOnUsage_calculation_typeEnumCumulative
    | -- | Represents the JSON value @"last_in_period"@
      AddOnUsage_calculation_typeEnumLast_in_period
    deriving (Int -> AddOnUsage_calculation_type -> ShowS
[AddOnUsage_calculation_type] -> ShowS
AddOnUsage_calculation_type -> String
(Int -> AddOnUsage_calculation_type -> ShowS)
-> (AddOnUsage_calculation_type -> String)
-> ([AddOnUsage_calculation_type] -> ShowS)
-> Show AddOnUsage_calculation_type
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> AddOnUsage_calculation_type -> ShowS
showsPrec :: Int -> AddOnUsage_calculation_type -> ShowS
$cshow :: AddOnUsage_calculation_type -> String
show :: AddOnUsage_calculation_type -> String
$cshowList :: [AddOnUsage_calculation_type] -> ShowS
showList :: [AddOnUsage_calculation_type] -> ShowS
GHC.Show.Show, AddOnUsage_calculation_type -> AddOnUsage_calculation_type -> Bool
(AddOnUsage_calculation_type
 -> AddOnUsage_calculation_type -> Bool)
-> (AddOnUsage_calculation_type
    -> AddOnUsage_calculation_type -> Bool)
-> Eq AddOnUsage_calculation_type
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: AddOnUsage_calculation_type -> AddOnUsage_calculation_type -> Bool
== :: AddOnUsage_calculation_type -> AddOnUsage_calculation_type -> Bool
$c/= :: AddOnUsage_calculation_type -> AddOnUsage_calculation_type -> Bool
/= :: AddOnUsage_calculation_type -> AddOnUsage_calculation_type -> Bool
GHC.Classes.Eq)

instance Data.Aeson.Types.ToJSON.ToJSON AddOnUsage_calculation_type where
    toJSON :: AddOnUsage_calculation_type -> Value
toJSON (AddOnUsage_calculation_typeOther Value
val) = Value
val
    toJSON (AddOnUsage_calculation_typeTyped Text
val) = Text -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON Text
val
    toJSON (AddOnUsage_calculation_type
AddOnUsage_calculation_typeEnumCumulative) = Value
"cumulative"
    toJSON (AddOnUsage_calculation_type
AddOnUsage_calculation_typeEnumLast_in_period) = Value
"last_in_period"
instance Data.Aeson.Types.FromJSON.FromJSON AddOnUsage_calculation_type where
    parseJSON :: Value -> Parser AddOnUsage_calculation_type
parseJSON Value
val =
        AddOnUsage_calculation_type -> Parser AddOnUsage_calculation_type
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure
            ( if
                | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"cumulative" -> AddOnUsage_calculation_type
AddOnUsage_calculation_typeEnumCumulative
                | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"last_in_period" -> AddOnUsage_calculation_type
AddOnUsage_calculation_typeEnumLast_in_period
                | Bool
GHC.Base.otherwise -> Value -> AddOnUsage_calculation_type
AddOnUsage_calculation_typeOther Value
val
            )

{- | Defines the enum schema located at @components.schemas.AddOn.properties.usage_timeframe@ in the specification.

The time at which usage totals are reset for billing purposes.
-}
data AddOnUsage_timeframe
    = -- | This case is used if the value encountered during decoding does not match any of the provided cases in the specification.
      AddOnUsage_timeframeOther Data.Aeson.Types.Internal.Value
    | -- | This constructor can be used to send values to the server which are not present in the specification yet.
      AddOnUsage_timeframeTyped Data.Text.Internal.Text
    | -- | Represents the JSON value @"billing_period"@
      AddOnUsage_timeframeEnumBilling_period
    | -- | Represents the JSON value @"subscription_term"@
      AddOnUsage_timeframeEnumSubscription_term
    deriving (Int -> AddOnUsage_timeframe -> ShowS
[AddOnUsage_timeframe] -> ShowS
AddOnUsage_timeframe -> String
(Int -> AddOnUsage_timeframe -> ShowS)
-> (AddOnUsage_timeframe -> String)
-> ([AddOnUsage_timeframe] -> ShowS)
-> Show AddOnUsage_timeframe
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> AddOnUsage_timeframe -> ShowS
showsPrec :: Int -> AddOnUsage_timeframe -> ShowS
$cshow :: AddOnUsage_timeframe -> String
show :: AddOnUsage_timeframe -> String
$cshowList :: [AddOnUsage_timeframe] -> ShowS
showList :: [AddOnUsage_timeframe] -> ShowS
GHC.Show.Show, AddOnUsage_timeframe -> AddOnUsage_timeframe -> Bool
(AddOnUsage_timeframe -> AddOnUsage_timeframe -> Bool)
-> (AddOnUsage_timeframe -> AddOnUsage_timeframe -> Bool)
-> Eq AddOnUsage_timeframe
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: AddOnUsage_timeframe -> AddOnUsage_timeframe -> Bool
== :: AddOnUsage_timeframe -> AddOnUsage_timeframe -> Bool
$c/= :: AddOnUsage_timeframe -> AddOnUsage_timeframe -> Bool
/= :: AddOnUsage_timeframe -> AddOnUsage_timeframe -> Bool
GHC.Classes.Eq)

instance Data.Aeson.Types.ToJSON.ToJSON AddOnUsage_timeframe where
    toJSON :: AddOnUsage_timeframe -> Value
toJSON (AddOnUsage_timeframeOther Value
val) = Value
val
    toJSON (AddOnUsage_timeframeTyped Text
val) = Text -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON Text
val
    toJSON (AddOnUsage_timeframe
AddOnUsage_timeframeEnumBilling_period) = Value
"billing_period"
    toJSON (AddOnUsage_timeframe
AddOnUsage_timeframeEnumSubscription_term) = Value
"subscription_term"
instance Data.Aeson.Types.FromJSON.FromJSON AddOnUsage_timeframe where
    parseJSON :: Value -> Parser AddOnUsage_timeframe
parseJSON Value
val =
        AddOnUsage_timeframe -> Parser AddOnUsage_timeframe
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure
            ( if
                | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"billing_period" -> AddOnUsage_timeframe
AddOnUsage_timeframeEnumBilling_period
                | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"subscription_term" -> AddOnUsage_timeframe
AddOnUsage_timeframeEnumSubscription_term
                | Bool
GHC.Base.otherwise -> Value -> AddOnUsage_timeframe
AddOnUsage_timeframeOther Value
val
            )

{- | Defines the enum schema located at @components.schemas.AddOn.properties.usage_type@ in the specification.

Type of usage, returns usage type if \`add_on_type\` is \`usage\`.
-}
data AddOnUsage_type
    = -- | This case is used if the value encountered during decoding does not match any of the provided cases in the specification.
      AddOnUsage_typeOther Data.Aeson.Types.Internal.Value
    | -- | This constructor can be used to send values to the server which are not present in the specification yet.
      AddOnUsage_typeTyped Data.Text.Internal.Text
    | -- | Represents the JSON value @"price"@
      AddOnUsage_typeEnumPrice
    | -- | Represents the JSON value @"percentage"@
      AddOnUsage_typeEnumPercentage
    deriving (Int -> AddOnUsage_type -> ShowS
[AddOnUsage_type] -> ShowS
AddOnUsage_type -> String
(Int -> AddOnUsage_type -> ShowS)
-> (AddOnUsage_type -> String)
-> ([AddOnUsage_type] -> ShowS)
-> Show AddOnUsage_type
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> AddOnUsage_type -> ShowS
showsPrec :: Int -> AddOnUsage_type -> ShowS
$cshow :: AddOnUsage_type -> String
show :: AddOnUsage_type -> String
$cshowList :: [AddOnUsage_type] -> ShowS
showList :: [AddOnUsage_type] -> ShowS
GHC.Show.Show, AddOnUsage_type -> AddOnUsage_type -> Bool
(AddOnUsage_type -> AddOnUsage_type -> Bool)
-> (AddOnUsage_type -> AddOnUsage_type -> Bool)
-> Eq AddOnUsage_type
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: AddOnUsage_type -> AddOnUsage_type -> Bool
== :: AddOnUsage_type -> AddOnUsage_type -> Bool
$c/= :: AddOnUsage_type -> AddOnUsage_type -> Bool
/= :: AddOnUsage_type -> AddOnUsage_type -> Bool
GHC.Classes.Eq)

instance Data.Aeson.Types.ToJSON.ToJSON AddOnUsage_type where
    toJSON :: AddOnUsage_type -> Value
toJSON (AddOnUsage_typeOther Value
val) = Value
val
    toJSON (AddOnUsage_typeTyped Text
val) = Text -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON Text
val
    toJSON (AddOnUsage_type
AddOnUsage_typeEnumPrice) = Value
"price"
    toJSON (AddOnUsage_type
AddOnUsage_typeEnumPercentage) = Value
"percentage"
instance Data.Aeson.Types.FromJSON.FromJSON AddOnUsage_type where
    parseJSON :: Value -> Parser AddOnUsage_type
parseJSON Value
val =
        AddOnUsage_type -> Parser AddOnUsage_type
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure
            ( if
                | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"price" -> AddOnUsage_type
AddOnUsage_typeEnumPrice
                | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"percentage" -> AddOnUsage_type
AddOnUsage_typeEnumPercentage
                | Bool
GHC.Base.otherwise -> Value -> AddOnUsage_type
AddOnUsage_typeOther Value
val
            )