{-# 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.InstanceRecommendation
-- 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.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

-- | Describes an Amazon EC2 instance recommendation.
--
-- /See:/ 'newInstanceRecommendation' smart constructor.
data InstanceRecommendation = InstanceRecommendation'
  { -- | The Amazon Resource Name (ARN) of the current instance.
    InstanceRecommendation -> Maybe Text
instanceArn :: Prelude.Maybe Prelude.Text,
    -- | The finding classification of the instance.
    --
    -- Findings for instances include:
    --
    -- -   __@Underprovisioned@__ —An instance is considered under-provisioned
    --     when at least one specification of your instance, such as CPU,
    --     memory, or network, does not meet the performance requirements of
    --     your workload. Under-provisioned instances may lead to poor
    --     application performance.
    --
    -- -   __@Overprovisioned@__ —An instance is considered over-provisioned
    --     when at least one specification of your instance, such as CPU,
    --     memory, or network, can be sized down while still meeting the
    --     performance requirements of your workload, and no specification is
    --     under-provisioned. Over-provisioned instances may lead to
    --     unnecessary infrastructure cost.
    --
    -- -   __@Optimized@__ —An instance is considered optimized when all
    --     specifications of your instance, such as CPU, memory, and network,
    --     meet the performance requirements of your workload and is not over
    --     provisioned. For optimized resources, Compute Optimizer might
    --     recommend a new generation instance type.
    InstanceRecommendation -> Maybe Finding
finding :: Prelude.Maybe Finding,
    -- | The instance type of the current instance.
    InstanceRecommendation -> Maybe Text
currentInstanceType :: Prelude.Maybe Prelude.Text,
    -- | The timestamp of when the instance recommendation was last refreshed.
    InstanceRecommendation -> Maybe POSIX
lastRefreshTimestamp :: Prelude.Maybe Core.POSIX,
    -- | The Amazon Web Services account ID of the instance.
    InstanceRecommendation -> Maybe Text
accountId :: Prelude.Maybe Prelude.Text,
    -- | The reason for the finding classification of the instance.
    --
    -- Finding reason codes for instances include:
    --
    -- -   __@CPUOverprovisioned@__ — The instance’s CPU configuration can be
    --     sized down while still meeting the performance requirements of your
    --     workload. This is identified by analyzing the @CPUUtilization@
    --     metric of the current instance during the look-back period.
    --
    -- -   __@CPUUnderprovisioned@__ — The instance’s CPU configuration
    --     doesn\'t meet the performance requirements of your workload and
    --     there is an alternative instance type that provides better CPU
    --     performance. This is identified by analyzing the @CPUUtilization@
    --     metric of the current instance during the look-back period.
    --
    -- -   __@MemoryOverprovisioned@__ — The instance’s memory configuration
    --     can be sized down while still meeting the performance requirements
    --     of your workload. This is identified by analyzing the memory
    --     utilization metric of the current instance during the look-back
    --     period.
    --
    -- -   __@MemoryUnderprovisioned@__ — The instance’s memory configuration
    --     doesn\'t meet the performance requirements of your workload and
    --     there is an alternative instance type that provides better memory
    --     performance. This is identified by analyzing the memory utilization
    --     metric of the current instance during the look-back period.
    --
    --     Memory utilization is analyzed only for resources that have the
    --     unified CloudWatch agent installed on them. For more information,
    --     see
    --     <https://docs.aws.amazon.com/compute-optimizer/latest/ug/metrics.html#cw-agent Enabling memory utilization with the Amazon CloudWatch Agent>
    --     in the /Compute Optimizer User Guide/. On Linux instances, Compute
    --     Optimizer analyses the @mem_used_percent@ metric in the @CWAgent@
    --     namespace, or the legacy @MemoryUtilization@ metric in the
    --     @System\/Linux@ namespace. On Windows instances, Compute Optimizer
    --     analyses the @Memory % Committed Bytes In Use@ metric in the
    --     @CWAgent@ namespace.
    --
    -- -   __@EBSThroughputOverprovisioned@__ — The instance’s EBS throughput
    --     configuration can be sized down while still meeting the performance
    --     requirements of your workload. This is identified by analyzing the
    --     @VolumeReadOps@ and @VolumeWriteOps@ metrics of EBS volumes attached
    --     to the current instance during the look-back period.
    --
    -- -   __@EBSThroughputUnderprovisioned@__ — The instance’s EBS throughput
    --     configuration doesn\'t meet the performance requirements of your
    --     workload and there is an alternative instance type that provides
    --     better EBS throughput performance. This is identified by analyzing
    --     the @VolumeReadOps@ and @VolumeWriteOps@ metrics of EBS volumes
    --     attached to the current instance during the look-back period.
    --
    -- -   __@EBSIOPSOverprovisioned@__ — The instance’s EBS IOPS configuration
    --     can be sized down while still meeting the performance requirements
    --     of your workload. This is identified by analyzing the
    --     @VolumeReadBytes@ and @VolumeWriteBytes@ metric of EBS volumes
    --     attached to the current instance during the look-back period.
    --
    -- -   __@EBSIOPSUnderprovisioned@__ — The instance’s EBS IOPS
    --     configuration doesn\'t meet the performance requirements of your
    --     workload and there is an alternative instance type that provides
    --     better EBS IOPS performance. This is identified by analyzing the
    --     @VolumeReadBytes@ and @VolumeWriteBytes@ metric of EBS volumes
    --     attached to the current instance during the look-back period.
    --
    -- -   __@NetworkBandwidthOverprovisioned@__ — The instance’s network
    --     bandwidth configuration can be sized down while still meeting the
    --     performance requirements of your workload. This is identified by
    --     analyzing the @NetworkIn@ and @NetworkOut@ metrics of the current
    --     instance during the look-back period.
    --
    -- -   __@NetworkBandwidthUnderprovisioned@__ — The instance’s network
    --     bandwidth configuration doesn\'t meet the performance requirements
    --     of your workload and there is an alternative instance type that
    --     provides better network bandwidth performance. This is identified by
    --     analyzing the @NetworkIn@ and @NetworkOut@ metrics of the current
    --     instance during the look-back period. This finding reason happens
    --     when the @NetworkIn@ or @NetworkOut@ performance of an instance is
    --     impacted.
    --
    -- -   __@NetworkPPSOverprovisioned@__ — The instance’s network PPS
    --     (packets per second) configuration can be sized down while still
    --     meeting the performance requirements of your workload. This is
    --     identified by analyzing the @NetworkPacketsIn@ and
    --     @NetworkPacketsIn@ metrics of the current instance during the
    --     look-back period.
    --
    -- -   __@NetworkPPSUnderprovisioned@__ — The instance’s network PPS
    --     (packets per second) configuration doesn\'t meet the performance
    --     requirements of your workload and there is an alternative instance
    --     type that provides better network PPS performance. This is
    --     identified by analyzing the @NetworkPacketsIn@ and
    --     @NetworkPacketsIn@ metrics of the current instance during the
    --     look-back period.
    --
    -- -   __@DiskIOPSOverprovisioned@__ — The instance’s disk IOPS
    --     configuration can be sized down while still meeting the performance
    --     requirements of your workload. This is identified by analyzing the
    --     @DiskReadOps@ and @DiskWriteOps@ metrics of the current instance
    --     during the look-back period.
    --
    -- -   __@DiskIOPSUnderprovisioned@__ — The instance’s disk IOPS
    --     configuration doesn\'t meet the performance requirements of your
    --     workload and there is an alternative instance type that provides
    --     better disk IOPS performance. This is identified by analyzing the
    --     @DiskReadOps@ and @DiskWriteOps@ metrics of the current instance
    --     during the look-back period.
    --
    -- -   __@DiskThroughputOverprovisioned@__ — The instance’s disk throughput
    --     configuration can be sized down while still meeting the performance
    --     requirements of your workload. This is identified by analyzing the
    --     @DiskReadBytes@ and @DiskWriteBytes@ metrics of the current instance
    --     during the look-back period.
    --
    -- -   __@DiskThroughputUnderprovisioned@__ — The instance’s disk
    --     throughput configuration doesn\'t meet the performance requirements
    --     of your workload and there is an alternative instance type that
    --     provides better disk throughput performance. This is identified by
    --     analyzing the @DiskReadBytes@ and @DiskWriteBytes@ metrics of the
    --     current instance during the look-back period.
    --
    -- For more information about instance metrics, see
    -- <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/viewing_metrics_with_cloudwatch.html List the available CloudWatch metrics for your instances>
    -- in the /Amazon Elastic Compute Cloud User Guide/. For more information
    -- about EBS volume metrics, see
    -- <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using_cloudwatch_ebs.html Amazon CloudWatch metrics for Amazon EBS>
    -- in the /Amazon Elastic Compute Cloud User Guide/.
    InstanceRecommendation
-> Maybe [InstanceRecommendationFindingReasonCode]
findingReasonCodes :: Prelude.Maybe [InstanceRecommendationFindingReasonCode],
    -- | An array of objects that describe the source resource of the
    -- recommendation.
    InstanceRecommendation -> Maybe [RecommendationSource]
recommendationSources :: Prelude.Maybe [RecommendationSource],
    -- | An array of objects that describe the utilization metrics of the
    -- instance.
    InstanceRecommendation -> Maybe [UtilizationMetric]
utilizationMetrics :: Prelude.Maybe [UtilizationMetric],
    -- | The name of the current instance.
    InstanceRecommendation -> Maybe Text
instanceName :: Prelude.Maybe Prelude.Text,
    -- | An array of objects that describe the recommendation options for the
    -- instance.
    InstanceRecommendation -> Maybe [InstanceRecommendationOption]
recommendationOptions :: Prelude.Maybe [InstanceRecommendationOption],
    -- | The number of days for which utilization metrics were analyzed for the
    -- instance.
    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)

-- |
-- Create a value of 'InstanceRecommendation' 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:
--
-- 'instanceArn', 'instanceRecommendation_instanceArn' - The Amazon Resource Name (ARN) of the current instance.
--
-- 'finding', 'instanceRecommendation_finding' - The finding classification of the instance.
--
-- Findings for instances include:
--
-- -   __@Underprovisioned@__ —An instance is considered under-provisioned
--     when at least one specification of your instance, such as CPU,
--     memory, or network, does not meet the performance requirements of
--     your workload. Under-provisioned instances may lead to poor
--     application performance.
--
-- -   __@Overprovisioned@__ —An instance is considered over-provisioned
--     when at least one specification of your instance, such as CPU,
--     memory, or network, can be sized down while still meeting the
--     performance requirements of your workload, and no specification is
--     under-provisioned. Over-provisioned instances may lead to
--     unnecessary infrastructure cost.
--
-- -   __@Optimized@__ —An instance is considered optimized when all
--     specifications of your instance, such as CPU, memory, and network,
--     meet the performance requirements of your workload and is not over
--     provisioned. For optimized resources, Compute Optimizer might
--     recommend a new generation instance type.
--
-- 'currentInstanceType', 'instanceRecommendation_currentInstanceType' - The instance type of the current instance.
--
-- 'lastRefreshTimestamp', 'instanceRecommendation_lastRefreshTimestamp' - The timestamp of when the instance recommendation was last refreshed.
--
-- 'accountId', 'instanceRecommendation_accountId' - The Amazon Web Services account ID of the instance.
--
-- 'findingReasonCodes', 'instanceRecommendation_findingReasonCodes' - The reason for the finding classification of the instance.
--
-- Finding reason codes for instances include:
--
-- -   __@CPUOverprovisioned@__ — The instance’s CPU configuration can be
--     sized down while still meeting the performance requirements of your
--     workload. This is identified by analyzing the @CPUUtilization@
--     metric of the current instance during the look-back period.
--
-- -   __@CPUUnderprovisioned@__ — The instance’s CPU configuration
--     doesn\'t meet the performance requirements of your workload and
--     there is an alternative instance type that provides better CPU
--     performance. This is identified by analyzing the @CPUUtilization@
--     metric of the current instance during the look-back period.
--
-- -   __@MemoryOverprovisioned@__ — The instance’s memory configuration
--     can be sized down while still meeting the performance requirements
--     of your workload. This is identified by analyzing the memory
--     utilization metric of the current instance during the look-back
--     period.
--
-- -   __@MemoryUnderprovisioned@__ — The instance’s memory configuration
--     doesn\'t meet the performance requirements of your workload and
--     there is an alternative instance type that provides better memory
--     performance. This is identified by analyzing the memory utilization
--     metric of the current instance during the look-back period.
--
--     Memory utilization is analyzed only for resources that have the
--     unified CloudWatch agent installed on them. For more information,
--     see
--     <https://docs.aws.amazon.com/compute-optimizer/latest/ug/metrics.html#cw-agent Enabling memory utilization with the Amazon CloudWatch Agent>
--     in the /Compute Optimizer User Guide/. On Linux instances, Compute
--     Optimizer analyses the @mem_used_percent@ metric in the @CWAgent@
--     namespace, or the legacy @MemoryUtilization@ metric in the
--     @System\/Linux@ namespace. On Windows instances, Compute Optimizer
--     analyses the @Memory % Committed Bytes In Use@ metric in the
--     @CWAgent@ namespace.
--
-- -   __@EBSThroughputOverprovisioned@__ — The instance’s EBS throughput
--     configuration can be sized down while still meeting the performance
--     requirements of your workload. This is identified by analyzing the
--     @VolumeReadOps@ and @VolumeWriteOps@ metrics of EBS volumes attached
--     to the current instance during the look-back period.
--
-- -   __@EBSThroughputUnderprovisioned@__ — The instance’s EBS throughput
--     configuration doesn\'t meet the performance requirements of your
--     workload and there is an alternative instance type that provides
--     better EBS throughput performance. This is identified by analyzing
--     the @VolumeReadOps@ and @VolumeWriteOps@ metrics of EBS volumes
--     attached to the current instance during the look-back period.
--
-- -   __@EBSIOPSOverprovisioned@__ — The instance’s EBS IOPS configuration
--     can be sized down while still meeting the performance requirements
--     of your workload. This is identified by analyzing the
--     @VolumeReadBytes@ and @VolumeWriteBytes@ metric of EBS volumes
--     attached to the current instance during the look-back period.
--
-- -   __@EBSIOPSUnderprovisioned@__ — The instance’s EBS IOPS
--     configuration doesn\'t meet the performance requirements of your
--     workload and there is an alternative instance type that provides
--     better EBS IOPS performance. This is identified by analyzing the
--     @VolumeReadBytes@ and @VolumeWriteBytes@ metric of EBS volumes
--     attached to the current instance during the look-back period.
--
-- -   __@NetworkBandwidthOverprovisioned@__ — The instance’s network
--     bandwidth configuration can be sized down while still meeting the
--     performance requirements of your workload. This is identified by
--     analyzing the @NetworkIn@ and @NetworkOut@ metrics of the current
--     instance during the look-back period.
--
-- -   __@NetworkBandwidthUnderprovisioned@__ — The instance’s network
--     bandwidth configuration doesn\'t meet the performance requirements
--     of your workload and there is an alternative instance type that
--     provides better network bandwidth performance. This is identified by
--     analyzing the @NetworkIn@ and @NetworkOut@ metrics of the current
--     instance during the look-back period. This finding reason happens
--     when the @NetworkIn@ or @NetworkOut@ performance of an instance is
--     impacted.
--
-- -   __@NetworkPPSOverprovisioned@__ — The instance’s network PPS
--     (packets per second) configuration can be sized down while still
--     meeting the performance requirements of your workload. This is
--     identified by analyzing the @NetworkPacketsIn@ and
--     @NetworkPacketsIn@ metrics of the current instance during the
--     look-back period.
--
-- -   __@NetworkPPSUnderprovisioned@__ — The instance’s network PPS
--     (packets per second) configuration doesn\'t meet the performance
--     requirements of your workload and there is an alternative instance
--     type that provides better network PPS performance. This is
--     identified by analyzing the @NetworkPacketsIn@ and
--     @NetworkPacketsIn@ metrics of the current instance during the
--     look-back period.
--
-- -   __@DiskIOPSOverprovisioned@__ — The instance’s disk IOPS
--     configuration can be sized down while still meeting the performance
--     requirements of your workload. This is identified by analyzing the
--     @DiskReadOps@ and @DiskWriteOps@ metrics of the current instance
--     during the look-back period.
--
-- -   __@DiskIOPSUnderprovisioned@__ — The instance’s disk IOPS
--     configuration doesn\'t meet the performance requirements of your
--     workload and there is an alternative instance type that provides
--     better disk IOPS performance. This is identified by analyzing the
--     @DiskReadOps@ and @DiskWriteOps@ metrics of the current instance
--     during the look-back period.
--
-- -   __@DiskThroughputOverprovisioned@__ — The instance’s disk throughput
--     configuration can be sized down while still meeting the performance
--     requirements of your workload. This is identified by analyzing the
--     @DiskReadBytes@ and @DiskWriteBytes@ metrics of the current instance
--     during the look-back period.
--
-- -   __@DiskThroughputUnderprovisioned@__ — The instance’s disk
--     throughput configuration doesn\'t meet the performance requirements
--     of your workload and there is an alternative instance type that
--     provides better disk throughput performance. This is identified by
--     analyzing the @DiskReadBytes@ and @DiskWriteBytes@ metrics of the
--     current instance during the look-back period.
--
-- For more information about instance metrics, see
-- <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/viewing_metrics_with_cloudwatch.html List the available CloudWatch metrics for your instances>
-- in the /Amazon Elastic Compute Cloud User Guide/. For more information
-- about EBS volume metrics, see
-- <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using_cloudwatch_ebs.html Amazon CloudWatch metrics for Amazon EBS>
-- in the /Amazon Elastic Compute Cloud User Guide/.
--
-- 'recommendationSources', 'instanceRecommendation_recommendationSources' - An array of objects that describe the source resource of the
-- recommendation.
--
-- 'utilizationMetrics', 'instanceRecommendation_utilizationMetrics' - An array of objects that describe the utilization metrics of the
-- instance.
--
-- 'instanceName', 'instanceRecommendation_instanceName' - The name of the current instance.
--
-- 'recommendationOptions', 'instanceRecommendation_recommendationOptions' - An array of objects that describe the recommendation options for the
-- instance.
--
-- 'lookBackPeriodInDays', 'instanceRecommendation_lookBackPeriodInDays' - The number of days for which utilization metrics were analyzed for the
-- instance.
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
    }

-- | The Amazon Resource Name (ARN) of the current instance.
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)

-- | The finding classification of the instance.
--
-- Findings for instances include:
--
-- -   __@Underprovisioned@__ —An instance is considered under-provisioned
--     when at least one specification of your instance, such as CPU,
--     memory, or network, does not meet the performance requirements of
--     your workload. Under-provisioned instances may lead to poor
--     application performance.
--
-- -   __@Overprovisioned@__ —An instance is considered over-provisioned
--     when at least one specification of your instance, such as CPU,
--     memory, or network, can be sized down while still meeting the
--     performance requirements of your workload, and no specification is
--     under-provisioned. Over-provisioned instances may lead to
--     unnecessary infrastructure cost.
--
-- -   __@Optimized@__ —An instance is considered optimized when all
--     specifications of your instance, such as CPU, memory, and network,
--     meet the performance requirements of your workload and is not over
--     provisioned. For optimized resources, Compute Optimizer might
--     recommend a new generation instance type.
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)

-- | The instance type of the current instance.
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)

-- | The timestamp of when the instance recommendation was last refreshed.
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

-- | The Amazon Web Services account ID of the instance.
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)

-- | The reason for the finding classification of the instance.
--
-- Finding reason codes for instances include:
--
-- -   __@CPUOverprovisioned@__ — The instance’s CPU configuration can be
--     sized down while still meeting the performance requirements of your
--     workload. This is identified by analyzing the @CPUUtilization@
--     metric of the current instance during the look-back period.
--
-- -   __@CPUUnderprovisioned@__ — The instance’s CPU configuration
--     doesn\'t meet the performance requirements of your workload and
--     there is an alternative instance type that provides better CPU
--     performance. This is identified by analyzing the @CPUUtilization@
--     metric of the current instance during the look-back period.
--
-- -   __@MemoryOverprovisioned@__ — The instance’s memory configuration
--     can be sized down while still meeting the performance requirements
--     of your workload. This is identified by analyzing the memory
--     utilization metric of the current instance during the look-back
--     period.
--
-- -   __@MemoryUnderprovisioned@__ — The instance’s memory configuration
--     doesn\'t meet the performance requirements of your workload and
--     there is an alternative instance type that provides better memory
--     performance. This is identified by analyzing the memory utilization
--     metric of the current instance during the look-back period.
--
--     Memory utilization is analyzed only for resources that have the
--     unified CloudWatch agent installed on them. For more information,
--     see
--     <https://docs.aws.amazon.com/compute-optimizer/latest/ug/metrics.html#cw-agent Enabling memory utilization with the Amazon CloudWatch Agent>
--     in the /Compute Optimizer User Guide/. On Linux instances, Compute
--     Optimizer analyses the @mem_used_percent@ metric in the @CWAgent@
--     namespace, or the legacy @MemoryUtilization@ metric in the
--     @System\/Linux@ namespace. On Windows instances, Compute Optimizer
--     analyses the @Memory % Committed Bytes In Use@ metric in the
--     @CWAgent@ namespace.
--
-- -   __@EBSThroughputOverprovisioned@__ — The instance’s EBS throughput
--     configuration can be sized down while still meeting the performance
--     requirements of your workload. This is identified by analyzing the
--     @VolumeReadOps@ and @VolumeWriteOps@ metrics of EBS volumes attached
--     to the current instance during the look-back period.
--
-- -   __@EBSThroughputUnderprovisioned@__ — The instance’s EBS throughput
--     configuration doesn\'t meet the performance requirements of your
--     workload and there is an alternative instance type that provides
--     better EBS throughput performance. This is identified by analyzing
--     the @VolumeReadOps@ and @VolumeWriteOps@ metrics of EBS volumes
--     attached to the current instance during the look-back period.
--
-- -   __@EBSIOPSOverprovisioned@__ — The instance’s EBS IOPS configuration
--     can be sized down while still meeting the performance requirements
--     of your workload. This is identified by analyzing the
--     @VolumeReadBytes@ and @VolumeWriteBytes@ metric of EBS volumes
--     attached to the current instance during the look-back period.
--
-- -   __@EBSIOPSUnderprovisioned@__ — The instance’s EBS IOPS
--     configuration doesn\'t meet the performance requirements of your
--     workload and there is an alternative instance type that provides
--     better EBS IOPS performance. This is identified by analyzing the
--     @VolumeReadBytes@ and @VolumeWriteBytes@ metric of EBS volumes
--     attached to the current instance during the look-back period.
--
-- -   __@NetworkBandwidthOverprovisioned@__ — The instance’s network
--     bandwidth configuration can be sized down while still meeting the
--     performance requirements of your workload. This is identified by
--     analyzing the @NetworkIn@ and @NetworkOut@ metrics of the current
--     instance during the look-back period.
--
-- -   __@NetworkBandwidthUnderprovisioned@__ — The instance’s network
--     bandwidth configuration doesn\'t meet the performance requirements
--     of your workload and there is an alternative instance type that
--     provides better network bandwidth performance. This is identified by
--     analyzing the @NetworkIn@ and @NetworkOut@ metrics of the current
--     instance during the look-back period. This finding reason happens
--     when the @NetworkIn@ or @NetworkOut@ performance of an instance is
--     impacted.
--
-- -   __@NetworkPPSOverprovisioned@__ — The instance’s network PPS
--     (packets per second) configuration can be sized down while still
--     meeting the performance requirements of your workload. This is
--     identified by analyzing the @NetworkPacketsIn@ and
--     @NetworkPacketsIn@ metrics of the current instance during the
--     look-back period.
--
-- -   __@NetworkPPSUnderprovisioned@__ — The instance’s network PPS
--     (packets per second) configuration doesn\'t meet the performance
--     requirements of your workload and there is an alternative instance
--     type that provides better network PPS performance. This is
--     identified by analyzing the @NetworkPacketsIn@ and
--     @NetworkPacketsIn@ metrics of the current instance during the
--     look-back period.
--
-- -   __@DiskIOPSOverprovisioned@__ — The instance’s disk IOPS
--     configuration can be sized down while still meeting the performance
--     requirements of your workload. This is identified by analyzing the
--     @DiskReadOps@ and @DiskWriteOps@ metrics of the current instance
--     during the look-back period.
--
-- -   __@DiskIOPSUnderprovisioned@__ — The instance’s disk IOPS
--     configuration doesn\'t meet the performance requirements of your
--     workload and there is an alternative instance type that provides
--     better disk IOPS performance. This is identified by analyzing the
--     @DiskReadOps@ and @DiskWriteOps@ metrics of the current instance
--     during the look-back period.
--
-- -   __@DiskThroughputOverprovisioned@__ — The instance’s disk throughput
--     configuration can be sized down while still meeting the performance
--     requirements of your workload. This is identified by analyzing the
--     @DiskReadBytes@ and @DiskWriteBytes@ metrics of the current instance
--     during the look-back period.
--
-- -   __@DiskThroughputUnderprovisioned@__ — The instance’s disk
--     throughput configuration doesn\'t meet the performance requirements
--     of your workload and there is an alternative instance type that
--     provides better disk throughput performance. This is identified by
--     analyzing the @DiskReadBytes@ and @DiskWriteBytes@ metrics of the
--     current instance during the look-back period.
--
-- For more information about instance metrics, see
-- <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/viewing_metrics_with_cloudwatch.html List the available CloudWatch metrics for your instances>
-- in the /Amazon Elastic Compute Cloud User Guide/. For more information
-- about EBS volume metrics, see
-- <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using_cloudwatch_ebs.html Amazon CloudWatch metrics for Amazon EBS>
-- in the /Amazon Elastic Compute Cloud User Guide/.
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

-- | An array of objects that describe the source resource of the
-- recommendation.
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

-- | An array of objects that describe the utilization metrics of the
-- instance.
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

-- | The name of the current instance.
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)

-- | An array of objects that describe the recommendation options for the
-- instance.
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

-- | The number of days for which utilization metrics were analyzed for the
-- instance.
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