{-# LANGUAGE MultiWayIf #-}
{-# LANGUAGE OverloadedStrings #-}
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
data AddOnUpdate = AddOnUpdate
{ AddOnUpdate -> Maybe Text
addOnUpdateAccounting_code :: (GHC.Maybe.Maybe Data.Text.Internal.Text)
, AddOnUpdate -> Maybe Int
addOnUpdateAvalara_service_type :: (GHC.Maybe.Maybe GHC.Types.Int)
, AddOnUpdate -> Maybe Int
addOnUpdateAvalara_transaction_type :: (GHC.Maybe.Maybe GHC.Types.Int)
, AddOnUpdate -> Maybe Text
addOnUpdateCode :: (GHC.Maybe.Maybe Data.Text.Internal.Text)
, AddOnUpdate -> Maybe (NonEmpty AddOnPricing)
addOnUpdateCurrencies :: (GHC.Maybe.Maybe (GHC.Base.NonEmpty AddOnPricing))
, AddOnUpdate -> Maybe Int
addOnUpdateDefault_quantity :: (GHC.Maybe.Maybe GHC.Types.Int)
, AddOnUpdate -> Maybe Bool
addOnUpdateDisplay_quantity :: (GHC.Maybe.Maybe GHC.Types.Bool)
, AddOnUpdate -> Maybe Text
addOnUpdateId :: (GHC.Maybe.Maybe Data.Text.Internal.Text)
, AddOnUpdate -> Maybe Text
addOnUpdateLiability_gl_account_id :: (GHC.Maybe.Maybe Data.Text.Internal.Text)
, AddOnUpdate -> Maybe Text
addOnUpdateMeasured_unit_id :: (GHC.Maybe.Maybe Data.Text.Internal.Text)
, AddOnUpdate -> Maybe Text
addOnUpdateMeasured_unit_name :: (GHC.Maybe.Maybe Data.Text.Internal.Text)
, AddOnUpdate -> Maybe Text
addOnUpdateName :: (GHC.Maybe.Maybe Data.Text.Internal.Text)
, AddOnUpdate -> Maybe Bool
addOnUpdateOptional :: (GHC.Maybe.Maybe GHC.Types.Bool)
, AddOnUpdate -> Maybe [PercentageTiersByCurrency]
addOnUpdatePercentage_tiers :: (GHC.Maybe.Maybe [PercentageTiersByCurrency])
, AddOnUpdate -> Maybe Text
addOnUpdatePerformance_obligation_id :: (GHC.Maybe.Maybe Data.Text.Internal.Text)
, AddOnUpdate -> Maybe Text
addOnUpdateRevenue_gl_account_id :: (GHC.Maybe.Maybe Data.Text.Internal.Text)
, AddOnUpdate -> Maybe AddOnUpdateRevenue_schedule_type
addOnUpdateRevenue_schedule_type :: (GHC.Maybe.Maybe AddOnUpdateRevenue_schedule_type)
, AddOnUpdate -> Maybe Text
addOnUpdateTax_code :: (GHC.Maybe.Maybe Data.Text.Internal.Text)
, AddOnUpdate -> Maybe [Tier]
addOnUpdateTiers :: (GHC.Maybe.Maybe [Tier])
, AddOnUpdate -> Maybe AddOnUpdateUsage_calculation_type
addOnUpdateUsage_calculation_type :: (GHC.Maybe.Maybe AddOnUpdateUsage_calculation_type)
, AddOnUpdate -> Maybe Float
addOnUpdateUsage_percentage :: (GHC.Maybe.Maybe GHC.Types.Float)
}
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"))
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
}
data AddOnUpdateRevenue_schedule_type
=
AddOnUpdateRevenue_schedule_typeOther Data.Aeson.Types.Internal.Value
|
AddOnUpdateRevenue_schedule_typeTyped Data.Text.Internal.Text
|
AddOnUpdateRevenue_schedule_typeEnumAt_range_end
|
AddOnUpdateRevenue_schedule_typeEnumAt_range_start
|
AddOnUpdateRevenue_schedule_typeEnumEvenly
|
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
)
data AddOnUpdateUsage_calculation_type
=
AddOnUpdateUsage_calculation_typeOther Data.Aeson.Types.Internal.Value
|
AddOnUpdateUsage_calculation_typeTyped Data.Text.Internal.Text
|
AddOnUpdateUsage_calculation_typeEnumCumulative
|
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
)