{-# 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.LambdaFunctionRecommendation
-- 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.LambdaFunctionRecommendation where

import Amazonka.ComputeOptimizer.Types.LambdaFunctionMemoryRecommendationOption
import Amazonka.ComputeOptimizer.Types.LambdaFunctionRecommendationFinding
import Amazonka.ComputeOptimizer.Types.LambdaFunctionRecommendationFindingReasonCode
import Amazonka.ComputeOptimizer.Types.LambdaFunctionUtilizationMetric
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Describes an Lambda function recommendation.
--
-- /See:/ 'newLambdaFunctionRecommendation' smart constructor.
data LambdaFunctionRecommendation = LambdaFunctionRecommendation'
  { -- | The Amazon Resource Name (ARN) of the current function.
    LambdaFunctionRecommendation -> Maybe Text
functionArn :: Prelude.Maybe Prelude.Text,
    -- | The finding classification of the function.
    --
    -- Findings for functions include:
    --
    -- -   __@Optimized@__ — The function is correctly provisioned to run your
    --     workload based on its current configuration and its utilization
    --     history. This finding classification does not include finding reason
    --     codes.
    --
    -- -   __@NotOptimized@__ — The function is performing at a higher level
    --     (over-provisioned) or at a lower level (under-provisioned) than
    --     required for your workload because its current configuration is not
    --     optimal. Over-provisioned resources might lead to unnecessary
    --     infrastructure cost, and under-provisioned resources might lead to
    --     poor application performance. This finding classification can
    --     include the @MemoryUnderprovisioned@ and @MemoryUnderprovisioned@
    --     finding reason codes.
    --
    -- -   __@Unavailable@__ — Compute Optimizer was unable to generate a
    --     recommendation for the function. This could be because the function
    --     has not accumulated sufficient metric data, or the function does not
    --     qualify for a recommendation. This finding classification can
    --     include the @InsufficientData@ and @Inconclusive@ finding reason
    --     codes.
    --
    --     Functions with a finding of unavailable are not returned unless you
    --     specify the @filter@ parameter with a value of @Unavailable@ in your
    --     @GetLambdaFunctionRecommendations@ request.
    LambdaFunctionRecommendation
-> Maybe LambdaFunctionRecommendationFinding
finding :: Prelude.Maybe LambdaFunctionRecommendationFinding,
    -- | The amount of memory, in MB, that\'s allocated to the current function.
    LambdaFunctionRecommendation -> Maybe Int
currentMemorySize :: Prelude.Maybe Prelude.Int,
    -- | The timestamp of when the function recommendation was last refreshed.
    LambdaFunctionRecommendation -> Maybe POSIX
lastRefreshTimestamp :: Prelude.Maybe Core.POSIX,
    -- | The Amazon Web Services account ID of the function.
    LambdaFunctionRecommendation -> Maybe Text
accountId :: Prelude.Maybe Prelude.Text,
    -- | The reason for the finding classification of the function.
    --
    -- Functions that have a finding classification of @Optimized@ don\'t have
    -- a finding reason code.
    --
    -- Finding reason codes for functions include:
    --
    -- -   __@MemoryOverprovisioned@__ — The function is over-provisioned when
    --     its memory configuration can be sized down while still meeting the
    --     performance requirements of your workload. An over-provisioned
    --     function might lead to unnecessary infrastructure cost. This finding
    --     reason code is part of the @NotOptimized@ finding classification.
    --
    -- -   __@MemoryUnderprovisioned@__ — The function is under-provisioned
    --     when its memory configuration doesn\'t meet the performance
    --     requirements of the workload. An under-provisioned function might
    --     lead to poor application performance. This finding reason code is
    --     part of the @NotOptimized@ finding classification.
    --
    -- -   __@InsufficientData@__ — The function does not have sufficient
    --     metric data for Compute Optimizer to generate a recommendation. For
    --     more information, see the
    --     <https://docs.aws.amazon.com/compute-optimizer/latest/ug/requirements.html Supported resources and requirements>
    --     in the /Compute Optimizer User Guide/. This finding reason code is
    --     part of the @Unavailable@ finding classification.
    --
    -- -   __@Inconclusive@__ — The function does not qualify for a
    --     recommendation because Compute Optimizer cannot generate a
    --     recommendation with a high degree of confidence. This finding reason
    --     code is part of the @Unavailable@ finding classification.
    LambdaFunctionRecommendation
-> Maybe [LambdaFunctionRecommendationFindingReasonCode]
findingReasonCodes :: Prelude.Maybe [LambdaFunctionRecommendationFindingReasonCode],
    -- | An array of objects that describe the utilization metrics of the
    -- function.
    LambdaFunctionRecommendation
-> Maybe [LambdaFunctionUtilizationMetric]
utilizationMetrics :: Prelude.Maybe [LambdaFunctionUtilizationMetric],
    -- | An array of objects that describe the memory configuration
    -- recommendation options for the function.
    LambdaFunctionRecommendation
-> Maybe [LambdaFunctionMemoryRecommendationOption]
memorySizeRecommendationOptions :: Prelude.Maybe [LambdaFunctionMemoryRecommendationOption],
    -- | The version number of the current function.
    LambdaFunctionRecommendation -> Maybe Text
functionVersion :: Prelude.Maybe Prelude.Text,
    -- | The number of times your function code was applied during the look-back
    -- period.
    LambdaFunctionRecommendation -> Maybe Integer
numberOfInvocations :: Prelude.Maybe Prelude.Integer,
    -- | The number of days for which utilization metrics were analyzed for the
    -- function.
    LambdaFunctionRecommendation -> Maybe Double
lookbackPeriodInDays :: Prelude.Maybe Prelude.Double
  }
  deriving (LambdaFunctionRecommendation
-> LambdaFunctionRecommendation -> Bool
(LambdaFunctionRecommendation
 -> LambdaFunctionRecommendation -> Bool)
-> (LambdaFunctionRecommendation
    -> LambdaFunctionRecommendation -> Bool)
-> Eq LambdaFunctionRecommendation
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: LambdaFunctionRecommendation
-> LambdaFunctionRecommendation -> Bool
$c/= :: LambdaFunctionRecommendation
-> LambdaFunctionRecommendation -> Bool
== :: LambdaFunctionRecommendation
-> LambdaFunctionRecommendation -> Bool
$c== :: LambdaFunctionRecommendation
-> LambdaFunctionRecommendation -> Bool
Prelude.Eq, ReadPrec [LambdaFunctionRecommendation]
ReadPrec LambdaFunctionRecommendation
Int -> ReadS LambdaFunctionRecommendation
ReadS [LambdaFunctionRecommendation]
(Int -> ReadS LambdaFunctionRecommendation)
-> ReadS [LambdaFunctionRecommendation]
-> ReadPrec LambdaFunctionRecommendation
-> ReadPrec [LambdaFunctionRecommendation]
-> Read LambdaFunctionRecommendation
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [LambdaFunctionRecommendation]
$creadListPrec :: ReadPrec [LambdaFunctionRecommendation]
readPrec :: ReadPrec LambdaFunctionRecommendation
$creadPrec :: ReadPrec LambdaFunctionRecommendation
readList :: ReadS [LambdaFunctionRecommendation]
$creadList :: ReadS [LambdaFunctionRecommendation]
readsPrec :: Int -> ReadS LambdaFunctionRecommendation
$creadsPrec :: Int -> ReadS LambdaFunctionRecommendation
Prelude.Read, Int -> LambdaFunctionRecommendation -> ShowS
[LambdaFunctionRecommendation] -> ShowS
LambdaFunctionRecommendation -> String
(Int -> LambdaFunctionRecommendation -> ShowS)
-> (LambdaFunctionRecommendation -> String)
-> ([LambdaFunctionRecommendation] -> ShowS)
-> Show LambdaFunctionRecommendation
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [LambdaFunctionRecommendation] -> ShowS
$cshowList :: [LambdaFunctionRecommendation] -> ShowS
show :: LambdaFunctionRecommendation -> String
$cshow :: LambdaFunctionRecommendation -> String
showsPrec :: Int -> LambdaFunctionRecommendation -> ShowS
$cshowsPrec :: Int -> LambdaFunctionRecommendation -> ShowS
Prelude.Show, (forall x.
 LambdaFunctionRecommendation -> Rep LambdaFunctionRecommendation x)
-> (forall x.
    Rep LambdaFunctionRecommendation x -> LambdaFunctionRecommendation)
-> Generic LambdaFunctionRecommendation
forall x.
Rep LambdaFunctionRecommendation x -> LambdaFunctionRecommendation
forall x.
LambdaFunctionRecommendation -> Rep LambdaFunctionRecommendation x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep LambdaFunctionRecommendation x -> LambdaFunctionRecommendation
$cfrom :: forall x.
LambdaFunctionRecommendation -> Rep LambdaFunctionRecommendation x
Prelude.Generic)

-- |
-- Create a value of 'LambdaFunctionRecommendation' 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:
--
-- 'functionArn', 'lambdaFunctionRecommendation_functionArn' - The Amazon Resource Name (ARN) of the current function.
--
-- 'finding', 'lambdaFunctionRecommendation_finding' - The finding classification of the function.
--
-- Findings for functions include:
--
-- -   __@Optimized@__ — The function is correctly provisioned to run your
--     workload based on its current configuration and its utilization
--     history. This finding classification does not include finding reason
--     codes.
--
-- -   __@NotOptimized@__ — The function is performing at a higher level
--     (over-provisioned) or at a lower level (under-provisioned) than
--     required for your workload because its current configuration is not
--     optimal. Over-provisioned resources might lead to unnecessary
--     infrastructure cost, and under-provisioned resources might lead to
--     poor application performance. This finding classification can
--     include the @MemoryUnderprovisioned@ and @MemoryUnderprovisioned@
--     finding reason codes.
--
-- -   __@Unavailable@__ — Compute Optimizer was unable to generate a
--     recommendation for the function. This could be because the function
--     has not accumulated sufficient metric data, or the function does not
--     qualify for a recommendation. This finding classification can
--     include the @InsufficientData@ and @Inconclusive@ finding reason
--     codes.
--
--     Functions with a finding of unavailable are not returned unless you
--     specify the @filter@ parameter with a value of @Unavailable@ in your
--     @GetLambdaFunctionRecommendations@ request.
--
-- 'currentMemorySize', 'lambdaFunctionRecommendation_currentMemorySize' - The amount of memory, in MB, that\'s allocated to the current function.
--
-- 'lastRefreshTimestamp', 'lambdaFunctionRecommendation_lastRefreshTimestamp' - The timestamp of when the function recommendation was last refreshed.
--
-- 'accountId', 'lambdaFunctionRecommendation_accountId' - The Amazon Web Services account ID of the function.
--
-- 'findingReasonCodes', 'lambdaFunctionRecommendation_findingReasonCodes' - The reason for the finding classification of the function.
--
-- Functions that have a finding classification of @Optimized@ don\'t have
-- a finding reason code.
--
-- Finding reason codes for functions include:
--
-- -   __@MemoryOverprovisioned@__ — The function is over-provisioned when
--     its memory configuration can be sized down while still meeting the
--     performance requirements of your workload. An over-provisioned
--     function might lead to unnecessary infrastructure cost. This finding
--     reason code is part of the @NotOptimized@ finding classification.
--
-- -   __@MemoryUnderprovisioned@__ — The function is under-provisioned
--     when its memory configuration doesn\'t meet the performance
--     requirements of the workload. An under-provisioned function might
--     lead to poor application performance. This finding reason code is
--     part of the @NotOptimized@ finding classification.
--
-- -   __@InsufficientData@__ — The function does not have sufficient
--     metric data for Compute Optimizer to generate a recommendation. For
--     more information, see the
--     <https://docs.aws.amazon.com/compute-optimizer/latest/ug/requirements.html Supported resources and requirements>
--     in the /Compute Optimizer User Guide/. This finding reason code is
--     part of the @Unavailable@ finding classification.
--
-- -   __@Inconclusive@__ — The function does not qualify for a
--     recommendation because Compute Optimizer cannot generate a
--     recommendation with a high degree of confidence. This finding reason
--     code is part of the @Unavailable@ finding classification.
--
-- 'utilizationMetrics', 'lambdaFunctionRecommendation_utilizationMetrics' - An array of objects that describe the utilization metrics of the
-- function.
--
-- 'memorySizeRecommendationOptions', 'lambdaFunctionRecommendation_memorySizeRecommendationOptions' - An array of objects that describe the memory configuration
-- recommendation options for the function.
--
-- 'functionVersion', 'lambdaFunctionRecommendation_functionVersion' - The version number of the current function.
--
-- 'numberOfInvocations', 'lambdaFunctionRecommendation_numberOfInvocations' - The number of times your function code was applied during the look-back
-- period.
--
-- 'lookbackPeriodInDays', 'lambdaFunctionRecommendation_lookbackPeriodInDays' - The number of days for which utilization metrics were analyzed for the
-- function.
newLambdaFunctionRecommendation ::
  LambdaFunctionRecommendation
newLambdaFunctionRecommendation :: LambdaFunctionRecommendation
newLambdaFunctionRecommendation =
  LambdaFunctionRecommendation' :: Maybe Text
-> Maybe LambdaFunctionRecommendationFinding
-> Maybe Int
-> Maybe POSIX
-> Maybe Text
-> Maybe [LambdaFunctionRecommendationFindingReasonCode]
-> Maybe [LambdaFunctionUtilizationMetric]
-> Maybe [LambdaFunctionMemoryRecommendationOption]
-> Maybe Text
-> Maybe Integer
-> Maybe Double
-> LambdaFunctionRecommendation
LambdaFunctionRecommendation'
    { $sel:functionArn:LambdaFunctionRecommendation' :: Maybe Text
functionArn =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:finding:LambdaFunctionRecommendation' :: Maybe LambdaFunctionRecommendationFinding
finding = Maybe LambdaFunctionRecommendationFinding
forall a. Maybe a
Prelude.Nothing,
      $sel:currentMemorySize:LambdaFunctionRecommendation' :: Maybe Int
currentMemorySize = Maybe Int
forall a. Maybe a
Prelude.Nothing,
      $sel:lastRefreshTimestamp:LambdaFunctionRecommendation' :: Maybe POSIX
lastRefreshTimestamp = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:accountId:LambdaFunctionRecommendation' :: Maybe Text
accountId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:findingReasonCodes:LambdaFunctionRecommendation' :: Maybe [LambdaFunctionRecommendationFindingReasonCode]
findingReasonCodes = Maybe [LambdaFunctionRecommendationFindingReasonCode]
forall a. Maybe a
Prelude.Nothing,
      $sel:utilizationMetrics:LambdaFunctionRecommendation' :: Maybe [LambdaFunctionUtilizationMetric]
utilizationMetrics = Maybe [LambdaFunctionUtilizationMetric]
forall a. Maybe a
Prelude.Nothing,
      $sel:memorySizeRecommendationOptions:LambdaFunctionRecommendation' :: Maybe [LambdaFunctionMemoryRecommendationOption]
memorySizeRecommendationOptions =
        Maybe [LambdaFunctionMemoryRecommendationOption]
forall a. Maybe a
Prelude.Nothing,
      $sel:functionVersion:LambdaFunctionRecommendation' :: Maybe Text
functionVersion = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:numberOfInvocations:LambdaFunctionRecommendation' :: Maybe Integer
numberOfInvocations = Maybe Integer
forall a. Maybe a
Prelude.Nothing,
      $sel:lookbackPeriodInDays:LambdaFunctionRecommendation' :: Maybe Double
lookbackPeriodInDays = Maybe Double
forall a. Maybe a
Prelude.Nothing
    }

-- | The Amazon Resource Name (ARN) of the current function.
lambdaFunctionRecommendation_functionArn :: Lens.Lens' LambdaFunctionRecommendation (Prelude.Maybe Prelude.Text)
lambdaFunctionRecommendation_functionArn :: (Maybe Text -> f (Maybe Text))
-> LambdaFunctionRecommendation -> f LambdaFunctionRecommendation
lambdaFunctionRecommendation_functionArn = (LambdaFunctionRecommendation -> Maybe Text)
-> (LambdaFunctionRecommendation
    -> Maybe Text -> LambdaFunctionRecommendation)
-> Lens
     LambdaFunctionRecommendation
     LambdaFunctionRecommendation
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LambdaFunctionRecommendation' {Maybe Text
functionArn :: Maybe Text
$sel:functionArn:LambdaFunctionRecommendation' :: LambdaFunctionRecommendation -> Maybe Text
functionArn} -> Maybe Text
functionArn) (\s :: LambdaFunctionRecommendation
s@LambdaFunctionRecommendation' {} Maybe Text
a -> LambdaFunctionRecommendation
s {$sel:functionArn:LambdaFunctionRecommendation' :: Maybe Text
functionArn = Maybe Text
a} :: LambdaFunctionRecommendation)

-- | The finding classification of the function.
--
-- Findings for functions include:
--
-- -   __@Optimized@__ — The function is correctly provisioned to run your
--     workload based on its current configuration and its utilization
--     history. This finding classification does not include finding reason
--     codes.
--
-- -   __@NotOptimized@__ — The function is performing at a higher level
--     (over-provisioned) or at a lower level (under-provisioned) than
--     required for your workload because its current configuration is not
--     optimal. Over-provisioned resources might lead to unnecessary
--     infrastructure cost, and under-provisioned resources might lead to
--     poor application performance. This finding classification can
--     include the @MemoryUnderprovisioned@ and @MemoryUnderprovisioned@
--     finding reason codes.
--
-- -   __@Unavailable@__ — Compute Optimizer was unable to generate a
--     recommendation for the function. This could be because the function
--     has not accumulated sufficient metric data, or the function does not
--     qualify for a recommendation. This finding classification can
--     include the @InsufficientData@ and @Inconclusive@ finding reason
--     codes.
--
--     Functions with a finding of unavailable are not returned unless you
--     specify the @filter@ parameter with a value of @Unavailable@ in your
--     @GetLambdaFunctionRecommendations@ request.
lambdaFunctionRecommendation_finding :: Lens.Lens' LambdaFunctionRecommendation (Prelude.Maybe LambdaFunctionRecommendationFinding)
lambdaFunctionRecommendation_finding :: (Maybe LambdaFunctionRecommendationFinding
 -> f (Maybe LambdaFunctionRecommendationFinding))
-> LambdaFunctionRecommendation -> f LambdaFunctionRecommendation
lambdaFunctionRecommendation_finding = (LambdaFunctionRecommendation
 -> Maybe LambdaFunctionRecommendationFinding)
-> (LambdaFunctionRecommendation
    -> Maybe LambdaFunctionRecommendationFinding
    -> LambdaFunctionRecommendation)
-> Lens
     LambdaFunctionRecommendation
     LambdaFunctionRecommendation
     (Maybe LambdaFunctionRecommendationFinding)
     (Maybe LambdaFunctionRecommendationFinding)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LambdaFunctionRecommendation' {Maybe LambdaFunctionRecommendationFinding
finding :: Maybe LambdaFunctionRecommendationFinding
$sel:finding:LambdaFunctionRecommendation' :: LambdaFunctionRecommendation
-> Maybe LambdaFunctionRecommendationFinding
finding} -> Maybe LambdaFunctionRecommendationFinding
finding) (\s :: LambdaFunctionRecommendation
s@LambdaFunctionRecommendation' {} Maybe LambdaFunctionRecommendationFinding
a -> LambdaFunctionRecommendation
s {$sel:finding:LambdaFunctionRecommendation' :: Maybe LambdaFunctionRecommendationFinding
finding = Maybe LambdaFunctionRecommendationFinding
a} :: LambdaFunctionRecommendation)

-- | The amount of memory, in MB, that\'s allocated to the current function.
lambdaFunctionRecommendation_currentMemorySize :: Lens.Lens' LambdaFunctionRecommendation (Prelude.Maybe Prelude.Int)
lambdaFunctionRecommendation_currentMemorySize :: (Maybe Int -> f (Maybe Int))
-> LambdaFunctionRecommendation -> f LambdaFunctionRecommendation
lambdaFunctionRecommendation_currentMemorySize = (LambdaFunctionRecommendation -> Maybe Int)
-> (LambdaFunctionRecommendation
    -> Maybe Int -> LambdaFunctionRecommendation)
-> Lens
     LambdaFunctionRecommendation
     LambdaFunctionRecommendation
     (Maybe Int)
     (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LambdaFunctionRecommendation' {Maybe Int
currentMemorySize :: Maybe Int
$sel:currentMemorySize:LambdaFunctionRecommendation' :: LambdaFunctionRecommendation -> Maybe Int
currentMemorySize} -> Maybe Int
currentMemorySize) (\s :: LambdaFunctionRecommendation
s@LambdaFunctionRecommendation' {} Maybe Int
a -> LambdaFunctionRecommendation
s {$sel:currentMemorySize:LambdaFunctionRecommendation' :: Maybe Int
currentMemorySize = Maybe Int
a} :: LambdaFunctionRecommendation)

-- | The timestamp of when the function recommendation was last refreshed.
lambdaFunctionRecommendation_lastRefreshTimestamp :: Lens.Lens' LambdaFunctionRecommendation (Prelude.Maybe Prelude.UTCTime)
lambdaFunctionRecommendation_lastRefreshTimestamp :: (Maybe UTCTime -> f (Maybe UTCTime))
-> LambdaFunctionRecommendation -> f LambdaFunctionRecommendation
lambdaFunctionRecommendation_lastRefreshTimestamp = (LambdaFunctionRecommendation -> Maybe POSIX)
-> (LambdaFunctionRecommendation
    -> Maybe POSIX -> LambdaFunctionRecommendation)
-> Lens
     LambdaFunctionRecommendation
     LambdaFunctionRecommendation
     (Maybe POSIX)
     (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LambdaFunctionRecommendation' {Maybe POSIX
lastRefreshTimestamp :: Maybe POSIX
$sel:lastRefreshTimestamp:LambdaFunctionRecommendation' :: LambdaFunctionRecommendation -> Maybe POSIX
lastRefreshTimestamp} -> Maybe POSIX
lastRefreshTimestamp) (\s :: LambdaFunctionRecommendation
s@LambdaFunctionRecommendation' {} Maybe POSIX
a -> LambdaFunctionRecommendation
s {$sel:lastRefreshTimestamp:LambdaFunctionRecommendation' :: Maybe POSIX
lastRefreshTimestamp = Maybe POSIX
a} :: LambdaFunctionRecommendation) ((Maybe POSIX -> f (Maybe POSIX))
 -> LambdaFunctionRecommendation -> f LambdaFunctionRecommendation)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> LambdaFunctionRecommendation
-> f LambdaFunctionRecommendation
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 function.
lambdaFunctionRecommendation_accountId :: Lens.Lens' LambdaFunctionRecommendation (Prelude.Maybe Prelude.Text)
lambdaFunctionRecommendation_accountId :: (Maybe Text -> f (Maybe Text))
-> LambdaFunctionRecommendation -> f LambdaFunctionRecommendation
lambdaFunctionRecommendation_accountId = (LambdaFunctionRecommendation -> Maybe Text)
-> (LambdaFunctionRecommendation
    -> Maybe Text -> LambdaFunctionRecommendation)
-> Lens
     LambdaFunctionRecommendation
     LambdaFunctionRecommendation
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LambdaFunctionRecommendation' {Maybe Text
accountId :: Maybe Text
$sel:accountId:LambdaFunctionRecommendation' :: LambdaFunctionRecommendation -> Maybe Text
accountId} -> Maybe Text
accountId) (\s :: LambdaFunctionRecommendation
s@LambdaFunctionRecommendation' {} Maybe Text
a -> LambdaFunctionRecommendation
s {$sel:accountId:LambdaFunctionRecommendation' :: Maybe Text
accountId = Maybe Text
a} :: LambdaFunctionRecommendation)

-- | The reason for the finding classification of the function.
--
-- Functions that have a finding classification of @Optimized@ don\'t have
-- a finding reason code.
--
-- Finding reason codes for functions include:
--
-- -   __@MemoryOverprovisioned@__ — The function is over-provisioned when
--     its memory configuration can be sized down while still meeting the
--     performance requirements of your workload. An over-provisioned
--     function might lead to unnecessary infrastructure cost. This finding
--     reason code is part of the @NotOptimized@ finding classification.
--
-- -   __@MemoryUnderprovisioned@__ — The function is under-provisioned
--     when its memory configuration doesn\'t meet the performance
--     requirements of the workload. An under-provisioned function might
--     lead to poor application performance. This finding reason code is
--     part of the @NotOptimized@ finding classification.
--
-- -   __@InsufficientData@__ — The function does not have sufficient
--     metric data for Compute Optimizer to generate a recommendation. For
--     more information, see the
--     <https://docs.aws.amazon.com/compute-optimizer/latest/ug/requirements.html Supported resources and requirements>
--     in the /Compute Optimizer User Guide/. This finding reason code is
--     part of the @Unavailable@ finding classification.
--
-- -   __@Inconclusive@__ — The function does not qualify for a
--     recommendation because Compute Optimizer cannot generate a
--     recommendation with a high degree of confidence. This finding reason
--     code is part of the @Unavailable@ finding classification.
lambdaFunctionRecommendation_findingReasonCodes :: Lens.Lens' LambdaFunctionRecommendation (Prelude.Maybe [LambdaFunctionRecommendationFindingReasonCode])
lambdaFunctionRecommendation_findingReasonCodes :: (Maybe [LambdaFunctionRecommendationFindingReasonCode]
 -> f (Maybe [LambdaFunctionRecommendationFindingReasonCode]))
-> LambdaFunctionRecommendation -> f LambdaFunctionRecommendation
lambdaFunctionRecommendation_findingReasonCodes = (LambdaFunctionRecommendation
 -> Maybe [LambdaFunctionRecommendationFindingReasonCode])
-> (LambdaFunctionRecommendation
    -> Maybe [LambdaFunctionRecommendationFindingReasonCode]
    -> LambdaFunctionRecommendation)
-> Lens
     LambdaFunctionRecommendation
     LambdaFunctionRecommendation
     (Maybe [LambdaFunctionRecommendationFindingReasonCode])
     (Maybe [LambdaFunctionRecommendationFindingReasonCode])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LambdaFunctionRecommendation' {Maybe [LambdaFunctionRecommendationFindingReasonCode]
findingReasonCodes :: Maybe [LambdaFunctionRecommendationFindingReasonCode]
$sel:findingReasonCodes:LambdaFunctionRecommendation' :: LambdaFunctionRecommendation
-> Maybe [LambdaFunctionRecommendationFindingReasonCode]
findingReasonCodes} -> Maybe [LambdaFunctionRecommendationFindingReasonCode]
findingReasonCodes) (\s :: LambdaFunctionRecommendation
s@LambdaFunctionRecommendation' {} Maybe [LambdaFunctionRecommendationFindingReasonCode]
a -> LambdaFunctionRecommendation
s {$sel:findingReasonCodes:LambdaFunctionRecommendation' :: Maybe [LambdaFunctionRecommendationFindingReasonCode]
findingReasonCodes = Maybe [LambdaFunctionRecommendationFindingReasonCode]
a} :: LambdaFunctionRecommendation) ((Maybe [LambdaFunctionRecommendationFindingReasonCode]
  -> f (Maybe [LambdaFunctionRecommendationFindingReasonCode]))
 -> LambdaFunctionRecommendation -> f LambdaFunctionRecommendation)
-> ((Maybe [LambdaFunctionRecommendationFindingReasonCode]
     -> f (Maybe [LambdaFunctionRecommendationFindingReasonCode]))
    -> Maybe [LambdaFunctionRecommendationFindingReasonCode]
    -> f (Maybe [LambdaFunctionRecommendationFindingReasonCode]))
-> (Maybe [LambdaFunctionRecommendationFindingReasonCode]
    -> f (Maybe [LambdaFunctionRecommendationFindingReasonCode]))
-> LambdaFunctionRecommendation
-> f LambdaFunctionRecommendation
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [LambdaFunctionRecommendationFindingReasonCode]
  [LambdaFunctionRecommendationFindingReasonCode]
  [LambdaFunctionRecommendationFindingReasonCode]
  [LambdaFunctionRecommendationFindingReasonCode]
-> Iso
     (Maybe [LambdaFunctionRecommendationFindingReasonCode])
     (Maybe [LambdaFunctionRecommendationFindingReasonCode])
     (Maybe [LambdaFunctionRecommendationFindingReasonCode])
     (Maybe [LambdaFunctionRecommendationFindingReasonCode])
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
  [LambdaFunctionRecommendationFindingReasonCode]
  [LambdaFunctionRecommendationFindingReasonCode]
  [LambdaFunctionRecommendationFindingReasonCode]
  [LambdaFunctionRecommendationFindingReasonCode]
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
-- function.
lambdaFunctionRecommendation_utilizationMetrics :: Lens.Lens' LambdaFunctionRecommendation (Prelude.Maybe [LambdaFunctionUtilizationMetric])
lambdaFunctionRecommendation_utilizationMetrics :: (Maybe [LambdaFunctionUtilizationMetric]
 -> f (Maybe [LambdaFunctionUtilizationMetric]))
-> LambdaFunctionRecommendation -> f LambdaFunctionRecommendation
lambdaFunctionRecommendation_utilizationMetrics = (LambdaFunctionRecommendation
 -> Maybe [LambdaFunctionUtilizationMetric])
-> (LambdaFunctionRecommendation
    -> Maybe [LambdaFunctionUtilizationMetric]
    -> LambdaFunctionRecommendation)
-> Lens
     LambdaFunctionRecommendation
     LambdaFunctionRecommendation
     (Maybe [LambdaFunctionUtilizationMetric])
     (Maybe [LambdaFunctionUtilizationMetric])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LambdaFunctionRecommendation' {Maybe [LambdaFunctionUtilizationMetric]
utilizationMetrics :: Maybe [LambdaFunctionUtilizationMetric]
$sel:utilizationMetrics:LambdaFunctionRecommendation' :: LambdaFunctionRecommendation
-> Maybe [LambdaFunctionUtilizationMetric]
utilizationMetrics} -> Maybe [LambdaFunctionUtilizationMetric]
utilizationMetrics) (\s :: LambdaFunctionRecommendation
s@LambdaFunctionRecommendation' {} Maybe [LambdaFunctionUtilizationMetric]
a -> LambdaFunctionRecommendation
s {$sel:utilizationMetrics:LambdaFunctionRecommendation' :: Maybe [LambdaFunctionUtilizationMetric]
utilizationMetrics = Maybe [LambdaFunctionUtilizationMetric]
a} :: LambdaFunctionRecommendation) ((Maybe [LambdaFunctionUtilizationMetric]
  -> f (Maybe [LambdaFunctionUtilizationMetric]))
 -> LambdaFunctionRecommendation -> f LambdaFunctionRecommendation)
-> ((Maybe [LambdaFunctionUtilizationMetric]
     -> f (Maybe [LambdaFunctionUtilizationMetric]))
    -> Maybe [LambdaFunctionUtilizationMetric]
    -> f (Maybe [LambdaFunctionUtilizationMetric]))
-> (Maybe [LambdaFunctionUtilizationMetric]
    -> f (Maybe [LambdaFunctionUtilizationMetric]))
-> LambdaFunctionRecommendation
-> f LambdaFunctionRecommendation
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [LambdaFunctionUtilizationMetric]
  [LambdaFunctionUtilizationMetric]
  [LambdaFunctionUtilizationMetric]
  [LambdaFunctionUtilizationMetric]
-> Iso
     (Maybe [LambdaFunctionUtilizationMetric])
     (Maybe [LambdaFunctionUtilizationMetric])
     (Maybe [LambdaFunctionUtilizationMetric])
     (Maybe [LambdaFunctionUtilizationMetric])
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
  [LambdaFunctionUtilizationMetric]
  [LambdaFunctionUtilizationMetric]
  [LambdaFunctionUtilizationMetric]
  [LambdaFunctionUtilizationMetric]
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 memory configuration
-- recommendation options for the function.
lambdaFunctionRecommendation_memorySizeRecommendationOptions :: Lens.Lens' LambdaFunctionRecommendation (Prelude.Maybe [LambdaFunctionMemoryRecommendationOption])
lambdaFunctionRecommendation_memorySizeRecommendationOptions :: (Maybe [LambdaFunctionMemoryRecommendationOption]
 -> f (Maybe [LambdaFunctionMemoryRecommendationOption]))
-> LambdaFunctionRecommendation -> f LambdaFunctionRecommendation
lambdaFunctionRecommendation_memorySizeRecommendationOptions = (LambdaFunctionRecommendation
 -> Maybe [LambdaFunctionMemoryRecommendationOption])
-> (LambdaFunctionRecommendation
    -> Maybe [LambdaFunctionMemoryRecommendationOption]
    -> LambdaFunctionRecommendation)
-> Lens
     LambdaFunctionRecommendation
     LambdaFunctionRecommendation
     (Maybe [LambdaFunctionMemoryRecommendationOption])
     (Maybe [LambdaFunctionMemoryRecommendationOption])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LambdaFunctionRecommendation' {Maybe [LambdaFunctionMemoryRecommendationOption]
memorySizeRecommendationOptions :: Maybe [LambdaFunctionMemoryRecommendationOption]
$sel:memorySizeRecommendationOptions:LambdaFunctionRecommendation' :: LambdaFunctionRecommendation
-> Maybe [LambdaFunctionMemoryRecommendationOption]
memorySizeRecommendationOptions} -> Maybe [LambdaFunctionMemoryRecommendationOption]
memorySizeRecommendationOptions) (\s :: LambdaFunctionRecommendation
s@LambdaFunctionRecommendation' {} Maybe [LambdaFunctionMemoryRecommendationOption]
a -> LambdaFunctionRecommendation
s {$sel:memorySizeRecommendationOptions:LambdaFunctionRecommendation' :: Maybe [LambdaFunctionMemoryRecommendationOption]
memorySizeRecommendationOptions = Maybe [LambdaFunctionMemoryRecommendationOption]
a} :: LambdaFunctionRecommendation) ((Maybe [LambdaFunctionMemoryRecommendationOption]
  -> f (Maybe [LambdaFunctionMemoryRecommendationOption]))
 -> LambdaFunctionRecommendation -> f LambdaFunctionRecommendation)
-> ((Maybe [LambdaFunctionMemoryRecommendationOption]
     -> f (Maybe [LambdaFunctionMemoryRecommendationOption]))
    -> Maybe [LambdaFunctionMemoryRecommendationOption]
    -> f (Maybe [LambdaFunctionMemoryRecommendationOption]))
-> (Maybe [LambdaFunctionMemoryRecommendationOption]
    -> f (Maybe [LambdaFunctionMemoryRecommendationOption]))
-> LambdaFunctionRecommendation
-> f LambdaFunctionRecommendation
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [LambdaFunctionMemoryRecommendationOption]
  [LambdaFunctionMemoryRecommendationOption]
  [LambdaFunctionMemoryRecommendationOption]
  [LambdaFunctionMemoryRecommendationOption]
-> Iso
     (Maybe [LambdaFunctionMemoryRecommendationOption])
     (Maybe [LambdaFunctionMemoryRecommendationOption])
     (Maybe [LambdaFunctionMemoryRecommendationOption])
     (Maybe [LambdaFunctionMemoryRecommendationOption])
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
  [LambdaFunctionMemoryRecommendationOption]
  [LambdaFunctionMemoryRecommendationOption]
  [LambdaFunctionMemoryRecommendationOption]
  [LambdaFunctionMemoryRecommendationOption]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The version number of the current function.
lambdaFunctionRecommendation_functionVersion :: Lens.Lens' LambdaFunctionRecommendation (Prelude.Maybe Prelude.Text)
lambdaFunctionRecommendation_functionVersion :: (Maybe Text -> f (Maybe Text))
-> LambdaFunctionRecommendation -> f LambdaFunctionRecommendation
lambdaFunctionRecommendation_functionVersion = (LambdaFunctionRecommendation -> Maybe Text)
-> (LambdaFunctionRecommendation
    -> Maybe Text -> LambdaFunctionRecommendation)
-> Lens
     LambdaFunctionRecommendation
     LambdaFunctionRecommendation
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LambdaFunctionRecommendation' {Maybe Text
functionVersion :: Maybe Text
$sel:functionVersion:LambdaFunctionRecommendation' :: LambdaFunctionRecommendation -> Maybe Text
functionVersion} -> Maybe Text
functionVersion) (\s :: LambdaFunctionRecommendation
s@LambdaFunctionRecommendation' {} Maybe Text
a -> LambdaFunctionRecommendation
s {$sel:functionVersion:LambdaFunctionRecommendation' :: Maybe Text
functionVersion = Maybe Text
a} :: LambdaFunctionRecommendation)

-- | The number of times your function code was applied during the look-back
-- period.
lambdaFunctionRecommendation_numberOfInvocations :: Lens.Lens' LambdaFunctionRecommendation (Prelude.Maybe Prelude.Integer)
lambdaFunctionRecommendation_numberOfInvocations :: (Maybe Integer -> f (Maybe Integer))
-> LambdaFunctionRecommendation -> f LambdaFunctionRecommendation
lambdaFunctionRecommendation_numberOfInvocations = (LambdaFunctionRecommendation -> Maybe Integer)
-> (LambdaFunctionRecommendation
    -> Maybe Integer -> LambdaFunctionRecommendation)
-> Lens
     LambdaFunctionRecommendation
     LambdaFunctionRecommendation
     (Maybe Integer)
     (Maybe Integer)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LambdaFunctionRecommendation' {Maybe Integer
numberOfInvocations :: Maybe Integer
$sel:numberOfInvocations:LambdaFunctionRecommendation' :: LambdaFunctionRecommendation -> Maybe Integer
numberOfInvocations} -> Maybe Integer
numberOfInvocations) (\s :: LambdaFunctionRecommendation
s@LambdaFunctionRecommendation' {} Maybe Integer
a -> LambdaFunctionRecommendation
s {$sel:numberOfInvocations:LambdaFunctionRecommendation' :: Maybe Integer
numberOfInvocations = Maybe Integer
a} :: LambdaFunctionRecommendation)

-- | The number of days for which utilization metrics were analyzed for the
-- function.
lambdaFunctionRecommendation_lookbackPeriodInDays :: Lens.Lens' LambdaFunctionRecommendation (Prelude.Maybe Prelude.Double)
lambdaFunctionRecommendation_lookbackPeriodInDays :: (Maybe Double -> f (Maybe Double))
-> LambdaFunctionRecommendation -> f LambdaFunctionRecommendation
lambdaFunctionRecommendation_lookbackPeriodInDays = (LambdaFunctionRecommendation -> Maybe Double)
-> (LambdaFunctionRecommendation
    -> Maybe Double -> LambdaFunctionRecommendation)
-> Lens
     LambdaFunctionRecommendation
     LambdaFunctionRecommendation
     (Maybe Double)
     (Maybe Double)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LambdaFunctionRecommendation' {Maybe Double
lookbackPeriodInDays :: Maybe Double
$sel:lookbackPeriodInDays:LambdaFunctionRecommendation' :: LambdaFunctionRecommendation -> Maybe Double
lookbackPeriodInDays} -> Maybe Double
lookbackPeriodInDays) (\s :: LambdaFunctionRecommendation
s@LambdaFunctionRecommendation' {} Maybe Double
a -> LambdaFunctionRecommendation
s {$sel:lookbackPeriodInDays:LambdaFunctionRecommendation' :: Maybe Double
lookbackPeriodInDays = Maybe Double
a} :: LambdaFunctionRecommendation)

instance Core.FromJSON LambdaFunctionRecommendation where
  parseJSON :: Value -> Parser LambdaFunctionRecommendation
parseJSON =
    String
-> (Object -> Parser LambdaFunctionRecommendation)
-> Value
-> Parser LambdaFunctionRecommendation
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"LambdaFunctionRecommendation"
      ( \Object
x ->
          Maybe Text
-> Maybe LambdaFunctionRecommendationFinding
-> Maybe Int
-> Maybe POSIX
-> Maybe Text
-> Maybe [LambdaFunctionRecommendationFindingReasonCode]
-> Maybe [LambdaFunctionUtilizationMetric]
-> Maybe [LambdaFunctionMemoryRecommendationOption]
-> Maybe Text
-> Maybe Integer
-> Maybe Double
-> LambdaFunctionRecommendation
LambdaFunctionRecommendation'
            (Maybe Text
 -> Maybe LambdaFunctionRecommendationFinding
 -> Maybe Int
 -> Maybe POSIX
 -> Maybe Text
 -> Maybe [LambdaFunctionRecommendationFindingReasonCode]
 -> Maybe [LambdaFunctionUtilizationMetric]
 -> Maybe [LambdaFunctionMemoryRecommendationOption]
 -> Maybe Text
 -> Maybe Integer
 -> Maybe Double
 -> LambdaFunctionRecommendation)
-> Parser (Maybe Text)
-> Parser
     (Maybe LambdaFunctionRecommendationFinding
      -> Maybe Int
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe [LambdaFunctionRecommendationFindingReasonCode]
      -> Maybe [LambdaFunctionUtilizationMetric]
      -> Maybe [LambdaFunctionMemoryRecommendationOption]
      -> Maybe Text
      -> Maybe Integer
      -> Maybe Double
      -> LambdaFunctionRecommendation)
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
"functionArn")
            Parser
  (Maybe LambdaFunctionRecommendationFinding
   -> Maybe Int
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe [LambdaFunctionRecommendationFindingReasonCode]
   -> Maybe [LambdaFunctionUtilizationMetric]
   -> Maybe [LambdaFunctionMemoryRecommendationOption]
   -> Maybe Text
   -> Maybe Integer
   -> Maybe Double
   -> LambdaFunctionRecommendation)
-> Parser (Maybe LambdaFunctionRecommendationFinding)
-> Parser
     (Maybe Int
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe [LambdaFunctionRecommendationFindingReasonCode]
      -> Maybe [LambdaFunctionUtilizationMetric]
      -> Maybe [LambdaFunctionMemoryRecommendationOption]
      -> Maybe Text
      -> Maybe Integer
      -> Maybe Double
      -> LambdaFunctionRecommendation)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object
-> Text -> Parser (Maybe LambdaFunctionRecommendationFinding)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"finding")
            Parser
  (Maybe Int
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe [LambdaFunctionRecommendationFindingReasonCode]
   -> Maybe [LambdaFunctionUtilizationMetric]
   -> Maybe [LambdaFunctionMemoryRecommendationOption]
   -> Maybe Text
   -> Maybe Integer
   -> Maybe Double
   -> LambdaFunctionRecommendation)
-> Parser (Maybe Int)
-> Parser
     (Maybe POSIX
      -> Maybe Text
      -> Maybe [LambdaFunctionRecommendationFindingReasonCode]
      -> Maybe [LambdaFunctionUtilizationMetric]
      -> Maybe [LambdaFunctionMemoryRecommendationOption]
      -> Maybe Text
      -> Maybe Integer
      -> Maybe Double
      -> LambdaFunctionRecommendation)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"currentMemorySize")
            Parser
  (Maybe POSIX
   -> Maybe Text
   -> Maybe [LambdaFunctionRecommendationFindingReasonCode]
   -> Maybe [LambdaFunctionUtilizationMetric]
   -> Maybe [LambdaFunctionMemoryRecommendationOption]
   -> Maybe Text
   -> Maybe Integer
   -> Maybe Double
   -> LambdaFunctionRecommendation)
-> Parser (Maybe POSIX)
-> Parser
     (Maybe Text
      -> Maybe [LambdaFunctionRecommendationFindingReasonCode]
      -> Maybe [LambdaFunctionUtilizationMetric]
      -> Maybe [LambdaFunctionMemoryRecommendationOption]
      -> Maybe Text
      -> Maybe Integer
      -> Maybe Double
      -> LambdaFunctionRecommendation)
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 [LambdaFunctionRecommendationFindingReasonCode]
   -> Maybe [LambdaFunctionUtilizationMetric]
   -> Maybe [LambdaFunctionMemoryRecommendationOption]
   -> Maybe Text
   -> Maybe Integer
   -> Maybe Double
   -> LambdaFunctionRecommendation)
-> Parser (Maybe Text)
-> Parser
     (Maybe [LambdaFunctionRecommendationFindingReasonCode]
      -> Maybe [LambdaFunctionUtilizationMetric]
      -> Maybe [LambdaFunctionMemoryRecommendationOption]
      -> Maybe Text
      -> Maybe Integer
      -> Maybe Double
      -> LambdaFunctionRecommendation)
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 [LambdaFunctionRecommendationFindingReasonCode]
   -> Maybe [LambdaFunctionUtilizationMetric]
   -> Maybe [LambdaFunctionMemoryRecommendationOption]
   -> Maybe Text
   -> Maybe Integer
   -> Maybe Double
   -> LambdaFunctionRecommendation)
-> Parser (Maybe [LambdaFunctionRecommendationFindingReasonCode])
-> Parser
     (Maybe [LambdaFunctionUtilizationMetric]
      -> Maybe [LambdaFunctionMemoryRecommendationOption]
      -> Maybe Text
      -> Maybe Integer
      -> Maybe Double
      -> LambdaFunctionRecommendation)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object
-> Text
-> Parser
     (Maybe (Maybe [LambdaFunctionRecommendationFindingReasonCode]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"findingReasonCodes"
                            Parser
  (Maybe (Maybe [LambdaFunctionRecommendationFindingReasonCode]))
-> Maybe [LambdaFunctionRecommendationFindingReasonCode]
-> Parser (Maybe [LambdaFunctionRecommendationFindingReasonCode])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [LambdaFunctionRecommendationFindingReasonCode]
forall a. Monoid a => a
Prelude.mempty
                        )
            Parser
  (Maybe [LambdaFunctionUtilizationMetric]
   -> Maybe [LambdaFunctionMemoryRecommendationOption]
   -> Maybe Text
   -> Maybe Integer
   -> Maybe Double
   -> LambdaFunctionRecommendation)
-> Parser (Maybe [LambdaFunctionUtilizationMetric])
-> Parser
     (Maybe [LambdaFunctionMemoryRecommendationOption]
      -> Maybe Text
      -> Maybe Integer
      -> Maybe Double
      -> LambdaFunctionRecommendation)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object
-> Text -> Parser (Maybe (Maybe [LambdaFunctionUtilizationMetric]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"utilizationMetrics"
                            Parser (Maybe (Maybe [LambdaFunctionUtilizationMetric]))
-> Maybe [LambdaFunctionUtilizationMetric]
-> Parser (Maybe [LambdaFunctionUtilizationMetric])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [LambdaFunctionUtilizationMetric]
forall a. Monoid a => a
Prelude.mempty
                        )
            Parser
  (Maybe [LambdaFunctionMemoryRecommendationOption]
   -> Maybe Text
   -> Maybe Integer
   -> Maybe Double
   -> LambdaFunctionRecommendation)
-> Parser (Maybe [LambdaFunctionMemoryRecommendationOption])
-> Parser
     (Maybe Text
      -> Maybe Integer -> Maybe Double -> LambdaFunctionRecommendation)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object
-> Text
-> Parser
     (Maybe (Maybe [LambdaFunctionMemoryRecommendationOption]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"memorySizeRecommendationOptions"
                            Parser (Maybe (Maybe [LambdaFunctionMemoryRecommendationOption]))
-> Maybe [LambdaFunctionMemoryRecommendationOption]
-> Parser (Maybe [LambdaFunctionMemoryRecommendationOption])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [LambdaFunctionMemoryRecommendationOption]
forall a. Monoid a => a
Prelude.mempty
                        )
            Parser
  (Maybe Text
   -> Maybe Integer -> Maybe Double -> LambdaFunctionRecommendation)
-> Parser (Maybe Text)
-> Parser
     (Maybe Integer -> Maybe Double -> LambdaFunctionRecommendation)
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
"functionVersion")
            Parser
  (Maybe Integer -> Maybe Double -> LambdaFunctionRecommendation)
-> Parser (Maybe Integer)
-> Parser (Maybe Double -> LambdaFunctionRecommendation)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Integer)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"numberOfInvocations")
            Parser (Maybe Double -> LambdaFunctionRecommendation)
-> Parser (Maybe Double) -> Parser LambdaFunctionRecommendation
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
    LambdaFunctionRecommendation

instance Prelude.NFData LambdaFunctionRecommendation