{-# 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.AutoScalingGroupRecommendationOption where
import Amazonka.ComputeOptimizer.Types.AutoScalingGroupConfiguration
import Amazonka.ComputeOptimizer.Types.UtilizationMetric
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data AutoScalingGroupRecommendationOption = AutoScalingGroupRecommendationOption'
{
AutoScalingGroupRecommendationOption -> Maybe Double
performanceRisk :: Prelude.Maybe Prelude.Double,
AutoScalingGroupRecommendationOption -> Maybe [UtilizationMetric]
projectedUtilizationMetrics :: Prelude.Maybe [UtilizationMetric],
AutoScalingGroupRecommendationOption
-> Maybe AutoScalingGroupConfiguration
configuration :: Prelude.Maybe AutoScalingGroupConfiguration,
AutoScalingGroupRecommendationOption -> Maybe Int
rank :: Prelude.Maybe Prelude.Int
}
deriving (AutoScalingGroupRecommendationOption
-> AutoScalingGroupRecommendationOption -> Bool
(AutoScalingGroupRecommendationOption
-> AutoScalingGroupRecommendationOption -> Bool)
-> (AutoScalingGroupRecommendationOption
-> AutoScalingGroupRecommendationOption -> Bool)
-> Eq AutoScalingGroupRecommendationOption
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AutoScalingGroupRecommendationOption
-> AutoScalingGroupRecommendationOption -> Bool
$c/= :: AutoScalingGroupRecommendationOption
-> AutoScalingGroupRecommendationOption -> Bool
== :: AutoScalingGroupRecommendationOption
-> AutoScalingGroupRecommendationOption -> Bool
$c== :: AutoScalingGroupRecommendationOption
-> AutoScalingGroupRecommendationOption -> Bool
Prelude.Eq, ReadPrec [AutoScalingGroupRecommendationOption]
ReadPrec AutoScalingGroupRecommendationOption
Int -> ReadS AutoScalingGroupRecommendationOption
ReadS [AutoScalingGroupRecommendationOption]
(Int -> ReadS AutoScalingGroupRecommendationOption)
-> ReadS [AutoScalingGroupRecommendationOption]
-> ReadPrec AutoScalingGroupRecommendationOption
-> ReadPrec [AutoScalingGroupRecommendationOption]
-> Read AutoScalingGroupRecommendationOption
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AutoScalingGroupRecommendationOption]
$creadListPrec :: ReadPrec [AutoScalingGroupRecommendationOption]
readPrec :: ReadPrec AutoScalingGroupRecommendationOption
$creadPrec :: ReadPrec AutoScalingGroupRecommendationOption
readList :: ReadS [AutoScalingGroupRecommendationOption]
$creadList :: ReadS [AutoScalingGroupRecommendationOption]
readsPrec :: Int -> ReadS AutoScalingGroupRecommendationOption
$creadsPrec :: Int -> ReadS AutoScalingGroupRecommendationOption
Prelude.Read, Int -> AutoScalingGroupRecommendationOption -> ShowS
[AutoScalingGroupRecommendationOption] -> ShowS
AutoScalingGroupRecommendationOption -> String
(Int -> AutoScalingGroupRecommendationOption -> ShowS)
-> (AutoScalingGroupRecommendationOption -> String)
-> ([AutoScalingGroupRecommendationOption] -> ShowS)
-> Show AutoScalingGroupRecommendationOption
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AutoScalingGroupRecommendationOption] -> ShowS
$cshowList :: [AutoScalingGroupRecommendationOption] -> ShowS
show :: AutoScalingGroupRecommendationOption -> String
$cshow :: AutoScalingGroupRecommendationOption -> String
showsPrec :: Int -> AutoScalingGroupRecommendationOption -> ShowS
$cshowsPrec :: Int -> AutoScalingGroupRecommendationOption -> ShowS
Prelude.Show, (forall x.
AutoScalingGroupRecommendationOption
-> Rep AutoScalingGroupRecommendationOption x)
-> (forall x.
Rep AutoScalingGroupRecommendationOption x
-> AutoScalingGroupRecommendationOption)
-> Generic AutoScalingGroupRecommendationOption
forall x.
Rep AutoScalingGroupRecommendationOption x
-> AutoScalingGroupRecommendationOption
forall x.
AutoScalingGroupRecommendationOption
-> Rep AutoScalingGroupRecommendationOption x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep AutoScalingGroupRecommendationOption x
-> AutoScalingGroupRecommendationOption
$cfrom :: forall x.
AutoScalingGroupRecommendationOption
-> Rep AutoScalingGroupRecommendationOption x
Prelude.Generic)
newAutoScalingGroupRecommendationOption ::
AutoScalingGroupRecommendationOption
newAutoScalingGroupRecommendationOption :: AutoScalingGroupRecommendationOption
newAutoScalingGroupRecommendationOption =
AutoScalingGroupRecommendationOption' :: Maybe Double
-> Maybe [UtilizationMetric]
-> Maybe AutoScalingGroupConfiguration
-> Maybe Int
-> AutoScalingGroupRecommendationOption
AutoScalingGroupRecommendationOption'
{ $sel:performanceRisk:AutoScalingGroupRecommendationOption' :: Maybe Double
performanceRisk =
Maybe Double
forall a. Maybe a
Prelude.Nothing,
$sel:projectedUtilizationMetrics:AutoScalingGroupRecommendationOption' :: Maybe [UtilizationMetric]
projectedUtilizationMetrics =
Maybe [UtilizationMetric]
forall a. Maybe a
Prelude.Nothing,
$sel:configuration:AutoScalingGroupRecommendationOption' :: Maybe AutoScalingGroupConfiguration
configuration = Maybe AutoScalingGroupConfiguration
forall a. Maybe a
Prelude.Nothing,
$sel:rank:AutoScalingGroupRecommendationOption' :: Maybe Int
rank = Maybe Int
forall a. Maybe a
Prelude.Nothing
}
autoScalingGroupRecommendationOption_performanceRisk :: Lens.Lens' AutoScalingGroupRecommendationOption (Prelude.Maybe Prelude.Double)
autoScalingGroupRecommendationOption_performanceRisk :: (Maybe Double -> f (Maybe Double))
-> AutoScalingGroupRecommendationOption
-> f AutoScalingGroupRecommendationOption
autoScalingGroupRecommendationOption_performanceRisk = (AutoScalingGroupRecommendationOption -> Maybe Double)
-> (AutoScalingGroupRecommendationOption
-> Maybe Double -> AutoScalingGroupRecommendationOption)
-> Lens
AutoScalingGroupRecommendationOption
AutoScalingGroupRecommendationOption
(Maybe Double)
(Maybe Double)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AutoScalingGroupRecommendationOption' {Maybe Double
performanceRisk :: Maybe Double
$sel:performanceRisk:AutoScalingGroupRecommendationOption' :: AutoScalingGroupRecommendationOption -> Maybe Double
performanceRisk} -> Maybe Double
performanceRisk) (\s :: AutoScalingGroupRecommendationOption
s@AutoScalingGroupRecommendationOption' {} Maybe Double
a -> AutoScalingGroupRecommendationOption
s {$sel:performanceRisk:AutoScalingGroupRecommendationOption' :: Maybe Double
performanceRisk = Maybe Double
a} :: AutoScalingGroupRecommendationOption)
autoScalingGroupRecommendationOption_projectedUtilizationMetrics :: Lens.Lens' AutoScalingGroupRecommendationOption (Prelude.Maybe [UtilizationMetric])
autoScalingGroupRecommendationOption_projectedUtilizationMetrics :: (Maybe [UtilizationMetric] -> f (Maybe [UtilizationMetric]))
-> AutoScalingGroupRecommendationOption
-> f AutoScalingGroupRecommendationOption
autoScalingGroupRecommendationOption_projectedUtilizationMetrics = (AutoScalingGroupRecommendationOption -> Maybe [UtilizationMetric])
-> (AutoScalingGroupRecommendationOption
-> Maybe [UtilizationMetric]
-> AutoScalingGroupRecommendationOption)
-> Lens
AutoScalingGroupRecommendationOption
AutoScalingGroupRecommendationOption
(Maybe [UtilizationMetric])
(Maybe [UtilizationMetric])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AutoScalingGroupRecommendationOption' {Maybe [UtilizationMetric]
projectedUtilizationMetrics :: Maybe [UtilizationMetric]
$sel:projectedUtilizationMetrics:AutoScalingGroupRecommendationOption' :: AutoScalingGroupRecommendationOption -> Maybe [UtilizationMetric]
projectedUtilizationMetrics} -> Maybe [UtilizationMetric]
projectedUtilizationMetrics) (\s :: AutoScalingGroupRecommendationOption
s@AutoScalingGroupRecommendationOption' {} Maybe [UtilizationMetric]
a -> AutoScalingGroupRecommendationOption
s {$sel:projectedUtilizationMetrics:AutoScalingGroupRecommendationOption' :: Maybe [UtilizationMetric]
projectedUtilizationMetrics = Maybe [UtilizationMetric]
a} :: AutoScalingGroupRecommendationOption) ((Maybe [UtilizationMetric] -> f (Maybe [UtilizationMetric]))
-> AutoScalingGroupRecommendationOption
-> f AutoScalingGroupRecommendationOption)
-> ((Maybe [UtilizationMetric] -> f (Maybe [UtilizationMetric]))
-> Maybe [UtilizationMetric] -> f (Maybe [UtilizationMetric]))
-> (Maybe [UtilizationMetric] -> f (Maybe [UtilizationMetric]))
-> AutoScalingGroupRecommendationOption
-> f AutoScalingGroupRecommendationOption
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
[UtilizationMetric]
[UtilizationMetric]
[UtilizationMetric]
[UtilizationMetric]
-> Iso
(Maybe [UtilizationMetric])
(Maybe [UtilizationMetric])
(Maybe [UtilizationMetric])
(Maybe [UtilizationMetric])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso
[UtilizationMetric]
[UtilizationMetric]
[UtilizationMetric]
[UtilizationMetric]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
autoScalingGroupRecommendationOption_configuration :: Lens.Lens' AutoScalingGroupRecommendationOption (Prelude.Maybe AutoScalingGroupConfiguration)
autoScalingGroupRecommendationOption_configuration :: (Maybe AutoScalingGroupConfiguration
-> f (Maybe AutoScalingGroupConfiguration))
-> AutoScalingGroupRecommendationOption
-> f AutoScalingGroupRecommendationOption
autoScalingGroupRecommendationOption_configuration = (AutoScalingGroupRecommendationOption
-> Maybe AutoScalingGroupConfiguration)
-> (AutoScalingGroupRecommendationOption
-> Maybe AutoScalingGroupConfiguration
-> AutoScalingGroupRecommendationOption)
-> Lens
AutoScalingGroupRecommendationOption
AutoScalingGroupRecommendationOption
(Maybe AutoScalingGroupConfiguration)
(Maybe AutoScalingGroupConfiguration)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AutoScalingGroupRecommendationOption' {Maybe AutoScalingGroupConfiguration
configuration :: Maybe AutoScalingGroupConfiguration
$sel:configuration:AutoScalingGroupRecommendationOption' :: AutoScalingGroupRecommendationOption
-> Maybe AutoScalingGroupConfiguration
configuration} -> Maybe AutoScalingGroupConfiguration
configuration) (\s :: AutoScalingGroupRecommendationOption
s@AutoScalingGroupRecommendationOption' {} Maybe AutoScalingGroupConfiguration
a -> AutoScalingGroupRecommendationOption
s {$sel:configuration:AutoScalingGroupRecommendationOption' :: Maybe AutoScalingGroupConfiguration
configuration = Maybe AutoScalingGroupConfiguration
a} :: AutoScalingGroupRecommendationOption)
autoScalingGroupRecommendationOption_rank :: Lens.Lens' AutoScalingGroupRecommendationOption (Prelude.Maybe Prelude.Int)
autoScalingGroupRecommendationOption_rank :: (Maybe Int -> f (Maybe Int))
-> AutoScalingGroupRecommendationOption
-> f AutoScalingGroupRecommendationOption
autoScalingGroupRecommendationOption_rank = (AutoScalingGroupRecommendationOption -> Maybe Int)
-> (AutoScalingGroupRecommendationOption
-> Maybe Int -> AutoScalingGroupRecommendationOption)
-> Lens
AutoScalingGroupRecommendationOption
AutoScalingGroupRecommendationOption
(Maybe Int)
(Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AutoScalingGroupRecommendationOption' {Maybe Int
rank :: Maybe Int
$sel:rank:AutoScalingGroupRecommendationOption' :: AutoScalingGroupRecommendationOption -> Maybe Int
rank} -> Maybe Int
rank) (\s :: AutoScalingGroupRecommendationOption
s@AutoScalingGroupRecommendationOption' {} Maybe Int
a -> AutoScalingGroupRecommendationOption
s {$sel:rank:AutoScalingGroupRecommendationOption' :: Maybe Int
rank = Maybe Int
a} :: AutoScalingGroupRecommendationOption)
instance
Core.FromJSON
AutoScalingGroupRecommendationOption
where
parseJSON :: Value -> Parser AutoScalingGroupRecommendationOption
parseJSON =
String
-> (Object -> Parser AutoScalingGroupRecommendationOption)
-> Value
-> Parser AutoScalingGroupRecommendationOption
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"AutoScalingGroupRecommendationOption"
( \Object
x ->
Maybe Double
-> Maybe [UtilizationMetric]
-> Maybe AutoScalingGroupConfiguration
-> Maybe Int
-> AutoScalingGroupRecommendationOption
AutoScalingGroupRecommendationOption'
(Maybe Double
-> Maybe [UtilizationMetric]
-> Maybe AutoScalingGroupConfiguration
-> Maybe Int
-> AutoScalingGroupRecommendationOption)
-> Parser (Maybe Double)
-> Parser
(Maybe [UtilizationMetric]
-> Maybe AutoScalingGroupConfiguration
-> Maybe Int
-> AutoScalingGroupRecommendationOption)
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
"performanceRisk")
Parser
(Maybe [UtilizationMetric]
-> Maybe AutoScalingGroupConfiguration
-> Maybe Int
-> AutoScalingGroupRecommendationOption)
-> Parser (Maybe [UtilizationMetric])
-> Parser
(Maybe AutoScalingGroupConfiguration
-> Maybe Int -> AutoScalingGroupRecommendationOption)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object -> Text -> Parser (Maybe (Maybe [UtilizationMetric]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"projectedUtilizationMetrics"
Parser (Maybe (Maybe [UtilizationMetric]))
-> Maybe [UtilizationMetric] -> Parser (Maybe [UtilizationMetric])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [UtilizationMetric]
forall a. Monoid a => a
Prelude.mempty
)
Parser
(Maybe AutoScalingGroupConfiguration
-> Maybe Int -> AutoScalingGroupRecommendationOption)
-> Parser (Maybe AutoScalingGroupConfiguration)
-> Parser (Maybe Int -> AutoScalingGroupRecommendationOption)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe AutoScalingGroupConfiguration)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"configuration")
Parser (Maybe Int -> AutoScalingGroupRecommendationOption)
-> Parser (Maybe Int)
-> Parser AutoScalingGroupRecommendationOption
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"rank")
)
instance
Prelude.Hashable
AutoScalingGroupRecommendationOption
instance
Prelude.NFData
AutoScalingGroupRecommendationOption