{-# 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.InstanceRecommendation where
import Amazonka.ComputeOptimizer.Types.Finding
import Amazonka.ComputeOptimizer.Types.InstanceRecommendationFindingReasonCode
import Amazonka.ComputeOptimizer.Types.InstanceRecommendationOption
import Amazonka.ComputeOptimizer.Types.RecommendationSource
import Amazonka.ComputeOptimizer.Types.UtilizationMetric
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data InstanceRecommendation = InstanceRecommendation'
{
InstanceRecommendation -> Maybe Text
instanceArn :: Prelude.Maybe Prelude.Text,
InstanceRecommendation -> Maybe Finding
finding :: Prelude.Maybe Finding,
InstanceRecommendation -> Maybe Text
currentInstanceType :: Prelude.Maybe Prelude.Text,
InstanceRecommendation -> Maybe POSIX
lastRefreshTimestamp :: Prelude.Maybe Core.POSIX,
InstanceRecommendation -> Maybe Text
accountId :: Prelude.Maybe Prelude.Text,
InstanceRecommendation
-> Maybe [InstanceRecommendationFindingReasonCode]
findingReasonCodes :: Prelude.Maybe [InstanceRecommendationFindingReasonCode],
InstanceRecommendation -> Maybe [RecommendationSource]
recommendationSources :: Prelude.Maybe [RecommendationSource],
InstanceRecommendation -> Maybe [UtilizationMetric]
utilizationMetrics :: Prelude.Maybe [UtilizationMetric],
InstanceRecommendation -> Maybe Text
instanceName :: Prelude.Maybe Prelude.Text,
InstanceRecommendation -> Maybe [InstanceRecommendationOption]
recommendationOptions :: Prelude.Maybe [InstanceRecommendationOption],
InstanceRecommendation -> Maybe Double
lookBackPeriodInDays :: Prelude.Maybe Prelude.Double
}
deriving (InstanceRecommendation -> InstanceRecommendation -> Bool
(InstanceRecommendation -> InstanceRecommendation -> Bool)
-> (InstanceRecommendation -> InstanceRecommendation -> Bool)
-> Eq InstanceRecommendation
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: InstanceRecommendation -> InstanceRecommendation -> Bool
$c/= :: InstanceRecommendation -> InstanceRecommendation -> Bool
== :: InstanceRecommendation -> InstanceRecommendation -> Bool
$c== :: InstanceRecommendation -> InstanceRecommendation -> Bool
Prelude.Eq, ReadPrec [InstanceRecommendation]
ReadPrec InstanceRecommendation
Int -> ReadS InstanceRecommendation
ReadS [InstanceRecommendation]
(Int -> ReadS InstanceRecommendation)
-> ReadS [InstanceRecommendation]
-> ReadPrec InstanceRecommendation
-> ReadPrec [InstanceRecommendation]
-> Read InstanceRecommendation
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [InstanceRecommendation]
$creadListPrec :: ReadPrec [InstanceRecommendation]
readPrec :: ReadPrec InstanceRecommendation
$creadPrec :: ReadPrec InstanceRecommendation
readList :: ReadS [InstanceRecommendation]
$creadList :: ReadS [InstanceRecommendation]
readsPrec :: Int -> ReadS InstanceRecommendation
$creadsPrec :: Int -> ReadS InstanceRecommendation
Prelude.Read, Int -> InstanceRecommendation -> ShowS
[InstanceRecommendation] -> ShowS
InstanceRecommendation -> String
(Int -> InstanceRecommendation -> ShowS)
-> (InstanceRecommendation -> String)
-> ([InstanceRecommendation] -> ShowS)
-> Show InstanceRecommendation
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [InstanceRecommendation] -> ShowS
$cshowList :: [InstanceRecommendation] -> ShowS
show :: InstanceRecommendation -> String
$cshow :: InstanceRecommendation -> String
showsPrec :: Int -> InstanceRecommendation -> ShowS
$cshowsPrec :: Int -> InstanceRecommendation -> ShowS
Prelude.Show, (forall x. InstanceRecommendation -> Rep InstanceRecommendation x)
-> (forall x.
Rep InstanceRecommendation x -> InstanceRecommendation)
-> Generic InstanceRecommendation
forall x. Rep InstanceRecommendation x -> InstanceRecommendation
forall x. InstanceRecommendation -> Rep InstanceRecommendation x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep InstanceRecommendation x -> InstanceRecommendation
$cfrom :: forall x. InstanceRecommendation -> Rep InstanceRecommendation x
Prelude.Generic)
newInstanceRecommendation ::
InstanceRecommendation
newInstanceRecommendation :: InstanceRecommendation
newInstanceRecommendation =
InstanceRecommendation' :: Maybe Text
-> Maybe Finding
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe [InstanceRecommendationFindingReasonCode]
-> Maybe [RecommendationSource]
-> Maybe [UtilizationMetric]
-> Maybe Text
-> Maybe [InstanceRecommendationOption]
-> Maybe Double
-> InstanceRecommendation
InstanceRecommendation'
{ $sel:instanceArn:InstanceRecommendation' :: Maybe Text
instanceArn =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:finding:InstanceRecommendation' :: Maybe Finding
finding = Maybe Finding
forall a. Maybe a
Prelude.Nothing,
$sel:currentInstanceType:InstanceRecommendation' :: Maybe Text
currentInstanceType = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:lastRefreshTimestamp:InstanceRecommendation' :: Maybe POSIX
lastRefreshTimestamp = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
$sel:accountId:InstanceRecommendation' :: Maybe Text
accountId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:findingReasonCodes:InstanceRecommendation' :: Maybe [InstanceRecommendationFindingReasonCode]
findingReasonCodes = Maybe [InstanceRecommendationFindingReasonCode]
forall a. Maybe a
Prelude.Nothing,
$sel:recommendationSources:InstanceRecommendation' :: Maybe [RecommendationSource]
recommendationSources = Maybe [RecommendationSource]
forall a. Maybe a
Prelude.Nothing,
$sel:utilizationMetrics:InstanceRecommendation' :: Maybe [UtilizationMetric]
utilizationMetrics = Maybe [UtilizationMetric]
forall a. Maybe a
Prelude.Nothing,
$sel:instanceName:InstanceRecommendation' :: Maybe Text
instanceName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:recommendationOptions:InstanceRecommendation' :: Maybe [InstanceRecommendationOption]
recommendationOptions = Maybe [InstanceRecommendationOption]
forall a. Maybe a
Prelude.Nothing,
$sel:lookBackPeriodInDays:InstanceRecommendation' :: Maybe Double
lookBackPeriodInDays = Maybe Double
forall a. Maybe a
Prelude.Nothing
}
instanceRecommendation_instanceArn :: Lens.Lens' InstanceRecommendation (Prelude.Maybe Prelude.Text)
instanceRecommendation_instanceArn :: (Maybe Text -> f (Maybe Text))
-> InstanceRecommendation -> f InstanceRecommendation
instanceRecommendation_instanceArn = (InstanceRecommendation -> Maybe Text)
-> (InstanceRecommendation -> Maybe Text -> InstanceRecommendation)
-> Lens
InstanceRecommendation
InstanceRecommendation
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InstanceRecommendation' {Maybe Text
instanceArn :: Maybe Text
$sel:instanceArn:InstanceRecommendation' :: InstanceRecommendation -> Maybe Text
instanceArn} -> Maybe Text
instanceArn) (\s :: InstanceRecommendation
s@InstanceRecommendation' {} Maybe Text
a -> InstanceRecommendation
s {$sel:instanceArn:InstanceRecommendation' :: Maybe Text
instanceArn = Maybe Text
a} :: InstanceRecommendation)
instanceRecommendation_finding :: Lens.Lens' InstanceRecommendation (Prelude.Maybe Finding)
instanceRecommendation_finding :: (Maybe Finding -> f (Maybe Finding))
-> InstanceRecommendation -> f InstanceRecommendation
instanceRecommendation_finding = (InstanceRecommendation -> Maybe Finding)
-> (InstanceRecommendation
-> Maybe Finding -> InstanceRecommendation)
-> Lens
InstanceRecommendation
InstanceRecommendation
(Maybe Finding)
(Maybe Finding)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InstanceRecommendation' {Maybe Finding
finding :: Maybe Finding
$sel:finding:InstanceRecommendation' :: InstanceRecommendation -> Maybe Finding
finding} -> Maybe Finding
finding) (\s :: InstanceRecommendation
s@InstanceRecommendation' {} Maybe Finding
a -> InstanceRecommendation
s {$sel:finding:InstanceRecommendation' :: Maybe Finding
finding = Maybe Finding
a} :: InstanceRecommendation)
instanceRecommendation_currentInstanceType :: Lens.Lens' InstanceRecommendation (Prelude.Maybe Prelude.Text)
instanceRecommendation_currentInstanceType :: (Maybe Text -> f (Maybe Text))
-> InstanceRecommendation -> f InstanceRecommendation
instanceRecommendation_currentInstanceType = (InstanceRecommendation -> Maybe Text)
-> (InstanceRecommendation -> Maybe Text -> InstanceRecommendation)
-> Lens
InstanceRecommendation
InstanceRecommendation
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InstanceRecommendation' {Maybe Text
currentInstanceType :: Maybe Text
$sel:currentInstanceType:InstanceRecommendation' :: InstanceRecommendation -> Maybe Text
currentInstanceType} -> Maybe Text
currentInstanceType) (\s :: InstanceRecommendation
s@InstanceRecommendation' {} Maybe Text
a -> InstanceRecommendation
s {$sel:currentInstanceType:InstanceRecommendation' :: Maybe Text
currentInstanceType = Maybe Text
a} :: InstanceRecommendation)
instanceRecommendation_lastRefreshTimestamp :: Lens.Lens' InstanceRecommendation (Prelude.Maybe Prelude.UTCTime)
instanceRecommendation_lastRefreshTimestamp :: (Maybe UTCTime -> f (Maybe UTCTime))
-> InstanceRecommendation -> f InstanceRecommendation
instanceRecommendation_lastRefreshTimestamp = (InstanceRecommendation -> Maybe POSIX)
-> (InstanceRecommendation
-> Maybe POSIX -> InstanceRecommendation)
-> Lens
InstanceRecommendation
InstanceRecommendation
(Maybe POSIX)
(Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InstanceRecommendation' {Maybe POSIX
lastRefreshTimestamp :: Maybe POSIX
$sel:lastRefreshTimestamp:InstanceRecommendation' :: InstanceRecommendation -> Maybe POSIX
lastRefreshTimestamp} -> Maybe POSIX
lastRefreshTimestamp) (\s :: InstanceRecommendation
s@InstanceRecommendation' {} Maybe POSIX
a -> InstanceRecommendation
s {$sel:lastRefreshTimestamp:InstanceRecommendation' :: Maybe POSIX
lastRefreshTimestamp = Maybe POSIX
a} :: InstanceRecommendation) ((Maybe POSIX -> f (Maybe POSIX))
-> InstanceRecommendation -> f InstanceRecommendation)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> InstanceRecommendation
-> f InstanceRecommendation
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
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 POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time
instanceRecommendation_accountId :: Lens.Lens' InstanceRecommendation (Prelude.Maybe Prelude.Text)
instanceRecommendation_accountId :: (Maybe Text -> f (Maybe Text))
-> InstanceRecommendation -> f InstanceRecommendation
instanceRecommendation_accountId = (InstanceRecommendation -> Maybe Text)
-> (InstanceRecommendation -> Maybe Text -> InstanceRecommendation)
-> Lens
InstanceRecommendation
InstanceRecommendation
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InstanceRecommendation' {Maybe Text
accountId :: Maybe Text
$sel:accountId:InstanceRecommendation' :: InstanceRecommendation -> Maybe Text
accountId} -> Maybe Text
accountId) (\s :: InstanceRecommendation
s@InstanceRecommendation' {} Maybe Text
a -> InstanceRecommendation
s {$sel:accountId:InstanceRecommendation' :: Maybe Text
accountId = Maybe Text
a} :: InstanceRecommendation)
instanceRecommendation_findingReasonCodes :: Lens.Lens' InstanceRecommendation (Prelude.Maybe [InstanceRecommendationFindingReasonCode])
instanceRecommendation_findingReasonCodes :: (Maybe [InstanceRecommendationFindingReasonCode]
-> f (Maybe [InstanceRecommendationFindingReasonCode]))
-> InstanceRecommendation -> f InstanceRecommendation
instanceRecommendation_findingReasonCodes = (InstanceRecommendation
-> Maybe [InstanceRecommendationFindingReasonCode])
-> (InstanceRecommendation
-> Maybe [InstanceRecommendationFindingReasonCode]
-> InstanceRecommendation)
-> Lens
InstanceRecommendation
InstanceRecommendation
(Maybe [InstanceRecommendationFindingReasonCode])
(Maybe [InstanceRecommendationFindingReasonCode])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InstanceRecommendation' {Maybe [InstanceRecommendationFindingReasonCode]
findingReasonCodes :: Maybe [InstanceRecommendationFindingReasonCode]
$sel:findingReasonCodes:InstanceRecommendation' :: InstanceRecommendation
-> Maybe [InstanceRecommendationFindingReasonCode]
findingReasonCodes} -> Maybe [InstanceRecommendationFindingReasonCode]
findingReasonCodes) (\s :: InstanceRecommendation
s@InstanceRecommendation' {} Maybe [InstanceRecommendationFindingReasonCode]
a -> InstanceRecommendation
s {$sel:findingReasonCodes:InstanceRecommendation' :: Maybe [InstanceRecommendationFindingReasonCode]
findingReasonCodes = Maybe [InstanceRecommendationFindingReasonCode]
a} :: InstanceRecommendation) ((Maybe [InstanceRecommendationFindingReasonCode]
-> f (Maybe [InstanceRecommendationFindingReasonCode]))
-> InstanceRecommendation -> f InstanceRecommendation)
-> ((Maybe [InstanceRecommendationFindingReasonCode]
-> f (Maybe [InstanceRecommendationFindingReasonCode]))
-> Maybe [InstanceRecommendationFindingReasonCode]
-> f (Maybe [InstanceRecommendationFindingReasonCode]))
-> (Maybe [InstanceRecommendationFindingReasonCode]
-> f (Maybe [InstanceRecommendationFindingReasonCode]))
-> InstanceRecommendation
-> f InstanceRecommendation
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
[InstanceRecommendationFindingReasonCode]
[InstanceRecommendationFindingReasonCode]
[InstanceRecommendationFindingReasonCode]
[InstanceRecommendationFindingReasonCode]
-> Iso
(Maybe [InstanceRecommendationFindingReasonCode])
(Maybe [InstanceRecommendationFindingReasonCode])
(Maybe [InstanceRecommendationFindingReasonCode])
(Maybe [InstanceRecommendationFindingReasonCode])
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
[InstanceRecommendationFindingReasonCode]
[InstanceRecommendationFindingReasonCode]
[InstanceRecommendationFindingReasonCode]
[InstanceRecommendationFindingReasonCode]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instanceRecommendation_recommendationSources :: Lens.Lens' InstanceRecommendation (Prelude.Maybe [RecommendationSource])
instanceRecommendation_recommendationSources :: (Maybe [RecommendationSource] -> f (Maybe [RecommendationSource]))
-> InstanceRecommendation -> f InstanceRecommendation
instanceRecommendation_recommendationSources = (InstanceRecommendation -> Maybe [RecommendationSource])
-> (InstanceRecommendation
-> Maybe [RecommendationSource] -> InstanceRecommendation)
-> Lens
InstanceRecommendation
InstanceRecommendation
(Maybe [RecommendationSource])
(Maybe [RecommendationSource])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InstanceRecommendation' {Maybe [RecommendationSource]
recommendationSources :: Maybe [RecommendationSource]
$sel:recommendationSources:InstanceRecommendation' :: InstanceRecommendation -> Maybe [RecommendationSource]
recommendationSources} -> Maybe [RecommendationSource]
recommendationSources) (\s :: InstanceRecommendation
s@InstanceRecommendation' {} Maybe [RecommendationSource]
a -> InstanceRecommendation
s {$sel:recommendationSources:InstanceRecommendation' :: Maybe [RecommendationSource]
recommendationSources = Maybe [RecommendationSource]
a} :: InstanceRecommendation) ((Maybe [RecommendationSource] -> f (Maybe [RecommendationSource]))
-> InstanceRecommendation -> f InstanceRecommendation)
-> ((Maybe [RecommendationSource]
-> f (Maybe [RecommendationSource]))
-> Maybe [RecommendationSource]
-> f (Maybe [RecommendationSource]))
-> (Maybe [RecommendationSource]
-> f (Maybe [RecommendationSource]))
-> InstanceRecommendation
-> f InstanceRecommendation
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
[RecommendationSource]
[RecommendationSource]
[RecommendationSource]
[RecommendationSource]
-> Iso
(Maybe [RecommendationSource])
(Maybe [RecommendationSource])
(Maybe [RecommendationSource])
(Maybe [RecommendationSource])
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
[RecommendationSource]
[RecommendationSource]
[RecommendationSource]
[RecommendationSource]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instanceRecommendation_utilizationMetrics :: Lens.Lens' InstanceRecommendation (Prelude.Maybe [UtilizationMetric])
instanceRecommendation_utilizationMetrics :: (Maybe [UtilizationMetric] -> f (Maybe [UtilizationMetric]))
-> InstanceRecommendation -> f InstanceRecommendation
instanceRecommendation_utilizationMetrics = (InstanceRecommendation -> Maybe [UtilizationMetric])
-> (InstanceRecommendation
-> Maybe [UtilizationMetric] -> InstanceRecommendation)
-> Lens
InstanceRecommendation
InstanceRecommendation
(Maybe [UtilizationMetric])
(Maybe [UtilizationMetric])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InstanceRecommendation' {Maybe [UtilizationMetric]
utilizationMetrics :: Maybe [UtilizationMetric]
$sel:utilizationMetrics:InstanceRecommendation' :: InstanceRecommendation -> Maybe [UtilizationMetric]
utilizationMetrics} -> Maybe [UtilizationMetric]
utilizationMetrics) (\s :: InstanceRecommendation
s@InstanceRecommendation' {} Maybe [UtilizationMetric]
a -> InstanceRecommendation
s {$sel:utilizationMetrics:InstanceRecommendation' :: Maybe [UtilizationMetric]
utilizationMetrics = Maybe [UtilizationMetric]
a} :: InstanceRecommendation) ((Maybe [UtilizationMetric] -> f (Maybe [UtilizationMetric]))
-> InstanceRecommendation -> f InstanceRecommendation)
-> ((Maybe [UtilizationMetric] -> f (Maybe [UtilizationMetric]))
-> Maybe [UtilizationMetric] -> f (Maybe [UtilizationMetric]))
-> (Maybe [UtilizationMetric] -> f (Maybe [UtilizationMetric]))
-> InstanceRecommendation
-> f InstanceRecommendation
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
instanceRecommendation_instanceName :: Lens.Lens' InstanceRecommendation (Prelude.Maybe Prelude.Text)
instanceRecommendation_instanceName :: (Maybe Text -> f (Maybe Text))
-> InstanceRecommendation -> f InstanceRecommendation
instanceRecommendation_instanceName = (InstanceRecommendation -> Maybe Text)
-> (InstanceRecommendation -> Maybe Text -> InstanceRecommendation)
-> Lens
InstanceRecommendation
InstanceRecommendation
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InstanceRecommendation' {Maybe Text
instanceName :: Maybe Text
$sel:instanceName:InstanceRecommendation' :: InstanceRecommendation -> Maybe Text
instanceName} -> Maybe Text
instanceName) (\s :: InstanceRecommendation
s@InstanceRecommendation' {} Maybe Text
a -> InstanceRecommendation
s {$sel:instanceName:InstanceRecommendation' :: Maybe Text
instanceName = Maybe Text
a} :: InstanceRecommendation)
instanceRecommendation_recommendationOptions :: Lens.Lens' InstanceRecommendation (Prelude.Maybe [InstanceRecommendationOption])
instanceRecommendation_recommendationOptions :: (Maybe [InstanceRecommendationOption]
-> f (Maybe [InstanceRecommendationOption]))
-> InstanceRecommendation -> f InstanceRecommendation
instanceRecommendation_recommendationOptions = (InstanceRecommendation -> Maybe [InstanceRecommendationOption])
-> (InstanceRecommendation
-> Maybe [InstanceRecommendationOption] -> InstanceRecommendation)
-> Lens
InstanceRecommendation
InstanceRecommendation
(Maybe [InstanceRecommendationOption])
(Maybe [InstanceRecommendationOption])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InstanceRecommendation' {Maybe [InstanceRecommendationOption]
recommendationOptions :: Maybe [InstanceRecommendationOption]
$sel:recommendationOptions:InstanceRecommendation' :: InstanceRecommendation -> Maybe [InstanceRecommendationOption]
recommendationOptions} -> Maybe [InstanceRecommendationOption]
recommendationOptions) (\s :: InstanceRecommendation
s@InstanceRecommendation' {} Maybe [InstanceRecommendationOption]
a -> InstanceRecommendation
s {$sel:recommendationOptions:InstanceRecommendation' :: Maybe [InstanceRecommendationOption]
recommendationOptions = Maybe [InstanceRecommendationOption]
a} :: InstanceRecommendation) ((Maybe [InstanceRecommendationOption]
-> f (Maybe [InstanceRecommendationOption]))
-> InstanceRecommendation -> f InstanceRecommendation)
-> ((Maybe [InstanceRecommendationOption]
-> f (Maybe [InstanceRecommendationOption]))
-> Maybe [InstanceRecommendationOption]
-> f (Maybe [InstanceRecommendationOption]))
-> (Maybe [InstanceRecommendationOption]
-> f (Maybe [InstanceRecommendationOption]))
-> InstanceRecommendation
-> f InstanceRecommendation
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
[InstanceRecommendationOption]
[InstanceRecommendationOption]
[InstanceRecommendationOption]
[InstanceRecommendationOption]
-> Iso
(Maybe [InstanceRecommendationOption])
(Maybe [InstanceRecommendationOption])
(Maybe [InstanceRecommendationOption])
(Maybe [InstanceRecommendationOption])
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
[InstanceRecommendationOption]
[InstanceRecommendationOption]
[InstanceRecommendationOption]
[InstanceRecommendationOption]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instanceRecommendation_lookBackPeriodInDays :: Lens.Lens' InstanceRecommendation (Prelude.Maybe Prelude.Double)
instanceRecommendation_lookBackPeriodInDays :: (Maybe Double -> f (Maybe Double))
-> InstanceRecommendation -> f InstanceRecommendation
instanceRecommendation_lookBackPeriodInDays = (InstanceRecommendation -> Maybe Double)
-> (InstanceRecommendation
-> Maybe Double -> InstanceRecommendation)
-> Lens
InstanceRecommendation
InstanceRecommendation
(Maybe Double)
(Maybe Double)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InstanceRecommendation' {Maybe Double
lookBackPeriodInDays :: Maybe Double
$sel:lookBackPeriodInDays:InstanceRecommendation' :: InstanceRecommendation -> Maybe Double
lookBackPeriodInDays} -> Maybe Double
lookBackPeriodInDays) (\s :: InstanceRecommendation
s@InstanceRecommendation' {} Maybe Double
a -> InstanceRecommendation
s {$sel:lookBackPeriodInDays:InstanceRecommendation' :: Maybe Double
lookBackPeriodInDays = Maybe Double
a} :: InstanceRecommendation)
instance Core.FromJSON InstanceRecommendation where
parseJSON :: Value -> Parser InstanceRecommendation
parseJSON =
String
-> (Object -> Parser InstanceRecommendation)
-> Value
-> Parser InstanceRecommendation
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"InstanceRecommendation"
( \Object
x ->
Maybe Text
-> Maybe Finding
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe [InstanceRecommendationFindingReasonCode]
-> Maybe [RecommendationSource]
-> Maybe [UtilizationMetric]
-> Maybe Text
-> Maybe [InstanceRecommendationOption]
-> Maybe Double
-> InstanceRecommendation
InstanceRecommendation'
(Maybe Text
-> Maybe Finding
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe [InstanceRecommendationFindingReasonCode]
-> Maybe [RecommendationSource]
-> Maybe [UtilizationMetric]
-> Maybe Text
-> Maybe [InstanceRecommendationOption]
-> Maybe Double
-> InstanceRecommendation)
-> Parser (Maybe Text)
-> Parser
(Maybe Finding
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe [InstanceRecommendationFindingReasonCode]
-> Maybe [RecommendationSource]
-> Maybe [UtilizationMetric]
-> Maybe Text
-> Maybe [InstanceRecommendationOption]
-> Maybe Double
-> InstanceRecommendation)
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
"instanceArn")
Parser
(Maybe Finding
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe [InstanceRecommendationFindingReasonCode]
-> Maybe [RecommendationSource]
-> Maybe [UtilizationMetric]
-> Maybe Text
-> Maybe [InstanceRecommendationOption]
-> Maybe Double
-> InstanceRecommendation)
-> Parser (Maybe Finding)
-> Parser
(Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe [InstanceRecommendationFindingReasonCode]
-> Maybe [RecommendationSource]
-> Maybe [UtilizationMetric]
-> Maybe Text
-> Maybe [InstanceRecommendationOption]
-> Maybe Double
-> InstanceRecommendation)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Finding)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"finding")
Parser
(Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe [InstanceRecommendationFindingReasonCode]
-> Maybe [RecommendationSource]
-> Maybe [UtilizationMetric]
-> Maybe Text
-> Maybe [InstanceRecommendationOption]
-> Maybe Double
-> InstanceRecommendation)
-> Parser (Maybe Text)
-> Parser
(Maybe POSIX
-> Maybe Text
-> Maybe [InstanceRecommendationFindingReasonCode]
-> Maybe [RecommendationSource]
-> Maybe [UtilizationMetric]
-> Maybe Text
-> Maybe [InstanceRecommendationOption]
-> Maybe Double
-> InstanceRecommendation)
forall (f :: * -> *) a b. Applicative f => 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
"currentInstanceType")
Parser
(Maybe POSIX
-> Maybe Text
-> Maybe [InstanceRecommendationFindingReasonCode]
-> Maybe [RecommendationSource]
-> Maybe [UtilizationMetric]
-> Maybe Text
-> Maybe [InstanceRecommendationOption]
-> Maybe Double
-> InstanceRecommendation)
-> Parser (Maybe POSIX)
-> Parser
(Maybe Text
-> Maybe [InstanceRecommendationFindingReasonCode]
-> Maybe [RecommendationSource]
-> Maybe [UtilizationMetric]
-> Maybe Text
-> Maybe [InstanceRecommendationOption]
-> Maybe Double
-> InstanceRecommendation)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"lastRefreshTimestamp")
Parser
(Maybe Text
-> Maybe [InstanceRecommendationFindingReasonCode]
-> Maybe [RecommendationSource]
-> Maybe [UtilizationMetric]
-> Maybe Text
-> Maybe [InstanceRecommendationOption]
-> Maybe Double
-> InstanceRecommendation)
-> Parser (Maybe Text)
-> Parser
(Maybe [InstanceRecommendationFindingReasonCode]
-> Maybe [RecommendationSource]
-> Maybe [UtilizationMetric]
-> Maybe Text
-> Maybe [InstanceRecommendationOption]
-> Maybe Double
-> InstanceRecommendation)
forall (f :: * -> *) a b. Applicative f => 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
"accountId")
Parser
(Maybe [InstanceRecommendationFindingReasonCode]
-> Maybe [RecommendationSource]
-> Maybe [UtilizationMetric]
-> Maybe Text
-> Maybe [InstanceRecommendationOption]
-> Maybe Double
-> InstanceRecommendation)
-> Parser (Maybe [InstanceRecommendationFindingReasonCode])
-> Parser
(Maybe [RecommendationSource]
-> Maybe [UtilizationMetric]
-> Maybe Text
-> Maybe [InstanceRecommendationOption]
-> Maybe Double
-> InstanceRecommendation)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object
-> Text
-> Parser (Maybe (Maybe [InstanceRecommendationFindingReasonCode]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"findingReasonCodes"
Parser (Maybe (Maybe [InstanceRecommendationFindingReasonCode]))
-> Maybe [InstanceRecommendationFindingReasonCode]
-> Parser (Maybe [InstanceRecommendationFindingReasonCode])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [InstanceRecommendationFindingReasonCode]
forall a. Monoid a => a
Prelude.mempty
)
Parser
(Maybe [RecommendationSource]
-> Maybe [UtilizationMetric]
-> Maybe Text
-> Maybe [InstanceRecommendationOption]
-> Maybe Double
-> InstanceRecommendation)
-> Parser (Maybe [RecommendationSource])
-> Parser
(Maybe [UtilizationMetric]
-> Maybe Text
-> Maybe [InstanceRecommendationOption]
-> Maybe Double
-> InstanceRecommendation)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object -> Text -> Parser (Maybe (Maybe [RecommendationSource]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"recommendationSources"
Parser (Maybe (Maybe [RecommendationSource]))
-> Maybe [RecommendationSource]
-> Parser (Maybe [RecommendationSource])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [RecommendationSource]
forall a. Monoid a => a
Prelude.mempty
)
Parser
(Maybe [UtilizationMetric]
-> Maybe Text
-> Maybe [InstanceRecommendationOption]
-> Maybe Double
-> InstanceRecommendation)
-> Parser (Maybe [UtilizationMetric])
-> Parser
(Maybe Text
-> Maybe [InstanceRecommendationOption]
-> Maybe Double
-> InstanceRecommendation)
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
"utilizationMetrics"
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 Text
-> Maybe [InstanceRecommendationOption]
-> Maybe Double
-> InstanceRecommendation)
-> Parser (Maybe Text)
-> Parser
(Maybe [InstanceRecommendationOption]
-> Maybe Double -> InstanceRecommendation)
forall (f :: * -> *) a b. Applicative f => 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
"instanceName")
Parser
(Maybe [InstanceRecommendationOption]
-> Maybe Double -> InstanceRecommendation)
-> Parser (Maybe [InstanceRecommendationOption])
-> Parser (Maybe Double -> InstanceRecommendation)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object
-> Text -> Parser (Maybe (Maybe [InstanceRecommendationOption]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"recommendationOptions"
Parser (Maybe (Maybe [InstanceRecommendationOption]))
-> Maybe [InstanceRecommendationOption]
-> Parser (Maybe [InstanceRecommendationOption])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [InstanceRecommendationOption]
forall a. Monoid a => a
Prelude.mempty
)
Parser (Maybe Double -> InstanceRecommendation)
-> Parser (Maybe Double) -> Parser InstanceRecommendation
forall (f :: * -> *) a b. Applicative f => 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
"lookBackPeriodInDays")
)
instance Prelude.Hashable InstanceRecommendation
instance Prelude.NFData InstanceRecommendation