{-# 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.CodeGuruProfiler.ListProfilingGroups
-- 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 a list of profiling groups. The profiling groups are returned as
-- <https://docs.aws.amazon.com/codeguru/latest/profiler-api/API_ProfilingGroupDescription.html ProfilingGroupDescription>
-- objects.
module Amazonka.CodeGuruProfiler.ListProfilingGroups
  ( -- * Creating a Request
    ListProfilingGroups (..),
    newListProfilingGroups,

    -- * Request Lenses
    listProfilingGroups_includeDescription,
    listProfilingGroups_maxResults,
    listProfilingGroups_nextToken,

    -- * Destructuring the Response
    ListProfilingGroupsResponse (..),
    newListProfilingGroupsResponse,

    -- * Response Lenses
    listProfilingGroupsResponse_nextToken,
    listProfilingGroupsResponse_profilingGroups,
    listProfilingGroupsResponse_httpStatus,
    listProfilingGroupsResponse_profilingGroupNames,
  )
where

import Amazonka.CodeGuruProfiler.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

-- | The structure representing the listProfilingGroupsRequest.
--
-- /See:/ 'newListProfilingGroups' smart constructor.
data ListProfilingGroups = ListProfilingGroups'
  { -- | A @Boolean@ value indicating whether to include a description. If
    -- @true@, then a list of
    -- <https://docs.aws.amazon.com/codeguru/latest/profiler-api/API_ProfilingGroupDescription.html ProfilingGroupDescription>
    -- objects that contain detailed information about profiling groups is
    -- returned. If @false@, then a list of profiling group names is returned.
    ListProfilingGroups -> Maybe Bool
includeDescription :: Prelude.Maybe Prelude.Bool,
    -- | The maximum number of profiling groups results returned by
    -- @ListProfilingGroups@ in paginated output. When this parameter is used,
    -- @ListProfilingGroups@ only returns @maxResults@ results in a single page
    -- along with a @nextToken@ response element. The remaining results of the
    -- initial request can be seen by sending another @ListProfilingGroups@
    -- request with the returned @nextToken@ value.
    ListProfilingGroups -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
    -- | The @nextToken@ value returned from a previous paginated
    -- @ListProfilingGroups@ request where @maxResults@ was used and the
    -- results exceeded the value of that parameter. Pagination continues from
    -- the end of the previous results that returned the @nextToken@ value.
    --
    -- This token should be treated as an opaque identifier that is only used
    -- to retrieve the next items in a list and not for other programmatic
    -- purposes.
    ListProfilingGroups -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text
  }
  deriving (ListProfilingGroups -> ListProfilingGroups -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListProfilingGroups -> ListProfilingGroups -> Bool
$c/= :: ListProfilingGroups -> ListProfilingGroups -> Bool
== :: ListProfilingGroups -> ListProfilingGroups -> Bool
$c== :: ListProfilingGroups -> ListProfilingGroups -> Bool
Prelude.Eq, ReadPrec [ListProfilingGroups]
ReadPrec ListProfilingGroups
Int -> ReadS ListProfilingGroups
ReadS [ListProfilingGroups]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListProfilingGroups]
$creadListPrec :: ReadPrec [ListProfilingGroups]
readPrec :: ReadPrec ListProfilingGroups
$creadPrec :: ReadPrec ListProfilingGroups
readList :: ReadS [ListProfilingGroups]
$creadList :: ReadS [ListProfilingGroups]
readsPrec :: Int -> ReadS ListProfilingGroups
$creadsPrec :: Int -> ReadS ListProfilingGroups
Prelude.Read, Int -> ListProfilingGroups -> ShowS
[ListProfilingGroups] -> ShowS
ListProfilingGroups -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListProfilingGroups] -> ShowS
$cshowList :: [ListProfilingGroups] -> ShowS
show :: ListProfilingGroups -> String
$cshow :: ListProfilingGroups -> String
showsPrec :: Int -> ListProfilingGroups -> ShowS
$cshowsPrec :: Int -> ListProfilingGroups -> ShowS
Prelude.Show, forall x. Rep ListProfilingGroups x -> ListProfilingGroups
forall x. ListProfilingGroups -> Rep ListProfilingGroups x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListProfilingGroups x -> ListProfilingGroups
$cfrom :: forall x. ListProfilingGroups -> Rep ListProfilingGroups x
Prelude.Generic)

-- |
-- Create a value of 'ListProfilingGroups' 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:
--
-- 'includeDescription', 'listProfilingGroups_includeDescription' - A @Boolean@ value indicating whether to include a description. If
-- @true@, then a list of
-- <https://docs.aws.amazon.com/codeguru/latest/profiler-api/API_ProfilingGroupDescription.html ProfilingGroupDescription>
-- objects that contain detailed information about profiling groups is
-- returned. If @false@, then a list of profiling group names is returned.
--
-- 'maxResults', 'listProfilingGroups_maxResults' - The maximum number of profiling groups results returned by
-- @ListProfilingGroups@ in paginated output. When this parameter is used,
-- @ListProfilingGroups@ only returns @maxResults@ results in a single page
-- along with a @nextToken@ response element. The remaining results of the
-- initial request can be seen by sending another @ListProfilingGroups@
-- request with the returned @nextToken@ value.
--
-- 'nextToken', 'listProfilingGroups_nextToken' - The @nextToken@ value returned from a previous paginated
-- @ListProfilingGroups@ request where @maxResults@ was used and the
-- results exceeded the value of that parameter. Pagination continues from
-- the end of the previous results that returned the @nextToken@ value.
--
-- This token should be treated as an opaque identifier that is only used
-- to retrieve the next items in a list and not for other programmatic
-- purposes.
newListProfilingGroups ::
  ListProfilingGroups
newListProfilingGroups :: ListProfilingGroups
newListProfilingGroups =
  ListProfilingGroups'
    { $sel:includeDescription:ListProfilingGroups' :: Maybe Bool
includeDescription =
        forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:ListProfilingGroups' :: Maybe Natural
maxResults = forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListProfilingGroups' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing
    }

-- | A @Boolean@ value indicating whether to include a description. If
-- @true@, then a list of
-- <https://docs.aws.amazon.com/codeguru/latest/profiler-api/API_ProfilingGroupDescription.html ProfilingGroupDescription>
-- objects that contain detailed information about profiling groups is
-- returned. If @false@, then a list of profiling group names is returned.
listProfilingGroups_includeDescription :: Lens.Lens' ListProfilingGroups (Prelude.Maybe Prelude.Bool)
listProfilingGroups_includeDescription :: Lens' ListProfilingGroups (Maybe Bool)
listProfilingGroups_includeDescription = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListProfilingGroups' {Maybe Bool
includeDescription :: Maybe Bool
$sel:includeDescription:ListProfilingGroups' :: ListProfilingGroups -> Maybe Bool
includeDescription} -> Maybe Bool
includeDescription) (\s :: ListProfilingGroups
s@ListProfilingGroups' {} Maybe Bool
a -> ListProfilingGroups
s {$sel:includeDescription:ListProfilingGroups' :: Maybe Bool
includeDescription = Maybe Bool
a} :: ListProfilingGroups)

-- | The maximum number of profiling groups results returned by
-- @ListProfilingGroups@ in paginated output. When this parameter is used,
-- @ListProfilingGroups@ only returns @maxResults@ results in a single page
-- along with a @nextToken@ response element. The remaining results of the
-- initial request can be seen by sending another @ListProfilingGroups@
-- request with the returned @nextToken@ value.
listProfilingGroups_maxResults :: Lens.Lens' ListProfilingGroups (Prelude.Maybe Prelude.Natural)
listProfilingGroups_maxResults :: Lens' ListProfilingGroups (Maybe Natural)
listProfilingGroups_maxResults = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListProfilingGroups' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListProfilingGroups' :: ListProfilingGroups -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListProfilingGroups
s@ListProfilingGroups' {} Maybe Natural
a -> ListProfilingGroups
s {$sel:maxResults:ListProfilingGroups' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListProfilingGroups)

-- | The @nextToken@ value returned from a previous paginated
-- @ListProfilingGroups@ request where @maxResults@ was used and the
-- results exceeded the value of that parameter. Pagination continues from
-- the end of the previous results that returned the @nextToken@ value.
--
-- This token should be treated as an opaque identifier that is only used
-- to retrieve the next items in a list and not for other programmatic
-- purposes.
listProfilingGroups_nextToken :: Lens.Lens' ListProfilingGroups (Prelude.Maybe Prelude.Text)
listProfilingGroups_nextToken :: Lens' ListProfilingGroups (Maybe Text)
listProfilingGroups_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListProfilingGroups' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListProfilingGroups' :: ListProfilingGroups -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListProfilingGroups
s@ListProfilingGroups' {} Maybe Text
a -> ListProfilingGroups
s {$sel:nextToken:ListProfilingGroups' :: Maybe Text
nextToken = Maybe Text
a} :: ListProfilingGroups)

instance Core.AWSRequest ListProfilingGroups where
  type
    AWSResponse ListProfilingGroups =
      ListProfilingGroupsResponse
  request :: (Service -> Service)
-> ListProfilingGroups -> Request ListProfilingGroups
request Service -> Service
overrides =
    forall a. ToRequest a => Service -> a -> Request a
Request.get (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy ListProfilingGroups
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ListProfilingGroups)))
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 [ProfilingGroupDescription]
-> Int
-> [Text]
-> ListProfilingGroupsResponse
ListProfilingGroupsResponse'
            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
"profilingGroups"
                            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))
            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
"profilingGroupNames"
                            forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty
                        )
      )

instance Prelude.Hashable ListProfilingGroups where
  hashWithSalt :: Int -> ListProfilingGroups -> Int
hashWithSalt Int
_salt ListProfilingGroups' {Maybe Bool
Maybe Natural
Maybe Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
includeDescription :: Maybe Bool
$sel:nextToken:ListProfilingGroups' :: ListProfilingGroups -> Maybe Text
$sel:maxResults:ListProfilingGroups' :: ListProfilingGroups -> Maybe Natural
$sel:includeDescription:ListProfilingGroups' :: ListProfilingGroups -> Maybe Bool
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
includeDescription
      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 ListProfilingGroups where
  rnf :: ListProfilingGroups -> ()
rnf ListProfilingGroups' {Maybe Bool
Maybe Natural
Maybe Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
includeDescription :: Maybe Bool
$sel:nextToken:ListProfilingGroups' :: ListProfilingGroups -> Maybe Text
$sel:maxResults:ListProfilingGroups' :: ListProfilingGroups -> Maybe Natural
$sel:includeDescription:ListProfilingGroups' :: ListProfilingGroups -> Maybe Bool
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
includeDescription
      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 ListProfilingGroups where
  toHeaders :: ListProfilingGroups -> ResponseHeaders
toHeaders =
    forall a b. a -> b -> a
Prelude.const
      ( forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"Content-Type"
              forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

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

instance Data.ToQuery ListProfilingGroups where
  toQuery :: ListProfilingGroups -> QueryString
toQuery ListProfilingGroups' {Maybe Bool
Maybe Natural
Maybe Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
includeDescription :: Maybe Bool
$sel:nextToken:ListProfilingGroups' :: ListProfilingGroups -> Maybe Text
$sel:maxResults:ListProfilingGroups' :: ListProfilingGroups -> Maybe Natural
$sel:includeDescription:ListProfilingGroups' :: ListProfilingGroups -> Maybe Bool
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"includeDescription" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Bool
includeDescription,
        ByteString
"maxResults" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Natural
maxResults,
        ByteString
"nextToken" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
nextToken
      ]

-- | The structure representing the listProfilingGroupsResponse.
--
-- /See:/ 'newListProfilingGroupsResponse' smart constructor.
data ListProfilingGroupsResponse = ListProfilingGroupsResponse'
  { -- | The @nextToken@ value to include in a future @ListProfilingGroups@
    -- request. When the results of a @ListProfilingGroups@ request exceed
    -- @maxResults@, this value can be used to retrieve the next page of
    -- results. This value is @null@ when there are no more results to return.
    ListProfilingGroupsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | A returned list
    -- <https://docs.aws.amazon.com/codeguru/latest/profiler-api/API_ProfilingGroupDescription.html ProfilingGroupDescription>
    -- objects. A list of
    -- <https://docs.aws.amazon.com/codeguru/latest/profiler-api/API_ProfilingGroupDescription.html ProfilingGroupDescription>
    -- objects is returned only if @includeDescription@ is @true@, otherwise a
    -- list of profiling group names is returned.
    ListProfilingGroupsResponse -> Maybe [ProfilingGroupDescription]
profilingGroups :: Prelude.Maybe [ProfilingGroupDescription],
    -- | The response's http status code.
    ListProfilingGroupsResponse -> Int
httpStatus :: Prelude.Int,
    -- | A returned list of profiling group names. A list of the names is
    -- returned only if @includeDescription@ is @false@, otherwise a list of
    -- <https://docs.aws.amazon.com/codeguru/latest/profiler-api/API_ProfilingGroupDescription.html ProfilingGroupDescription>
    -- objects is returned.
    ListProfilingGroupsResponse -> [Text]
profilingGroupNames :: [Prelude.Text]
  }
  deriving (ListProfilingGroupsResponse -> ListProfilingGroupsResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListProfilingGroupsResponse -> ListProfilingGroupsResponse -> Bool
$c/= :: ListProfilingGroupsResponse -> ListProfilingGroupsResponse -> Bool
== :: ListProfilingGroupsResponse -> ListProfilingGroupsResponse -> Bool
$c== :: ListProfilingGroupsResponse -> ListProfilingGroupsResponse -> Bool
Prelude.Eq, ReadPrec [ListProfilingGroupsResponse]
ReadPrec ListProfilingGroupsResponse
Int -> ReadS ListProfilingGroupsResponse
ReadS [ListProfilingGroupsResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListProfilingGroupsResponse]
$creadListPrec :: ReadPrec [ListProfilingGroupsResponse]
readPrec :: ReadPrec ListProfilingGroupsResponse
$creadPrec :: ReadPrec ListProfilingGroupsResponse
readList :: ReadS [ListProfilingGroupsResponse]
$creadList :: ReadS [ListProfilingGroupsResponse]
readsPrec :: Int -> ReadS ListProfilingGroupsResponse
$creadsPrec :: Int -> ReadS ListProfilingGroupsResponse
Prelude.Read, Int -> ListProfilingGroupsResponse -> ShowS
[ListProfilingGroupsResponse] -> ShowS
ListProfilingGroupsResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListProfilingGroupsResponse] -> ShowS
$cshowList :: [ListProfilingGroupsResponse] -> ShowS
show :: ListProfilingGroupsResponse -> String
$cshow :: ListProfilingGroupsResponse -> String
showsPrec :: Int -> ListProfilingGroupsResponse -> ShowS
$cshowsPrec :: Int -> ListProfilingGroupsResponse -> ShowS
Prelude.Show, forall x.
Rep ListProfilingGroupsResponse x -> ListProfilingGroupsResponse
forall x.
ListProfilingGroupsResponse -> Rep ListProfilingGroupsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListProfilingGroupsResponse x -> ListProfilingGroupsResponse
$cfrom :: forall x.
ListProfilingGroupsResponse -> Rep ListProfilingGroupsResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListProfilingGroupsResponse' 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', 'listProfilingGroupsResponse_nextToken' - The @nextToken@ value to include in a future @ListProfilingGroups@
-- request. When the results of a @ListProfilingGroups@ request exceed
-- @maxResults@, this value can be used to retrieve the next page of
-- results. This value is @null@ when there are no more results to return.
--
-- 'profilingGroups', 'listProfilingGroupsResponse_profilingGroups' - A returned list
-- <https://docs.aws.amazon.com/codeguru/latest/profiler-api/API_ProfilingGroupDescription.html ProfilingGroupDescription>
-- objects. A list of
-- <https://docs.aws.amazon.com/codeguru/latest/profiler-api/API_ProfilingGroupDescription.html ProfilingGroupDescription>
-- objects is returned only if @includeDescription@ is @true@, otherwise a
-- list of profiling group names is returned.
--
-- 'httpStatus', 'listProfilingGroupsResponse_httpStatus' - The response's http status code.
--
-- 'profilingGroupNames', 'listProfilingGroupsResponse_profilingGroupNames' - A returned list of profiling group names. A list of the names is
-- returned only if @includeDescription@ is @false@, otherwise a list of
-- <https://docs.aws.amazon.com/codeguru/latest/profiler-api/API_ProfilingGroupDescription.html ProfilingGroupDescription>
-- objects is returned.
newListProfilingGroupsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListProfilingGroupsResponse
newListProfilingGroupsResponse :: Int -> ListProfilingGroupsResponse
newListProfilingGroupsResponse Int
pHttpStatus_ =
  ListProfilingGroupsResponse'
    { $sel:nextToken:ListProfilingGroupsResponse' :: Maybe Text
nextToken =
        forall a. Maybe a
Prelude.Nothing,
      $sel:profilingGroups:ListProfilingGroupsResponse' :: Maybe [ProfilingGroupDescription]
profilingGroups = forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListProfilingGroupsResponse' :: Int
httpStatus = Int
pHttpStatus_,
      $sel:profilingGroupNames:ListProfilingGroupsResponse' :: [Text]
profilingGroupNames = forall a. Monoid a => a
Prelude.mempty
    }

-- | The @nextToken@ value to include in a future @ListProfilingGroups@
-- request. When the results of a @ListProfilingGroups@ request exceed
-- @maxResults@, this value can be used to retrieve the next page of
-- results. This value is @null@ when there are no more results to return.
listProfilingGroupsResponse_nextToken :: Lens.Lens' ListProfilingGroupsResponse (Prelude.Maybe Prelude.Text)
listProfilingGroupsResponse_nextToken :: Lens' ListProfilingGroupsResponse (Maybe Text)
listProfilingGroupsResponse_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListProfilingGroupsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListProfilingGroupsResponse' :: ListProfilingGroupsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListProfilingGroupsResponse
s@ListProfilingGroupsResponse' {} Maybe Text
a -> ListProfilingGroupsResponse
s {$sel:nextToken:ListProfilingGroupsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListProfilingGroupsResponse)

-- | A returned list
-- <https://docs.aws.amazon.com/codeguru/latest/profiler-api/API_ProfilingGroupDescription.html ProfilingGroupDescription>
-- objects. A list of
-- <https://docs.aws.amazon.com/codeguru/latest/profiler-api/API_ProfilingGroupDescription.html ProfilingGroupDescription>
-- objects is returned only if @includeDescription@ is @true@, otherwise a
-- list of profiling group names is returned.
listProfilingGroupsResponse_profilingGroups :: Lens.Lens' ListProfilingGroupsResponse (Prelude.Maybe [ProfilingGroupDescription])
listProfilingGroupsResponse_profilingGroups :: Lens'
  ListProfilingGroupsResponse (Maybe [ProfilingGroupDescription])
listProfilingGroupsResponse_profilingGroups = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListProfilingGroupsResponse' {Maybe [ProfilingGroupDescription]
profilingGroups :: Maybe [ProfilingGroupDescription]
$sel:profilingGroups:ListProfilingGroupsResponse' :: ListProfilingGroupsResponse -> Maybe [ProfilingGroupDescription]
profilingGroups} -> Maybe [ProfilingGroupDescription]
profilingGroups) (\s :: ListProfilingGroupsResponse
s@ListProfilingGroupsResponse' {} Maybe [ProfilingGroupDescription]
a -> ListProfilingGroupsResponse
s {$sel:profilingGroups:ListProfilingGroupsResponse' :: Maybe [ProfilingGroupDescription]
profilingGroups = Maybe [ProfilingGroupDescription]
a} :: ListProfilingGroupsResponse) 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.
listProfilingGroupsResponse_httpStatus :: Lens.Lens' ListProfilingGroupsResponse Prelude.Int
listProfilingGroupsResponse_httpStatus :: Lens' ListProfilingGroupsResponse Int
listProfilingGroupsResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListProfilingGroupsResponse' {Int
httpStatus :: Int
$sel:httpStatus:ListProfilingGroupsResponse' :: ListProfilingGroupsResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: ListProfilingGroupsResponse
s@ListProfilingGroupsResponse' {} Int
a -> ListProfilingGroupsResponse
s {$sel:httpStatus:ListProfilingGroupsResponse' :: Int
httpStatus = Int
a} :: ListProfilingGroupsResponse)

-- | A returned list of profiling group names. A list of the names is
-- returned only if @includeDescription@ is @false@, otherwise a list of
-- <https://docs.aws.amazon.com/codeguru/latest/profiler-api/API_ProfilingGroupDescription.html ProfilingGroupDescription>
-- objects is returned.
listProfilingGroupsResponse_profilingGroupNames :: Lens.Lens' ListProfilingGroupsResponse [Prelude.Text]
listProfilingGroupsResponse_profilingGroupNames :: Lens' ListProfilingGroupsResponse [Text]
listProfilingGroupsResponse_profilingGroupNames = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListProfilingGroupsResponse' {[Text]
profilingGroupNames :: [Text]
$sel:profilingGroupNames:ListProfilingGroupsResponse' :: ListProfilingGroupsResponse -> [Text]
profilingGroupNames} -> [Text]
profilingGroupNames) (\s :: ListProfilingGroupsResponse
s@ListProfilingGroupsResponse' {} [Text]
a -> ListProfilingGroupsResponse
s {$sel:profilingGroupNames:ListProfilingGroupsResponse' :: [Text]
profilingGroupNames = [Text]
a} :: ListProfilingGroupsResponse) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Prelude.NFData ListProfilingGroupsResponse where
  rnf :: ListProfilingGroupsResponse -> ()
rnf ListProfilingGroupsResponse' {Int
[Text]
Maybe [ProfilingGroupDescription]
Maybe Text
profilingGroupNames :: [Text]
httpStatus :: Int
profilingGroups :: Maybe [ProfilingGroupDescription]
nextToken :: Maybe Text
$sel:profilingGroupNames:ListProfilingGroupsResponse' :: ListProfilingGroupsResponse -> [Text]
$sel:httpStatus:ListProfilingGroupsResponse' :: ListProfilingGroupsResponse -> Int
$sel:profilingGroups:ListProfilingGroupsResponse' :: ListProfilingGroupsResponse -> Maybe [ProfilingGroupDescription]
$sel:nextToken:ListProfilingGroupsResponse' :: ListProfilingGroupsResponse -> 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 [ProfilingGroupDescription]
profilingGroups
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf [Text]
profilingGroupNames