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