{-# 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.GetRecommendationSummaries
-- 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 the optimization findings for an account.
--
-- It returns the number of:
--
-- -   Amazon EC2 instances in an account that are @Underprovisioned@,
--     @Overprovisioned@, or @Optimized@.
--
-- -   Auto Scaling groups in an account that are @NotOptimized@, or
--     @Optimized@.
--
-- -   Amazon EBS volumes in an account that are @NotOptimized@, or
--     @Optimized@.
--
-- -   Lambda functions in an account that are @NotOptimized@, or
--     @Optimized@.
module Amazonka.ComputeOptimizer.GetRecommendationSummaries
  ( -- * Creating a Request
    GetRecommendationSummaries (..),
    newGetRecommendationSummaries,

    -- * Request Lenses
    getRecommendationSummaries_accountIds,
    getRecommendationSummaries_nextToken,
    getRecommendationSummaries_maxResults,

    -- * Destructuring the Response
    GetRecommendationSummariesResponse (..),
    newGetRecommendationSummariesResponse,

    -- * Response Lenses
    getRecommendationSummariesResponse_nextToken,
    getRecommendationSummariesResponse_recommendationSummaries,
    getRecommendationSummariesResponse_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:/ 'newGetRecommendationSummaries' smart constructor.
data GetRecommendationSummaries = GetRecommendationSummaries'
  { -- | The ID of the Amazon Web Services account for which to return
    -- recommendation summaries.
    --
    -- If your account is the management account of an organization, use this
    -- parameter to specify the member account for which you want to return
    -- recommendation summaries.
    --
    -- Only one account ID can be specified per request.
    GetRecommendationSummaries -> Maybe [Text]
accountIds :: Prelude.Maybe [Prelude.Text],
    -- | The token to advance to the next page of recommendation summaries.
    GetRecommendationSummaries -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The maximum number of recommendation summaries to return with a single
    -- request.
    --
    -- To retrieve the remaining results, make another request with the
    -- returned @nextToken@ value.
    GetRecommendationSummaries -> Maybe Int
maxResults :: Prelude.Maybe Prelude.Int
  }
  deriving (GetRecommendationSummaries -> GetRecommendationSummaries -> Bool
(GetRecommendationSummaries -> GetRecommendationSummaries -> Bool)
-> (GetRecommendationSummaries
    -> GetRecommendationSummaries -> Bool)
-> Eq GetRecommendationSummaries
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetRecommendationSummaries -> GetRecommendationSummaries -> Bool
$c/= :: GetRecommendationSummaries -> GetRecommendationSummaries -> Bool
== :: GetRecommendationSummaries -> GetRecommendationSummaries -> Bool
$c== :: GetRecommendationSummaries -> GetRecommendationSummaries -> Bool
Prelude.Eq, ReadPrec [GetRecommendationSummaries]
ReadPrec GetRecommendationSummaries
Int -> ReadS GetRecommendationSummaries
ReadS [GetRecommendationSummaries]
(Int -> ReadS GetRecommendationSummaries)
-> ReadS [GetRecommendationSummaries]
-> ReadPrec GetRecommendationSummaries
-> ReadPrec [GetRecommendationSummaries]
-> Read GetRecommendationSummaries
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetRecommendationSummaries]
$creadListPrec :: ReadPrec [GetRecommendationSummaries]
readPrec :: ReadPrec GetRecommendationSummaries
$creadPrec :: ReadPrec GetRecommendationSummaries
readList :: ReadS [GetRecommendationSummaries]
$creadList :: ReadS [GetRecommendationSummaries]
readsPrec :: Int -> ReadS GetRecommendationSummaries
$creadsPrec :: Int -> ReadS GetRecommendationSummaries
Prelude.Read, Int -> GetRecommendationSummaries -> ShowS
[GetRecommendationSummaries] -> ShowS
GetRecommendationSummaries -> String
(Int -> GetRecommendationSummaries -> ShowS)
-> (GetRecommendationSummaries -> String)
-> ([GetRecommendationSummaries] -> ShowS)
-> Show GetRecommendationSummaries
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetRecommendationSummaries] -> ShowS
$cshowList :: [GetRecommendationSummaries] -> ShowS
show :: GetRecommendationSummaries -> String
$cshow :: GetRecommendationSummaries -> String
showsPrec :: Int -> GetRecommendationSummaries -> ShowS
$cshowsPrec :: Int -> GetRecommendationSummaries -> ShowS
Prelude.Show, (forall x.
 GetRecommendationSummaries -> Rep GetRecommendationSummaries x)
-> (forall x.
    Rep GetRecommendationSummaries x -> GetRecommendationSummaries)
-> Generic GetRecommendationSummaries
forall x.
Rep GetRecommendationSummaries x -> GetRecommendationSummaries
forall x.
GetRecommendationSummaries -> Rep GetRecommendationSummaries x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetRecommendationSummaries x -> GetRecommendationSummaries
$cfrom :: forall x.
GetRecommendationSummaries -> Rep GetRecommendationSummaries x
Prelude.Generic)

-- |
-- Create a value of 'GetRecommendationSummaries' 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', 'getRecommendationSummaries_accountIds' - The ID of the Amazon Web Services account for which to return
-- recommendation summaries.
--
-- If your account is the management account of an organization, use this
-- parameter to specify the member account for which you want to return
-- recommendation summaries.
--
-- Only one account ID can be specified per request.
--
-- 'nextToken', 'getRecommendationSummaries_nextToken' - The token to advance to the next page of recommendation summaries.
--
-- 'maxResults', 'getRecommendationSummaries_maxResults' - The maximum number of recommendation summaries to return with a single
-- request.
--
-- To retrieve the remaining results, make another request with the
-- returned @nextToken@ value.
newGetRecommendationSummaries ::
  GetRecommendationSummaries
newGetRecommendationSummaries :: GetRecommendationSummaries
newGetRecommendationSummaries =
  GetRecommendationSummaries' :: Maybe [Text]
-> Maybe Text -> Maybe Int -> GetRecommendationSummaries
GetRecommendationSummaries'
    { $sel:accountIds:GetRecommendationSummaries' :: Maybe [Text]
accountIds =
        Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:GetRecommendationSummaries' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:GetRecommendationSummaries' :: Maybe Int
maxResults = Maybe Int
forall a. Maybe a
Prelude.Nothing
    }

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

-- | The token to advance to the next page of recommendation summaries.
getRecommendationSummaries_nextToken :: Lens.Lens' GetRecommendationSummaries (Prelude.Maybe Prelude.Text)
getRecommendationSummaries_nextToken :: (Maybe Text -> f (Maybe Text))
-> GetRecommendationSummaries -> f GetRecommendationSummaries
getRecommendationSummaries_nextToken = (GetRecommendationSummaries -> Maybe Text)
-> (GetRecommendationSummaries
    -> Maybe Text -> GetRecommendationSummaries)
-> Lens
     GetRecommendationSummaries
     GetRecommendationSummaries
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetRecommendationSummaries' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:GetRecommendationSummaries' :: GetRecommendationSummaries -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: GetRecommendationSummaries
s@GetRecommendationSummaries' {} Maybe Text
a -> GetRecommendationSummaries
s {$sel:nextToken:GetRecommendationSummaries' :: Maybe Text
nextToken = Maybe Text
a} :: GetRecommendationSummaries)

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

instance Core.AWSRequest GetRecommendationSummaries where
  type
    AWSResponse GetRecommendationSummaries =
      GetRecommendationSummariesResponse
  request :: GetRecommendationSummaries -> Request GetRecommendationSummaries
request = Service
-> GetRecommendationSummaries -> Request GetRecommendationSummaries
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy GetRecommendationSummaries
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse GetRecommendationSummaries)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse GetRecommendationSummaries))
-> Logger
-> Service
-> Proxy GetRecommendationSummaries
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse GetRecommendationSummaries)))
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 Text
-> Maybe [RecommendationSummary]
-> Int
-> GetRecommendationSummariesResponse
GetRecommendationSummariesResponse'
            (Maybe Text
 -> Maybe [RecommendationSummary]
 -> Int
 -> GetRecommendationSummariesResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe [RecommendationSummary]
      -> Int -> GetRecommendationSummariesResponse)
forall (f :: * -> *) a b. Functor 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 [RecommendationSummary]
   -> Int -> GetRecommendationSummariesResponse)
-> Either String (Maybe [RecommendationSummary])
-> Either String (Int -> GetRecommendationSummariesResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object
-> Text -> Either String (Maybe (Maybe [RecommendationSummary]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"recommendationSummaries"
                            Either String (Maybe (Maybe [RecommendationSummary]))
-> Maybe [RecommendationSummary]
-> Either String (Maybe [RecommendationSummary])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [RecommendationSummary]
forall a. Monoid a => a
Prelude.mempty
                        )
            Either String (Int -> GetRecommendationSummariesResponse)
-> Either String Int
-> Either String GetRecommendationSummariesResponse
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 GetRecommendationSummaries

instance Prelude.NFData GetRecommendationSummaries

instance Core.ToHeaders GetRecommendationSummaries where
  toHeaders :: GetRecommendationSummaries -> ResponseHeaders
toHeaders =
    ResponseHeaders -> GetRecommendationSummaries -> 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.GetRecommendationSummaries" ::
                          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 GetRecommendationSummaries where
  toJSON :: GetRecommendationSummaries -> Value
toJSON GetRecommendationSummaries' {Maybe Int
Maybe [Text]
Maybe Text
maxResults :: Maybe Int
nextToken :: Maybe Text
accountIds :: Maybe [Text]
$sel:maxResults:GetRecommendationSummaries' :: GetRecommendationSummaries -> Maybe Int
$sel:nextToken:GetRecommendationSummaries' :: GetRecommendationSummaries -> Maybe Text
$sel:accountIds:GetRecommendationSummaries' :: GetRecommendationSummaries -> 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
"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 GetRecommendationSummaries where
  toPath :: GetRecommendationSummaries -> ByteString
toPath = ByteString -> GetRecommendationSummaries -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"

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

-- | /See:/ 'newGetRecommendationSummariesResponse' smart constructor.
data GetRecommendationSummariesResponse = GetRecommendationSummariesResponse'
  { -- | The token to use to advance to the next page of recommendation
    -- summaries.
    --
    -- This value is null when there are no more pages of recommendation
    -- summaries to return.
    GetRecommendationSummariesResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | An array of objects that summarize a recommendation.
    GetRecommendationSummariesResponse -> Maybe [RecommendationSummary]
recommendationSummaries :: Prelude.Maybe [RecommendationSummary],
    -- | The response's http status code.
    GetRecommendationSummariesResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (GetRecommendationSummariesResponse
-> GetRecommendationSummariesResponse -> Bool
(GetRecommendationSummariesResponse
 -> GetRecommendationSummariesResponse -> Bool)
-> (GetRecommendationSummariesResponse
    -> GetRecommendationSummariesResponse -> Bool)
-> Eq GetRecommendationSummariesResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetRecommendationSummariesResponse
-> GetRecommendationSummariesResponse -> Bool
$c/= :: GetRecommendationSummariesResponse
-> GetRecommendationSummariesResponse -> Bool
== :: GetRecommendationSummariesResponse
-> GetRecommendationSummariesResponse -> Bool
$c== :: GetRecommendationSummariesResponse
-> GetRecommendationSummariesResponse -> Bool
Prelude.Eq, ReadPrec [GetRecommendationSummariesResponse]
ReadPrec GetRecommendationSummariesResponse
Int -> ReadS GetRecommendationSummariesResponse
ReadS [GetRecommendationSummariesResponse]
(Int -> ReadS GetRecommendationSummariesResponse)
-> ReadS [GetRecommendationSummariesResponse]
-> ReadPrec GetRecommendationSummariesResponse
-> ReadPrec [GetRecommendationSummariesResponse]
-> Read GetRecommendationSummariesResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetRecommendationSummariesResponse]
$creadListPrec :: ReadPrec [GetRecommendationSummariesResponse]
readPrec :: ReadPrec GetRecommendationSummariesResponse
$creadPrec :: ReadPrec GetRecommendationSummariesResponse
readList :: ReadS [GetRecommendationSummariesResponse]
$creadList :: ReadS [GetRecommendationSummariesResponse]
readsPrec :: Int -> ReadS GetRecommendationSummariesResponse
$creadsPrec :: Int -> ReadS GetRecommendationSummariesResponse
Prelude.Read, Int -> GetRecommendationSummariesResponse -> ShowS
[GetRecommendationSummariesResponse] -> ShowS
GetRecommendationSummariesResponse -> String
(Int -> GetRecommendationSummariesResponse -> ShowS)
-> (GetRecommendationSummariesResponse -> String)
-> ([GetRecommendationSummariesResponse] -> ShowS)
-> Show GetRecommendationSummariesResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetRecommendationSummariesResponse] -> ShowS
$cshowList :: [GetRecommendationSummariesResponse] -> ShowS
show :: GetRecommendationSummariesResponse -> String
$cshow :: GetRecommendationSummariesResponse -> String
showsPrec :: Int -> GetRecommendationSummariesResponse -> ShowS
$cshowsPrec :: Int -> GetRecommendationSummariesResponse -> ShowS
Prelude.Show, (forall x.
 GetRecommendationSummariesResponse
 -> Rep GetRecommendationSummariesResponse x)
-> (forall x.
    Rep GetRecommendationSummariesResponse x
    -> GetRecommendationSummariesResponse)
-> Generic GetRecommendationSummariesResponse
forall x.
Rep GetRecommendationSummariesResponse x
-> GetRecommendationSummariesResponse
forall x.
GetRecommendationSummariesResponse
-> Rep GetRecommendationSummariesResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetRecommendationSummariesResponse x
-> GetRecommendationSummariesResponse
$cfrom :: forall x.
GetRecommendationSummariesResponse
-> Rep GetRecommendationSummariesResponse x
Prelude.Generic)

-- |
-- Create a value of 'GetRecommendationSummariesResponse' 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:
--
-- 'nextToken', 'getRecommendationSummariesResponse_nextToken' - The token to use to advance to the next page of recommendation
-- summaries.
--
-- This value is null when there are no more pages of recommendation
-- summaries to return.
--
-- 'recommendationSummaries', 'getRecommendationSummariesResponse_recommendationSummaries' - An array of objects that summarize a recommendation.
--
-- 'httpStatus', 'getRecommendationSummariesResponse_httpStatus' - The response's http status code.
newGetRecommendationSummariesResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  GetRecommendationSummariesResponse
newGetRecommendationSummariesResponse :: Int -> GetRecommendationSummariesResponse
newGetRecommendationSummariesResponse Int
pHttpStatus_ =
  GetRecommendationSummariesResponse' :: Maybe Text
-> Maybe [RecommendationSummary]
-> Int
-> GetRecommendationSummariesResponse
GetRecommendationSummariesResponse'
    { $sel:nextToken:GetRecommendationSummariesResponse' :: Maybe Text
nextToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:recommendationSummaries:GetRecommendationSummariesResponse' :: Maybe [RecommendationSummary]
recommendationSummaries =
        Maybe [RecommendationSummary]
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:GetRecommendationSummariesResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

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

-- | An array of objects that summarize a recommendation.
getRecommendationSummariesResponse_recommendationSummaries :: Lens.Lens' GetRecommendationSummariesResponse (Prelude.Maybe [RecommendationSummary])
getRecommendationSummariesResponse_recommendationSummaries :: (Maybe [RecommendationSummary]
 -> f (Maybe [RecommendationSummary]))
-> GetRecommendationSummariesResponse
-> f GetRecommendationSummariesResponse
getRecommendationSummariesResponse_recommendationSummaries = (GetRecommendationSummariesResponse
 -> Maybe [RecommendationSummary])
-> (GetRecommendationSummariesResponse
    -> Maybe [RecommendationSummary]
    -> GetRecommendationSummariesResponse)
-> Lens
     GetRecommendationSummariesResponse
     GetRecommendationSummariesResponse
     (Maybe [RecommendationSummary])
     (Maybe [RecommendationSummary])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetRecommendationSummariesResponse' {Maybe [RecommendationSummary]
recommendationSummaries :: Maybe [RecommendationSummary]
$sel:recommendationSummaries:GetRecommendationSummariesResponse' :: GetRecommendationSummariesResponse -> Maybe [RecommendationSummary]
recommendationSummaries} -> Maybe [RecommendationSummary]
recommendationSummaries) (\s :: GetRecommendationSummariesResponse
s@GetRecommendationSummariesResponse' {} Maybe [RecommendationSummary]
a -> GetRecommendationSummariesResponse
s {$sel:recommendationSummaries:GetRecommendationSummariesResponse' :: Maybe [RecommendationSummary]
recommendationSummaries = Maybe [RecommendationSummary]
a} :: GetRecommendationSummariesResponse) ((Maybe [RecommendationSummary]
  -> f (Maybe [RecommendationSummary]))
 -> GetRecommendationSummariesResponse
 -> f GetRecommendationSummariesResponse)
-> ((Maybe [RecommendationSummary]
     -> f (Maybe [RecommendationSummary]))
    -> Maybe [RecommendationSummary]
    -> f (Maybe [RecommendationSummary]))
-> (Maybe [RecommendationSummary]
    -> f (Maybe [RecommendationSummary]))
-> GetRecommendationSummariesResponse
-> f GetRecommendationSummariesResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [RecommendationSummary]
  [RecommendationSummary]
  [RecommendationSummary]
  [RecommendationSummary]
-> Iso
     (Maybe [RecommendationSummary])
     (Maybe [RecommendationSummary])
     (Maybe [RecommendationSummary])
     (Maybe [RecommendationSummary])
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
  [RecommendationSummary]
  [RecommendationSummary]
  [RecommendationSummary]
  [RecommendationSummary]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

instance
  Prelude.NFData
    GetRecommendationSummariesResponse