{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# 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.GetEffectiveRecommendationPreferences
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Returns the recommendation preferences that are in effect for a given
-- resource, such as enhanced infrastructure metrics. Considers all
-- applicable preferences that you might have set at the resource, account,
-- and organization level.
--
-- When you create a recommendation preference, you can set its status to
-- @Active@ or @Inactive@. Use this action to view the recommendation
-- preferences that are in effect, or @Active@.
module Amazonka.ComputeOptimizer.GetEffectiveRecommendationPreferences
  ( -- * Creating a Request
    GetEffectiveRecommendationPreferences (..),
    newGetEffectiveRecommendationPreferences,

    -- * Request Lenses
    getEffectiveRecommendationPreferences_resourceArn,

    -- * Destructuring the Response
    GetEffectiveRecommendationPreferencesResponse (..),
    newGetEffectiveRecommendationPreferencesResponse,

    -- * Response Lenses
    getEffectiveRecommendationPreferencesResponse_enhancedInfrastructureMetrics,
    getEffectiveRecommendationPreferencesResponse_externalMetricsPreference,
    getEffectiveRecommendationPreferencesResponse_httpStatus,
  )
where

import Amazonka.ComputeOptimizer.Types
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | /See:/ 'newGetEffectiveRecommendationPreferences' smart constructor.
data GetEffectiveRecommendationPreferences = GetEffectiveRecommendationPreferences'
  { -- | The Amazon Resource Name (ARN) of the resource for which to confirm
    -- effective recommendation preferences. Only EC2 instance and Auto Scaling
    -- group ARNs are currently supported.
    GetEffectiveRecommendationPreferences -> Text
resourceArn :: Prelude.Text
  }
  deriving (GetEffectiveRecommendationPreferences
-> GetEffectiveRecommendationPreferences -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetEffectiveRecommendationPreferences
-> GetEffectiveRecommendationPreferences -> Bool
$c/= :: GetEffectiveRecommendationPreferences
-> GetEffectiveRecommendationPreferences -> Bool
== :: GetEffectiveRecommendationPreferences
-> GetEffectiveRecommendationPreferences -> Bool
$c== :: GetEffectiveRecommendationPreferences
-> GetEffectiveRecommendationPreferences -> Bool
Prelude.Eq, ReadPrec [GetEffectiveRecommendationPreferences]
ReadPrec GetEffectiveRecommendationPreferences
Int -> ReadS GetEffectiveRecommendationPreferences
ReadS [GetEffectiveRecommendationPreferences]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetEffectiveRecommendationPreferences]
$creadListPrec :: ReadPrec [GetEffectiveRecommendationPreferences]
readPrec :: ReadPrec GetEffectiveRecommendationPreferences
$creadPrec :: ReadPrec GetEffectiveRecommendationPreferences
readList :: ReadS [GetEffectiveRecommendationPreferences]
$creadList :: ReadS [GetEffectiveRecommendationPreferences]
readsPrec :: Int -> ReadS GetEffectiveRecommendationPreferences
$creadsPrec :: Int -> ReadS GetEffectiveRecommendationPreferences
Prelude.Read, Int -> GetEffectiveRecommendationPreferences -> ShowS
[GetEffectiveRecommendationPreferences] -> ShowS
GetEffectiveRecommendationPreferences -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetEffectiveRecommendationPreferences] -> ShowS
$cshowList :: [GetEffectiveRecommendationPreferences] -> ShowS
show :: GetEffectiveRecommendationPreferences -> String
$cshow :: GetEffectiveRecommendationPreferences -> String
showsPrec :: Int -> GetEffectiveRecommendationPreferences -> ShowS
$cshowsPrec :: Int -> GetEffectiveRecommendationPreferences -> ShowS
Prelude.Show, forall x.
Rep GetEffectiveRecommendationPreferences x
-> GetEffectiveRecommendationPreferences
forall x.
GetEffectiveRecommendationPreferences
-> Rep GetEffectiveRecommendationPreferences x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetEffectiveRecommendationPreferences x
-> GetEffectiveRecommendationPreferences
$cfrom :: forall x.
GetEffectiveRecommendationPreferences
-> Rep GetEffectiveRecommendationPreferences x
Prelude.Generic)

-- |
-- Create a value of 'GetEffectiveRecommendationPreferences' 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:
--
-- 'resourceArn', 'getEffectiveRecommendationPreferences_resourceArn' - The Amazon Resource Name (ARN) of the resource for which to confirm
-- effective recommendation preferences. Only EC2 instance and Auto Scaling
-- group ARNs are currently supported.
newGetEffectiveRecommendationPreferences ::
  -- | 'resourceArn'
  Prelude.Text ->
  GetEffectiveRecommendationPreferences
newGetEffectiveRecommendationPreferences :: Text -> GetEffectiveRecommendationPreferences
newGetEffectiveRecommendationPreferences
  Text
pResourceArn_ =
    GetEffectiveRecommendationPreferences'
      { $sel:resourceArn:GetEffectiveRecommendationPreferences' :: Text
resourceArn =
          Text
pResourceArn_
      }

-- | The Amazon Resource Name (ARN) of the resource for which to confirm
-- effective recommendation preferences. Only EC2 instance and Auto Scaling
-- group ARNs are currently supported.
getEffectiveRecommendationPreferences_resourceArn :: Lens.Lens' GetEffectiveRecommendationPreferences Prelude.Text
getEffectiveRecommendationPreferences_resourceArn :: Lens' GetEffectiveRecommendationPreferences Text
getEffectiveRecommendationPreferences_resourceArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetEffectiveRecommendationPreferences' {Text
resourceArn :: Text
$sel:resourceArn:GetEffectiveRecommendationPreferences' :: GetEffectiveRecommendationPreferences -> Text
resourceArn} -> Text
resourceArn) (\s :: GetEffectiveRecommendationPreferences
s@GetEffectiveRecommendationPreferences' {} Text
a -> GetEffectiveRecommendationPreferences
s {$sel:resourceArn:GetEffectiveRecommendationPreferences' :: Text
resourceArn = Text
a} :: GetEffectiveRecommendationPreferences)

instance
  Core.AWSRequest
    GetEffectiveRecommendationPreferences
  where
  type
    AWSResponse
      GetEffectiveRecommendationPreferences =
      GetEffectiveRecommendationPreferencesResponse
  request :: (Service -> Service)
-> GetEffectiveRecommendationPreferences
-> Request GetEffectiveRecommendationPreferences
request Service -> Service
overrides =
    forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy GetEffectiveRecommendationPreferences
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse
           (AWSResponse GetEffectiveRecommendationPreferences)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe EnhancedInfrastructureMetrics
-> Maybe ExternalMetricsPreference
-> Int
-> GetEffectiveRecommendationPreferencesResponse
GetEffectiveRecommendationPreferencesResponse'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"enhancedInfrastructureMetrics")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"externalMetricsPreference")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance
  Prelude.Hashable
    GetEffectiveRecommendationPreferences
  where
  hashWithSalt :: Int -> GetEffectiveRecommendationPreferences -> Int
hashWithSalt
    Int
_salt
    GetEffectiveRecommendationPreferences' {Text
resourceArn :: Text
$sel:resourceArn:GetEffectiveRecommendationPreferences' :: GetEffectiveRecommendationPreferences -> Text
..} =
      Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
resourceArn

instance
  Prelude.NFData
    GetEffectiveRecommendationPreferences
  where
  rnf :: GetEffectiveRecommendationPreferences -> ()
rnf GetEffectiveRecommendationPreferences' {Text
resourceArn :: Text
$sel:resourceArn:GetEffectiveRecommendationPreferences' :: GetEffectiveRecommendationPreferences -> Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Text
resourceArn

instance
  Data.ToHeaders
    GetEffectiveRecommendationPreferences
  where
  toHeaders :: GetEffectiveRecommendationPreferences -> ResponseHeaders
toHeaders =
    forall a b. a -> b -> a
Prelude.const
      ( forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"X-Amz-Target"
              forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"ComputeOptimizerService.GetEffectiveRecommendationPreferences" ::
                          Prelude.ByteString
                      ),
            HeaderName
"Content-Type"
              forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.0" ::
                          Prelude.ByteString
                      )
          ]
      )

instance
  Data.ToJSON
    GetEffectiveRecommendationPreferences
  where
  toJSON :: GetEffectiveRecommendationPreferences -> Value
toJSON GetEffectiveRecommendationPreferences' {Text
resourceArn :: Text
$sel:resourceArn:GetEffectiveRecommendationPreferences' :: GetEffectiveRecommendationPreferences -> Text
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [forall a. a -> Maybe a
Prelude.Just (Key
"resourceArn" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
resourceArn)]
      )

instance
  Data.ToPath
    GetEffectiveRecommendationPreferences
  where
  toPath :: GetEffectiveRecommendationPreferences -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"

instance
  Data.ToQuery
    GetEffectiveRecommendationPreferences
  where
  toQuery :: GetEffectiveRecommendationPreferences -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty

-- | /See:/ 'newGetEffectiveRecommendationPreferencesResponse' smart constructor.
data GetEffectiveRecommendationPreferencesResponse = GetEffectiveRecommendationPreferencesResponse'
  { -- | The status of the enhanced infrastructure metrics recommendation
    -- preference. Considers all applicable preferences that you might have set
    -- at the resource, account, and organization level.
    --
    -- A status of @Active@ confirms that the preference is applied in the
    -- latest recommendation refresh, and a status of @Inactive@ confirms that
    -- it\'s not yet applied to recommendations.
    --
    -- To validate whether the preference is applied to your last generated set
    -- of recommendations, review the @effectiveRecommendationPreferences@
    -- value in the response of the GetAutoScalingGroupRecommendations and
    -- GetEC2InstanceRecommendations actions.
    --
    -- For more information, see
    -- <https://docs.aws.amazon.com/compute-optimizer/latest/ug/enhanced-infrastructure-metrics.html Enhanced infrastructure metrics>
    -- in the /Compute Optimizer User Guide/.
    GetEffectiveRecommendationPreferencesResponse
-> Maybe EnhancedInfrastructureMetrics
enhancedInfrastructureMetrics :: Prelude.Maybe EnhancedInfrastructureMetrics,
    -- | The provider of the external metrics recommendation preference.
    -- Considers all applicable preferences that you might have set at the
    -- account and organization level.
    --
    -- If the preference is applied in the latest recommendation refresh, an
    -- object with a valid @source@ value appears in the response. If the
    -- preference isn\'t applied to the recommendations already, then this
    -- object doesn\'t appear in the response.
    --
    -- To validate whether the preference is applied to your last generated set
    -- of recommendations, review the @effectiveRecommendationPreferences@
    -- value in the response of the GetEC2InstanceRecommendations actions.
    --
    -- For more information, see
    -- <https://docs.aws.amazon.com/compute-optimizer/latest/ug/external-metrics-ingestion.html Enhanced infrastructure metrics>
    -- in the /Compute Optimizer User Guide/.
    GetEffectiveRecommendationPreferencesResponse
-> Maybe ExternalMetricsPreference
externalMetricsPreference :: Prelude.Maybe ExternalMetricsPreference,
    -- | The response's http status code.
    GetEffectiveRecommendationPreferencesResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (GetEffectiveRecommendationPreferencesResponse
-> GetEffectiveRecommendationPreferencesResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetEffectiveRecommendationPreferencesResponse
-> GetEffectiveRecommendationPreferencesResponse -> Bool
$c/= :: GetEffectiveRecommendationPreferencesResponse
-> GetEffectiveRecommendationPreferencesResponse -> Bool
== :: GetEffectiveRecommendationPreferencesResponse
-> GetEffectiveRecommendationPreferencesResponse -> Bool
$c== :: GetEffectiveRecommendationPreferencesResponse
-> GetEffectiveRecommendationPreferencesResponse -> Bool
Prelude.Eq, ReadPrec [GetEffectiveRecommendationPreferencesResponse]
ReadPrec GetEffectiveRecommendationPreferencesResponse
Int -> ReadS GetEffectiveRecommendationPreferencesResponse
ReadS [GetEffectiveRecommendationPreferencesResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetEffectiveRecommendationPreferencesResponse]
$creadListPrec :: ReadPrec [GetEffectiveRecommendationPreferencesResponse]
readPrec :: ReadPrec GetEffectiveRecommendationPreferencesResponse
$creadPrec :: ReadPrec GetEffectiveRecommendationPreferencesResponse
readList :: ReadS [GetEffectiveRecommendationPreferencesResponse]
$creadList :: ReadS [GetEffectiveRecommendationPreferencesResponse]
readsPrec :: Int -> ReadS GetEffectiveRecommendationPreferencesResponse
$creadsPrec :: Int -> ReadS GetEffectiveRecommendationPreferencesResponse
Prelude.Read, Int -> GetEffectiveRecommendationPreferencesResponse -> ShowS
[GetEffectiveRecommendationPreferencesResponse] -> ShowS
GetEffectiveRecommendationPreferencesResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetEffectiveRecommendationPreferencesResponse] -> ShowS
$cshowList :: [GetEffectiveRecommendationPreferencesResponse] -> ShowS
show :: GetEffectiveRecommendationPreferencesResponse -> String
$cshow :: GetEffectiveRecommendationPreferencesResponse -> String
showsPrec :: Int -> GetEffectiveRecommendationPreferencesResponse -> ShowS
$cshowsPrec :: Int -> GetEffectiveRecommendationPreferencesResponse -> ShowS
Prelude.Show, forall x.
Rep GetEffectiveRecommendationPreferencesResponse x
-> GetEffectiveRecommendationPreferencesResponse
forall x.
GetEffectiveRecommendationPreferencesResponse
-> Rep GetEffectiveRecommendationPreferencesResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetEffectiveRecommendationPreferencesResponse x
-> GetEffectiveRecommendationPreferencesResponse
$cfrom :: forall x.
GetEffectiveRecommendationPreferencesResponse
-> Rep GetEffectiveRecommendationPreferencesResponse x
Prelude.Generic)

-- |
-- Create a value of 'GetEffectiveRecommendationPreferencesResponse' 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:
--
-- 'enhancedInfrastructureMetrics', 'getEffectiveRecommendationPreferencesResponse_enhancedInfrastructureMetrics' - The status of the enhanced infrastructure metrics recommendation
-- preference. Considers all applicable preferences that you might have set
-- at the resource, account, and organization level.
--
-- A status of @Active@ confirms that the preference is applied in the
-- latest recommendation refresh, and a status of @Inactive@ confirms that
-- it\'s not yet applied to recommendations.
--
-- To validate whether the preference is applied to your last generated set
-- of recommendations, review the @effectiveRecommendationPreferences@
-- value in the response of the GetAutoScalingGroupRecommendations and
-- GetEC2InstanceRecommendations actions.
--
-- For more information, see
-- <https://docs.aws.amazon.com/compute-optimizer/latest/ug/enhanced-infrastructure-metrics.html Enhanced infrastructure metrics>
-- in the /Compute Optimizer User Guide/.
--
-- 'externalMetricsPreference', 'getEffectiveRecommendationPreferencesResponse_externalMetricsPreference' - The provider of the external metrics recommendation preference.
-- Considers all applicable preferences that you might have set at the
-- account and organization level.
--
-- If the preference is applied in the latest recommendation refresh, an
-- object with a valid @source@ value appears in the response. If the
-- preference isn\'t applied to the recommendations already, then this
-- object doesn\'t appear in the response.
--
-- To validate whether the preference is applied to your last generated set
-- of recommendations, review the @effectiveRecommendationPreferences@
-- value in the response of the GetEC2InstanceRecommendations actions.
--
-- For more information, see
-- <https://docs.aws.amazon.com/compute-optimizer/latest/ug/external-metrics-ingestion.html Enhanced infrastructure metrics>
-- in the /Compute Optimizer User Guide/.
--
-- 'httpStatus', 'getEffectiveRecommendationPreferencesResponse_httpStatus' - The response's http status code.
newGetEffectiveRecommendationPreferencesResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  GetEffectiveRecommendationPreferencesResponse
newGetEffectiveRecommendationPreferencesResponse :: Int -> GetEffectiveRecommendationPreferencesResponse
newGetEffectiveRecommendationPreferencesResponse
  Int
pHttpStatus_ =
    GetEffectiveRecommendationPreferencesResponse'
      { $sel:enhancedInfrastructureMetrics:GetEffectiveRecommendationPreferencesResponse' :: Maybe EnhancedInfrastructureMetrics
enhancedInfrastructureMetrics =
          forall a. Maybe a
Prelude.Nothing,
        $sel:externalMetricsPreference:GetEffectiveRecommendationPreferencesResponse' :: Maybe ExternalMetricsPreference
externalMetricsPreference =
          forall a. Maybe a
Prelude.Nothing,
        $sel:httpStatus:GetEffectiveRecommendationPreferencesResponse' :: Int
httpStatus = Int
pHttpStatus_
      }

-- | The status of the enhanced infrastructure metrics recommendation
-- preference. Considers all applicable preferences that you might have set
-- at the resource, account, and organization level.
--
-- A status of @Active@ confirms that the preference is applied in the
-- latest recommendation refresh, and a status of @Inactive@ confirms that
-- it\'s not yet applied to recommendations.
--
-- To validate whether the preference is applied to your last generated set
-- of recommendations, review the @effectiveRecommendationPreferences@
-- value in the response of the GetAutoScalingGroupRecommendations and
-- GetEC2InstanceRecommendations actions.
--
-- For more information, see
-- <https://docs.aws.amazon.com/compute-optimizer/latest/ug/enhanced-infrastructure-metrics.html Enhanced infrastructure metrics>
-- in the /Compute Optimizer User Guide/.
getEffectiveRecommendationPreferencesResponse_enhancedInfrastructureMetrics :: Lens.Lens' GetEffectiveRecommendationPreferencesResponse (Prelude.Maybe EnhancedInfrastructureMetrics)
getEffectiveRecommendationPreferencesResponse_enhancedInfrastructureMetrics :: Lens'
  GetEffectiveRecommendationPreferencesResponse
  (Maybe EnhancedInfrastructureMetrics)
getEffectiveRecommendationPreferencesResponse_enhancedInfrastructureMetrics = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetEffectiveRecommendationPreferencesResponse' {Maybe EnhancedInfrastructureMetrics
enhancedInfrastructureMetrics :: Maybe EnhancedInfrastructureMetrics
$sel:enhancedInfrastructureMetrics:GetEffectiveRecommendationPreferencesResponse' :: GetEffectiveRecommendationPreferencesResponse
-> Maybe EnhancedInfrastructureMetrics
enhancedInfrastructureMetrics} -> Maybe EnhancedInfrastructureMetrics
enhancedInfrastructureMetrics) (\s :: GetEffectiveRecommendationPreferencesResponse
s@GetEffectiveRecommendationPreferencesResponse' {} Maybe EnhancedInfrastructureMetrics
a -> GetEffectiveRecommendationPreferencesResponse
s {$sel:enhancedInfrastructureMetrics:GetEffectiveRecommendationPreferencesResponse' :: Maybe EnhancedInfrastructureMetrics
enhancedInfrastructureMetrics = Maybe EnhancedInfrastructureMetrics
a} :: GetEffectiveRecommendationPreferencesResponse)

-- | The provider of the external metrics recommendation preference.
-- Considers all applicable preferences that you might have set at the
-- account and organization level.
--
-- If the preference is applied in the latest recommendation refresh, an
-- object with a valid @source@ value appears in the response. If the
-- preference isn\'t applied to the recommendations already, then this
-- object doesn\'t appear in the response.
--
-- To validate whether the preference is applied to your last generated set
-- of recommendations, review the @effectiveRecommendationPreferences@
-- value in the response of the GetEC2InstanceRecommendations actions.
--
-- For more information, see
-- <https://docs.aws.amazon.com/compute-optimizer/latest/ug/external-metrics-ingestion.html Enhanced infrastructure metrics>
-- in the /Compute Optimizer User Guide/.
getEffectiveRecommendationPreferencesResponse_externalMetricsPreference :: Lens.Lens' GetEffectiveRecommendationPreferencesResponse (Prelude.Maybe ExternalMetricsPreference)
getEffectiveRecommendationPreferencesResponse_externalMetricsPreference :: Lens'
  GetEffectiveRecommendationPreferencesResponse
  (Maybe ExternalMetricsPreference)
getEffectiveRecommendationPreferencesResponse_externalMetricsPreference = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetEffectiveRecommendationPreferencesResponse' {Maybe ExternalMetricsPreference
externalMetricsPreference :: Maybe ExternalMetricsPreference
$sel:externalMetricsPreference:GetEffectiveRecommendationPreferencesResponse' :: GetEffectiveRecommendationPreferencesResponse
-> Maybe ExternalMetricsPreference
externalMetricsPreference} -> Maybe ExternalMetricsPreference
externalMetricsPreference) (\s :: GetEffectiveRecommendationPreferencesResponse
s@GetEffectiveRecommendationPreferencesResponse' {} Maybe ExternalMetricsPreference
a -> GetEffectiveRecommendationPreferencesResponse
s {$sel:externalMetricsPreference:GetEffectiveRecommendationPreferencesResponse' :: Maybe ExternalMetricsPreference
externalMetricsPreference = Maybe ExternalMetricsPreference
a} :: GetEffectiveRecommendationPreferencesResponse)

-- | The response's http status code.
getEffectiveRecommendationPreferencesResponse_httpStatus :: Lens.Lens' GetEffectiveRecommendationPreferencesResponse Prelude.Int
getEffectiveRecommendationPreferencesResponse_httpStatus :: Lens' GetEffectiveRecommendationPreferencesResponse Int
getEffectiveRecommendationPreferencesResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetEffectiveRecommendationPreferencesResponse' {Int
httpStatus :: Int
$sel:httpStatus:GetEffectiveRecommendationPreferencesResponse' :: GetEffectiveRecommendationPreferencesResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: GetEffectiveRecommendationPreferencesResponse
s@GetEffectiveRecommendationPreferencesResponse' {} Int
a -> GetEffectiveRecommendationPreferencesResponse
s {$sel:httpStatus:GetEffectiveRecommendationPreferencesResponse' :: Int
httpStatus = Int
a} :: GetEffectiveRecommendationPreferencesResponse)

instance
  Prelude.NFData
    GetEffectiveRecommendationPreferencesResponse
  where
  rnf :: GetEffectiveRecommendationPreferencesResponse -> ()
rnf
    GetEffectiveRecommendationPreferencesResponse' {Int
Maybe EnhancedInfrastructureMetrics
Maybe ExternalMetricsPreference
httpStatus :: Int
externalMetricsPreference :: Maybe ExternalMetricsPreference
enhancedInfrastructureMetrics :: Maybe EnhancedInfrastructureMetrics
$sel:httpStatus:GetEffectiveRecommendationPreferencesResponse' :: GetEffectiveRecommendationPreferencesResponse -> Int
$sel:externalMetricsPreference:GetEffectiveRecommendationPreferencesResponse' :: GetEffectiveRecommendationPreferencesResponse
-> Maybe ExternalMetricsPreference
$sel:enhancedInfrastructureMetrics:GetEffectiveRecommendationPreferencesResponse' :: GetEffectiveRecommendationPreferencesResponse
-> Maybe EnhancedInfrastructureMetrics
..} =
      forall a. NFData a => a -> ()
Prelude.rnf Maybe EnhancedInfrastructureMetrics
enhancedInfrastructureMetrics
        seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ExternalMetricsPreference
externalMetricsPreference
        seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus