{-# 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 #-}
module Amazonka.CostExplorer.Types.SavingsPlansUtilizationAggregates where
import qualified Amazonka.Core as Core
import Amazonka.CostExplorer.Types.SavingsPlansAmortizedCommitment
import Amazonka.CostExplorer.Types.SavingsPlansSavings
import Amazonka.CostExplorer.Types.SavingsPlansUtilization
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data SavingsPlansUtilizationAggregates = SavingsPlansUtilizationAggregates'
{
SavingsPlansUtilizationAggregates
-> Maybe SavingsPlansAmortizedCommitment
amortizedCommitment :: Prelude.Maybe SavingsPlansAmortizedCommitment,
SavingsPlansUtilizationAggregates -> Maybe SavingsPlansSavings
savings :: Prelude.Maybe SavingsPlansSavings,
SavingsPlansUtilizationAggregates -> SavingsPlansUtilization
utilization :: SavingsPlansUtilization
}
deriving (SavingsPlansUtilizationAggregates
-> SavingsPlansUtilizationAggregates -> Bool
(SavingsPlansUtilizationAggregates
-> SavingsPlansUtilizationAggregates -> Bool)
-> (SavingsPlansUtilizationAggregates
-> SavingsPlansUtilizationAggregates -> Bool)
-> Eq SavingsPlansUtilizationAggregates
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SavingsPlansUtilizationAggregates
-> SavingsPlansUtilizationAggregates -> Bool
$c/= :: SavingsPlansUtilizationAggregates
-> SavingsPlansUtilizationAggregates -> Bool
== :: SavingsPlansUtilizationAggregates
-> SavingsPlansUtilizationAggregates -> Bool
$c== :: SavingsPlansUtilizationAggregates
-> SavingsPlansUtilizationAggregates -> Bool
Prelude.Eq, ReadPrec [SavingsPlansUtilizationAggregates]
ReadPrec SavingsPlansUtilizationAggregates
Int -> ReadS SavingsPlansUtilizationAggregates
ReadS [SavingsPlansUtilizationAggregates]
(Int -> ReadS SavingsPlansUtilizationAggregates)
-> ReadS [SavingsPlansUtilizationAggregates]
-> ReadPrec SavingsPlansUtilizationAggregates
-> ReadPrec [SavingsPlansUtilizationAggregates]
-> Read SavingsPlansUtilizationAggregates
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SavingsPlansUtilizationAggregates]
$creadListPrec :: ReadPrec [SavingsPlansUtilizationAggregates]
readPrec :: ReadPrec SavingsPlansUtilizationAggregates
$creadPrec :: ReadPrec SavingsPlansUtilizationAggregates
readList :: ReadS [SavingsPlansUtilizationAggregates]
$creadList :: ReadS [SavingsPlansUtilizationAggregates]
readsPrec :: Int -> ReadS SavingsPlansUtilizationAggregates
$creadsPrec :: Int -> ReadS SavingsPlansUtilizationAggregates
Prelude.Read, Int -> SavingsPlansUtilizationAggregates -> ShowS
[SavingsPlansUtilizationAggregates] -> ShowS
SavingsPlansUtilizationAggregates -> String
(Int -> SavingsPlansUtilizationAggregates -> ShowS)
-> (SavingsPlansUtilizationAggregates -> String)
-> ([SavingsPlansUtilizationAggregates] -> ShowS)
-> Show SavingsPlansUtilizationAggregates
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SavingsPlansUtilizationAggregates] -> ShowS
$cshowList :: [SavingsPlansUtilizationAggregates] -> ShowS
show :: SavingsPlansUtilizationAggregates -> String
$cshow :: SavingsPlansUtilizationAggregates -> String
showsPrec :: Int -> SavingsPlansUtilizationAggregates -> ShowS
$cshowsPrec :: Int -> SavingsPlansUtilizationAggregates -> ShowS
Prelude.Show, (forall x.
SavingsPlansUtilizationAggregates
-> Rep SavingsPlansUtilizationAggregates x)
-> (forall x.
Rep SavingsPlansUtilizationAggregates x
-> SavingsPlansUtilizationAggregates)
-> Generic SavingsPlansUtilizationAggregates
forall x.
Rep SavingsPlansUtilizationAggregates x
-> SavingsPlansUtilizationAggregates
forall x.
SavingsPlansUtilizationAggregates
-> Rep SavingsPlansUtilizationAggregates x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep SavingsPlansUtilizationAggregates x
-> SavingsPlansUtilizationAggregates
$cfrom :: forall x.
SavingsPlansUtilizationAggregates
-> Rep SavingsPlansUtilizationAggregates x
Prelude.Generic)
newSavingsPlansUtilizationAggregates ::
SavingsPlansUtilization ->
SavingsPlansUtilizationAggregates
newSavingsPlansUtilizationAggregates :: SavingsPlansUtilization -> SavingsPlansUtilizationAggregates
newSavingsPlansUtilizationAggregates SavingsPlansUtilization
pUtilization_ =
SavingsPlansUtilizationAggregates' :: Maybe SavingsPlansAmortizedCommitment
-> Maybe SavingsPlansSavings
-> SavingsPlansUtilization
-> SavingsPlansUtilizationAggregates
SavingsPlansUtilizationAggregates'
{ $sel:amortizedCommitment:SavingsPlansUtilizationAggregates' :: Maybe SavingsPlansAmortizedCommitment
amortizedCommitment =
Maybe SavingsPlansAmortizedCommitment
forall a. Maybe a
Prelude.Nothing,
$sel:savings:SavingsPlansUtilizationAggregates' :: Maybe SavingsPlansSavings
savings = Maybe SavingsPlansSavings
forall a. Maybe a
Prelude.Nothing,
$sel:utilization:SavingsPlansUtilizationAggregates' :: SavingsPlansUtilization
utilization = SavingsPlansUtilization
pUtilization_
}
savingsPlansUtilizationAggregates_amortizedCommitment :: Lens.Lens' SavingsPlansUtilizationAggregates (Prelude.Maybe SavingsPlansAmortizedCommitment)
savingsPlansUtilizationAggregates_amortizedCommitment :: (Maybe SavingsPlansAmortizedCommitment
-> f (Maybe SavingsPlansAmortizedCommitment))
-> SavingsPlansUtilizationAggregates
-> f SavingsPlansUtilizationAggregates
savingsPlansUtilizationAggregates_amortizedCommitment = (SavingsPlansUtilizationAggregates
-> Maybe SavingsPlansAmortizedCommitment)
-> (SavingsPlansUtilizationAggregates
-> Maybe SavingsPlansAmortizedCommitment
-> SavingsPlansUtilizationAggregates)
-> Lens
SavingsPlansUtilizationAggregates
SavingsPlansUtilizationAggregates
(Maybe SavingsPlansAmortizedCommitment)
(Maybe SavingsPlansAmortizedCommitment)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SavingsPlansUtilizationAggregates' {Maybe SavingsPlansAmortizedCommitment
amortizedCommitment :: Maybe SavingsPlansAmortizedCommitment
$sel:amortizedCommitment:SavingsPlansUtilizationAggregates' :: SavingsPlansUtilizationAggregates
-> Maybe SavingsPlansAmortizedCommitment
amortizedCommitment} -> Maybe SavingsPlansAmortizedCommitment
amortizedCommitment) (\s :: SavingsPlansUtilizationAggregates
s@SavingsPlansUtilizationAggregates' {} Maybe SavingsPlansAmortizedCommitment
a -> SavingsPlansUtilizationAggregates
s {$sel:amortizedCommitment:SavingsPlansUtilizationAggregates' :: Maybe SavingsPlansAmortizedCommitment
amortizedCommitment = Maybe SavingsPlansAmortizedCommitment
a} :: SavingsPlansUtilizationAggregates)
savingsPlansUtilizationAggregates_savings :: Lens.Lens' SavingsPlansUtilizationAggregates (Prelude.Maybe SavingsPlansSavings)
savingsPlansUtilizationAggregates_savings :: (Maybe SavingsPlansSavings -> f (Maybe SavingsPlansSavings))
-> SavingsPlansUtilizationAggregates
-> f SavingsPlansUtilizationAggregates
savingsPlansUtilizationAggregates_savings = (SavingsPlansUtilizationAggregates -> Maybe SavingsPlansSavings)
-> (SavingsPlansUtilizationAggregates
-> Maybe SavingsPlansSavings -> SavingsPlansUtilizationAggregates)
-> Lens
SavingsPlansUtilizationAggregates
SavingsPlansUtilizationAggregates
(Maybe SavingsPlansSavings)
(Maybe SavingsPlansSavings)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SavingsPlansUtilizationAggregates' {Maybe SavingsPlansSavings
savings :: Maybe SavingsPlansSavings
$sel:savings:SavingsPlansUtilizationAggregates' :: SavingsPlansUtilizationAggregates -> Maybe SavingsPlansSavings
savings} -> Maybe SavingsPlansSavings
savings) (\s :: SavingsPlansUtilizationAggregates
s@SavingsPlansUtilizationAggregates' {} Maybe SavingsPlansSavings
a -> SavingsPlansUtilizationAggregates
s {$sel:savings:SavingsPlansUtilizationAggregates' :: Maybe SavingsPlansSavings
savings = Maybe SavingsPlansSavings
a} :: SavingsPlansUtilizationAggregates)
savingsPlansUtilizationAggregates_utilization :: Lens.Lens' SavingsPlansUtilizationAggregates SavingsPlansUtilization
savingsPlansUtilizationAggregates_utilization :: (SavingsPlansUtilization -> f SavingsPlansUtilization)
-> SavingsPlansUtilizationAggregates
-> f SavingsPlansUtilizationAggregates
savingsPlansUtilizationAggregates_utilization = (SavingsPlansUtilizationAggregates -> SavingsPlansUtilization)
-> (SavingsPlansUtilizationAggregates
-> SavingsPlansUtilization -> SavingsPlansUtilizationAggregates)
-> Lens
SavingsPlansUtilizationAggregates
SavingsPlansUtilizationAggregates
SavingsPlansUtilization
SavingsPlansUtilization
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SavingsPlansUtilizationAggregates' {SavingsPlansUtilization
utilization :: SavingsPlansUtilization
$sel:utilization:SavingsPlansUtilizationAggregates' :: SavingsPlansUtilizationAggregates -> SavingsPlansUtilization
utilization} -> SavingsPlansUtilization
utilization) (\s :: SavingsPlansUtilizationAggregates
s@SavingsPlansUtilizationAggregates' {} SavingsPlansUtilization
a -> SavingsPlansUtilizationAggregates
s {$sel:utilization:SavingsPlansUtilizationAggregates' :: SavingsPlansUtilization
utilization = SavingsPlansUtilization
a} :: SavingsPlansUtilizationAggregates)
instance
Core.FromJSON
SavingsPlansUtilizationAggregates
where
parseJSON :: Value -> Parser SavingsPlansUtilizationAggregates
parseJSON =
String
-> (Object -> Parser SavingsPlansUtilizationAggregates)
-> Value
-> Parser SavingsPlansUtilizationAggregates
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"SavingsPlansUtilizationAggregates"
( \Object
x ->
Maybe SavingsPlansAmortizedCommitment
-> Maybe SavingsPlansSavings
-> SavingsPlansUtilization
-> SavingsPlansUtilizationAggregates
SavingsPlansUtilizationAggregates'
(Maybe SavingsPlansAmortizedCommitment
-> Maybe SavingsPlansSavings
-> SavingsPlansUtilization
-> SavingsPlansUtilizationAggregates)
-> Parser (Maybe SavingsPlansAmortizedCommitment)
-> Parser
(Maybe SavingsPlansSavings
-> SavingsPlansUtilization -> SavingsPlansUtilizationAggregates)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe SavingsPlansAmortizedCommitment)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"AmortizedCommitment")
Parser
(Maybe SavingsPlansSavings
-> SavingsPlansUtilization -> SavingsPlansUtilizationAggregates)
-> Parser (Maybe SavingsPlansSavings)
-> Parser
(SavingsPlansUtilization -> SavingsPlansUtilizationAggregates)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe SavingsPlansSavings)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Savings")
Parser
(SavingsPlansUtilization -> SavingsPlansUtilizationAggregates)
-> Parser SavingsPlansUtilization
-> Parser SavingsPlansUtilizationAggregates
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser SavingsPlansUtilization
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"Utilization")
)
instance
Prelude.Hashable
SavingsPlansUtilizationAggregates
instance
Prelude.NFData
SavingsPlansUtilizationAggregates