{-# 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.GetAutoScalingGroupRecommendations
-- 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)
--
-- Returns Auto Scaling group recommendations.
--
-- Compute Optimizer generates recommendations for Amazon EC2 Auto Scaling
-- groups that meet a specific set of requirements. 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/.
module Amazonka.ComputeOptimizer.GetAutoScalingGroupRecommendations
  ( -- * Creating a Request
    GetAutoScalingGroupRecommendations (..),
    newGetAutoScalingGroupRecommendations,

    -- * Request Lenses
    getAutoScalingGroupRecommendations_accountIds,
    getAutoScalingGroupRecommendations_filters,
    getAutoScalingGroupRecommendations_autoScalingGroupArns,
    getAutoScalingGroupRecommendations_recommendationPreferences,
    getAutoScalingGroupRecommendations_nextToken,
    getAutoScalingGroupRecommendations_maxResults,

    -- * Destructuring the Response
    GetAutoScalingGroupRecommendationsResponse (..),
    newGetAutoScalingGroupRecommendationsResponse,

    -- * Response Lenses
    getAutoScalingGroupRecommendationsResponse_autoScalingGroupRecommendations,
    getAutoScalingGroupRecommendationsResponse_nextToken,
    getAutoScalingGroupRecommendationsResponse_errors,
    getAutoScalingGroupRecommendationsResponse_httpStatus,
  )
where

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

-- | /See:/ 'newGetAutoScalingGroupRecommendations' smart constructor.
data GetAutoScalingGroupRecommendations = GetAutoScalingGroupRecommendations'
  { -- | The ID of the Amazon Web Services account for which to return Auto
    -- Scaling group recommendations.
    --
    -- If your account is the management account of an organization, use this
    -- parameter to specify the member account for which you want to return
    -- Auto Scaling group recommendations.
    --
    -- Only one account ID can be specified per request.
    GetAutoScalingGroupRecommendations -> Maybe [Text]
accountIds :: Prelude.Maybe [Prelude.Text],
    -- | An array of objects to specify a filter that returns a more specific
    -- list of Auto Scaling group recommendations.
    GetAutoScalingGroupRecommendations -> Maybe [Filter]
filters :: Prelude.Maybe [Filter],
    -- | The Amazon Resource Name (ARN) of the Auto Scaling groups for which to
    -- return recommendations.
    GetAutoScalingGroupRecommendations -> Maybe [Text]
autoScalingGroupArns :: Prelude.Maybe [Prelude.Text],
    -- | An object to specify the preferences for the Auto Scaling group
    -- recommendations to return in the response.
    GetAutoScalingGroupRecommendations
-> Maybe RecommendationPreferences
recommendationPreferences :: Prelude.Maybe RecommendationPreferences,
    -- | The token to advance to the next page of Auto Scaling group
    -- recommendations.
    GetAutoScalingGroupRecommendations -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The maximum number of Auto Scaling group recommendations to return with
    -- a single request.
    --
    -- To retrieve the remaining results, make another request with the
    -- returned @nextToken@ value.
    GetAutoScalingGroupRecommendations -> Maybe Int
maxResults :: Prelude.Maybe Prelude.Int
  }
  deriving (GetAutoScalingGroupRecommendations
-> GetAutoScalingGroupRecommendations -> Bool
(GetAutoScalingGroupRecommendations
 -> GetAutoScalingGroupRecommendations -> Bool)
-> (GetAutoScalingGroupRecommendations
    -> GetAutoScalingGroupRecommendations -> Bool)
-> Eq GetAutoScalingGroupRecommendations
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetAutoScalingGroupRecommendations
-> GetAutoScalingGroupRecommendations -> Bool
$c/= :: GetAutoScalingGroupRecommendations
-> GetAutoScalingGroupRecommendations -> Bool
== :: GetAutoScalingGroupRecommendations
-> GetAutoScalingGroupRecommendations -> Bool
$c== :: GetAutoScalingGroupRecommendations
-> GetAutoScalingGroupRecommendations -> Bool
Prelude.Eq, ReadPrec [GetAutoScalingGroupRecommendations]
ReadPrec GetAutoScalingGroupRecommendations
Int -> ReadS GetAutoScalingGroupRecommendations
ReadS [GetAutoScalingGroupRecommendations]
(Int -> ReadS GetAutoScalingGroupRecommendations)
-> ReadS [GetAutoScalingGroupRecommendations]
-> ReadPrec GetAutoScalingGroupRecommendations
-> ReadPrec [GetAutoScalingGroupRecommendations]
-> Read GetAutoScalingGroupRecommendations
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetAutoScalingGroupRecommendations]
$creadListPrec :: ReadPrec [GetAutoScalingGroupRecommendations]
readPrec :: ReadPrec GetAutoScalingGroupRecommendations
$creadPrec :: ReadPrec GetAutoScalingGroupRecommendations
readList :: ReadS [GetAutoScalingGroupRecommendations]
$creadList :: ReadS [GetAutoScalingGroupRecommendations]
readsPrec :: Int -> ReadS GetAutoScalingGroupRecommendations
$creadsPrec :: Int -> ReadS GetAutoScalingGroupRecommendations
Prelude.Read, Int -> GetAutoScalingGroupRecommendations -> ShowS
[GetAutoScalingGroupRecommendations] -> ShowS
GetAutoScalingGroupRecommendations -> String
(Int -> GetAutoScalingGroupRecommendations -> ShowS)
-> (GetAutoScalingGroupRecommendations -> String)
-> ([GetAutoScalingGroupRecommendations] -> ShowS)
-> Show GetAutoScalingGroupRecommendations
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetAutoScalingGroupRecommendations] -> ShowS
$cshowList :: [GetAutoScalingGroupRecommendations] -> ShowS
show :: GetAutoScalingGroupRecommendations -> String
$cshow :: GetAutoScalingGroupRecommendations -> String
showsPrec :: Int -> GetAutoScalingGroupRecommendations -> ShowS
$cshowsPrec :: Int -> GetAutoScalingGroupRecommendations -> ShowS
Prelude.Show, (forall x.
 GetAutoScalingGroupRecommendations
 -> Rep GetAutoScalingGroupRecommendations x)
-> (forall x.
    Rep GetAutoScalingGroupRecommendations x
    -> GetAutoScalingGroupRecommendations)
-> Generic GetAutoScalingGroupRecommendations
forall x.
Rep GetAutoScalingGroupRecommendations x
-> GetAutoScalingGroupRecommendations
forall x.
GetAutoScalingGroupRecommendations
-> Rep GetAutoScalingGroupRecommendations x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetAutoScalingGroupRecommendations x
-> GetAutoScalingGroupRecommendations
$cfrom :: forall x.
GetAutoScalingGroupRecommendations
-> Rep GetAutoScalingGroupRecommendations x
Prelude.Generic)

-- |
-- Create a value of 'GetAutoScalingGroupRecommendations' 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:
--
-- 'accountIds', 'getAutoScalingGroupRecommendations_accountIds' - The ID of the Amazon Web Services account for which to return Auto
-- Scaling group recommendations.
--
-- If your account is the management account of an organization, use this
-- parameter to specify the member account for which you want to return
-- Auto Scaling group recommendations.
--
-- Only one account ID can be specified per request.
--
-- 'filters', 'getAutoScalingGroupRecommendations_filters' - An array of objects to specify a filter that returns a more specific
-- list of Auto Scaling group recommendations.
--
-- 'autoScalingGroupArns', 'getAutoScalingGroupRecommendations_autoScalingGroupArns' - The Amazon Resource Name (ARN) of the Auto Scaling groups for which to
-- return recommendations.
--
-- 'recommendationPreferences', 'getAutoScalingGroupRecommendations_recommendationPreferences' - An object to specify the preferences for the Auto Scaling group
-- recommendations to return in the response.
--
-- 'nextToken', 'getAutoScalingGroupRecommendations_nextToken' - The token to advance to the next page of Auto Scaling group
-- recommendations.
--
-- 'maxResults', 'getAutoScalingGroupRecommendations_maxResults' - The maximum number of Auto Scaling group recommendations to return with
-- a single request.
--
-- To retrieve the remaining results, make another request with the
-- returned @nextToken@ value.
newGetAutoScalingGroupRecommendations ::
  GetAutoScalingGroupRecommendations
newGetAutoScalingGroupRecommendations :: GetAutoScalingGroupRecommendations
newGetAutoScalingGroupRecommendations =
  GetAutoScalingGroupRecommendations' :: Maybe [Text]
-> Maybe [Filter]
-> Maybe [Text]
-> Maybe RecommendationPreferences
-> Maybe Text
-> Maybe Int
-> GetAutoScalingGroupRecommendations
GetAutoScalingGroupRecommendations'
    { $sel:accountIds:GetAutoScalingGroupRecommendations' :: Maybe [Text]
accountIds =
        Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:filters:GetAutoScalingGroupRecommendations' :: Maybe [Filter]
filters = Maybe [Filter]
forall a. Maybe a
Prelude.Nothing,
      $sel:autoScalingGroupArns:GetAutoScalingGroupRecommendations' :: Maybe [Text]
autoScalingGroupArns = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:recommendationPreferences:GetAutoScalingGroupRecommendations' :: Maybe RecommendationPreferences
recommendationPreferences =
        Maybe RecommendationPreferences
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:GetAutoScalingGroupRecommendations' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:GetAutoScalingGroupRecommendations' :: Maybe Int
maxResults = Maybe Int
forall a. Maybe a
Prelude.Nothing
    }

-- | The ID of the Amazon Web Services account for which to return Auto
-- Scaling group recommendations.
--
-- If your account is the management account of an organization, use this
-- parameter to specify the member account for which you want to return
-- Auto Scaling group recommendations.
--
-- Only one account ID can be specified per request.
getAutoScalingGroupRecommendations_accountIds :: Lens.Lens' GetAutoScalingGroupRecommendations (Prelude.Maybe [Prelude.Text])
getAutoScalingGroupRecommendations_accountIds :: (Maybe [Text] -> f (Maybe [Text]))
-> GetAutoScalingGroupRecommendations
-> f GetAutoScalingGroupRecommendations
getAutoScalingGroupRecommendations_accountIds = (GetAutoScalingGroupRecommendations -> Maybe [Text])
-> (GetAutoScalingGroupRecommendations
    -> Maybe [Text] -> GetAutoScalingGroupRecommendations)
-> Lens
     GetAutoScalingGroupRecommendations
     GetAutoScalingGroupRecommendations
     (Maybe [Text])
     (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetAutoScalingGroupRecommendations' {Maybe [Text]
accountIds :: Maybe [Text]
$sel:accountIds:GetAutoScalingGroupRecommendations' :: GetAutoScalingGroupRecommendations -> Maybe [Text]
accountIds} -> Maybe [Text]
accountIds) (\s :: GetAutoScalingGroupRecommendations
s@GetAutoScalingGroupRecommendations' {} Maybe [Text]
a -> GetAutoScalingGroupRecommendations
s {$sel:accountIds:GetAutoScalingGroupRecommendations' :: Maybe [Text]
accountIds = Maybe [Text]
a} :: GetAutoScalingGroupRecommendations) ((Maybe [Text] -> f (Maybe [Text]))
 -> GetAutoScalingGroupRecommendations
 -> f GetAutoScalingGroupRecommendations)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> GetAutoScalingGroupRecommendations
-> f GetAutoScalingGroupRecommendations
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [Text])
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 [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | An array of objects to specify a filter that returns a more specific
-- list of Auto Scaling group recommendations.
getAutoScalingGroupRecommendations_filters :: Lens.Lens' GetAutoScalingGroupRecommendations (Prelude.Maybe [Filter])
getAutoScalingGroupRecommendations_filters :: (Maybe [Filter] -> f (Maybe [Filter]))
-> GetAutoScalingGroupRecommendations
-> f GetAutoScalingGroupRecommendations
getAutoScalingGroupRecommendations_filters = (GetAutoScalingGroupRecommendations -> Maybe [Filter])
-> (GetAutoScalingGroupRecommendations
    -> Maybe [Filter] -> GetAutoScalingGroupRecommendations)
-> Lens
     GetAutoScalingGroupRecommendations
     GetAutoScalingGroupRecommendations
     (Maybe [Filter])
     (Maybe [Filter])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetAutoScalingGroupRecommendations' {Maybe [Filter]
filters :: Maybe [Filter]
$sel:filters:GetAutoScalingGroupRecommendations' :: GetAutoScalingGroupRecommendations -> Maybe [Filter]
filters} -> Maybe [Filter]
filters) (\s :: GetAutoScalingGroupRecommendations
s@GetAutoScalingGroupRecommendations' {} Maybe [Filter]
a -> GetAutoScalingGroupRecommendations
s {$sel:filters:GetAutoScalingGroupRecommendations' :: Maybe [Filter]
filters = Maybe [Filter]
a} :: GetAutoScalingGroupRecommendations) ((Maybe [Filter] -> f (Maybe [Filter]))
 -> GetAutoScalingGroupRecommendations
 -> f GetAutoScalingGroupRecommendations)
-> ((Maybe [Filter] -> f (Maybe [Filter]))
    -> Maybe [Filter] -> f (Maybe [Filter]))
-> (Maybe [Filter] -> f (Maybe [Filter]))
-> GetAutoScalingGroupRecommendations
-> f GetAutoScalingGroupRecommendations
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Filter] [Filter] [Filter] [Filter]
-> Iso
     (Maybe [Filter]) (Maybe [Filter]) (Maybe [Filter]) (Maybe [Filter])
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 [Filter] [Filter] [Filter] [Filter]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The Amazon Resource Name (ARN) of the Auto Scaling groups for which to
-- return recommendations.
getAutoScalingGroupRecommendations_autoScalingGroupArns :: Lens.Lens' GetAutoScalingGroupRecommendations (Prelude.Maybe [Prelude.Text])
getAutoScalingGroupRecommendations_autoScalingGroupArns :: (Maybe [Text] -> f (Maybe [Text]))
-> GetAutoScalingGroupRecommendations
-> f GetAutoScalingGroupRecommendations
getAutoScalingGroupRecommendations_autoScalingGroupArns = (GetAutoScalingGroupRecommendations -> Maybe [Text])
-> (GetAutoScalingGroupRecommendations
    -> Maybe [Text] -> GetAutoScalingGroupRecommendations)
-> Lens
     GetAutoScalingGroupRecommendations
     GetAutoScalingGroupRecommendations
     (Maybe [Text])
     (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetAutoScalingGroupRecommendations' {Maybe [Text]
autoScalingGroupArns :: Maybe [Text]
$sel:autoScalingGroupArns:GetAutoScalingGroupRecommendations' :: GetAutoScalingGroupRecommendations -> Maybe [Text]
autoScalingGroupArns} -> Maybe [Text]
autoScalingGroupArns) (\s :: GetAutoScalingGroupRecommendations
s@GetAutoScalingGroupRecommendations' {} Maybe [Text]
a -> GetAutoScalingGroupRecommendations
s {$sel:autoScalingGroupArns:GetAutoScalingGroupRecommendations' :: Maybe [Text]
autoScalingGroupArns = Maybe [Text]
a} :: GetAutoScalingGroupRecommendations) ((Maybe [Text] -> f (Maybe [Text]))
 -> GetAutoScalingGroupRecommendations
 -> f GetAutoScalingGroupRecommendations)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> GetAutoScalingGroupRecommendations
-> f GetAutoScalingGroupRecommendations
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [Text])
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 [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | An object to specify the preferences for the Auto Scaling group
-- recommendations to return in the response.
getAutoScalingGroupRecommendations_recommendationPreferences :: Lens.Lens' GetAutoScalingGroupRecommendations (Prelude.Maybe RecommendationPreferences)
getAutoScalingGroupRecommendations_recommendationPreferences :: (Maybe RecommendationPreferences
 -> f (Maybe RecommendationPreferences))
-> GetAutoScalingGroupRecommendations
-> f GetAutoScalingGroupRecommendations
getAutoScalingGroupRecommendations_recommendationPreferences = (GetAutoScalingGroupRecommendations
 -> Maybe RecommendationPreferences)
-> (GetAutoScalingGroupRecommendations
    -> Maybe RecommendationPreferences
    -> GetAutoScalingGroupRecommendations)
-> Lens
     GetAutoScalingGroupRecommendations
     GetAutoScalingGroupRecommendations
     (Maybe RecommendationPreferences)
     (Maybe RecommendationPreferences)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetAutoScalingGroupRecommendations' {Maybe RecommendationPreferences
recommendationPreferences :: Maybe RecommendationPreferences
$sel:recommendationPreferences:GetAutoScalingGroupRecommendations' :: GetAutoScalingGroupRecommendations
-> Maybe RecommendationPreferences
recommendationPreferences} -> Maybe RecommendationPreferences
recommendationPreferences) (\s :: GetAutoScalingGroupRecommendations
s@GetAutoScalingGroupRecommendations' {} Maybe RecommendationPreferences
a -> GetAutoScalingGroupRecommendations
s {$sel:recommendationPreferences:GetAutoScalingGroupRecommendations' :: Maybe RecommendationPreferences
recommendationPreferences = Maybe RecommendationPreferences
a} :: GetAutoScalingGroupRecommendations)

-- | The token to advance to the next page of Auto Scaling group
-- recommendations.
getAutoScalingGroupRecommendations_nextToken :: Lens.Lens' GetAutoScalingGroupRecommendations (Prelude.Maybe Prelude.Text)
getAutoScalingGroupRecommendations_nextToken :: (Maybe Text -> f (Maybe Text))
-> GetAutoScalingGroupRecommendations
-> f GetAutoScalingGroupRecommendations
getAutoScalingGroupRecommendations_nextToken = (GetAutoScalingGroupRecommendations -> Maybe Text)
-> (GetAutoScalingGroupRecommendations
    -> Maybe Text -> GetAutoScalingGroupRecommendations)
-> Lens
     GetAutoScalingGroupRecommendations
     GetAutoScalingGroupRecommendations
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetAutoScalingGroupRecommendations' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:GetAutoScalingGroupRecommendations' :: GetAutoScalingGroupRecommendations -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: GetAutoScalingGroupRecommendations
s@GetAutoScalingGroupRecommendations' {} Maybe Text
a -> GetAutoScalingGroupRecommendations
s {$sel:nextToken:GetAutoScalingGroupRecommendations' :: Maybe Text
nextToken = Maybe Text
a} :: GetAutoScalingGroupRecommendations)

-- | The maximum number of Auto Scaling group recommendations to return with
-- a single request.
--
-- To retrieve the remaining results, make another request with the
-- returned @nextToken@ value.
getAutoScalingGroupRecommendations_maxResults :: Lens.Lens' GetAutoScalingGroupRecommendations (Prelude.Maybe Prelude.Int)
getAutoScalingGroupRecommendations_maxResults :: (Maybe Int -> f (Maybe Int))
-> GetAutoScalingGroupRecommendations
-> f GetAutoScalingGroupRecommendations
getAutoScalingGroupRecommendations_maxResults = (GetAutoScalingGroupRecommendations -> Maybe Int)
-> (GetAutoScalingGroupRecommendations
    -> Maybe Int -> GetAutoScalingGroupRecommendations)
-> Lens
     GetAutoScalingGroupRecommendations
     GetAutoScalingGroupRecommendations
     (Maybe Int)
     (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetAutoScalingGroupRecommendations' {Maybe Int
maxResults :: Maybe Int
$sel:maxResults:GetAutoScalingGroupRecommendations' :: GetAutoScalingGroupRecommendations -> Maybe Int
maxResults} -> Maybe Int
maxResults) (\s :: GetAutoScalingGroupRecommendations
s@GetAutoScalingGroupRecommendations' {} Maybe Int
a -> GetAutoScalingGroupRecommendations
s {$sel:maxResults:GetAutoScalingGroupRecommendations' :: Maybe Int
maxResults = Maybe Int
a} :: GetAutoScalingGroupRecommendations)

instance
  Core.AWSRequest
    GetAutoScalingGroupRecommendations
  where
  type
    AWSResponse GetAutoScalingGroupRecommendations =
      GetAutoScalingGroupRecommendationsResponse
  request :: GetAutoScalingGroupRecommendations
-> Request GetAutoScalingGroupRecommendations
request = Service
-> GetAutoScalingGroupRecommendations
-> Request GetAutoScalingGroupRecommendations
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy GetAutoScalingGroupRecommendations
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse (AWSResponse GetAutoScalingGroupRecommendations)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse GetAutoScalingGroupRecommendations))
-> Logger
-> Service
-> Proxy GetAutoScalingGroupRecommendations
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse (AWSResponse GetAutoScalingGroupRecommendations)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe [AutoScalingGroupRecommendation]
-> Maybe Text
-> Maybe [GetRecommendationError]
-> Int
-> GetAutoScalingGroupRecommendationsResponse
GetAutoScalingGroupRecommendationsResponse'
            (Maybe [AutoScalingGroupRecommendation]
 -> Maybe Text
 -> Maybe [GetRecommendationError]
 -> Int
 -> GetAutoScalingGroupRecommendationsResponse)
-> Either String (Maybe [AutoScalingGroupRecommendation])
-> Either
     String
     (Maybe Text
      -> Maybe [GetRecommendationError]
      -> Int
      -> GetAutoScalingGroupRecommendationsResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ( Object
x Object
-> Text
-> Either String (Maybe (Maybe [AutoScalingGroupRecommendation]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"autoScalingGroupRecommendations"
                            Either String (Maybe (Maybe [AutoScalingGroupRecommendation]))
-> Maybe [AutoScalingGroupRecommendation]
-> Either String (Maybe [AutoScalingGroupRecommendation])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [AutoScalingGroupRecommendation]
forall a. Monoid a => a
Prelude.mempty
                        )
              Either
  String
  (Maybe Text
   -> Maybe [GetRecommendationError]
   -> Int
   -> GetAutoScalingGroupRecommendationsResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe [GetRecommendationError]
      -> Int -> GetAutoScalingGroupRecommendationsResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"nextToken")
              Either
  String
  (Maybe [GetRecommendationError]
   -> Int -> GetAutoScalingGroupRecommendationsResponse)
-> Either String (Maybe [GetRecommendationError])
-> Either
     String (Int -> GetAutoScalingGroupRecommendationsResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object
-> Text -> Either String (Maybe (Maybe [GetRecommendationError]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"errors" Either String (Maybe (Maybe [GetRecommendationError]))
-> Maybe [GetRecommendationError]
-> Either String (Maybe [GetRecommendationError])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [GetRecommendationError]
forall a. Monoid a => a
Prelude.mempty)
              Either String (Int -> GetAutoScalingGroupRecommendationsResponse)
-> Either String Int
-> Either String GetAutoScalingGroupRecommendationsResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance
  Prelude.Hashable
    GetAutoScalingGroupRecommendations

instance
  Prelude.NFData
    GetAutoScalingGroupRecommendations

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

instance
  Core.ToJSON
    GetAutoScalingGroupRecommendations
  where
  toJSON :: GetAutoScalingGroupRecommendations -> Value
toJSON GetAutoScalingGroupRecommendations' {Maybe Int
Maybe [Text]
Maybe [Filter]
Maybe Text
Maybe RecommendationPreferences
maxResults :: Maybe Int
nextToken :: Maybe Text
recommendationPreferences :: Maybe RecommendationPreferences
autoScalingGroupArns :: Maybe [Text]
filters :: Maybe [Filter]
accountIds :: Maybe [Text]
$sel:maxResults:GetAutoScalingGroupRecommendations' :: GetAutoScalingGroupRecommendations -> Maybe Int
$sel:nextToken:GetAutoScalingGroupRecommendations' :: GetAutoScalingGroupRecommendations -> Maybe Text
$sel:recommendationPreferences:GetAutoScalingGroupRecommendations' :: GetAutoScalingGroupRecommendations
-> Maybe RecommendationPreferences
$sel:autoScalingGroupArns:GetAutoScalingGroupRecommendations' :: GetAutoScalingGroupRecommendations -> Maybe [Text]
$sel:filters:GetAutoScalingGroupRecommendations' :: GetAutoScalingGroupRecommendations -> Maybe [Filter]
$sel:accountIds:GetAutoScalingGroupRecommendations' :: GetAutoScalingGroupRecommendations -> Maybe [Text]
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"accountIds" Text -> [Text] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) ([Text] -> Pair) -> Maybe [Text] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Text]
accountIds,
            (Text
"filters" Text -> [Filter] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) ([Filter] -> Pair) -> Maybe [Filter] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Filter]
filters,
            (Text
"autoScalingGroupArns" Text -> [Text] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              ([Text] -> Pair) -> Maybe [Text] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Text]
autoScalingGroupArns,
            (Text
"recommendationPreferences" Text -> RecommendationPreferences -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (RecommendationPreferences -> Pair)
-> Maybe RecommendationPreferences -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe RecommendationPreferences
recommendationPreferences,
            (Text
"nextToken" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
nextToken,
            (Text
"maxResults" Text -> Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Int -> Pair) -> Maybe Int -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Int
maxResults
          ]
      )

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

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

-- | /See:/ 'newGetAutoScalingGroupRecommendationsResponse' smart constructor.
data GetAutoScalingGroupRecommendationsResponse = GetAutoScalingGroupRecommendationsResponse'
  { -- | An array of objects that describe Auto Scaling group recommendations.
    GetAutoScalingGroupRecommendationsResponse
-> Maybe [AutoScalingGroupRecommendation]
autoScalingGroupRecommendations :: Prelude.Maybe [AutoScalingGroupRecommendation],
    -- | The token to use to advance to the next page of Auto Scaling group
    -- recommendations.
    --
    -- This value is null when there are no more pages of Auto Scaling group
    -- recommendations to return.
    GetAutoScalingGroupRecommendationsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | An array of objects that describe errors of the request.
    --
    -- For example, an error is returned if you request recommendations for an
    -- unsupported Auto Scaling group.
    GetAutoScalingGroupRecommendationsResponse
-> Maybe [GetRecommendationError]
errors :: Prelude.Maybe [GetRecommendationError],
    -- | The response's http status code.
    GetAutoScalingGroupRecommendationsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (GetAutoScalingGroupRecommendationsResponse
-> GetAutoScalingGroupRecommendationsResponse -> Bool
(GetAutoScalingGroupRecommendationsResponse
 -> GetAutoScalingGroupRecommendationsResponse -> Bool)
-> (GetAutoScalingGroupRecommendationsResponse
    -> GetAutoScalingGroupRecommendationsResponse -> Bool)
-> Eq GetAutoScalingGroupRecommendationsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetAutoScalingGroupRecommendationsResponse
-> GetAutoScalingGroupRecommendationsResponse -> Bool
$c/= :: GetAutoScalingGroupRecommendationsResponse
-> GetAutoScalingGroupRecommendationsResponse -> Bool
== :: GetAutoScalingGroupRecommendationsResponse
-> GetAutoScalingGroupRecommendationsResponse -> Bool
$c== :: GetAutoScalingGroupRecommendationsResponse
-> GetAutoScalingGroupRecommendationsResponse -> Bool
Prelude.Eq, ReadPrec [GetAutoScalingGroupRecommendationsResponse]
ReadPrec GetAutoScalingGroupRecommendationsResponse
Int -> ReadS GetAutoScalingGroupRecommendationsResponse
ReadS [GetAutoScalingGroupRecommendationsResponse]
(Int -> ReadS GetAutoScalingGroupRecommendationsResponse)
-> ReadS [GetAutoScalingGroupRecommendationsResponse]
-> ReadPrec GetAutoScalingGroupRecommendationsResponse
-> ReadPrec [GetAutoScalingGroupRecommendationsResponse]
-> Read GetAutoScalingGroupRecommendationsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetAutoScalingGroupRecommendationsResponse]
$creadListPrec :: ReadPrec [GetAutoScalingGroupRecommendationsResponse]
readPrec :: ReadPrec GetAutoScalingGroupRecommendationsResponse
$creadPrec :: ReadPrec GetAutoScalingGroupRecommendationsResponse
readList :: ReadS [GetAutoScalingGroupRecommendationsResponse]
$creadList :: ReadS [GetAutoScalingGroupRecommendationsResponse]
readsPrec :: Int -> ReadS GetAutoScalingGroupRecommendationsResponse
$creadsPrec :: Int -> ReadS GetAutoScalingGroupRecommendationsResponse
Prelude.Read, Int -> GetAutoScalingGroupRecommendationsResponse -> ShowS
[GetAutoScalingGroupRecommendationsResponse] -> ShowS
GetAutoScalingGroupRecommendationsResponse -> String
(Int -> GetAutoScalingGroupRecommendationsResponse -> ShowS)
-> (GetAutoScalingGroupRecommendationsResponse -> String)
-> ([GetAutoScalingGroupRecommendationsResponse] -> ShowS)
-> Show GetAutoScalingGroupRecommendationsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetAutoScalingGroupRecommendationsResponse] -> ShowS
$cshowList :: [GetAutoScalingGroupRecommendationsResponse] -> ShowS
show :: GetAutoScalingGroupRecommendationsResponse -> String
$cshow :: GetAutoScalingGroupRecommendationsResponse -> String
showsPrec :: Int -> GetAutoScalingGroupRecommendationsResponse -> ShowS
$cshowsPrec :: Int -> GetAutoScalingGroupRecommendationsResponse -> ShowS
Prelude.Show, (forall x.
 GetAutoScalingGroupRecommendationsResponse
 -> Rep GetAutoScalingGroupRecommendationsResponse x)
-> (forall x.
    Rep GetAutoScalingGroupRecommendationsResponse x
    -> GetAutoScalingGroupRecommendationsResponse)
-> Generic GetAutoScalingGroupRecommendationsResponse
forall x.
Rep GetAutoScalingGroupRecommendationsResponse x
-> GetAutoScalingGroupRecommendationsResponse
forall x.
GetAutoScalingGroupRecommendationsResponse
-> Rep GetAutoScalingGroupRecommendationsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetAutoScalingGroupRecommendationsResponse x
-> GetAutoScalingGroupRecommendationsResponse
$cfrom :: forall x.
GetAutoScalingGroupRecommendationsResponse
-> Rep GetAutoScalingGroupRecommendationsResponse x
Prelude.Generic)

-- |
-- Create a value of 'GetAutoScalingGroupRecommendationsResponse' 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:
--
-- 'autoScalingGroupRecommendations', 'getAutoScalingGroupRecommendationsResponse_autoScalingGroupRecommendations' - An array of objects that describe Auto Scaling group recommendations.
--
-- 'nextToken', 'getAutoScalingGroupRecommendationsResponse_nextToken' - The token to use to advance to the next page of Auto Scaling group
-- recommendations.
--
-- This value is null when there are no more pages of Auto Scaling group
-- recommendations to return.
--
-- 'errors', 'getAutoScalingGroupRecommendationsResponse_errors' - An array of objects that describe errors of the request.
--
-- For example, an error is returned if you request recommendations for an
-- unsupported Auto Scaling group.
--
-- 'httpStatus', 'getAutoScalingGroupRecommendationsResponse_httpStatus' - The response's http status code.
newGetAutoScalingGroupRecommendationsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  GetAutoScalingGroupRecommendationsResponse
newGetAutoScalingGroupRecommendationsResponse :: Int -> GetAutoScalingGroupRecommendationsResponse
newGetAutoScalingGroupRecommendationsResponse
  Int
pHttpStatus_ =
    GetAutoScalingGroupRecommendationsResponse' :: Maybe [AutoScalingGroupRecommendation]
-> Maybe Text
-> Maybe [GetRecommendationError]
-> Int
-> GetAutoScalingGroupRecommendationsResponse
GetAutoScalingGroupRecommendationsResponse'
      { $sel:autoScalingGroupRecommendations:GetAutoScalingGroupRecommendationsResponse' :: Maybe [AutoScalingGroupRecommendation]
autoScalingGroupRecommendations =
          Maybe [AutoScalingGroupRecommendation]
forall a. Maybe a
Prelude.Nothing,
        $sel:nextToken:GetAutoScalingGroupRecommendationsResponse' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:errors:GetAutoScalingGroupRecommendationsResponse' :: Maybe [GetRecommendationError]
errors = Maybe [GetRecommendationError]
forall a. Maybe a
Prelude.Nothing,
        $sel:httpStatus:GetAutoScalingGroupRecommendationsResponse' :: Int
httpStatus = Int
pHttpStatus_
      }

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

-- | The token to use to advance to the next page of Auto Scaling group
-- recommendations.
--
-- This value is null when there are no more pages of Auto Scaling group
-- recommendations to return.
getAutoScalingGroupRecommendationsResponse_nextToken :: Lens.Lens' GetAutoScalingGroupRecommendationsResponse (Prelude.Maybe Prelude.Text)
getAutoScalingGroupRecommendationsResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> GetAutoScalingGroupRecommendationsResponse
-> f GetAutoScalingGroupRecommendationsResponse
getAutoScalingGroupRecommendationsResponse_nextToken = (GetAutoScalingGroupRecommendationsResponse -> Maybe Text)
-> (GetAutoScalingGroupRecommendationsResponse
    -> Maybe Text -> GetAutoScalingGroupRecommendationsResponse)
-> Lens
     GetAutoScalingGroupRecommendationsResponse
     GetAutoScalingGroupRecommendationsResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetAutoScalingGroupRecommendationsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:GetAutoScalingGroupRecommendationsResponse' :: GetAutoScalingGroupRecommendationsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: GetAutoScalingGroupRecommendationsResponse
s@GetAutoScalingGroupRecommendationsResponse' {} Maybe Text
a -> GetAutoScalingGroupRecommendationsResponse
s {$sel:nextToken:GetAutoScalingGroupRecommendationsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: GetAutoScalingGroupRecommendationsResponse)

-- | An array of objects that describe errors of the request.
--
-- For example, an error is returned if you request recommendations for an
-- unsupported Auto Scaling group.
getAutoScalingGroupRecommendationsResponse_errors :: Lens.Lens' GetAutoScalingGroupRecommendationsResponse (Prelude.Maybe [GetRecommendationError])
getAutoScalingGroupRecommendationsResponse_errors :: (Maybe [GetRecommendationError]
 -> f (Maybe [GetRecommendationError]))
-> GetAutoScalingGroupRecommendationsResponse
-> f GetAutoScalingGroupRecommendationsResponse
getAutoScalingGroupRecommendationsResponse_errors = (GetAutoScalingGroupRecommendationsResponse
 -> Maybe [GetRecommendationError])
-> (GetAutoScalingGroupRecommendationsResponse
    -> Maybe [GetRecommendationError]
    -> GetAutoScalingGroupRecommendationsResponse)
-> Lens
     GetAutoScalingGroupRecommendationsResponse
     GetAutoScalingGroupRecommendationsResponse
     (Maybe [GetRecommendationError])
     (Maybe [GetRecommendationError])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetAutoScalingGroupRecommendationsResponse' {Maybe [GetRecommendationError]
errors :: Maybe [GetRecommendationError]
$sel:errors:GetAutoScalingGroupRecommendationsResponse' :: GetAutoScalingGroupRecommendationsResponse
-> Maybe [GetRecommendationError]
errors} -> Maybe [GetRecommendationError]
errors) (\s :: GetAutoScalingGroupRecommendationsResponse
s@GetAutoScalingGroupRecommendationsResponse' {} Maybe [GetRecommendationError]
a -> GetAutoScalingGroupRecommendationsResponse
s {$sel:errors:GetAutoScalingGroupRecommendationsResponse' :: Maybe [GetRecommendationError]
errors = Maybe [GetRecommendationError]
a} :: GetAutoScalingGroupRecommendationsResponse) ((Maybe [GetRecommendationError]
  -> f (Maybe [GetRecommendationError]))
 -> GetAutoScalingGroupRecommendationsResponse
 -> f GetAutoScalingGroupRecommendationsResponse)
-> ((Maybe [GetRecommendationError]
     -> f (Maybe [GetRecommendationError]))
    -> Maybe [GetRecommendationError]
    -> f (Maybe [GetRecommendationError]))
-> (Maybe [GetRecommendationError]
    -> f (Maybe [GetRecommendationError]))
-> GetAutoScalingGroupRecommendationsResponse
-> f GetAutoScalingGroupRecommendationsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [GetRecommendationError]
  [GetRecommendationError]
  [GetRecommendationError]
  [GetRecommendationError]
-> Iso
     (Maybe [GetRecommendationError])
     (Maybe [GetRecommendationError])
     (Maybe [GetRecommendationError])
     (Maybe [GetRecommendationError])
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
  [GetRecommendationError]
  [GetRecommendationError]
  [GetRecommendationError]
  [GetRecommendationError]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

instance
  Prelude.NFData
    GetAutoScalingGroupRecommendationsResponse