{-# 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 #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.ComputeOptimizer.Types.AutoScalingGroupRecommendation
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.ComputeOptimizer.Types.AutoScalingGroupRecommendation where

import Amazonka.ComputeOptimizer.Types.AutoScalingGroupConfiguration
import Amazonka.ComputeOptimizer.Types.AutoScalingGroupRecommendationOption
import Amazonka.ComputeOptimizer.Types.Finding
import Amazonka.ComputeOptimizer.Types.UtilizationMetric
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Describes an Auto Scaling group recommendation.
--
-- /See:/ 'newAutoScalingGroupRecommendation' smart constructor.
data AutoScalingGroupRecommendation = AutoScalingGroupRecommendation'
  { -- | The finding classification of the Auto Scaling group.
    --
    -- Findings for Auto Scaling groups include:
    --
    -- -   __@NotOptimized@__ —An Auto Scaling group is considered not
    --     optimized when Compute Optimizer identifies a recommendation that
    --     can provide better performance for your workload.
    --
    -- -   __@Optimized@__ —An Auto Scaling group is considered optimized when
    --     Compute Optimizer determines that the group is correctly provisioned
    --     to run your workload based on the chosen instance type. For
    --     optimized resources, Compute Optimizer might recommend a new
    --     generation instance type.
    AutoScalingGroupRecommendation -> Maybe Finding
finding :: Prelude.Maybe Finding,
    -- | The timestamp of when the Auto Scaling group recommendation was last
    -- refreshed.
    AutoScalingGroupRecommendation -> Maybe POSIX
lastRefreshTimestamp :: Prelude.Maybe Core.POSIX,
    -- | An array of objects that describe the current configuration of the Auto
    -- Scaling group.
    AutoScalingGroupRecommendation
-> Maybe AutoScalingGroupConfiguration
currentConfiguration :: Prelude.Maybe AutoScalingGroupConfiguration,
    -- | The Amazon Web Services account ID of the Auto Scaling group.
    AutoScalingGroupRecommendation -> Maybe Text
accountId :: Prelude.Maybe Prelude.Text,
    -- | The name of the Auto Scaling group.
    AutoScalingGroupRecommendation -> Maybe Text
autoScalingGroupName :: Prelude.Maybe Prelude.Text,
    -- | An array of objects that describe the utilization metrics of the Auto
    -- Scaling group.
    AutoScalingGroupRecommendation -> Maybe [UtilizationMetric]
utilizationMetrics :: Prelude.Maybe [UtilizationMetric],
    -- | The Amazon Resource Name (ARN) of the Auto Scaling group.
    AutoScalingGroupRecommendation -> Maybe Text
autoScalingGroupArn :: Prelude.Maybe Prelude.Text,
    -- | An array of objects that describe the recommendation options for the
    -- Auto Scaling group.
    AutoScalingGroupRecommendation
-> Maybe [AutoScalingGroupRecommendationOption]
recommendationOptions :: Prelude.Maybe [AutoScalingGroupRecommendationOption],
    -- | The number of days for which utilization metrics were analyzed for the
    -- Auto Scaling group.
    AutoScalingGroupRecommendation -> Maybe Double
lookBackPeriodInDays :: Prelude.Maybe Prelude.Double
  }
  deriving (AutoScalingGroupRecommendation
-> AutoScalingGroupRecommendation -> Bool
(AutoScalingGroupRecommendation
 -> AutoScalingGroupRecommendation -> Bool)
-> (AutoScalingGroupRecommendation
    -> AutoScalingGroupRecommendation -> Bool)
-> Eq AutoScalingGroupRecommendation
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AutoScalingGroupRecommendation
-> AutoScalingGroupRecommendation -> Bool
$c/= :: AutoScalingGroupRecommendation
-> AutoScalingGroupRecommendation -> Bool
== :: AutoScalingGroupRecommendation
-> AutoScalingGroupRecommendation -> Bool
$c== :: AutoScalingGroupRecommendation
-> AutoScalingGroupRecommendation -> Bool
Prelude.Eq, ReadPrec [AutoScalingGroupRecommendation]
ReadPrec AutoScalingGroupRecommendation
Int -> ReadS AutoScalingGroupRecommendation
ReadS [AutoScalingGroupRecommendation]
(Int -> ReadS AutoScalingGroupRecommendation)
-> ReadS [AutoScalingGroupRecommendation]
-> ReadPrec AutoScalingGroupRecommendation
-> ReadPrec [AutoScalingGroupRecommendation]
-> Read AutoScalingGroupRecommendation
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AutoScalingGroupRecommendation]
$creadListPrec :: ReadPrec [AutoScalingGroupRecommendation]
readPrec :: ReadPrec AutoScalingGroupRecommendation
$creadPrec :: ReadPrec AutoScalingGroupRecommendation
readList :: ReadS [AutoScalingGroupRecommendation]
$creadList :: ReadS [AutoScalingGroupRecommendation]
readsPrec :: Int -> ReadS AutoScalingGroupRecommendation
$creadsPrec :: Int -> ReadS AutoScalingGroupRecommendation
Prelude.Read, Int -> AutoScalingGroupRecommendation -> ShowS
[AutoScalingGroupRecommendation] -> ShowS
AutoScalingGroupRecommendation -> String
(Int -> AutoScalingGroupRecommendation -> ShowS)
-> (AutoScalingGroupRecommendation -> String)
-> ([AutoScalingGroupRecommendation] -> ShowS)
-> Show AutoScalingGroupRecommendation
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AutoScalingGroupRecommendation] -> ShowS
$cshowList :: [AutoScalingGroupRecommendation] -> ShowS
show :: AutoScalingGroupRecommendation -> String
$cshow :: AutoScalingGroupRecommendation -> String
showsPrec :: Int -> AutoScalingGroupRecommendation -> ShowS
$cshowsPrec :: Int -> AutoScalingGroupRecommendation -> ShowS
Prelude.Show, (forall x.
 AutoScalingGroupRecommendation
 -> Rep AutoScalingGroupRecommendation x)
-> (forall x.
    Rep AutoScalingGroupRecommendation x
    -> AutoScalingGroupRecommendation)
-> Generic AutoScalingGroupRecommendation
forall x.
Rep AutoScalingGroupRecommendation x
-> AutoScalingGroupRecommendation
forall x.
AutoScalingGroupRecommendation
-> Rep AutoScalingGroupRecommendation x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep AutoScalingGroupRecommendation x
-> AutoScalingGroupRecommendation
$cfrom :: forall x.
AutoScalingGroupRecommendation
-> Rep AutoScalingGroupRecommendation x
Prelude.Generic)

-- |
-- Create a value of 'AutoScalingGroupRecommendation' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'finding', 'autoScalingGroupRecommendation_finding' - The finding classification of the Auto Scaling group.
--
-- Findings for Auto Scaling groups include:
--
-- -   __@NotOptimized@__ —An Auto Scaling group is considered not
--     optimized when Compute Optimizer identifies a recommendation that
--     can provide better performance for your workload.
--
-- -   __@Optimized@__ —An Auto Scaling group is considered optimized when
--     Compute Optimizer determines that the group is correctly provisioned
--     to run your workload based on the chosen instance type. For
--     optimized resources, Compute Optimizer might recommend a new
--     generation instance type.
--
-- 'lastRefreshTimestamp', 'autoScalingGroupRecommendation_lastRefreshTimestamp' - The timestamp of when the Auto Scaling group recommendation was last
-- refreshed.
--
-- 'currentConfiguration', 'autoScalingGroupRecommendation_currentConfiguration' - An array of objects that describe the current configuration of the Auto
-- Scaling group.
--
-- 'accountId', 'autoScalingGroupRecommendation_accountId' - The Amazon Web Services account ID of the Auto Scaling group.
--
-- 'autoScalingGroupName', 'autoScalingGroupRecommendation_autoScalingGroupName' - The name of the Auto Scaling group.
--
-- 'utilizationMetrics', 'autoScalingGroupRecommendation_utilizationMetrics' - An array of objects that describe the utilization metrics of the Auto
-- Scaling group.
--
-- 'autoScalingGroupArn', 'autoScalingGroupRecommendation_autoScalingGroupArn' - The Amazon Resource Name (ARN) of the Auto Scaling group.
--
-- 'recommendationOptions', 'autoScalingGroupRecommendation_recommendationOptions' - An array of objects that describe the recommendation options for the
-- Auto Scaling group.
--
-- 'lookBackPeriodInDays', 'autoScalingGroupRecommendation_lookBackPeriodInDays' - The number of days for which utilization metrics were analyzed for the
-- Auto Scaling group.
newAutoScalingGroupRecommendation ::
  AutoScalingGroupRecommendation
newAutoScalingGroupRecommendation :: AutoScalingGroupRecommendation
newAutoScalingGroupRecommendation =
  AutoScalingGroupRecommendation' :: Maybe Finding
-> Maybe POSIX
-> Maybe AutoScalingGroupConfiguration
-> Maybe Text
-> Maybe Text
-> Maybe [UtilizationMetric]
-> Maybe Text
-> Maybe [AutoScalingGroupRecommendationOption]
-> Maybe Double
-> AutoScalingGroupRecommendation
AutoScalingGroupRecommendation'
    { $sel:finding:AutoScalingGroupRecommendation' :: Maybe Finding
finding =
        Maybe Finding
forall a. Maybe a
Prelude.Nothing,
      $sel:lastRefreshTimestamp:AutoScalingGroupRecommendation' :: Maybe POSIX
lastRefreshTimestamp = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:currentConfiguration:AutoScalingGroupRecommendation' :: Maybe AutoScalingGroupConfiguration
currentConfiguration = Maybe AutoScalingGroupConfiguration
forall a. Maybe a
Prelude.Nothing,
      $sel:accountId:AutoScalingGroupRecommendation' :: Maybe Text
accountId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:autoScalingGroupName:AutoScalingGroupRecommendation' :: Maybe Text
autoScalingGroupName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:utilizationMetrics:AutoScalingGroupRecommendation' :: Maybe [UtilizationMetric]
utilizationMetrics = Maybe [UtilizationMetric]
forall a. Maybe a
Prelude.Nothing,
      $sel:autoScalingGroupArn:AutoScalingGroupRecommendation' :: Maybe Text
autoScalingGroupArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:recommendationOptions:AutoScalingGroupRecommendation' :: Maybe [AutoScalingGroupRecommendationOption]
recommendationOptions = Maybe [AutoScalingGroupRecommendationOption]
forall a. Maybe a
Prelude.Nothing,
      $sel:lookBackPeriodInDays:AutoScalingGroupRecommendation' :: Maybe Double
lookBackPeriodInDays = Maybe Double
forall a. Maybe a
Prelude.Nothing
    }

-- | The finding classification of the Auto Scaling group.
--
-- Findings for Auto Scaling groups include:
--
-- -   __@NotOptimized@__ —An Auto Scaling group is considered not
--     optimized when Compute Optimizer identifies a recommendation that
--     can provide better performance for your workload.
--
-- -   __@Optimized@__ —An Auto Scaling group is considered optimized when
--     Compute Optimizer determines that the group is correctly provisioned
--     to run your workload based on the chosen instance type. For
--     optimized resources, Compute Optimizer might recommend a new
--     generation instance type.
autoScalingGroupRecommendation_finding :: Lens.Lens' AutoScalingGroupRecommendation (Prelude.Maybe Finding)
autoScalingGroupRecommendation_finding :: (Maybe Finding -> f (Maybe Finding))
-> AutoScalingGroupRecommendation
-> f AutoScalingGroupRecommendation
autoScalingGroupRecommendation_finding = (AutoScalingGroupRecommendation -> Maybe Finding)
-> (AutoScalingGroupRecommendation
    -> Maybe Finding -> AutoScalingGroupRecommendation)
-> Lens
     AutoScalingGroupRecommendation
     AutoScalingGroupRecommendation
     (Maybe Finding)
     (Maybe Finding)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AutoScalingGroupRecommendation' {Maybe Finding
finding :: Maybe Finding
$sel:finding:AutoScalingGroupRecommendation' :: AutoScalingGroupRecommendation -> Maybe Finding
finding} -> Maybe Finding
finding) (\s :: AutoScalingGroupRecommendation
s@AutoScalingGroupRecommendation' {} Maybe Finding
a -> AutoScalingGroupRecommendation
s {$sel:finding:AutoScalingGroupRecommendation' :: Maybe Finding
finding = Maybe Finding
a} :: AutoScalingGroupRecommendation)

-- | The timestamp of when the Auto Scaling group recommendation was last
-- refreshed.
autoScalingGroupRecommendation_lastRefreshTimestamp :: Lens.Lens' AutoScalingGroupRecommendation (Prelude.Maybe Prelude.UTCTime)
autoScalingGroupRecommendation_lastRefreshTimestamp :: (Maybe UTCTime -> f (Maybe UTCTime))
-> AutoScalingGroupRecommendation
-> f AutoScalingGroupRecommendation
autoScalingGroupRecommendation_lastRefreshTimestamp = (AutoScalingGroupRecommendation -> Maybe POSIX)
-> (AutoScalingGroupRecommendation
    -> Maybe POSIX -> AutoScalingGroupRecommendation)
-> Lens
     AutoScalingGroupRecommendation
     AutoScalingGroupRecommendation
     (Maybe POSIX)
     (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AutoScalingGroupRecommendation' {Maybe POSIX
lastRefreshTimestamp :: Maybe POSIX
$sel:lastRefreshTimestamp:AutoScalingGroupRecommendation' :: AutoScalingGroupRecommendation -> Maybe POSIX
lastRefreshTimestamp} -> Maybe POSIX
lastRefreshTimestamp) (\s :: AutoScalingGroupRecommendation
s@AutoScalingGroupRecommendation' {} Maybe POSIX
a -> AutoScalingGroupRecommendation
s {$sel:lastRefreshTimestamp:AutoScalingGroupRecommendation' :: Maybe POSIX
lastRefreshTimestamp = Maybe POSIX
a} :: AutoScalingGroupRecommendation) ((Maybe POSIX -> f (Maybe POSIX))
 -> AutoScalingGroupRecommendation
 -> f AutoScalingGroupRecommendation)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> AutoScalingGroupRecommendation
-> f AutoScalingGroupRecommendation
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

-- | An array of objects that describe the current configuration of the Auto
-- Scaling group.
autoScalingGroupRecommendation_currentConfiguration :: Lens.Lens' AutoScalingGroupRecommendation (Prelude.Maybe AutoScalingGroupConfiguration)
autoScalingGroupRecommendation_currentConfiguration :: (Maybe AutoScalingGroupConfiguration
 -> f (Maybe AutoScalingGroupConfiguration))
-> AutoScalingGroupRecommendation
-> f AutoScalingGroupRecommendation
autoScalingGroupRecommendation_currentConfiguration = (AutoScalingGroupRecommendation
 -> Maybe AutoScalingGroupConfiguration)
-> (AutoScalingGroupRecommendation
    -> Maybe AutoScalingGroupConfiguration
    -> AutoScalingGroupRecommendation)
-> Lens
     AutoScalingGroupRecommendation
     AutoScalingGroupRecommendation
     (Maybe AutoScalingGroupConfiguration)
     (Maybe AutoScalingGroupConfiguration)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AutoScalingGroupRecommendation' {Maybe AutoScalingGroupConfiguration
currentConfiguration :: Maybe AutoScalingGroupConfiguration
$sel:currentConfiguration:AutoScalingGroupRecommendation' :: AutoScalingGroupRecommendation
-> Maybe AutoScalingGroupConfiguration
currentConfiguration} -> Maybe AutoScalingGroupConfiguration
currentConfiguration) (\s :: AutoScalingGroupRecommendation
s@AutoScalingGroupRecommendation' {} Maybe AutoScalingGroupConfiguration
a -> AutoScalingGroupRecommendation
s {$sel:currentConfiguration:AutoScalingGroupRecommendation' :: Maybe AutoScalingGroupConfiguration
currentConfiguration = Maybe AutoScalingGroupConfiguration
a} :: AutoScalingGroupRecommendation)

-- | The Amazon Web Services account ID of the Auto Scaling group.
autoScalingGroupRecommendation_accountId :: Lens.Lens' AutoScalingGroupRecommendation (Prelude.Maybe Prelude.Text)
autoScalingGroupRecommendation_accountId :: (Maybe Text -> f (Maybe Text))
-> AutoScalingGroupRecommendation
-> f AutoScalingGroupRecommendation
autoScalingGroupRecommendation_accountId = (AutoScalingGroupRecommendation -> Maybe Text)
-> (AutoScalingGroupRecommendation
    -> Maybe Text -> AutoScalingGroupRecommendation)
-> Lens
     AutoScalingGroupRecommendation
     AutoScalingGroupRecommendation
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AutoScalingGroupRecommendation' {Maybe Text
accountId :: Maybe Text
$sel:accountId:AutoScalingGroupRecommendation' :: AutoScalingGroupRecommendation -> Maybe Text
accountId} -> Maybe Text
accountId) (\s :: AutoScalingGroupRecommendation
s@AutoScalingGroupRecommendation' {} Maybe Text
a -> AutoScalingGroupRecommendation
s {$sel:accountId:AutoScalingGroupRecommendation' :: Maybe Text
accountId = Maybe Text
a} :: AutoScalingGroupRecommendation)

-- | The name of the Auto Scaling group.
autoScalingGroupRecommendation_autoScalingGroupName :: Lens.Lens' AutoScalingGroupRecommendation (Prelude.Maybe Prelude.Text)
autoScalingGroupRecommendation_autoScalingGroupName :: (Maybe Text -> f (Maybe Text))
-> AutoScalingGroupRecommendation
-> f AutoScalingGroupRecommendation
autoScalingGroupRecommendation_autoScalingGroupName = (AutoScalingGroupRecommendation -> Maybe Text)
-> (AutoScalingGroupRecommendation
    -> Maybe Text -> AutoScalingGroupRecommendation)
-> Lens
     AutoScalingGroupRecommendation
     AutoScalingGroupRecommendation
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AutoScalingGroupRecommendation' {Maybe Text
autoScalingGroupName :: Maybe Text
$sel:autoScalingGroupName:AutoScalingGroupRecommendation' :: AutoScalingGroupRecommendation -> Maybe Text
autoScalingGroupName} -> Maybe Text
autoScalingGroupName) (\s :: AutoScalingGroupRecommendation
s@AutoScalingGroupRecommendation' {} Maybe Text
a -> AutoScalingGroupRecommendation
s {$sel:autoScalingGroupName:AutoScalingGroupRecommendation' :: Maybe Text
autoScalingGroupName = Maybe Text
a} :: AutoScalingGroupRecommendation)

-- | An array of objects that describe the utilization metrics of the Auto
-- Scaling group.
autoScalingGroupRecommendation_utilizationMetrics :: Lens.Lens' AutoScalingGroupRecommendation (Prelude.Maybe [UtilizationMetric])
autoScalingGroupRecommendation_utilizationMetrics :: (Maybe [UtilizationMetric] -> f (Maybe [UtilizationMetric]))
-> AutoScalingGroupRecommendation
-> f AutoScalingGroupRecommendation
autoScalingGroupRecommendation_utilizationMetrics = (AutoScalingGroupRecommendation -> Maybe [UtilizationMetric])
-> (AutoScalingGroupRecommendation
    -> Maybe [UtilizationMetric] -> AutoScalingGroupRecommendation)
-> Lens
     AutoScalingGroupRecommendation
     AutoScalingGroupRecommendation
     (Maybe [UtilizationMetric])
     (Maybe [UtilizationMetric])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AutoScalingGroupRecommendation' {Maybe [UtilizationMetric]
utilizationMetrics :: Maybe [UtilizationMetric]
$sel:utilizationMetrics:AutoScalingGroupRecommendation' :: AutoScalingGroupRecommendation -> Maybe [UtilizationMetric]
utilizationMetrics} -> Maybe [UtilizationMetric]
utilizationMetrics) (\s :: AutoScalingGroupRecommendation
s@AutoScalingGroupRecommendation' {} Maybe [UtilizationMetric]
a -> AutoScalingGroupRecommendation
s {$sel:utilizationMetrics:AutoScalingGroupRecommendation' :: Maybe [UtilizationMetric]
utilizationMetrics = Maybe [UtilizationMetric]
a} :: AutoScalingGroupRecommendation) ((Maybe [UtilizationMetric] -> f (Maybe [UtilizationMetric]))
 -> AutoScalingGroupRecommendation
 -> f AutoScalingGroupRecommendation)
-> ((Maybe [UtilizationMetric] -> f (Maybe [UtilizationMetric]))
    -> Maybe [UtilizationMetric] -> f (Maybe [UtilizationMetric]))
-> (Maybe [UtilizationMetric] -> f (Maybe [UtilizationMetric]))
-> AutoScalingGroupRecommendation
-> f AutoScalingGroupRecommendation
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

-- | The Amazon Resource Name (ARN) of the Auto Scaling group.
autoScalingGroupRecommendation_autoScalingGroupArn :: Lens.Lens' AutoScalingGroupRecommendation (Prelude.Maybe Prelude.Text)
autoScalingGroupRecommendation_autoScalingGroupArn :: (Maybe Text -> f (Maybe Text))
-> AutoScalingGroupRecommendation
-> f AutoScalingGroupRecommendation
autoScalingGroupRecommendation_autoScalingGroupArn = (AutoScalingGroupRecommendation -> Maybe Text)
-> (AutoScalingGroupRecommendation
    -> Maybe Text -> AutoScalingGroupRecommendation)
-> Lens
     AutoScalingGroupRecommendation
     AutoScalingGroupRecommendation
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AutoScalingGroupRecommendation' {Maybe Text
autoScalingGroupArn :: Maybe Text
$sel:autoScalingGroupArn:AutoScalingGroupRecommendation' :: AutoScalingGroupRecommendation -> Maybe Text
autoScalingGroupArn} -> Maybe Text
autoScalingGroupArn) (\s :: AutoScalingGroupRecommendation
s@AutoScalingGroupRecommendation' {} Maybe Text
a -> AutoScalingGroupRecommendation
s {$sel:autoScalingGroupArn:AutoScalingGroupRecommendation' :: Maybe Text
autoScalingGroupArn = Maybe Text
a} :: AutoScalingGroupRecommendation)

-- | An array of objects that describe the recommendation options for the
-- Auto Scaling group.
autoScalingGroupRecommendation_recommendationOptions :: Lens.Lens' AutoScalingGroupRecommendation (Prelude.Maybe [AutoScalingGroupRecommendationOption])
autoScalingGroupRecommendation_recommendationOptions :: (Maybe [AutoScalingGroupRecommendationOption]
 -> f (Maybe [AutoScalingGroupRecommendationOption]))
-> AutoScalingGroupRecommendation
-> f AutoScalingGroupRecommendation
autoScalingGroupRecommendation_recommendationOptions = (AutoScalingGroupRecommendation
 -> Maybe [AutoScalingGroupRecommendationOption])
-> (AutoScalingGroupRecommendation
    -> Maybe [AutoScalingGroupRecommendationOption]
    -> AutoScalingGroupRecommendation)
-> Lens
     AutoScalingGroupRecommendation
     AutoScalingGroupRecommendation
     (Maybe [AutoScalingGroupRecommendationOption])
     (Maybe [AutoScalingGroupRecommendationOption])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AutoScalingGroupRecommendation' {Maybe [AutoScalingGroupRecommendationOption]
recommendationOptions :: Maybe [AutoScalingGroupRecommendationOption]
$sel:recommendationOptions:AutoScalingGroupRecommendation' :: AutoScalingGroupRecommendation
-> Maybe [AutoScalingGroupRecommendationOption]
recommendationOptions} -> Maybe [AutoScalingGroupRecommendationOption]
recommendationOptions) (\s :: AutoScalingGroupRecommendation
s@AutoScalingGroupRecommendation' {} Maybe [AutoScalingGroupRecommendationOption]
a -> AutoScalingGroupRecommendation
s {$sel:recommendationOptions:AutoScalingGroupRecommendation' :: Maybe [AutoScalingGroupRecommendationOption]
recommendationOptions = Maybe [AutoScalingGroupRecommendationOption]
a} :: AutoScalingGroupRecommendation) ((Maybe [AutoScalingGroupRecommendationOption]
  -> f (Maybe [AutoScalingGroupRecommendationOption]))
 -> AutoScalingGroupRecommendation
 -> f AutoScalingGroupRecommendation)
-> ((Maybe [AutoScalingGroupRecommendationOption]
     -> f (Maybe [AutoScalingGroupRecommendationOption]))
    -> Maybe [AutoScalingGroupRecommendationOption]
    -> f (Maybe [AutoScalingGroupRecommendationOption]))
-> (Maybe [AutoScalingGroupRecommendationOption]
    -> f (Maybe [AutoScalingGroupRecommendationOption]))
-> AutoScalingGroupRecommendation
-> f AutoScalingGroupRecommendation
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [AutoScalingGroupRecommendationOption]
  [AutoScalingGroupRecommendationOption]
  [AutoScalingGroupRecommendationOption]
  [AutoScalingGroupRecommendationOption]
-> Iso
     (Maybe [AutoScalingGroupRecommendationOption])
     (Maybe [AutoScalingGroupRecommendationOption])
     (Maybe [AutoScalingGroupRecommendationOption])
     (Maybe [AutoScalingGroupRecommendationOption])
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
  [AutoScalingGroupRecommendationOption]
  [AutoScalingGroupRecommendationOption]
  [AutoScalingGroupRecommendationOption]
  [AutoScalingGroupRecommendationOption]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The number of days for which utilization metrics were analyzed for the
-- Auto Scaling group.
autoScalingGroupRecommendation_lookBackPeriodInDays :: Lens.Lens' AutoScalingGroupRecommendation (Prelude.Maybe Prelude.Double)
autoScalingGroupRecommendation_lookBackPeriodInDays :: (Maybe Double -> f (Maybe Double))
-> AutoScalingGroupRecommendation
-> f AutoScalingGroupRecommendation
autoScalingGroupRecommendation_lookBackPeriodInDays = (AutoScalingGroupRecommendation -> Maybe Double)
-> (AutoScalingGroupRecommendation
    -> Maybe Double -> AutoScalingGroupRecommendation)
-> Lens
     AutoScalingGroupRecommendation
     AutoScalingGroupRecommendation
     (Maybe Double)
     (Maybe Double)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AutoScalingGroupRecommendation' {Maybe Double
lookBackPeriodInDays :: Maybe Double
$sel:lookBackPeriodInDays:AutoScalingGroupRecommendation' :: AutoScalingGroupRecommendation -> Maybe Double
lookBackPeriodInDays} -> Maybe Double
lookBackPeriodInDays) (\s :: AutoScalingGroupRecommendation
s@AutoScalingGroupRecommendation' {} Maybe Double
a -> AutoScalingGroupRecommendation
s {$sel:lookBackPeriodInDays:AutoScalingGroupRecommendation' :: Maybe Double
lookBackPeriodInDays = Maybe Double
a} :: AutoScalingGroupRecommendation)

instance Core.FromJSON AutoScalingGroupRecommendation where
  parseJSON :: Value -> Parser AutoScalingGroupRecommendation
parseJSON =
    String
-> (Object -> Parser AutoScalingGroupRecommendation)
-> Value
-> Parser AutoScalingGroupRecommendation
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"AutoScalingGroupRecommendation"
      ( \Object
x ->
          Maybe Finding
-> Maybe POSIX
-> Maybe AutoScalingGroupConfiguration
-> Maybe Text
-> Maybe Text
-> Maybe [UtilizationMetric]
-> Maybe Text
-> Maybe [AutoScalingGroupRecommendationOption]
-> Maybe Double
-> AutoScalingGroupRecommendation
AutoScalingGroupRecommendation'
            (Maybe Finding
 -> Maybe POSIX
 -> Maybe AutoScalingGroupConfiguration
 -> Maybe Text
 -> Maybe Text
 -> Maybe [UtilizationMetric]
 -> Maybe Text
 -> Maybe [AutoScalingGroupRecommendationOption]
 -> Maybe Double
 -> AutoScalingGroupRecommendation)
-> Parser (Maybe Finding)
-> Parser
     (Maybe POSIX
      -> Maybe AutoScalingGroupConfiguration
      -> Maybe Text
      -> Maybe Text
      -> Maybe [UtilizationMetric]
      -> Maybe Text
      -> Maybe [AutoScalingGroupRecommendationOption]
      -> Maybe Double
      -> AutoScalingGroupRecommendation)
forall (f :: * -> *) a b. Functor 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 POSIX
   -> Maybe AutoScalingGroupConfiguration
   -> Maybe Text
   -> Maybe Text
   -> Maybe [UtilizationMetric]
   -> Maybe Text
   -> Maybe [AutoScalingGroupRecommendationOption]
   -> Maybe Double
   -> AutoScalingGroupRecommendation)
-> Parser (Maybe POSIX)
-> Parser
     (Maybe AutoScalingGroupConfiguration
      -> Maybe Text
      -> Maybe Text
      -> Maybe [UtilizationMetric]
      -> Maybe Text
      -> Maybe [AutoScalingGroupRecommendationOption]
      -> Maybe Double
      -> AutoScalingGroupRecommendation)
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 AutoScalingGroupConfiguration
   -> Maybe Text
   -> Maybe Text
   -> Maybe [UtilizationMetric]
   -> Maybe Text
   -> Maybe [AutoScalingGroupRecommendationOption]
   -> Maybe Double
   -> AutoScalingGroupRecommendation)
-> Parser (Maybe AutoScalingGroupConfiguration)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe [UtilizationMetric]
      -> Maybe Text
      -> Maybe [AutoScalingGroupRecommendationOption]
      -> Maybe Double
      -> AutoScalingGroupRecommendation)
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
"currentConfiguration")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe [UtilizationMetric]
   -> Maybe Text
   -> Maybe [AutoScalingGroupRecommendationOption]
   -> Maybe Double
   -> AutoScalingGroupRecommendation)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe [UtilizationMetric]
      -> Maybe Text
      -> Maybe [AutoScalingGroupRecommendationOption]
      -> Maybe Double
      -> AutoScalingGroupRecommendation)
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 Text
   -> Maybe [UtilizationMetric]
   -> Maybe Text
   -> Maybe [AutoScalingGroupRecommendationOption]
   -> Maybe Double
   -> AutoScalingGroupRecommendation)
-> Parser (Maybe Text)
-> Parser
     (Maybe [UtilizationMetric]
      -> Maybe Text
      -> Maybe [AutoScalingGroupRecommendationOption]
      -> Maybe Double
      -> AutoScalingGroupRecommendation)
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
"autoScalingGroupName")
            Parser
  (Maybe [UtilizationMetric]
   -> Maybe Text
   -> Maybe [AutoScalingGroupRecommendationOption]
   -> Maybe Double
   -> AutoScalingGroupRecommendation)
-> Parser (Maybe [UtilizationMetric])
-> Parser
     (Maybe Text
      -> Maybe [AutoScalingGroupRecommendationOption]
      -> Maybe Double
      -> AutoScalingGroupRecommendation)
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 [AutoScalingGroupRecommendationOption]
   -> Maybe Double
   -> AutoScalingGroupRecommendation)
-> Parser (Maybe Text)
-> Parser
     (Maybe [AutoScalingGroupRecommendationOption]
      -> Maybe Double -> AutoScalingGroupRecommendation)
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
"autoScalingGroupArn")
            Parser
  (Maybe [AutoScalingGroupRecommendationOption]
   -> Maybe Double -> AutoScalingGroupRecommendation)
-> Parser (Maybe [AutoScalingGroupRecommendationOption])
-> Parser (Maybe Double -> AutoScalingGroupRecommendation)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object
-> Text
-> Parser (Maybe (Maybe [AutoScalingGroupRecommendationOption]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"recommendationOptions"
                            Parser (Maybe (Maybe [AutoScalingGroupRecommendationOption]))
-> Maybe [AutoScalingGroupRecommendationOption]
-> Parser (Maybe [AutoScalingGroupRecommendationOption])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [AutoScalingGroupRecommendationOption]
forall a. Monoid a => a
Prelude.mempty
                        )
            Parser (Maybe Double -> AutoScalingGroupRecommendation)
-> Parser (Maybe Double) -> Parser AutoScalingGroupRecommendation
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
    AutoScalingGroupRecommendation

instance
  Prelude.NFData
    AutoScalingGroupRecommendation