{-# 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.ComputeOptimizer.Types.EstimatedMonthlySavings where
import Amazonka.ComputeOptimizer.Types.Currency
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 EstimatedMonthlySavings = EstimatedMonthlySavings'
{
EstimatedMonthlySavings -> Maybe Currency
currency :: Prelude.Maybe Currency,
EstimatedMonthlySavings -> Maybe Double
value :: Prelude.Maybe Prelude.Double
}
deriving (EstimatedMonthlySavings -> EstimatedMonthlySavings -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: EstimatedMonthlySavings -> EstimatedMonthlySavings -> Bool
$c/= :: EstimatedMonthlySavings -> EstimatedMonthlySavings -> Bool
== :: EstimatedMonthlySavings -> EstimatedMonthlySavings -> Bool
$c== :: EstimatedMonthlySavings -> EstimatedMonthlySavings -> Bool
Prelude.Eq, ReadPrec [EstimatedMonthlySavings]
ReadPrec EstimatedMonthlySavings
Int -> ReadS EstimatedMonthlySavings
ReadS [EstimatedMonthlySavings]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [EstimatedMonthlySavings]
$creadListPrec :: ReadPrec [EstimatedMonthlySavings]
readPrec :: ReadPrec EstimatedMonthlySavings
$creadPrec :: ReadPrec EstimatedMonthlySavings
readList :: ReadS [EstimatedMonthlySavings]
$creadList :: ReadS [EstimatedMonthlySavings]
readsPrec :: Int -> ReadS EstimatedMonthlySavings
$creadsPrec :: Int -> ReadS EstimatedMonthlySavings
Prelude.Read, Int -> EstimatedMonthlySavings -> ShowS
[EstimatedMonthlySavings] -> ShowS
EstimatedMonthlySavings -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [EstimatedMonthlySavings] -> ShowS
$cshowList :: [EstimatedMonthlySavings] -> ShowS
show :: EstimatedMonthlySavings -> String
$cshow :: EstimatedMonthlySavings -> String
showsPrec :: Int -> EstimatedMonthlySavings -> ShowS
$cshowsPrec :: Int -> EstimatedMonthlySavings -> ShowS
Prelude.Show, forall x. Rep EstimatedMonthlySavings x -> EstimatedMonthlySavings
forall x. EstimatedMonthlySavings -> Rep EstimatedMonthlySavings x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep EstimatedMonthlySavings x -> EstimatedMonthlySavings
$cfrom :: forall x. EstimatedMonthlySavings -> Rep EstimatedMonthlySavings x
Prelude.Generic)
newEstimatedMonthlySavings ::
EstimatedMonthlySavings
newEstimatedMonthlySavings :: EstimatedMonthlySavings
newEstimatedMonthlySavings =
EstimatedMonthlySavings'
{ $sel:currency:EstimatedMonthlySavings' :: Maybe Currency
currency =
forall a. Maybe a
Prelude.Nothing,
$sel:value:EstimatedMonthlySavings' :: Maybe Double
value = forall a. Maybe a
Prelude.Nothing
}
estimatedMonthlySavings_currency :: Lens.Lens' EstimatedMonthlySavings (Prelude.Maybe Currency)
estimatedMonthlySavings_currency :: Lens' EstimatedMonthlySavings (Maybe Currency)
estimatedMonthlySavings_currency = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EstimatedMonthlySavings' {Maybe Currency
currency :: Maybe Currency
$sel:currency:EstimatedMonthlySavings' :: EstimatedMonthlySavings -> Maybe Currency
currency} -> Maybe Currency
currency) (\s :: EstimatedMonthlySavings
s@EstimatedMonthlySavings' {} Maybe Currency
a -> EstimatedMonthlySavings
s {$sel:currency:EstimatedMonthlySavings' :: Maybe Currency
currency = Maybe Currency
a} :: EstimatedMonthlySavings)
estimatedMonthlySavings_value :: Lens.Lens' EstimatedMonthlySavings (Prelude.Maybe Prelude.Double)
estimatedMonthlySavings_value :: Lens' EstimatedMonthlySavings (Maybe Double)
estimatedMonthlySavings_value = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EstimatedMonthlySavings' {Maybe Double
value :: Maybe Double
$sel:value:EstimatedMonthlySavings' :: EstimatedMonthlySavings -> Maybe Double
value} -> Maybe Double
value) (\s :: EstimatedMonthlySavings
s@EstimatedMonthlySavings' {} Maybe Double
a -> EstimatedMonthlySavings
s {$sel:value:EstimatedMonthlySavings' :: Maybe Double
value = Maybe Double
a} :: EstimatedMonthlySavings)
instance Data.FromJSON EstimatedMonthlySavings where
parseJSON :: Value -> Parser EstimatedMonthlySavings
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"EstimatedMonthlySavings"
( \Object
x ->
Maybe Currency -> Maybe Double -> EstimatedMonthlySavings
EstimatedMonthlySavings'
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
"currency")
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
"value")
)
instance Prelude.Hashable EstimatedMonthlySavings where
hashWithSalt :: Int -> EstimatedMonthlySavings -> Int
hashWithSalt Int
_salt EstimatedMonthlySavings' {Maybe Double
Maybe Currency
value :: Maybe Double
currency :: Maybe Currency
$sel:value:EstimatedMonthlySavings' :: EstimatedMonthlySavings -> Maybe Double
$sel:currency:EstimatedMonthlySavings' :: EstimatedMonthlySavings -> Maybe Currency
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Currency
currency
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Double
value
instance Prelude.NFData EstimatedMonthlySavings where
rnf :: EstimatedMonthlySavings -> ()
rnf EstimatedMonthlySavings' {Maybe Double
Maybe Currency
value :: Maybe Double
currency :: Maybe Currency
$sel:value:EstimatedMonthlySavings' :: EstimatedMonthlySavings -> Maybe Double
$sel:currency:EstimatedMonthlySavings' :: EstimatedMonthlySavings -> Maybe Currency
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Currency
currency
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Double
value