{-# 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-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- 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@.
--
-- -   Amazon ECS services in an account that are @Underprovisioned@,
--     @Overprovisioned@, or @Optimized@.
--
-- This operation returns paginated results.
module Amazonka.ComputeOptimizer.GetRecommendationSummaries
  ( -- * Creating a Request
    GetRecommendationSummaries (..),
    newGetRecommendationSummaries,

    -- * Request Lenses
    getRecommendationSummaries_accountIds,
    getRecommendationSummaries_maxResults,
    getRecommendationSummaries_nextToken,

    -- * 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.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:/ '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 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 Natural
maxResults :: Prelude.Maybe Prelude.Natural,
    -- | The token to advance to the next page of recommendation summaries.
    GetRecommendationSummaries -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text
  }
  deriving (GetRecommendationSummaries -> GetRecommendationSummaries -> Bool
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]
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
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.
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.
--
-- '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.
--
-- 'nextToken', 'getRecommendationSummaries_nextToken' - The token to advance to the next page of recommendation summaries.
newGetRecommendationSummaries ::
  GetRecommendationSummaries
newGetRecommendationSummaries :: GetRecommendationSummaries
newGetRecommendationSummaries =
  GetRecommendationSummaries'
    { $sel:accountIds:GetRecommendationSummaries' :: Maybe [Text]
accountIds =
        forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:GetRecommendationSummaries' :: Maybe Natural
maxResults = forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:GetRecommendationSummaries' :: Maybe Text
nextToken = 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 :: Lens' GetRecommendationSummaries (Maybe [Text])
getRecommendationSummaries_accountIds = 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) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | 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.Natural)
getRecommendationSummaries_maxResults :: Lens' GetRecommendationSummaries (Maybe Natural)
getRecommendationSummaries_maxResults = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetRecommendationSummaries' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:GetRecommendationSummaries' :: GetRecommendationSummaries -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: GetRecommendationSummaries
s@GetRecommendationSummaries' {} Maybe Natural
a -> GetRecommendationSummaries
s {$sel:maxResults:GetRecommendationSummaries' :: Maybe Natural
maxResults = Maybe Natural
a} :: GetRecommendationSummaries)

-- | The token to advance to the next page of recommendation summaries.
getRecommendationSummaries_nextToken :: Lens.Lens' GetRecommendationSummaries (Prelude.Maybe Prelude.Text)
getRecommendationSummaries_nextToken :: Lens' GetRecommendationSummaries (Maybe Text)
getRecommendationSummaries_nextToken = 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)

instance Core.AWSPager GetRecommendationSummaries where
  page :: GetRecommendationSummaries
-> AWSResponse GetRecommendationSummaries
-> Maybe GetRecommendationSummaries
page GetRecommendationSummaries
rq AWSResponse GetRecommendationSummaries
rs
    | forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse GetRecommendationSummaries
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' GetRecommendationSummariesResponse (Maybe Text)
getRecommendationSummariesResponse_nextToken
            forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
        forall a. Maybe a
Prelude.Nothing
    | forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse GetRecommendationSummaries
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens'
  GetRecommendationSummariesResponse (Maybe [RecommendationSummary])
getRecommendationSummariesResponse_recommendationSummaries
            forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
        forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
        forall a. a -> Maybe a
Prelude.Just
          forall a b. (a -> b) -> a -> b
Prelude.$ GetRecommendationSummaries
rq
          forall a b. a -> (a -> b) -> b
Prelude.& Lens' GetRecommendationSummaries (Maybe Text)
getRecommendationSummaries_nextToken
          forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse GetRecommendationSummaries
rs
          forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' GetRecommendationSummariesResponse (Maybe Text)
getRecommendationSummariesResponse_nextToken
          forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just

instance Core.AWSRequest GetRecommendationSummaries where
  type
    AWSResponse GetRecommendationSummaries =
      GetRecommendationSummariesResponse
  request :: (Service -> Service)
-> GetRecommendationSummaries -> Request GetRecommendationSummaries
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 GetRecommendationSummaries
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse GetRecommendationSummaries)))
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 Text
-> Maybe [RecommendationSummary]
-> Int
-> GetRecommendationSummariesResponse
GetRecommendationSummariesResponse'
            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
"nextToken")
            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
"recommendationSummaries"
                            forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty
                        )
            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 GetRecommendationSummaries where
  hashWithSalt :: Int -> GetRecommendationSummaries -> Int
hashWithSalt Int
_salt GetRecommendationSummaries' {Maybe Natural
Maybe [Text]
Maybe Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
accountIds :: Maybe [Text]
$sel:nextToken:GetRecommendationSummaries' :: GetRecommendationSummaries -> Maybe Text
$sel:maxResults:GetRecommendationSummaries' :: GetRecommendationSummaries -> Maybe Natural
$sel:accountIds:GetRecommendationSummaries' :: GetRecommendationSummaries -> Maybe [Text]
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Text]
accountIds
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
maxResults
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
nextToken

instance Prelude.NFData GetRecommendationSummaries where
  rnf :: GetRecommendationSummaries -> ()
rnf GetRecommendationSummaries' {Maybe Natural
Maybe [Text]
Maybe Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
accountIds :: Maybe [Text]
$sel:nextToken:GetRecommendationSummaries' :: GetRecommendationSummaries -> Maybe Text
$sel:maxResults:GetRecommendationSummaries' :: GetRecommendationSummaries -> Maybe Natural
$sel:accountIds:GetRecommendationSummaries' :: GetRecommendationSummaries -> Maybe [Text]
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe [Text]
accountIds
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
maxResults
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextToken

instance Data.ToHeaders GetRecommendationSummaries where
  toHeaders :: GetRecommendationSummaries -> 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.GetRecommendationSummaries" ::
                          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 GetRecommendationSummaries where
  toJSON :: GetRecommendationSummaries -> Value
toJSON GetRecommendationSummaries' {Maybe Natural
Maybe [Text]
Maybe Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
accountIds :: Maybe [Text]
$sel:nextToken:GetRecommendationSummaries' :: GetRecommendationSummaries -> Maybe Text
$sel:maxResults:GetRecommendationSummaries' :: GetRecommendationSummaries -> Maybe Natural
$sel:accountIds:GetRecommendationSummaries' :: GetRecommendationSummaries -> Maybe [Text]
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"accountIds" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Text]
accountIds,
            (Key
"maxResults" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
maxResults,
            (Key
"nextToken" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
nextToken
          ]
      )

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

instance Data.ToQuery GetRecommendationSummaries where
  toQuery :: GetRecommendationSummaries -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const 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
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]
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
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.
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'
    { $sel:nextToken:GetRecommendationSummariesResponse' :: Maybe Text
nextToken =
        forall a. Maybe a
Prelude.Nothing,
      $sel:recommendationSummaries:GetRecommendationSummariesResponse' :: Maybe [RecommendationSummary]
recommendationSummaries =
        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 :: Lens' GetRecommendationSummariesResponse (Maybe Text)
getRecommendationSummariesResponse_nextToken = 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 :: Lens'
  GetRecommendationSummariesResponse (Maybe [RecommendationSummary])
getRecommendationSummariesResponse_recommendationSummaries = 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) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 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 :: Lens' GetRecommendationSummariesResponse Int
getRecommendationSummariesResponse_httpStatus = 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
  where
  rnf :: GetRecommendationSummariesResponse -> ()
rnf GetRecommendationSummariesResponse' {Int
Maybe [RecommendationSummary]
Maybe Text
httpStatus :: Int
recommendationSummaries :: Maybe [RecommendationSummary]
nextToken :: Maybe Text
$sel:httpStatus:GetRecommendationSummariesResponse' :: GetRecommendationSummariesResponse -> Int
$sel:recommendationSummaries:GetRecommendationSummariesResponse' :: GetRecommendationSummariesResponse -> Maybe [RecommendationSummary]
$sel:nextToken:GetRecommendationSummariesResponse' :: GetRecommendationSummariesResponse -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextToken
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [RecommendationSummary]
recommendationSummaries
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus