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