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