{-# 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.LambdaFunctionUtilizationMetric where
import Amazonka.ComputeOptimizer.Types.LambdaFunctionMetricName
import Amazonka.ComputeOptimizer.Types.LambdaFunctionMetricStatistic
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data LambdaFunctionUtilizationMetric = LambdaFunctionUtilizationMetric'
{
LambdaFunctionUtilizationMetric -> Maybe Double
value :: Prelude.Maybe Prelude.Double,
LambdaFunctionUtilizationMetric -> Maybe LambdaFunctionMetricName
name :: Prelude.Maybe LambdaFunctionMetricName,
LambdaFunctionUtilizationMetric
-> Maybe LambdaFunctionMetricStatistic
statistic :: Prelude.Maybe LambdaFunctionMetricStatistic
}
deriving (LambdaFunctionUtilizationMetric
-> LambdaFunctionUtilizationMetric -> Bool
(LambdaFunctionUtilizationMetric
-> LambdaFunctionUtilizationMetric -> Bool)
-> (LambdaFunctionUtilizationMetric
-> LambdaFunctionUtilizationMetric -> Bool)
-> Eq LambdaFunctionUtilizationMetric
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: LambdaFunctionUtilizationMetric
-> LambdaFunctionUtilizationMetric -> Bool
$c/= :: LambdaFunctionUtilizationMetric
-> LambdaFunctionUtilizationMetric -> Bool
== :: LambdaFunctionUtilizationMetric
-> LambdaFunctionUtilizationMetric -> Bool
$c== :: LambdaFunctionUtilizationMetric
-> LambdaFunctionUtilizationMetric -> Bool
Prelude.Eq, ReadPrec [LambdaFunctionUtilizationMetric]
ReadPrec LambdaFunctionUtilizationMetric
Int -> ReadS LambdaFunctionUtilizationMetric
ReadS [LambdaFunctionUtilizationMetric]
(Int -> ReadS LambdaFunctionUtilizationMetric)
-> ReadS [LambdaFunctionUtilizationMetric]
-> ReadPrec LambdaFunctionUtilizationMetric
-> ReadPrec [LambdaFunctionUtilizationMetric]
-> Read LambdaFunctionUtilizationMetric
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [LambdaFunctionUtilizationMetric]
$creadListPrec :: ReadPrec [LambdaFunctionUtilizationMetric]
readPrec :: ReadPrec LambdaFunctionUtilizationMetric
$creadPrec :: ReadPrec LambdaFunctionUtilizationMetric
readList :: ReadS [LambdaFunctionUtilizationMetric]
$creadList :: ReadS [LambdaFunctionUtilizationMetric]
readsPrec :: Int -> ReadS LambdaFunctionUtilizationMetric
$creadsPrec :: Int -> ReadS LambdaFunctionUtilizationMetric
Prelude.Read, Int -> LambdaFunctionUtilizationMetric -> ShowS
[LambdaFunctionUtilizationMetric] -> ShowS
LambdaFunctionUtilizationMetric -> String
(Int -> LambdaFunctionUtilizationMetric -> ShowS)
-> (LambdaFunctionUtilizationMetric -> String)
-> ([LambdaFunctionUtilizationMetric] -> ShowS)
-> Show LambdaFunctionUtilizationMetric
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [LambdaFunctionUtilizationMetric] -> ShowS
$cshowList :: [LambdaFunctionUtilizationMetric] -> ShowS
show :: LambdaFunctionUtilizationMetric -> String
$cshow :: LambdaFunctionUtilizationMetric -> String
showsPrec :: Int -> LambdaFunctionUtilizationMetric -> ShowS
$cshowsPrec :: Int -> LambdaFunctionUtilizationMetric -> ShowS
Prelude.Show, (forall x.
LambdaFunctionUtilizationMetric
-> Rep LambdaFunctionUtilizationMetric x)
-> (forall x.
Rep LambdaFunctionUtilizationMetric x
-> LambdaFunctionUtilizationMetric)
-> Generic LambdaFunctionUtilizationMetric
forall x.
Rep LambdaFunctionUtilizationMetric x
-> LambdaFunctionUtilizationMetric
forall x.
LambdaFunctionUtilizationMetric
-> Rep LambdaFunctionUtilizationMetric x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep LambdaFunctionUtilizationMetric x
-> LambdaFunctionUtilizationMetric
$cfrom :: forall x.
LambdaFunctionUtilizationMetric
-> Rep LambdaFunctionUtilizationMetric x
Prelude.Generic)
newLambdaFunctionUtilizationMetric ::
LambdaFunctionUtilizationMetric
newLambdaFunctionUtilizationMetric :: LambdaFunctionUtilizationMetric
newLambdaFunctionUtilizationMetric =
LambdaFunctionUtilizationMetric' :: Maybe Double
-> Maybe LambdaFunctionMetricName
-> Maybe LambdaFunctionMetricStatistic
-> LambdaFunctionUtilizationMetric
LambdaFunctionUtilizationMetric'
{ $sel:value:LambdaFunctionUtilizationMetric' :: Maybe Double
value =
Maybe Double
forall a. Maybe a
Prelude.Nothing,
$sel:name:LambdaFunctionUtilizationMetric' :: Maybe LambdaFunctionMetricName
name = Maybe LambdaFunctionMetricName
forall a. Maybe a
Prelude.Nothing,
$sel:statistic:LambdaFunctionUtilizationMetric' :: Maybe LambdaFunctionMetricStatistic
statistic = Maybe LambdaFunctionMetricStatistic
forall a. Maybe a
Prelude.Nothing
}
lambdaFunctionUtilizationMetric_value :: Lens.Lens' LambdaFunctionUtilizationMetric (Prelude.Maybe Prelude.Double)
lambdaFunctionUtilizationMetric_value :: (Maybe Double -> f (Maybe Double))
-> LambdaFunctionUtilizationMetric
-> f LambdaFunctionUtilizationMetric
lambdaFunctionUtilizationMetric_value = (LambdaFunctionUtilizationMetric -> Maybe Double)
-> (LambdaFunctionUtilizationMetric
-> Maybe Double -> LambdaFunctionUtilizationMetric)
-> Lens
LambdaFunctionUtilizationMetric
LambdaFunctionUtilizationMetric
(Maybe Double)
(Maybe Double)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LambdaFunctionUtilizationMetric' {Maybe Double
value :: Maybe Double
$sel:value:LambdaFunctionUtilizationMetric' :: LambdaFunctionUtilizationMetric -> Maybe Double
value} -> Maybe Double
value) (\s :: LambdaFunctionUtilizationMetric
s@LambdaFunctionUtilizationMetric' {} Maybe Double
a -> LambdaFunctionUtilizationMetric
s {$sel:value:LambdaFunctionUtilizationMetric' :: Maybe Double
value = Maybe Double
a} :: LambdaFunctionUtilizationMetric)
lambdaFunctionUtilizationMetric_name :: Lens.Lens' LambdaFunctionUtilizationMetric (Prelude.Maybe LambdaFunctionMetricName)
lambdaFunctionUtilizationMetric_name :: (Maybe LambdaFunctionMetricName
-> f (Maybe LambdaFunctionMetricName))
-> LambdaFunctionUtilizationMetric
-> f LambdaFunctionUtilizationMetric
lambdaFunctionUtilizationMetric_name = (LambdaFunctionUtilizationMetric -> Maybe LambdaFunctionMetricName)
-> (LambdaFunctionUtilizationMetric
-> Maybe LambdaFunctionMetricName
-> LambdaFunctionUtilizationMetric)
-> Lens
LambdaFunctionUtilizationMetric
LambdaFunctionUtilizationMetric
(Maybe LambdaFunctionMetricName)
(Maybe LambdaFunctionMetricName)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LambdaFunctionUtilizationMetric' {Maybe LambdaFunctionMetricName
name :: Maybe LambdaFunctionMetricName
$sel:name:LambdaFunctionUtilizationMetric' :: LambdaFunctionUtilizationMetric -> Maybe LambdaFunctionMetricName
name} -> Maybe LambdaFunctionMetricName
name) (\s :: LambdaFunctionUtilizationMetric
s@LambdaFunctionUtilizationMetric' {} Maybe LambdaFunctionMetricName
a -> LambdaFunctionUtilizationMetric
s {$sel:name:LambdaFunctionUtilizationMetric' :: Maybe LambdaFunctionMetricName
name = Maybe LambdaFunctionMetricName
a} :: LambdaFunctionUtilizationMetric)
lambdaFunctionUtilizationMetric_statistic :: Lens.Lens' LambdaFunctionUtilizationMetric (Prelude.Maybe LambdaFunctionMetricStatistic)
lambdaFunctionUtilizationMetric_statistic :: (Maybe LambdaFunctionMetricStatistic
-> f (Maybe LambdaFunctionMetricStatistic))
-> LambdaFunctionUtilizationMetric
-> f LambdaFunctionUtilizationMetric
lambdaFunctionUtilizationMetric_statistic = (LambdaFunctionUtilizationMetric
-> Maybe LambdaFunctionMetricStatistic)
-> (LambdaFunctionUtilizationMetric
-> Maybe LambdaFunctionMetricStatistic
-> LambdaFunctionUtilizationMetric)
-> Lens
LambdaFunctionUtilizationMetric
LambdaFunctionUtilizationMetric
(Maybe LambdaFunctionMetricStatistic)
(Maybe LambdaFunctionMetricStatistic)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LambdaFunctionUtilizationMetric' {Maybe LambdaFunctionMetricStatistic
statistic :: Maybe LambdaFunctionMetricStatistic
$sel:statistic:LambdaFunctionUtilizationMetric' :: LambdaFunctionUtilizationMetric
-> Maybe LambdaFunctionMetricStatistic
statistic} -> Maybe LambdaFunctionMetricStatistic
statistic) (\s :: LambdaFunctionUtilizationMetric
s@LambdaFunctionUtilizationMetric' {} Maybe LambdaFunctionMetricStatistic
a -> LambdaFunctionUtilizationMetric
s {$sel:statistic:LambdaFunctionUtilizationMetric' :: Maybe LambdaFunctionMetricStatistic
statistic = Maybe LambdaFunctionMetricStatistic
a} :: LambdaFunctionUtilizationMetric)
instance
Core.FromJSON
LambdaFunctionUtilizationMetric
where
parseJSON :: Value -> Parser LambdaFunctionUtilizationMetric
parseJSON =
String
-> (Object -> Parser LambdaFunctionUtilizationMetric)
-> Value
-> Parser LambdaFunctionUtilizationMetric
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"LambdaFunctionUtilizationMetric"
( \Object
x ->
Maybe Double
-> Maybe LambdaFunctionMetricName
-> Maybe LambdaFunctionMetricStatistic
-> LambdaFunctionUtilizationMetric
LambdaFunctionUtilizationMetric'
(Maybe Double
-> Maybe LambdaFunctionMetricName
-> Maybe LambdaFunctionMetricStatistic
-> LambdaFunctionUtilizationMetric)
-> Parser (Maybe Double)
-> Parser
(Maybe LambdaFunctionMetricName
-> Maybe LambdaFunctionMetricStatistic
-> LambdaFunctionUtilizationMetric)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Double)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"value")
Parser
(Maybe LambdaFunctionMetricName
-> Maybe LambdaFunctionMetricStatistic
-> LambdaFunctionUtilizationMetric)
-> Parser (Maybe LambdaFunctionMetricName)
-> Parser
(Maybe LambdaFunctionMetricStatistic
-> LambdaFunctionUtilizationMetric)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe LambdaFunctionMetricName)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"name")
Parser
(Maybe LambdaFunctionMetricStatistic
-> LambdaFunctionUtilizationMetric)
-> Parser (Maybe LambdaFunctionMetricStatistic)
-> Parser LambdaFunctionUtilizationMetric
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe LambdaFunctionMetricStatistic)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"statistic")
)
instance
Prelude.Hashable
LambdaFunctionUtilizationMetric
instance
Prelude.NFData
LambdaFunctionUtilizationMetric