{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.Budgets.Types.CostTypes
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.Budgets.Types.CostTypes where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude

-- | The types of cost that are included in a @COST@ budget, such as tax and
-- subscriptions.
--
-- @USAGE@, @RI_UTILIZATION@, @RI_COVERAGE@, @SAVINGS_PLANS_UTILIZATION@,
-- and @SAVINGS_PLANS_COVERAGE@ budgets don\'t have @CostTypes@.
--
-- /See:/ 'newCostTypes' smart constructor.
data CostTypes = CostTypes'
  { -- | Specifies whether a budget includes credits.
    --
    -- The default value is @true@.
    CostTypes -> Maybe Bool
includeCredit :: Prelude.Maybe Prelude.Bool,
    -- | Specifies whether a budget includes discounts.
    --
    -- The default value is @true@.
    CostTypes -> Maybe Bool
includeDiscount :: Prelude.Maybe Prelude.Bool,
    -- | Specifies whether a budget includes non-RI subscription costs.
    --
    -- The default value is @true@.
    CostTypes -> Maybe Bool
includeOtherSubscription :: Prelude.Maybe Prelude.Bool,
    -- | Specifies whether a budget includes recurring fees such as monthly RI
    -- fees.
    --
    -- The default value is @true@.
    CostTypes -> Maybe Bool
includeRecurring :: Prelude.Maybe Prelude.Bool,
    -- | Specifies whether a budget includes refunds.
    --
    -- The default value is @true@.
    CostTypes -> Maybe Bool
includeRefund :: Prelude.Maybe Prelude.Bool,
    -- | Specifies whether a budget includes subscriptions.
    --
    -- The default value is @true@.
    CostTypes -> Maybe Bool
includeSubscription :: Prelude.Maybe Prelude.Bool,
    -- | Specifies whether a budget includes support subscription fees.
    --
    -- The default value is @true@.
    CostTypes -> Maybe Bool
includeSupport :: Prelude.Maybe Prelude.Bool,
    -- | Specifies whether a budget includes taxes.
    --
    -- The default value is @true@.
    CostTypes -> Maybe Bool
includeTax :: Prelude.Maybe Prelude.Bool,
    -- | Specifies whether a budget includes upfront RI costs.
    --
    -- The default value is @true@.
    CostTypes -> Maybe Bool
includeUpfront :: Prelude.Maybe Prelude.Bool,
    -- | Specifies whether a budget uses the amortized rate.
    --
    -- The default value is @false@.
    CostTypes -> Maybe Bool
useAmortized :: Prelude.Maybe Prelude.Bool,
    -- | Specifies whether a budget uses a blended rate.
    --
    -- The default value is @false@.
    CostTypes -> Maybe Bool
useBlended :: Prelude.Maybe Prelude.Bool
  }
  deriving (CostTypes -> CostTypes -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CostTypes -> CostTypes -> Bool
$c/= :: CostTypes -> CostTypes -> Bool
== :: CostTypes -> CostTypes -> Bool
$c== :: CostTypes -> CostTypes -> Bool
Prelude.Eq, ReadPrec [CostTypes]
ReadPrec CostTypes
Int -> ReadS CostTypes
ReadS [CostTypes]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CostTypes]
$creadListPrec :: ReadPrec [CostTypes]
readPrec :: ReadPrec CostTypes
$creadPrec :: ReadPrec CostTypes
readList :: ReadS [CostTypes]
$creadList :: ReadS [CostTypes]
readsPrec :: Int -> ReadS CostTypes
$creadsPrec :: Int -> ReadS CostTypes
Prelude.Read, Int -> CostTypes -> ShowS
[CostTypes] -> ShowS
CostTypes -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CostTypes] -> ShowS
$cshowList :: [CostTypes] -> ShowS
show :: CostTypes -> String
$cshow :: CostTypes -> String
showsPrec :: Int -> CostTypes -> ShowS
$cshowsPrec :: Int -> CostTypes -> ShowS
Prelude.Show, forall x. Rep CostTypes x -> CostTypes
forall x. CostTypes -> Rep CostTypes x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CostTypes x -> CostTypes
$cfrom :: forall x. CostTypes -> Rep CostTypes x
Prelude.Generic)

-- |
-- Create a value of 'CostTypes' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'includeCredit', 'costTypes_includeCredit' - Specifies whether a budget includes credits.
--
-- The default value is @true@.
--
-- 'includeDiscount', 'costTypes_includeDiscount' - Specifies whether a budget includes discounts.
--
-- The default value is @true@.
--
-- 'includeOtherSubscription', 'costTypes_includeOtherSubscription' - Specifies whether a budget includes non-RI subscription costs.
--
-- The default value is @true@.
--
-- 'includeRecurring', 'costTypes_includeRecurring' - Specifies whether a budget includes recurring fees such as monthly RI
-- fees.
--
-- The default value is @true@.
--
-- 'includeRefund', 'costTypes_includeRefund' - Specifies whether a budget includes refunds.
--
-- The default value is @true@.
--
-- 'includeSubscription', 'costTypes_includeSubscription' - Specifies whether a budget includes subscriptions.
--
-- The default value is @true@.
--
-- 'includeSupport', 'costTypes_includeSupport' - Specifies whether a budget includes support subscription fees.
--
-- The default value is @true@.
--
-- 'includeTax', 'costTypes_includeTax' - Specifies whether a budget includes taxes.
--
-- The default value is @true@.
--
-- 'includeUpfront', 'costTypes_includeUpfront' - Specifies whether a budget includes upfront RI costs.
--
-- The default value is @true@.
--
-- 'useAmortized', 'costTypes_useAmortized' - Specifies whether a budget uses the amortized rate.
--
-- The default value is @false@.
--
-- 'useBlended', 'costTypes_useBlended' - Specifies whether a budget uses a blended rate.
--
-- The default value is @false@.
newCostTypes ::
  CostTypes
newCostTypes :: CostTypes
newCostTypes =
  CostTypes'
    { $sel:includeCredit:CostTypes' :: Maybe Bool
includeCredit = forall a. Maybe a
Prelude.Nothing,
      $sel:includeDiscount:CostTypes' :: Maybe Bool
includeDiscount = forall a. Maybe a
Prelude.Nothing,
      $sel:includeOtherSubscription:CostTypes' :: Maybe Bool
includeOtherSubscription = forall a. Maybe a
Prelude.Nothing,
      $sel:includeRecurring:CostTypes' :: Maybe Bool
includeRecurring = forall a. Maybe a
Prelude.Nothing,
      $sel:includeRefund:CostTypes' :: Maybe Bool
includeRefund = forall a. Maybe a
Prelude.Nothing,
      $sel:includeSubscription:CostTypes' :: Maybe Bool
includeSubscription = forall a. Maybe a
Prelude.Nothing,
      $sel:includeSupport:CostTypes' :: Maybe Bool
includeSupport = forall a. Maybe a
Prelude.Nothing,
      $sel:includeTax:CostTypes' :: Maybe Bool
includeTax = forall a. Maybe a
Prelude.Nothing,
      $sel:includeUpfront:CostTypes' :: Maybe Bool
includeUpfront = forall a. Maybe a
Prelude.Nothing,
      $sel:useAmortized:CostTypes' :: Maybe Bool
useAmortized = forall a. Maybe a
Prelude.Nothing,
      $sel:useBlended:CostTypes' :: Maybe Bool
useBlended = forall a. Maybe a
Prelude.Nothing
    }

-- | Specifies whether a budget includes credits.
--
-- The default value is @true@.
costTypes_includeCredit :: Lens.Lens' CostTypes (Prelude.Maybe Prelude.Bool)
costTypes_includeCredit :: Lens' CostTypes (Maybe Bool)
costTypes_includeCredit = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CostTypes' {Maybe Bool
includeCredit :: Maybe Bool
$sel:includeCredit:CostTypes' :: CostTypes -> Maybe Bool
includeCredit} -> Maybe Bool
includeCredit) (\s :: CostTypes
s@CostTypes' {} Maybe Bool
a -> CostTypes
s {$sel:includeCredit:CostTypes' :: Maybe Bool
includeCredit = Maybe Bool
a} :: CostTypes)

-- | Specifies whether a budget includes discounts.
--
-- The default value is @true@.
costTypes_includeDiscount :: Lens.Lens' CostTypes (Prelude.Maybe Prelude.Bool)
costTypes_includeDiscount :: Lens' CostTypes (Maybe Bool)
costTypes_includeDiscount = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CostTypes' {Maybe Bool
includeDiscount :: Maybe Bool
$sel:includeDiscount:CostTypes' :: CostTypes -> Maybe Bool
includeDiscount} -> Maybe Bool
includeDiscount) (\s :: CostTypes
s@CostTypes' {} Maybe Bool
a -> CostTypes
s {$sel:includeDiscount:CostTypes' :: Maybe Bool
includeDiscount = Maybe Bool
a} :: CostTypes)

-- | Specifies whether a budget includes non-RI subscription costs.
--
-- The default value is @true@.
costTypes_includeOtherSubscription :: Lens.Lens' CostTypes (Prelude.Maybe Prelude.Bool)
costTypes_includeOtherSubscription :: Lens' CostTypes (Maybe Bool)
costTypes_includeOtherSubscription = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CostTypes' {Maybe Bool
includeOtherSubscription :: Maybe Bool
$sel:includeOtherSubscription:CostTypes' :: CostTypes -> Maybe Bool
includeOtherSubscription} -> Maybe Bool
includeOtherSubscription) (\s :: CostTypes
s@CostTypes' {} Maybe Bool
a -> CostTypes
s {$sel:includeOtherSubscription:CostTypes' :: Maybe Bool
includeOtherSubscription = Maybe Bool
a} :: CostTypes)

-- | Specifies whether a budget includes recurring fees such as monthly RI
-- fees.
--
-- The default value is @true@.
costTypes_includeRecurring :: Lens.Lens' CostTypes (Prelude.Maybe Prelude.Bool)
costTypes_includeRecurring :: Lens' CostTypes (Maybe Bool)
costTypes_includeRecurring = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CostTypes' {Maybe Bool
includeRecurring :: Maybe Bool
$sel:includeRecurring:CostTypes' :: CostTypes -> Maybe Bool
includeRecurring} -> Maybe Bool
includeRecurring) (\s :: CostTypes
s@CostTypes' {} Maybe Bool
a -> CostTypes
s {$sel:includeRecurring:CostTypes' :: Maybe Bool
includeRecurring = Maybe Bool
a} :: CostTypes)

-- | Specifies whether a budget includes refunds.
--
-- The default value is @true@.
costTypes_includeRefund :: Lens.Lens' CostTypes (Prelude.Maybe Prelude.Bool)
costTypes_includeRefund :: Lens' CostTypes (Maybe Bool)
costTypes_includeRefund = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CostTypes' {Maybe Bool
includeRefund :: Maybe Bool
$sel:includeRefund:CostTypes' :: CostTypes -> Maybe Bool
includeRefund} -> Maybe Bool
includeRefund) (\s :: CostTypes
s@CostTypes' {} Maybe Bool
a -> CostTypes
s {$sel:includeRefund:CostTypes' :: Maybe Bool
includeRefund = Maybe Bool
a} :: CostTypes)

-- | Specifies whether a budget includes subscriptions.
--
-- The default value is @true@.
costTypes_includeSubscription :: Lens.Lens' CostTypes (Prelude.Maybe Prelude.Bool)
costTypes_includeSubscription :: Lens' CostTypes (Maybe Bool)
costTypes_includeSubscription = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CostTypes' {Maybe Bool
includeSubscription :: Maybe Bool
$sel:includeSubscription:CostTypes' :: CostTypes -> Maybe Bool
includeSubscription} -> Maybe Bool
includeSubscription) (\s :: CostTypes
s@CostTypes' {} Maybe Bool
a -> CostTypes
s {$sel:includeSubscription:CostTypes' :: Maybe Bool
includeSubscription = Maybe Bool
a} :: CostTypes)

-- | Specifies whether a budget includes support subscription fees.
--
-- The default value is @true@.
costTypes_includeSupport :: Lens.Lens' CostTypes (Prelude.Maybe Prelude.Bool)
costTypes_includeSupport :: Lens' CostTypes (Maybe Bool)
costTypes_includeSupport = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CostTypes' {Maybe Bool
includeSupport :: Maybe Bool
$sel:includeSupport:CostTypes' :: CostTypes -> Maybe Bool
includeSupport} -> Maybe Bool
includeSupport) (\s :: CostTypes
s@CostTypes' {} Maybe Bool
a -> CostTypes
s {$sel:includeSupport:CostTypes' :: Maybe Bool
includeSupport = Maybe Bool
a} :: CostTypes)

-- | Specifies whether a budget includes taxes.
--
-- The default value is @true@.
costTypes_includeTax :: Lens.Lens' CostTypes (Prelude.Maybe Prelude.Bool)
costTypes_includeTax :: Lens' CostTypes (Maybe Bool)
costTypes_includeTax = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CostTypes' {Maybe Bool
includeTax :: Maybe Bool
$sel:includeTax:CostTypes' :: CostTypes -> Maybe Bool
includeTax} -> Maybe Bool
includeTax) (\s :: CostTypes
s@CostTypes' {} Maybe Bool
a -> CostTypes
s {$sel:includeTax:CostTypes' :: Maybe Bool
includeTax = Maybe Bool
a} :: CostTypes)

-- | Specifies whether a budget includes upfront RI costs.
--
-- The default value is @true@.
costTypes_includeUpfront :: Lens.Lens' CostTypes (Prelude.Maybe Prelude.Bool)
costTypes_includeUpfront :: Lens' CostTypes (Maybe Bool)
costTypes_includeUpfront = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CostTypes' {Maybe Bool
includeUpfront :: Maybe Bool
$sel:includeUpfront:CostTypes' :: CostTypes -> Maybe Bool
includeUpfront} -> Maybe Bool
includeUpfront) (\s :: CostTypes
s@CostTypes' {} Maybe Bool
a -> CostTypes
s {$sel:includeUpfront:CostTypes' :: Maybe Bool
includeUpfront = Maybe Bool
a} :: CostTypes)

-- | Specifies whether a budget uses the amortized rate.
--
-- The default value is @false@.
costTypes_useAmortized :: Lens.Lens' CostTypes (Prelude.Maybe Prelude.Bool)
costTypes_useAmortized :: Lens' CostTypes (Maybe Bool)
costTypes_useAmortized = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CostTypes' {Maybe Bool
useAmortized :: Maybe Bool
$sel:useAmortized:CostTypes' :: CostTypes -> Maybe Bool
useAmortized} -> Maybe Bool
useAmortized) (\s :: CostTypes
s@CostTypes' {} Maybe Bool
a -> CostTypes
s {$sel:useAmortized:CostTypes' :: Maybe Bool
useAmortized = Maybe Bool
a} :: CostTypes)

-- | Specifies whether a budget uses a blended rate.
--
-- The default value is @false@.
costTypes_useBlended :: Lens.Lens' CostTypes (Prelude.Maybe Prelude.Bool)
costTypes_useBlended :: Lens' CostTypes (Maybe Bool)
costTypes_useBlended = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CostTypes' {Maybe Bool
useBlended :: Maybe Bool
$sel:useBlended:CostTypes' :: CostTypes -> Maybe Bool
useBlended} -> Maybe Bool
useBlended) (\s :: CostTypes
s@CostTypes' {} Maybe Bool
a -> CostTypes
s {$sel:useBlended:CostTypes' :: Maybe Bool
useBlended = Maybe Bool
a} :: CostTypes)

instance Data.FromJSON CostTypes where
  parseJSON :: Value -> Parser CostTypes
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"CostTypes"
      ( \Object
x ->
          Maybe Bool
-> Maybe Bool
-> Maybe Bool
-> Maybe Bool
-> Maybe Bool
-> Maybe Bool
-> Maybe Bool
-> Maybe Bool
-> Maybe Bool
-> Maybe Bool
-> Maybe Bool
-> CostTypes
CostTypes'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"IncludeCredit")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"IncludeDiscount")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"IncludeOtherSubscription")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"IncludeRecurring")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"IncludeRefund")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"IncludeSubscription")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"IncludeSupport")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"IncludeTax")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"IncludeUpfront")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"UseAmortized")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"UseBlended")
      )

instance Prelude.Hashable CostTypes where
  hashWithSalt :: Int -> CostTypes -> Int
hashWithSalt Int
_salt CostTypes' {Maybe Bool
useBlended :: Maybe Bool
useAmortized :: Maybe Bool
includeUpfront :: Maybe Bool
includeTax :: Maybe Bool
includeSupport :: Maybe Bool
includeSubscription :: Maybe Bool
includeRefund :: Maybe Bool
includeRecurring :: Maybe Bool
includeOtherSubscription :: Maybe Bool
includeDiscount :: Maybe Bool
includeCredit :: Maybe Bool
$sel:useBlended:CostTypes' :: CostTypes -> Maybe Bool
$sel:useAmortized:CostTypes' :: CostTypes -> Maybe Bool
$sel:includeUpfront:CostTypes' :: CostTypes -> Maybe Bool
$sel:includeTax:CostTypes' :: CostTypes -> Maybe Bool
$sel:includeSupport:CostTypes' :: CostTypes -> Maybe Bool
$sel:includeSubscription:CostTypes' :: CostTypes -> Maybe Bool
$sel:includeRefund:CostTypes' :: CostTypes -> Maybe Bool
$sel:includeRecurring:CostTypes' :: CostTypes -> Maybe Bool
$sel:includeOtherSubscription:CostTypes' :: CostTypes -> Maybe Bool
$sel:includeDiscount:CostTypes' :: CostTypes -> Maybe Bool
$sel:includeCredit:CostTypes' :: CostTypes -> Maybe Bool
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
includeCredit
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
includeDiscount
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
includeOtherSubscription
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
includeRecurring
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
includeRefund
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
includeSubscription
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
includeSupport
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
includeTax
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
includeUpfront
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
useAmortized
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
useBlended

instance Prelude.NFData CostTypes where
  rnf :: CostTypes -> ()
rnf CostTypes' {Maybe Bool
useBlended :: Maybe Bool
useAmortized :: Maybe Bool
includeUpfront :: Maybe Bool
includeTax :: Maybe Bool
includeSupport :: Maybe Bool
includeSubscription :: Maybe Bool
includeRefund :: Maybe Bool
includeRecurring :: Maybe Bool
includeOtherSubscription :: Maybe Bool
includeDiscount :: Maybe Bool
includeCredit :: Maybe Bool
$sel:useBlended:CostTypes' :: CostTypes -> Maybe Bool
$sel:useAmortized:CostTypes' :: CostTypes -> Maybe Bool
$sel:includeUpfront:CostTypes' :: CostTypes -> Maybe Bool
$sel:includeTax:CostTypes' :: CostTypes -> Maybe Bool
$sel:includeSupport:CostTypes' :: CostTypes -> Maybe Bool
$sel:includeSubscription:CostTypes' :: CostTypes -> Maybe Bool
$sel:includeRefund:CostTypes' :: CostTypes -> Maybe Bool
$sel:includeRecurring:CostTypes' :: CostTypes -> Maybe Bool
$sel:includeOtherSubscription:CostTypes' :: CostTypes -> Maybe Bool
$sel:includeDiscount:CostTypes' :: CostTypes -> Maybe Bool
$sel:includeCredit:CostTypes' :: CostTypes -> Maybe Bool
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
includeCredit
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
includeDiscount
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
includeOtherSubscription
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
includeRecurring
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
includeRefund
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
includeSubscription
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
includeSupport
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
includeTax
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
includeUpfront
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
useAmortized
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
useBlended

instance Data.ToJSON CostTypes where
  toJSON :: CostTypes -> Value
toJSON CostTypes' {Maybe Bool
useBlended :: Maybe Bool
useAmortized :: Maybe Bool
includeUpfront :: Maybe Bool
includeTax :: Maybe Bool
includeSupport :: Maybe Bool
includeSubscription :: Maybe Bool
includeRefund :: Maybe Bool
includeRecurring :: Maybe Bool
includeOtherSubscription :: Maybe Bool
includeDiscount :: Maybe Bool
includeCredit :: Maybe Bool
$sel:useBlended:CostTypes' :: CostTypes -> Maybe Bool
$sel:useAmortized:CostTypes' :: CostTypes -> Maybe Bool
$sel:includeUpfront:CostTypes' :: CostTypes -> Maybe Bool
$sel:includeTax:CostTypes' :: CostTypes -> Maybe Bool
$sel:includeSupport:CostTypes' :: CostTypes -> Maybe Bool
$sel:includeSubscription:CostTypes' :: CostTypes -> Maybe Bool
$sel:includeRefund:CostTypes' :: CostTypes -> Maybe Bool
$sel:includeRecurring:CostTypes' :: CostTypes -> Maybe Bool
$sel:includeOtherSubscription:CostTypes' :: CostTypes -> Maybe Bool
$sel:includeDiscount:CostTypes' :: CostTypes -> Maybe Bool
$sel:includeCredit:CostTypes' :: CostTypes -> Maybe Bool
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"IncludeCredit" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
includeCredit,
            (Key
"IncludeDiscount" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
includeDiscount,
            (Key
"IncludeOtherSubscription" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
includeOtherSubscription,
            (Key
"IncludeRecurring" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
includeRecurring,
            (Key
"IncludeRefund" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
includeRefund,
            (Key
"IncludeSubscription" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
includeSubscription,
            (Key
"IncludeSupport" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
includeSupport,
            (Key
"IncludeTax" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
includeTax,
            (Key
"IncludeUpfront" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
includeUpfront,
            (Key
"UseAmortized" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
useAmortized,
            (Key
"UseBlended" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
useBlended
          ]
      )