{-# 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.SavingsPlansCoverageData where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data SavingsPlansCoverageData = SavingsPlansCoverageData'
{
SavingsPlansCoverageData -> Maybe Text
onDemandCost :: Prelude.Maybe Prelude.Text,
SavingsPlansCoverageData -> Maybe Text
spendCoveredBySavingsPlans :: Prelude.Maybe Prelude.Text,
SavingsPlansCoverageData -> Maybe Text
coveragePercentage :: Prelude.Maybe Prelude.Text,
SavingsPlansCoverageData -> Maybe Text
totalCost :: Prelude.Maybe Prelude.Text
}
deriving (SavingsPlansCoverageData -> SavingsPlansCoverageData -> Bool
(SavingsPlansCoverageData -> SavingsPlansCoverageData -> Bool)
-> (SavingsPlansCoverageData -> SavingsPlansCoverageData -> Bool)
-> Eq SavingsPlansCoverageData
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SavingsPlansCoverageData -> SavingsPlansCoverageData -> Bool
$c/= :: SavingsPlansCoverageData -> SavingsPlansCoverageData -> Bool
== :: SavingsPlansCoverageData -> SavingsPlansCoverageData -> Bool
$c== :: SavingsPlansCoverageData -> SavingsPlansCoverageData -> Bool
Prelude.Eq, ReadPrec [SavingsPlansCoverageData]
ReadPrec SavingsPlansCoverageData
Int -> ReadS SavingsPlansCoverageData
ReadS [SavingsPlansCoverageData]
(Int -> ReadS SavingsPlansCoverageData)
-> ReadS [SavingsPlansCoverageData]
-> ReadPrec SavingsPlansCoverageData
-> ReadPrec [SavingsPlansCoverageData]
-> Read SavingsPlansCoverageData
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SavingsPlansCoverageData]
$creadListPrec :: ReadPrec [SavingsPlansCoverageData]
readPrec :: ReadPrec SavingsPlansCoverageData
$creadPrec :: ReadPrec SavingsPlansCoverageData
readList :: ReadS [SavingsPlansCoverageData]
$creadList :: ReadS [SavingsPlansCoverageData]
readsPrec :: Int -> ReadS SavingsPlansCoverageData
$creadsPrec :: Int -> ReadS SavingsPlansCoverageData
Prelude.Read, Int -> SavingsPlansCoverageData -> ShowS
[SavingsPlansCoverageData] -> ShowS
SavingsPlansCoverageData -> String
(Int -> SavingsPlansCoverageData -> ShowS)
-> (SavingsPlansCoverageData -> String)
-> ([SavingsPlansCoverageData] -> ShowS)
-> Show SavingsPlansCoverageData
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SavingsPlansCoverageData] -> ShowS
$cshowList :: [SavingsPlansCoverageData] -> ShowS
show :: SavingsPlansCoverageData -> String
$cshow :: SavingsPlansCoverageData -> String
showsPrec :: Int -> SavingsPlansCoverageData -> ShowS
$cshowsPrec :: Int -> SavingsPlansCoverageData -> ShowS
Prelude.Show, (forall x.
SavingsPlansCoverageData -> Rep SavingsPlansCoverageData x)
-> (forall x.
Rep SavingsPlansCoverageData x -> SavingsPlansCoverageData)
-> Generic SavingsPlansCoverageData
forall x.
Rep SavingsPlansCoverageData x -> SavingsPlansCoverageData
forall x.
SavingsPlansCoverageData -> Rep SavingsPlansCoverageData x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep SavingsPlansCoverageData x -> SavingsPlansCoverageData
$cfrom :: forall x.
SavingsPlansCoverageData -> Rep SavingsPlansCoverageData x
Prelude.Generic)
newSavingsPlansCoverageData ::
SavingsPlansCoverageData
newSavingsPlansCoverageData :: SavingsPlansCoverageData
newSavingsPlansCoverageData =
SavingsPlansCoverageData' :: Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> SavingsPlansCoverageData
SavingsPlansCoverageData'
{ $sel:onDemandCost:SavingsPlansCoverageData' :: Maybe Text
onDemandCost =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:spendCoveredBySavingsPlans:SavingsPlansCoverageData' :: Maybe Text
spendCoveredBySavingsPlans = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:coveragePercentage:SavingsPlansCoverageData' :: Maybe Text
coveragePercentage = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:totalCost:SavingsPlansCoverageData' :: Maybe Text
totalCost = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
savingsPlansCoverageData_onDemandCost :: Lens.Lens' SavingsPlansCoverageData (Prelude.Maybe Prelude.Text)
savingsPlansCoverageData_onDemandCost :: (Maybe Text -> f (Maybe Text))
-> SavingsPlansCoverageData -> f SavingsPlansCoverageData
savingsPlansCoverageData_onDemandCost = (SavingsPlansCoverageData -> Maybe Text)
-> (SavingsPlansCoverageData
-> Maybe Text -> SavingsPlansCoverageData)
-> Lens
SavingsPlansCoverageData
SavingsPlansCoverageData
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SavingsPlansCoverageData' {Maybe Text
onDemandCost :: Maybe Text
$sel:onDemandCost:SavingsPlansCoverageData' :: SavingsPlansCoverageData -> Maybe Text
onDemandCost} -> Maybe Text
onDemandCost) (\s :: SavingsPlansCoverageData
s@SavingsPlansCoverageData' {} Maybe Text
a -> SavingsPlansCoverageData
s {$sel:onDemandCost:SavingsPlansCoverageData' :: Maybe Text
onDemandCost = Maybe Text
a} :: SavingsPlansCoverageData)
savingsPlansCoverageData_spendCoveredBySavingsPlans :: Lens.Lens' SavingsPlansCoverageData (Prelude.Maybe Prelude.Text)
savingsPlansCoverageData_spendCoveredBySavingsPlans :: (Maybe Text -> f (Maybe Text))
-> SavingsPlansCoverageData -> f SavingsPlansCoverageData
savingsPlansCoverageData_spendCoveredBySavingsPlans = (SavingsPlansCoverageData -> Maybe Text)
-> (SavingsPlansCoverageData
-> Maybe Text -> SavingsPlansCoverageData)
-> Lens
SavingsPlansCoverageData
SavingsPlansCoverageData
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SavingsPlansCoverageData' {Maybe Text
spendCoveredBySavingsPlans :: Maybe Text
$sel:spendCoveredBySavingsPlans:SavingsPlansCoverageData' :: SavingsPlansCoverageData -> Maybe Text
spendCoveredBySavingsPlans} -> Maybe Text
spendCoveredBySavingsPlans) (\s :: SavingsPlansCoverageData
s@SavingsPlansCoverageData' {} Maybe Text
a -> SavingsPlansCoverageData
s {$sel:spendCoveredBySavingsPlans:SavingsPlansCoverageData' :: Maybe Text
spendCoveredBySavingsPlans = Maybe Text
a} :: SavingsPlansCoverageData)
savingsPlansCoverageData_coveragePercentage :: Lens.Lens' SavingsPlansCoverageData (Prelude.Maybe Prelude.Text)
savingsPlansCoverageData_coveragePercentage :: (Maybe Text -> f (Maybe Text))
-> SavingsPlansCoverageData -> f SavingsPlansCoverageData
savingsPlansCoverageData_coveragePercentage = (SavingsPlansCoverageData -> Maybe Text)
-> (SavingsPlansCoverageData
-> Maybe Text -> SavingsPlansCoverageData)
-> Lens
SavingsPlansCoverageData
SavingsPlansCoverageData
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SavingsPlansCoverageData' {Maybe Text
coveragePercentage :: Maybe Text
$sel:coveragePercentage:SavingsPlansCoverageData' :: SavingsPlansCoverageData -> Maybe Text
coveragePercentage} -> Maybe Text
coveragePercentage) (\s :: SavingsPlansCoverageData
s@SavingsPlansCoverageData' {} Maybe Text
a -> SavingsPlansCoverageData
s {$sel:coveragePercentage:SavingsPlansCoverageData' :: Maybe Text
coveragePercentage = Maybe Text
a} :: SavingsPlansCoverageData)
savingsPlansCoverageData_totalCost :: Lens.Lens' SavingsPlansCoverageData (Prelude.Maybe Prelude.Text)
savingsPlansCoverageData_totalCost :: (Maybe Text -> f (Maybe Text))
-> SavingsPlansCoverageData -> f SavingsPlansCoverageData
savingsPlansCoverageData_totalCost = (SavingsPlansCoverageData -> Maybe Text)
-> (SavingsPlansCoverageData
-> Maybe Text -> SavingsPlansCoverageData)
-> Lens
SavingsPlansCoverageData
SavingsPlansCoverageData
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SavingsPlansCoverageData' {Maybe Text
totalCost :: Maybe Text
$sel:totalCost:SavingsPlansCoverageData' :: SavingsPlansCoverageData -> Maybe Text
totalCost} -> Maybe Text
totalCost) (\s :: SavingsPlansCoverageData
s@SavingsPlansCoverageData' {} Maybe Text
a -> SavingsPlansCoverageData
s {$sel:totalCost:SavingsPlansCoverageData' :: Maybe Text
totalCost = Maybe Text
a} :: SavingsPlansCoverageData)
instance Core.FromJSON SavingsPlansCoverageData where
parseJSON :: Value -> Parser SavingsPlansCoverageData
parseJSON =
String
-> (Object -> Parser SavingsPlansCoverageData)
-> Value
-> Parser SavingsPlansCoverageData
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"SavingsPlansCoverageData"
( \Object
x ->
Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> SavingsPlansCoverageData
SavingsPlansCoverageData'
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> SavingsPlansCoverageData)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe Text -> Maybe Text -> SavingsPlansCoverageData)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"OnDemandCost")
Parser
(Maybe Text
-> Maybe Text -> Maybe Text -> SavingsPlansCoverageData)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe Text -> SavingsPlansCoverageData)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"SpendCoveredBySavingsPlans")
Parser (Maybe Text -> Maybe Text -> SavingsPlansCoverageData)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> SavingsPlansCoverageData)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"CoveragePercentage")
Parser (Maybe Text -> SavingsPlansCoverageData)
-> Parser (Maybe Text) -> Parser SavingsPlansCoverageData
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"TotalCost")
)
instance Prelude.Hashable SavingsPlansCoverageData
instance Prelude.NFData SavingsPlansCoverageData