{-# 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.Lens as Lens
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
(SavingsPlansSavings -> SavingsPlansSavings -> Bool)
-> (SavingsPlansSavings -> SavingsPlansSavings -> Bool)
-> Eq SavingsPlansSavings
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]
(Int -> ReadS SavingsPlansSavings)
-> ReadS [SavingsPlansSavings]
-> ReadPrec SavingsPlansSavings
-> ReadPrec [SavingsPlansSavings]
-> Read 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
(Int -> SavingsPlansSavings -> ShowS)
-> (SavingsPlansSavings -> String)
-> ([SavingsPlansSavings] -> ShowS)
-> Show SavingsPlansSavings
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. SavingsPlansSavings -> Rep SavingsPlansSavings x)
-> (forall x. Rep SavingsPlansSavings x -> SavingsPlansSavings)
-> Generic SavingsPlansSavings
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' :: Maybe Text -> Maybe Text -> SavingsPlansSavings
SavingsPlansSavings'
{ $sel:netSavings:SavingsPlansSavings' :: Maybe Text
netSavings = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:onDemandCostEquivalent:SavingsPlansSavings' :: Maybe Text
onDemandCostEquivalent = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
savingsPlansSavings_netSavings :: Lens.Lens' SavingsPlansSavings (Prelude.Maybe Prelude.Text)
savingsPlansSavings_netSavings :: (Maybe Text -> f (Maybe Text))
-> SavingsPlansSavings -> f SavingsPlansSavings
savingsPlansSavings_netSavings = (SavingsPlansSavings -> Maybe Text)
-> (SavingsPlansSavings -> Maybe Text -> SavingsPlansSavings)
-> Lens
SavingsPlansSavings SavingsPlansSavings (Maybe Text) (Maybe Text)
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 :: (Maybe Text -> f (Maybe Text))
-> SavingsPlansSavings -> f SavingsPlansSavings
savingsPlansSavings_onDemandCostEquivalent = (SavingsPlansSavings -> Maybe Text)
-> (SavingsPlansSavings -> Maybe Text -> SavingsPlansSavings)
-> Lens
SavingsPlansSavings SavingsPlansSavings (Maybe Text) (Maybe Text)
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 Core.FromJSON SavingsPlansSavings where
parseJSON :: Value -> Parser SavingsPlansSavings
parseJSON =
String
-> (Object -> Parser SavingsPlansSavings)
-> Value
-> Parser SavingsPlansSavings
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"SavingsPlansSavings"
( \Object
x ->
Maybe Text -> Maybe Text -> SavingsPlansSavings
SavingsPlansSavings'
(Maybe Text -> Maybe Text -> SavingsPlansSavings)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> SavingsPlansSavings)
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
"NetSavings")
Parser (Maybe Text -> SavingsPlansSavings)
-> Parser (Maybe Text) -> Parser SavingsPlansSavings
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
"OnDemandCostEquivalent")
)
instance Prelude.Hashable SavingsPlansSavings
instance Prelude.NFData SavingsPlansSavings