{-# 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 AddOnUpdate
module RecurlyClient.Types.AddOnUpdate 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.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.AddOnUpdate@ in the specification.

Full add-on details.
-}
data AddOnUpdate = AddOnUpdate
    { AddOnUpdate -> Maybe Text
addOnUpdateAccounting_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. If an \`Item\` is associated to the \`AddOn\` then \`accounting code\` must be absent.
    --
    -- Constraints:
    --
    -- * Maximum length of 20
    -- * Must match pattern \'\/^[a-z0-9_+-]+\$\/\'
    , AddOnUpdate -> Maybe Int
addOnUpdateAvalara_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. If an \`Item\` is associated to the \`AddOn\`, then the \`avalara_service_type\` must be absent.
    --
    -- Constraints:
    --
    -- * Minimum  of 0.0
    , AddOnUpdate -> Maybe Int
addOnUpdateAvalara_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. If an \`Item\` is associated to the \`AddOn\`, then the \`avalara_transaction_type\` must be absent.
    --
    -- Constraints:
    --
    -- * Minimum  of 0.0
    , AddOnUpdate -> Maybe Text
addOnUpdateCode :: (GHC.Maybe.Maybe Data.Text.Internal.Text)
    -- ^ code: The unique identifier for the add-on within its plan. If an \`Item\` is associated to the \`AddOn\` then \`code\` must be absent.
    --
    -- Constraints:
    --
    -- * Maximum length of 50
    , AddOnUpdate -> Maybe (NonEmpty AddOnPricing)
addOnUpdateCurrencies :: (GHC.Maybe.Maybe (GHC.Base.NonEmpty AddOnPricing))
    -- ^ currencies: If the add-on\'s \`tier_type\` is \`tiered\`, \`volume\`, or \`stairstep\`,
    -- then currencies must be absent. Must also be absent if \`add_on_type\` is
    -- \`usage\` and \`usage_type\` is \`percentage\`.
    --
    --
    -- Constraints:
    --
    -- * Must have a minimum of 1 items
    , AddOnUpdate -> Maybe Int
addOnUpdateDefault_quantity :: (GHC.Maybe.Maybe GHC.Types.Int)
    -- ^ default_quantity: Default quantity for the hosted pages.
    , AddOnUpdate -> Maybe Bool
addOnUpdateDisplay_quantity :: (GHC.Maybe.Maybe GHC.Types.Bool)
    -- ^ display_quantity: Determines if the quantity field is displayed on the hosted pages for the add-on.
    , AddOnUpdate -> Maybe Text
addOnUpdateId :: (GHC.Maybe.Maybe Data.Text.Internal.Text)
    -- ^ id
    --
    -- Constraints:
    --
    -- * Maximum length of 13
    , AddOnUpdate -> Maybe Text
addOnUpdateLiability_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
    , AddOnUpdate -> Maybe Text
addOnUpdateMeasured_unit_id :: (GHC.Maybe.Maybe Data.Text.Internal.Text)
    -- ^ measured_unit_id: System-generated unique identifier for a measured unit to be associated with the add-on. Either \`measured_unit_id\` or \`measured_unit_name\` are required when \`add_on_type\` is \`usage\`. If \`measured_unit_id\` and \`measured_unit_name\` are both present, \`measured_unit_id\` will be used.
    --
    -- Constraints:
    --
    -- * Maximum length of 13
    , AddOnUpdate -> Maybe Text
addOnUpdateMeasured_unit_name :: (GHC.Maybe.Maybe Data.Text.Internal.Text)
    -- ^ measured_unit_name: Name of a measured unit to be associated with the add-on. Either \`measured_unit_id\` or \`measured_unit_name\` are required when \`add_on_type\` is \`usage\`. If \`measured_unit_id\` and \`measured_unit_name\` are both present, \`measured_unit_id\` will be used.
    , AddOnUpdate -> Maybe Text
addOnUpdateName :: (GHC.Maybe.Maybe Data.Text.Internal.Text)
    -- ^ name: Describes your add-on and will appear in subscribers\' invoices. If an \`Item\` is associated to the \`AddOn\` then \`name\` must be absent.
    --
    -- Constraints:
    --
    -- * Maximum length of 255
    , AddOnUpdate -> Maybe Bool
addOnUpdateOptional :: (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.
    , AddOnUpdate -> Maybe [PercentageTiersByCurrency]
addOnUpdatePercentage_tiers :: (GHC.Maybe.Maybe [PercentageTiersByCurrency])
    -- ^ percentage_tiers: \`percentage_tiers\` is an array of objects, which must have the set of tiers
    -- per currency and the currency code. The tier_type must be \`volume\` or \`tiered\`,
    -- if not, it must be absent. There must be one tier without an \`ending_amount\` value
    -- which represents the final tier. This feature is currently in development and
    -- requires approval and enablement, please contact support.
    , AddOnUpdate -> Maybe Text
addOnUpdatePerformance_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
    , AddOnUpdate -> Maybe Text
addOnUpdateRevenue_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
    , AddOnUpdate -> Maybe AddOnUpdateRevenue_schedule_type
addOnUpdateRevenue_schedule_type :: (GHC.Maybe.Maybe AddOnUpdateRevenue_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.
    , AddOnUpdate -> Maybe Text
addOnUpdateTax_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 an \`Item\` is associated to the \`AddOn\` then \`tax_code\` must be absent.
    --
    -- Constraints:
    --
    -- * Maximum length of 50
    , AddOnUpdate -> Maybe [Tier]
addOnUpdateTiers :: (GHC.Maybe.Maybe [Tier])
    -- ^ tiers: If the tier_type is \`flat\`, then \`tiers\` must be absent. The \`tiers\` object
    -- must include one to many tiers with \`ending_quantity\` and \`unit_amount\` for
    -- the desired \`currencies\`. There must be one tier without an \`ending_quantity\` value
    -- which represents the final tier.
    , AddOnUpdate -> Maybe AddOnUpdateUsage_calculation_type
addOnUpdateUsage_calculation_type :: (GHC.Maybe.Maybe AddOnUpdateUsage_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.
    , AddOnUpdate -> Maybe Float
addOnUpdateUsage_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. Required if \`add_on_type\` is usage, \`tier_type\` is \`flat\` and \`usage_type\` is percentage. Must be omitted otherwise.
    }
    deriving
        ( Int -> AddOnUpdate -> ShowS
[AddOnUpdate] -> ShowS
AddOnUpdate -> String
(Int -> AddOnUpdate -> ShowS)
-> (AddOnUpdate -> String)
-> ([AddOnUpdate] -> ShowS)
-> Show AddOnUpdate
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> AddOnUpdate -> ShowS
showsPrec :: Int -> AddOnUpdate -> ShowS
$cshow :: AddOnUpdate -> String
show :: AddOnUpdate -> String
$cshowList :: [AddOnUpdate] -> ShowS
showList :: [AddOnUpdate] -> ShowS
GHC.Show.Show
        , AddOnUpdate -> AddOnUpdate -> Bool
(AddOnUpdate -> AddOnUpdate -> Bool)
-> (AddOnUpdate -> AddOnUpdate -> Bool) -> Eq AddOnUpdate
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: AddOnUpdate -> AddOnUpdate -> Bool
== :: AddOnUpdate -> AddOnUpdate -> Bool
$c/= :: AddOnUpdate -> AddOnUpdate -> Bool
/= :: AddOnUpdate -> AddOnUpdate -> Bool
GHC.Classes.Eq
        )

instance Data.Aeson.Types.ToJSON.ToJSON AddOnUpdate where
    toJSON :: AddOnUpdate -> Value
toJSON AddOnUpdate
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..=)) (AddOnUpdate -> Maybe Text
addOnUpdateAccounting_code AddOnUpdate
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..=)) (AddOnUpdate -> Maybe Int
addOnUpdateAvalara_service_type AddOnUpdate
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..=)) (AddOnUpdate -> Maybe Int
addOnUpdateAvalara_transaction_type AddOnUpdate
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
"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..=)) (AddOnUpdate -> Maybe Text
addOnUpdateCode AddOnUpdate
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..=)) (AddOnUpdate -> Maybe (NonEmpty AddOnPricing)
addOnUpdateCurrencies AddOnUpdate
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..=)) (AddOnUpdate -> Maybe Int
addOnUpdateDefault_quantity AddOnUpdate
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..=)) (AddOnUpdate -> Maybe Bool
addOnUpdateDisplay_quantity AddOnUpdate
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..=)) (AddOnUpdate -> Maybe Text
addOnUpdateId AddOnUpdate
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..=)) (AddOnUpdate -> Maybe Text
addOnUpdateLiability_gl_account_id AddOnUpdate
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..=)) (AddOnUpdate -> Maybe Text
addOnUpdateMeasured_unit_id AddOnUpdate
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_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..=)) (AddOnUpdate -> Maybe Text
addOnUpdateMeasured_unit_name AddOnUpdate
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
"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..=)) (AddOnUpdate -> Maybe Text
addOnUpdateName AddOnUpdate
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..=)) (AddOnUpdate -> Maybe Bool
addOnUpdateOptional AddOnUpdate
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..=)) (AddOnUpdate -> Maybe [PercentageTiersByCurrency]
addOnUpdatePercentage_tiers AddOnUpdate
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..=)) (AddOnUpdate -> Maybe Text
addOnUpdatePerformance_obligation_id AddOnUpdate
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..=)) (AddOnUpdate -> Maybe Text
addOnUpdateRevenue_gl_account_id AddOnUpdate
obj) [Pair] -> [[Pair]] -> [[Pair]]
forall a. a -> [a] -> [a]
: [Pair]
-> (AddOnUpdateRevenue_schedule_type -> [Pair])
-> Maybe AddOnUpdateRevenue_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])
-> (AddOnUpdateRevenue_schedule_type -> Pair)
-> AddOnUpdateRevenue_schedule_type
-> [Pair]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"revenue_schedule_type" Key -> AddOnUpdateRevenue_schedule_type -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (AddOnUpdate -> Maybe AddOnUpdateRevenue_schedule_type
addOnUpdateRevenue_schedule_type AddOnUpdate
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..=)) (AddOnUpdate -> Maybe Text
addOnUpdateTax_code AddOnUpdate
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..=)) (AddOnUpdate -> Maybe [Tier]
addOnUpdateTiers AddOnUpdate
obj) [Pair] -> [[Pair]] -> [[Pair]]
forall a. a -> [a] -> [a]
: [Pair]
-> (AddOnUpdateUsage_calculation_type -> [Pair])
-> Maybe AddOnUpdateUsage_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])
-> (AddOnUpdateUsage_calculation_type -> Pair)
-> AddOnUpdateUsage_calculation_type
-> [Pair]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"usage_calculation_type" Key -> AddOnUpdateUsage_calculation_type -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (AddOnUpdate -> Maybe AddOnUpdateUsage_calculation_type
addOnUpdateUsage_calculation_type AddOnUpdate
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..=)) (AddOnUpdate -> Maybe Float
addOnUpdateUsage_percentage AddOnUpdate
obj) [Pair] -> [[Pair]] -> [[Pair]]
forall a. a -> [a] -> [a]
: [[Pair]]
forall a. Monoid a => a
GHC.Base.mempty))
    toEncoding :: AddOnUpdate -> Encoding
toEncoding AddOnUpdate
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..=)) (AddOnUpdate -> Maybe Text
addOnUpdateAccounting_code AddOnUpdate
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..=)) (AddOnUpdate -> Maybe Int
addOnUpdateAvalara_service_type AddOnUpdate
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..=)) (AddOnUpdate -> Maybe Int
addOnUpdateAvalara_transaction_type AddOnUpdate
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
"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..=)) (AddOnUpdate -> Maybe Text
addOnUpdateCode AddOnUpdate
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..=)) (AddOnUpdate -> Maybe (NonEmpty AddOnPricing)
addOnUpdateCurrencies AddOnUpdate
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..=)) (AddOnUpdate -> Maybe Int
addOnUpdateDefault_quantity AddOnUpdate
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..=)) (AddOnUpdate -> Maybe Bool
addOnUpdateDisplay_quantity AddOnUpdate
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..=)) (AddOnUpdate -> Maybe Text
addOnUpdateId AddOnUpdate
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..=)) (AddOnUpdate -> Maybe Text
addOnUpdateLiability_gl_account_id AddOnUpdate
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..=)) (AddOnUpdate -> Maybe Text
addOnUpdateMeasured_unit_id AddOnUpdate
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_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..=)) (AddOnUpdate -> Maybe Text
addOnUpdateMeasured_unit_name AddOnUpdate
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
"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..=)) (AddOnUpdate -> Maybe Text
addOnUpdateName AddOnUpdate
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..=)) (AddOnUpdate -> Maybe Bool
addOnUpdateOptional AddOnUpdate
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..=)) (AddOnUpdate -> Maybe [PercentageTiersByCurrency]
addOnUpdatePercentage_tiers AddOnUpdate
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..=)) (AddOnUpdate -> Maybe Text
addOnUpdatePerformance_obligation_id AddOnUpdate
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..=)) (AddOnUpdate -> Maybe Text
addOnUpdateRevenue_gl_account_id AddOnUpdate
obj) [Series] -> [[Series]] -> [[Series]]
forall a. a -> [a] -> [a]
: [Series]
-> (AddOnUpdateRevenue_schedule_type -> [Series])
-> Maybe AddOnUpdateRevenue_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])
-> (AddOnUpdateRevenue_schedule_type -> Series)
-> AddOnUpdateRevenue_schedule_type
-> [Series]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"revenue_schedule_type" Key -> AddOnUpdateRevenue_schedule_type -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (AddOnUpdate -> Maybe AddOnUpdateRevenue_schedule_type
addOnUpdateRevenue_schedule_type AddOnUpdate
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..=)) (AddOnUpdate -> Maybe Text
addOnUpdateTax_code AddOnUpdate
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..=)) (AddOnUpdate -> Maybe [Tier]
addOnUpdateTiers AddOnUpdate
obj) [Series] -> [[Series]] -> [[Series]]
forall a. a -> [a] -> [a]
: [Series]
-> (AddOnUpdateUsage_calculation_type -> [Series])
-> Maybe AddOnUpdateUsage_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])
-> (AddOnUpdateUsage_calculation_type -> Series)
-> AddOnUpdateUsage_calculation_type
-> [Series]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"usage_calculation_type" Key -> AddOnUpdateUsage_calculation_type -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (AddOnUpdate -> Maybe AddOnUpdateUsage_calculation_type
addOnUpdateUsage_calculation_type AddOnUpdate
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..=)) (AddOnUpdate -> Maybe Float
addOnUpdateUsage_percentage AddOnUpdate
obj) [Series] -> [[Series]] -> [[Series]]
forall a. a -> [a] -> [a]
: [[Series]]
forall a. Monoid a => a
GHC.Base.mempty)))
instance Data.Aeson.Types.FromJSON.FromJSON AddOnUpdate where
    parseJSON :: Value -> Parser AddOnUpdate
parseJSON = String
-> (Object -> Parser AddOnUpdate) -> Value -> Parser AddOnUpdate
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.Aeson.Types.FromJSON.withObject String
"AddOnUpdate" (\Object
obj -> (((((((((((((((((((((Maybe Text
 -> Maybe Int
 -> Maybe Int
 -> Maybe Text
 -> Maybe (NonEmpty AddOnPricing)
 -> Maybe Int
 -> Maybe Bool
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Bool
 -> Maybe [PercentageTiersByCurrency]
 -> Maybe Text
 -> Maybe Text
 -> Maybe AddOnUpdateRevenue_schedule_type
 -> Maybe Text
 -> Maybe [Tier]
 -> Maybe AddOnUpdateUsage_calculation_type
 -> Maybe Float
 -> AddOnUpdate)
-> Parser
     (Maybe Text
      -> Maybe Int
      -> Maybe Int
      -> Maybe Text
      -> Maybe (NonEmpty AddOnPricing)
      -> Maybe Int
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Bool
      -> Maybe [PercentageTiersByCurrency]
      -> Maybe Text
      -> Maybe Text
      -> Maybe AddOnUpdateRevenue_schedule_type
      -> Maybe Text
      -> Maybe [Tier]
      -> Maybe AddOnUpdateUsage_calculation_type
      -> Maybe Float
      -> AddOnUpdate)
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure Maybe Text
-> Maybe Int
-> Maybe Int
-> Maybe Text
-> Maybe (NonEmpty AddOnPricing)
-> Maybe Int
-> Maybe Bool
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Bool
-> Maybe [PercentageTiersByCurrency]
-> Maybe Text
-> Maybe Text
-> Maybe AddOnUpdateRevenue_schedule_type
-> Maybe Text
-> Maybe [Tier]
-> Maybe AddOnUpdateUsage_calculation_type
-> Maybe Float
-> AddOnUpdate
AddOnUpdate Parser
  (Maybe Text
   -> Maybe Int
   -> Maybe Int
   -> Maybe Text
   -> Maybe (NonEmpty AddOnPricing)
   -> Maybe Int
   -> Maybe Bool
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Bool
   -> Maybe [PercentageTiersByCurrency]
   -> Maybe Text
   -> Maybe Text
   -> Maybe AddOnUpdateRevenue_schedule_type
   -> Maybe Text
   -> Maybe [Tier]
   -> Maybe AddOnUpdateUsage_calculation_type
   -> Maybe Float
   -> AddOnUpdate)
-> Parser (Maybe Text)
-> Parser
     (Maybe Int
      -> Maybe Int
      -> Maybe Text
      -> Maybe (NonEmpty AddOnPricing)
      -> Maybe Int
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Bool
      -> Maybe [PercentageTiersByCurrency]
      -> Maybe Text
      -> Maybe Text
      -> Maybe AddOnUpdateRevenue_schedule_type
      -> Maybe Text
      -> Maybe [Tier]
      -> Maybe AddOnUpdateUsage_calculation_type
      -> Maybe Float
      -> AddOnUpdate)
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 Int
   -> Maybe Int
   -> Maybe Text
   -> Maybe (NonEmpty AddOnPricing)
   -> Maybe Int
   -> Maybe Bool
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Bool
   -> Maybe [PercentageTiersByCurrency]
   -> Maybe Text
   -> Maybe Text
   -> Maybe AddOnUpdateRevenue_schedule_type
   -> Maybe Text
   -> Maybe [Tier]
   -> Maybe AddOnUpdateUsage_calculation_type
   -> Maybe Float
   -> AddOnUpdate)
-> Parser (Maybe Int)
-> Parser
     (Maybe Int
      -> Maybe Text
      -> Maybe (NonEmpty AddOnPricing)
      -> Maybe Int
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Bool
      -> Maybe [PercentageTiersByCurrency]
      -> Maybe Text
      -> Maybe Text
      -> Maybe AddOnUpdateRevenue_schedule_type
      -> Maybe Text
      -> Maybe [Tier]
      -> Maybe AddOnUpdateUsage_calculation_type
      -> Maybe Float
      -> AddOnUpdate)
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
   -> Maybe Text
   -> Maybe (NonEmpty AddOnPricing)
   -> Maybe Int
   -> Maybe Bool
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Bool
   -> Maybe [PercentageTiersByCurrency]
   -> Maybe Text
   -> Maybe Text
   -> Maybe AddOnUpdateRevenue_schedule_type
   -> Maybe Text
   -> Maybe [Tier]
   -> Maybe AddOnUpdateUsage_calculation_type
   -> Maybe Float
   -> AddOnUpdate)
-> Parser (Maybe Int)
-> Parser
     (Maybe Text
      -> Maybe (NonEmpty AddOnPricing)
      -> Maybe Int
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Bool
      -> Maybe [PercentageTiersByCurrency]
      -> Maybe Text
      -> Maybe Text
      -> Maybe AddOnUpdateRevenue_schedule_type
      -> Maybe Text
      -> Maybe [Tier]
      -> Maybe AddOnUpdateUsage_calculation_type
      -> Maybe Float
      -> AddOnUpdate)
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
  (Maybe Text
   -> Maybe (NonEmpty AddOnPricing)
   -> Maybe Int
   -> Maybe Bool
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Bool
   -> Maybe [PercentageTiersByCurrency]
   -> Maybe Text
   -> Maybe Text
   -> Maybe AddOnUpdateRevenue_schedule_type
   -> Maybe Text
   -> Maybe [Tier]
   -> Maybe AddOnUpdateUsage_calculation_type
   -> Maybe Float
   -> AddOnUpdate)
-> Parser (Maybe Text)
-> Parser
     (Maybe (NonEmpty AddOnPricing)
      -> Maybe Int
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Bool
      -> Maybe [PercentageTiersByCurrency]
      -> Maybe Text
      -> Maybe Text
      -> Maybe AddOnUpdateRevenue_schedule_type
      -> Maybe Text
      -> Maybe [Tier]
      -> Maybe AddOnUpdateUsage_calculation_type
      -> Maybe Float
      -> AddOnUpdate)
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
"code")) Parser
  (Maybe (NonEmpty AddOnPricing)
   -> Maybe Int
   -> Maybe Bool
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Bool
   -> Maybe [PercentageTiersByCurrency]
   -> Maybe Text
   -> Maybe Text
   -> Maybe AddOnUpdateRevenue_schedule_type
   -> Maybe Text
   -> Maybe [Tier]
   -> Maybe AddOnUpdateUsage_calculation_type
   -> Maybe Float
   -> AddOnUpdate)
-> Parser (Maybe (NonEmpty AddOnPricing))
-> Parser
     (Maybe Int
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Bool
      -> Maybe [PercentageTiersByCurrency]
      -> Maybe Text
      -> Maybe Text
      -> Maybe AddOnUpdateRevenue_schedule_type
      -> Maybe Text
      -> Maybe [Tier]
      -> Maybe AddOnUpdateUsage_calculation_type
      -> Maybe Float
      -> AddOnUpdate)
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 Bool
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Bool
   -> Maybe [PercentageTiersByCurrency]
   -> Maybe Text
   -> Maybe Text
   -> Maybe AddOnUpdateRevenue_schedule_type
   -> Maybe Text
   -> Maybe [Tier]
   -> Maybe AddOnUpdateUsage_calculation_type
   -> Maybe Float
   -> AddOnUpdate)
-> Parser (Maybe Int)
-> Parser
     (Maybe Bool
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Bool
      -> Maybe [PercentageTiersByCurrency]
      -> Maybe Text
      -> Maybe Text
      -> Maybe AddOnUpdateRevenue_schedule_type
      -> Maybe Text
      -> Maybe [Tier]
      -> Maybe AddOnUpdateUsage_calculation_type
      -> Maybe Float
      -> AddOnUpdate)
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 Bool
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Bool
   -> Maybe [PercentageTiersByCurrency]
   -> Maybe Text
   -> Maybe Text
   -> Maybe AddOnUpdateRevenue_schedule_type
   -> Maybe Text
   -> Maybe [Tier]
   -> Maybe AddOnUpdateUsage_calculation_type
   -> Maybe Float
   -> AddOnUpdate)
-> Parser (Maybe Bool)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Bool
      -> Maybe [PercentageTiersByCurrency]
      -> Maybe Text
      -> Maybe Text
      -> Maybe AddOnUpdateRevenue_schedule_type
      -> Maybe Text
      -> Maybe [Tier]
      -> Maybe AddOnUpdateUsage_calculation_type
      -> Maybe Float
      -> AddOnUpdate)
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 Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Bool
   -> Maybe [PercentageTiersByCurrency]
   -> Maybe Text
   -> Maybe Text
   -> Maybe AddOnUpdateRevenue_schedule_type
   -> Maybe Text
   -> Maybe [Tier]
   -> Maybe AddOnUpdateUsage_calculation_type
   -> Maybe Float
   -> AddOnUpdate)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Bool
      -> Maybe [PercentageTiersByCurrency]
      -> Maybe Text
      -> Maybe Text
      -> Maybe AddOnUpdateRevenue_schedule_type
      -> Maybe Text
      -> Maybe [Tier]
      -> Maybe AddOnUpdateUsage_calculation_type
      -> Maybe Float
      -> AddOnUpdate)
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 Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Bool
   -> Maybe [PercentageTiersByCurrency]
   -> Maybe Text
   -> Maybe Text
   -> Maybe AddOnUpdateRevenue_schedule_type
   -> Maybe Text
   -> Maybe [Tier]
   -> Maybe AddOnUpdateUsage_calculation_type
   -> Maybe Float
   -> AddOnUpdate)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Bool
      -> Maybe [PercentageTiersByCurrency]
      -> Maybe Text
      -> Maybe Text
      -> Maybe AddOnUpdateRevenue_schedule_type
      -> Maybe Text
      -> Maybe [Tier]
      -> Maybe AddOnUpdateUsage_calculation_type
      -> Maybe Float
      -> AddOnUpdate)
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
   -> Maybe Text
   -> Maybe Text
   -> Maybe Bool
   -> Maybe [PercentageTiersByCurrency]
   -> Maybe Text
   -> Maybe Text
   -> Maybe AddOnUpdateRevenue_schedule_type
   -> Maybe Text
   -> Maybe [Tier]
   -> Maybe AddOnUpdateUsage_calculation_type
   -> Maybe Float
   -> AddOnUpdate)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Bool
      -> Maybe [PercentageTiersByCurrency]
      -> Maybe Text
      -> Maybe Text
      -> Maybe AddOnUpdateRevenue_schedule_type
      -> Maybe Text
      -> Maybe [Tier]
      -> Maybe AddOnUpdateUsage_calculation_type
      -> Maybe Float
      -> AddOnUpdate)
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
  (Maybe Text
   -> Maybe Text
   -> Maybe Bool
   -> Maybe [PercentageTiersByCurrency]
   -> Maybe Text
   -> Maybe Text
   -> Maybe AddOnUpdateRevenue_schedule_type
   -> Maybe Text
   -> Maybe [Tier]
   -> Maybe AddOnUpdateUsage_calculation_type
   -> Maybe Float
   -> AddOnUpdate)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Bool
      -> Maybe [PercentageTiersByCurrency]
      -> Maybe Text
      -> Maybe Text
      -> Maybe AddOnUpdateRevenue_schedule_type
      -> Maybe Text
      -> Maybe [Tier]
      -> Maybe AddOnUpdateUsage_calculation_type
      -> Maybe Float
      -> AddOnUpdate)
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_name")) Parser
  (Maybe Text
   -> Maybe Bool
   -> Maybe [PercentageTiersByCurrency]
   -> Maybe Text
   -> Maybe Text
   -> Maybe AddOnUpdateRevenue_schedule_type
   -> Maybe Text
   -> Maybe [Tier]
   -> Maybe AddOnUpdateUsage_calculation_type
   -> Maybe Float
   -> AddOnUpdate)
-> Parser (Maybe Text)
-> Parser
     (Maybe Bool
      -> Maybe [PercentageTiersByCurrency]
      -> Maybe Text
      -> Maybe Text
      -> Maybe AddOnUpdateRevenue_schedule_type
      -> Maybe Text
      -> Maybe [Tier]
      -> Maybe AddOnUpdateUsage_calculation_type
      -> Maybe Float
      -> AddOnUpdate)
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
"name")) Parser
  (Maybe Bool
   -> Maybe [PercentageTiersByCurrency]
   -> Maybe Text
   -> Maybe Text
   -> Maybe AddOnUpdateRevenue_schedule_type
   -> Maybe Text
   -> Maybe [Tier]
   -> Maybe AddOnUpdateUsage_calculation_type
   -> Maybe Float
   -> AddOnUpdate)
-> Parser (Maybe Bool)
-> Parser
     (Maybe [PercentageTiersByCurrency]
      -> Maybe Text
      -> Maybe Text
      -> Maybe AddOnUpdateRevenue_schedule_type
      -> Maybe Text
      -> Maybe [Tier]
      -> Maybe AddOnUpdateUsage_calculation_type
      -> Maybe Float
      -> AddOnUpdate)
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 AddOnUpdateRevenue_schedule_type
   -> Maybe Text
   -> Maybe [Tier]
   -> Maybe AddOnUpdateUsage_calculation_type
   -> Maybe Float
   -> AddOnUpdate)
-> Parser (Maybe [PercentageTiersByCurrency])
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe AddOnUpdateRevenue_schedule_type
      -> Maybe Text
      -> Maybe [Tier]
      -> Maybe AddOnUpdateUsage_calculation_type
      -> Maybe Float
      -> AddOnUpdate)
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 AddOnUpdateRevenue_schedule_type
   -> Maybe Text
   -> Maybe [Tier]
   -> Maybe AddOnUpdateUsage_calculation_type
   -> Maybe Float
   -> AddOnUpdate)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe AddOnUpdateRevenue_schedule_type
      -> Maybe Text
      -> Maybe [Tier]
      -> Maybe AddOnUpdateUsage_calculation_type
      -> Maybe Float
      -> AddOnUpdate)
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 AddOnUpdateRevenue_schedule_type
   -> Maybe Text
   -> Maybe [Tier]
   -> Maybe AddOnUpdateUsage_calculation_type
   -> Maybe Float
   -> AddOnUpdate)
-> Parser (Maybe Text)
-> Parser
     (Maybe AddOnUpdateRevenue_schedule_type
      -> Maybe Text
      -> Maybe [Tier]
      -> Maybe AddOnUpdateUsage_calculation_type
      -> Maybe Float
      -> AddOnUpdate)
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 AddOnUpdateRevenue_schedule_type
   -> Maybe Text
   -> Maybe [Tier]
   -> Maybe AddOnUpdateUsage_calculation_type
   -> Maybe Float
   -> AddOnUpdate)
-> Parser (Maybe AddOnUpdateRevenue_schedule_type)
-> Parser
     (Maybe Text
      -> Maybe [Tier]
      -> Maybe AddOnUpdateUsage_calculation_type
      -> Maybe Float
      -> AddOnUpdate)
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 AddOnUpdateRevenue_schedule_type)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Key
"revenue_schedule_type")) Parser
  (Maybe Text
   -> Maybe [Tier]
   -> Maybe AddOnUpdateUsage_calculation_type
   -> Maybe Float
   -> AddOnUpdate)
-> Parser (Maybe Text)
-> Parser
     (Maybe [Tier]
      -> Maybe AddOnUpdateUsage_calculation_type
      -> Maybe Float
      -> AddOnUpdate)
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 [Tier]
   -> Maybe AddOnUpdateUsage_calculation_type
   -> Maybe Float
   -> AddOnUpdate)
-> Parser (Maybe [Tier])
-> Parser
     (Maybe AddOnUpdateUsage_calculation_type
      -> Maybe Float -> AddOnUpdate)
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 AddOnUpdateUsage_calculation_type
   -> Maybe Float -> AddOnUpdate)
-> Parser (Maybe AddOnUpdateUsage_calculation_type)
-> Parser (Maybe Float -> AddOnUpdate)
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 AddOnUpdateUsage_calculation_type)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Key
"usage_calculation_type")) Parser (Maybe Float -> AddOnUpdate)
-> Parser (Maybe Float) -> Parser AddOnUpdate
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"))

-- | Create a new 'AddOnUpdate' with all required fields.
mkAddOnUpdate :: AddOnUpdate
mkAddOnUpdate :: AddOnUpdate
mkAddOnUpdate =
    AddOnUpdate
        { addOnUpdateAccounting_code :: Maybe Text
addOnUpdateAccounting_code = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing
        , addOnUpdateAvalara_service_type :: Maybe Int
addOnUpdateAvalara_service_type = Maybe Int
forall a. Maybe a
GHC.Maybe.Nothing
        , addOnUpdateAvalara_transaction_type :: Maybe Int
addOnUpdateAvalara_transaction_type = Maybe Int
forall a. Maybe a
GHC.Maybe.Nothing
        , addOnUpdateCode :: Maybe Text
addOnUpdateCode = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing
        , addOnUpdateCurrencies :: Maybe (NonEmpty AddOnPricing)
addOnUpdateCurrencies = Maybe (NonEmpty AddOnPricing)
forall a. Maybe a
GHC.Maybe.Nothing
        , addOnUpdateDefault_quantity :: Maybe Int
addOnUpdateDefault_quantity = Maybe Int
forall a. Maybe a
GHC.Maybe.Nothing
        , addOnUpdateDisplay_quantity :: Maybe Bool
addOnUpdateDisplay_quantity = Maybe Bool
forall a. Maybe a
GHC.Maybe.Nothing
        , addOnUpdateId :: Maybe Text
addOnUpdateId = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing
        , addOnUpdateLiability_gl_account_id :: Maybe Text
addOnUpdateLiability_gl_account_id = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing
        , addOnUpdateMeasured_unit_id :: Maybe Text
addOnUpdateMeasured_unit_id = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing
        , addOnUpdateMeasured_unit_name :: Maybe Text
addOnUpdateMeasured_unit_name = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing
        , addOnUpdateName :: Maybe Text
addOnUpdateName = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing
        , addOnUpdateOptional :: Maybe Bool
addOnUpdateOptional = Maybe Bool
forall a. Maybe a
GHC.Maybe.Nothing
        , addOnUpdatePercentage_tiers :: Maybe [PercentageTiersByCurrency]
addOnUpdatePercentage_tiers = Maybe [PercentageTiersByCurrency]
forall a. Maybe a
GHC.Maybe.Nothing
        , addOnUpdatePerformance_obligation_id :: Maybe Text
addOnUpdatePerformance_obligation_id = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing
        , addOnUpdateRevenue_gl_account_id :: Maybe Text
addOnUpdateRevenue_gl_account_id = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing
        , addOnUpdateRevenue_schedule_type :: Maybe AddOnUpdateRevenue_schedule_type
addOnUpdateRevenue_schedule_type = Maybe AddOnUpdateRevenue_schedule_type
forall a. Maybe a
GHC.Maybe.Nothing
        , addOnUpdateTax_code :: Maybe Text
addOnUpdateTax_code = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing
        , addOnUpdateTiers :: Maybe [Tier]
addOnUpdateTiers = Maybe [Tier]
forall a. Maybe a
GHC.Maybe.Nothing
        , addOnUpdateUsage_calculation_type :: Maybe AddOnUpdateUsage_calculation_type
addOnUpdateUsage_calculation_type = Maybe AddOnUpdateUsage_calculation_type
forall a. Maybe a
GHC.Maybe.Nothing
        , addOnUpdateUsage_percentage :: Maybe Float
addOnUpdateUsage_percentage = Maybe Float
forall a. Maybe a
GHC.Maybe.Nothing
        }

{- | Defines the enum schema located at @components.schemas.AddOnUpdate.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 AddOnUpdateRevenue_schedule_type
    = -- | This case is used if the value encountered during decoding does not match any of the provided cases in the specification.
      AddOnUpdateRevenue_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.
      AddOnUpdateRevenue_schedule_typeTyped Data.Text.Internal.Text
    | -- | Represents the JSON value @"at_range_end"@
      AddOnUpdateRevenue_schedule_typeEnumAt_range_end
    | -- | Represents the JSON value @"at_range_start"@
      AddOnUpdateRevenue_schedule_typeEnumAt_range_start
    | -- | Represents the JSON value @"evenly"@
      AddOnUpdateRevenue_schedule_typeEnumEvenly
    | -- | Represents the JSON value @"never"@
      AddOnUpdateRevenue_schedule_typeEnumNever
    deriving (Int -> AddOnUpdateRevenue_schedule_type -> ShowS
[AddOnUpdateRevenue_schedule_type] -> ShowS
AddOnUpdateRevenue_schedule_type -> String
(Int -> AddOnUpdateRevenue_schedule_type -> ShowS)
-> (AddOnUpdateRevenue_schedule_type -> String)
-> ([AddOnUpdateRevenue_schedule_type] -> ShowS)
-> Show AddOnUpdateRevenue_schedule_type
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> AddOnUpdateRevenue_schedule_type -> ShowS
showsPrec :: Int -> AddOnUpdateRevenue_schedule_type -> ShowS
$cshow :: AddOnUpdateRevenue_schedule_type -> String
show :: AddOnUpdateRevenue_schedule_type -> String
$cshowList :: [AddOnUpdateRevenue_schedule_type] -> ShowS
showList :: [AddOnUpdateRevenue_schedule_type] -> ShowS
GHC.Show.Show, AddOnUpdateRevenue_schedule_type
-> AddOnUpdateRevenue_schedule_type -> Bool
(AddOnUpdateRevenue_schedule_type
 -> AddOnUpdateRevenue_schedule_type -> Bool)
-> (AddOnUpdateRevenue_schedule_type
    -> AddOnUpdateRevenue_schedule_type -> Bool)
-> Eq AddOnUpdateRevenue_schedule_type
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: AddOnUpdateRevenue_schedule_type
-> AddOnUpdateRevenue_schedule_type -> Bool
== :: AddOnUpdateRevenue_schedule_type
-> AddOnUpdateRevenue_schedule_type -> Bool
$c/= :: AddOnUpdateRevenue_schedule_type
-> AddOnUpdateRevenue_schedule_type -> Bool
/= :: AddOnUpdateRevenue_schedule_type
-> AddOnUpdateRevenue_schedule_type -> Bool
GHC.Classes.Eq)

instance Data.Aeson.Types.ToJSON.ToJSON AddOnUpdateRevenue_schedule_type where
    toJSON :: AddOnUpdateRevenue_schedule_type -> Value
toJSON (AddOnUpdateRevenue_schedule_typeOther Value
val) = Value
val
    toJSON (AddOnUpdateRevenue_schedule_typeTyped Text
val) = Text -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON Text
val
    toJSON (AddOnUpdateRevenue_schedule_type
AddOnUpdateRevenue_schedule_typeEnumAt_range_end) = Value
"at_range_end"
    toJSON (AddOnUpdateRevenue_schedule_type
AddOnUpdateRevenue_schedule_typeEnumAt_range_start) = Value
"at_range_start"
    toJSON (AddOnUpdateRevenue_schedule_type
AddOnUpdateRevenue_schedule_typeEnumEvenly) = Value
"evenly"
    toJSON (AddOnUpdateRevenue_schedule_type
AddOnUpdateRevenue_schedule_typeEnumNever) = Value
"never"
instance Data.Aeson.Types.FromJSON.FromJSON AddOnUpdateRevenue_schedule_type where
    parseJSON :: Value -> Parser AddOnUpdateRevenue_schedule_type
parseJSON Value
val =
        AddOnUpdateRevenue_schedule_type
-> Parser AddOnUpdateRevenue_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" -> AddOnUpdateRevenue_schedule_type
AddOnUpdateRevenue_schedule_typeEnumAt_range_end
                | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"at_range_start" -> AddOnUpdateRevenue_schedule_type
AddOnUpdateRevenue_schedule_typeEnumAt_range_start
                | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"evenly" -> AddOnUpdateRevenue_schedule_type
AddOnUpdateRevenue_schedule_typeEnumEvenly
                | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"never" -> AddOnUpdateRevenue_schedule_type
AddOnUpdateRevenue_schedule_typeEnumNever
                | Bool
GHC.Base.otherwise -> Value -> AddOnUpdateRevenue_schedule_type
AddOnUpdateRevenue_schedule_typeOther Value
val
            )

{- | Defines the enum schema located at @components.schemas.AddOnUpdate.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 AddOnUpdateUsage_calculation_type
    = -- | This case is used if the value encountered during decoding does not match any of the provided cases in the specification.
      AddOnUpdateUsage_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.
      AddOnUpdateUsage_calculation_typeTyped Data.Text.Internal.Text
    | -- | Represents the JSON value @"cumulative"@
      AddOnUpdateUsage_calculation_typeEnumCumulative
    | -- | Represents the JSON value @"last_in_period"@
      AddOnUpdateUsage_calculation_typeEnumLast_in_period
    deriving (Int -> AddOnUpdateUsage_calculation_type -> ShowS
[AddOnUpdateUsage_calculation_type] -> ShowS
AddOnUpdateUsage_calculation_type -> String
(Int -> AddOnUpdateUsage_calculation_type -> ShowS)
-> (AddOnUpdateUsage_calculation_type -> String)
-> ([AddOnUpdateUsage_calculation_type] -> ShowS)
-> Show AddOnUpdateUsage_calculation_type
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> AddOnUpdateUsage_calculation_type -> ShowS
showsPrec :: Int -> AddOnUpdateUsage_calculation_type -> ShowS
$cshow :: AddOnUpdateUsage_calculation_type -> String
show :: AddOnUpdateUsage_calculation_type -> String
$cshowList :: [AddOnUpdateUsage_calculation_type] -> ShowS
showList :: [AddOnUpdateUsage_calculation_type] -> ShowS
GHC.Show.Show, AddOnUpdateUsage_calculation_type
-> AddOnUpdateUsage_calculation_type -> Bool
(AddOnUpdateUsage_calculation_type
 -> AddOnUpdateUsage_calculation_type -> Bool)
-> (AddOnUpdateUsage_calculation_type
    -> AddOnUpdateUsage_calculation_type -> Bool)
-> Eq AddOnUpdateUsage_calculation_type
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: AddOnUpdateUsage_calculation_type
-> AddOnUpdateUsage_calculation_type -> Bool
== :: AddOnUpdateUsage_calculation_type
-> AddOnUpdateUsage_calculation_type -> Bool
$c/= :: AddOnUpdateUsage_calculation_type
-> AddOnUpdateUsage_calculation_type -> Bool
/= :: AddOnUpdateUsage_calculation_type
-> AddOnUpdateUsage_calculation_type -> Bool
GHC.Classes.Eq)

instance Data.Aeson.Types.ToJSON.ToJSON AddOnUpdateUsage_calculation_type where
    toJSON :: AddOnUpdateUsage_calculation_type -> Value
toJSON (AddOnUpdateUsage_calculation_typeOther Value
val) = Value
val
    toJSON (AddOnUpdateUsage_calculation_typeTyped Text
val) = Text -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON Text
val
    toJSON (AddOnUpdateUsage_calculation_type
AddOnUpdateUsage_calculation_typeEnumCumulative) = Value
"cumulative"
    toJSON (AddOnUpdateUsage_calculation_type
AddOnUpdateUsage_calculation_typeEnumLast_in_period) = Value
"last_in_period"
instance Data.Aeson.Types.FromJSON.FromJSON AddOnUpdateUsage_calculation_type where
    parseJSON :: Value -> Parser AddOnUpdateUsage_calculation_type
parseJSON Value
val =
        AddOnUpdateUsage_calculation_type
-> Parser AddOnUpdateUsage_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" -> AddOnUpdateUsage_calculation_type
AddOnUpdateUsage_calculation_typeEnumCumulative
                | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"last_in_period" -> AddOnUpdateUsage_calculation_type
AddOnUpdateUsage_calculation_typeEnumLast_in_period
                | Bool
GHC.Base.otherwise -> Value -> AddOnUpdateUsage_calculation_type
AddOnUpdateUsage_calculation_typeOther Value
val
            )