{-# 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.SavingsPlansSavings 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
data SavingsPlansSavings = SavingsPlansSavings'
{
SavingsPlansSavings -> Maybe Text
netSavings :: Prelude.Maybe Prelude.Text,
SavingsPlansSavings -> Maybe Text
onDemandCostEquivalent :: Prelude.Maybe Prelude.Text
}
deriving (SavingsPlansSavings -> SavingsPlansSavings -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SavingsPlansSavings -> SavingsPlansSavings -> Bool
$c/= :: SavingsPlansSavings -> SavingsPlansSavings -> Bool
== :: SavingsPlansSavings -> SavingsPlansSavings -> Bool
$c== :: SavingsPlansSavings -> SavingsPlansSavings -> Bool
Prelude.Eq, ReadPrec [SavingsPlansSavings]
ReadPrec SavingsPlansSavings
Int -> ReadS SavingsPlansSavings
ReadS [SavingsPlansSavings]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SavingsPlansSavings]
$creadListPrec :: ReadPrec [SavingsPlansSavings]
readPrec :: ReadPrec SavingsPlansSavings
$creadPrec :: ReadPrec SavingsPlansSavings
readList :: ReadS [SavingsPlansSavings]
$creadList :: ReadS [SavingsPlansSavings]
readsPrec :: Int -> ReadS SavingsPlansSavings
$creadsPrec :: Int -> ReadS SavingsPlansSavings
Prelude.Read, Int -> SavingsPlansSavings -> ShowS
[SavingsPlansSavings] -> ShowS
SavingsPlansSavings -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SavingsPlansSavings] -> ShowS
$cshowList :: [SavingsPlansSavings] -> ShowS
show :: SavingsPlansSavings -> String
$cshow :: SavingsPlansSavings -> String
showsPrec :: Int -> SavingsPlansSavings -> ShowS
$cshowsPrec :: Int -> SavingsPlansSavings -> ShowS
Prelude.Show, forall x. Rep SavingsPlansSavings x -> SavingsPlansSavings
forall x. SavingsPlansSavings -> Rep SavingsPlansSavings x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SavingsPlansSavings x -> SavingsPlansSavings
$cfrom :: forall x. SavingsPlansSavings -> Rep SavingsPlansSavings x
Prelude.Generic)
newSavingsPlansSavings ::
SavingsPlansSavings
newSavingsPlansSavings :: SavingsPlansSavings
newSavingsPlansSavings =
SavingsPlansSavings'
{ $sel:netSavings:SavingsPlansSavings' :: Maybe Text
netSavings = forall a. Maybe a
Prelude.Nothing,
$sel:onDemandCostEquivalent:SavingsPlansSavings' :: Maybe Text
onDemandCostEquivalent = forall a. Maybe a
Prelude.Nothing
}
savingsPlansSavings_netSavings :: Lens.Lens' SavingsPlansSavings (Prelude.Maybe Prelude.Text)
savingsPlansSavings_netSavings :: Lens' SavingsPlansSavings (Maybe Text)
savingsPlansSavings_netSavings = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SavingsPlansSavings' {Maybe Text
netSavings :: Maybe Text
$sel:netSavings:SavingsPlansSavings' :: SavingsPlansSavings -> Maybe Text
netSavings} -> Maybe Text
netSavings) (\s :: SavingsPlansSavings
s@SavingsPlansSavings' {} Maybe Text
a -> SavingsPlansSavings
s {$sel:netSavings:SavingsPlansSavings' :: Maybe Text
netSavings = Maybe Text
a} :: SavingsPlansSavings)
savingsPlansSavings_onDemandCostEquivalent :: Lens.Lens' SavingsPlansSavings (Prelude.Maybe Prelude.Text)
savingsPlansSavings_onDemandCostEquivalent :: Lens' SavingsPlansSavings (Maybe Text)
savingsPlansSavings_onDemandCostEquivalent = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SavingsPlansSavings' {Maybe Text
onDemandCostEquivalent :: Maybe Text
$sel:onDemandCostEquivalent:SavingsPlansSavings' :: SavingsPlansSavings -> Maybe Text
onDemandCostEquivalent} -> Maybe Text
onDemandCostEquivalent) (\s :: SavingsPlansSavings
s@SavingsPlansSavings' {} Maybe Text
a -> SavingsPlansSavings
s {$sel:onDemandCostEquivalent:SavingsPlansSavings' :: Maybe Text
onDemandCostEquivalent = Maybe Text
a} :: SavingsPlansSavings)
instance Data.FromJSON SavingsPlansSavings where
parseJSON :: Value -> Parser SavingsPlansSavings
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"SavingsPlansSavings"
( \Object
x ->
Maybe Text -> Maybe Text -> SavingsPlansSavings
SavingsPlansSavings'
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
"NetSavings")
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
"OnDemandCostEquivalent")
)
instance Prelude.Hashable SavingsPlansSavings where
hashWithSalt :: Int -> SavingsPlansSavings -> Int
hashWithSalt Int
_salt SavingsPlansSavings' {Maybe Text
onDemandCostEquivalent :: Maybe Text
netSavings :: Maybe Text
$sel:onDemandCostEquivalent:SavingsPlansSavings' :: SavingsPlansSavings -> Maybe Text
$sel:netSavings:SavingsPlansSavings' :: SavingsPlansSavings -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
netSavings
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
onDemandCostEquivalent
instance Prelude.NFData SavingsPlansSavings where
rnf :: SavingsPlansSavings -> ()
rnf SavingsPlansSavings' {Maybe Text
onDemandCostEquivalent :: Maybe Text
netSavings :: Maybe Text
$sel:onDemandCostEquivalent:SavingsPlansSavings' :: SavingsPlansSavings -> Maybe Text
$sel:netSavings:SavingsPlansSavings' :: SavingsPlansSavings -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
netSavings
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
onDemandCostEquivalent