{-# 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-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 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_nextToken,
    listProfilingGroups_maxResults,

    -- * 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.Lens as Lens
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 @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,
    -- | 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
  }
  deriving (ListProfilingGroups -> ListProfilingGroups -> Bool
(ListProfilingGroups -> ListProfilingGroups -> Bool)
-> (ListProfilingGroups -> ListProfilingGroups -> Bool)
-> Eq ListProfilingGroups
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]
(Int -> ReadS ListProfilingGroups)
-> ReadS [ListProfilingGroups]
-> ReadPrec ListProfilingGroups
-> ReadPrec [ListProfilingGroups]
-> Read 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
(Int -> ListProfilingGroups -> ShowS)
-> (ListProfilingGroups -> String)
-> ([ListProfilingGroups] -> ShowS)
-> Show ListProfilingGroups
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. ListProfilingGroups -> Rep ListProfilingGroups x)
-> (forall x. Rep ListProfilingGroups x -> ListProfilingGroups)
-> Generic ListProfilingGroups
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.
--
-- '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.
--
-- '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.
newListProfilingGroups ::
  ListProfilingGroups
newListProfilingGroups :: ListProfilingGroups
newListProfilingGroups =
  ListProfilingGroups' :: Maybe Bool -> Maybe Text -> Maybe Natural -> ListProfilingGroups
ListProfilingGroups'
    { $sel:includeDescription:ListProfilingGroups' :: Maybe Bool
includeDescription =
        Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListProfilingGroups' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:ListProfilingGroups' :: Maybe Natural
maxResults = Maybe Natural
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 :: (Maybe Bool -> f (Maybe Bool))
-> ListProfilingGroups -> f ListProfilingGroups
listProfilingGroups_includeDescription = (ListProfilingGroups -> Maybe Bool)
-> (ListProfilingGroups -> Maybe Bool -> ListProfilingGroups)
-> Lens
     ListProfilingGroups ListProfilingGroups (Maybe Bool) (Maybe Bool)
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 @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 :: (Maybe Text -> f (Maybe Text))
-> ListProfilingGroups -> f ListProfilingGroups
listProfilingGroups_nextToken = (ListProfilingGroups -> Maybe Text)
-> (ListProfilingGroups -> Maybe Text -> ListProfilingGroups)
-> Lens
     ListProfilingGroups ListProfilingGroups (Maybe Text) (Maybe Text)
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)

-- | 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 :: (Maybe Natural -> f (Maybe Natural))
-> ListProfilingGroups -> f ListProfilingGroups
listProfilingGroups_maxResults = (ListProfilingGroups -> Maybe Natural)
-> (ListProfilingGroups -> Maybe Natural -> ListProfilingGroups)
-> Lens
     ListProfilingGroups
     ListProfilingGroups
     (Maybe Natural)
     (Maybe Natural)
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)

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

instance Prelude.Hashable ListProfilingGroups

instance Prelude.NFData ListProfilingGroups

instance Core.ToHeaders ListProfilingGroups where
  toHeaders :: ListProfilingGroups -> ResponseHeaders
toHeaders =
    ResponseHeaders -> ListProfilingGroups -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
      ( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"Content-Type"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

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

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

-- | 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
(ListProfilingGroupsResponse
 -> ListProfilingGroupsResponse -> Bool)
-> (ListProfilingGroupsResponse
    -> ListProfilingGroupsResponse -> Bool)
-> Eq ListProfilingGroupsResponse
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]
(Int -> ReadS ListProfilingGroupsResponse)
-> ReadS [ListProfilingGroupsResponse]
-> ReadPrec ListProfilingGroupsResponse
-> ReadPrec [ListProfilingGroupsResponse]
-> Read 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
(Int -> ListProfilingGroupsResponse -> ShowS)
-> (ListProfilingGroupsResponse -> String)
-> ([ListProfilingGroupsResponse] -> ShowS)
-> Show ListProfilingGroupsResponse
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.
 ListProfilingGroupsResponse -> Rep ListProfilingGroupsResponse x)
-> (forall x.
    Rep ListProfilingGroupsResponse x -> ListProfilingGroupsResponse)
-> Generic ListProfilingGroupsResponse
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' :: Maybe Text
-> Maybe [ProfilingGroupDescription]
-> Int
-> [Text]
-> ListProfilingGroupsResponse
ListProfilingGroupsResponse'
    { $sel:nextToken:ListProfilingGroupsResponse' :: Maybe Text
nextToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:profilingGroups:ListProfilingGroupsResponse' :: Maybe [ProfilingGroupDescription]
profilingGroups = Maybe [ProfilingGroupDescription]
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListProfilingGroupsResponse' :: Int
httpStatus = Int
pHttpStatus_,
      $sel:profilingGroupNames:ListProfilingGroupsResponse' :: [Text]
profilingGroupNames = [Text]
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 :: (Maybe Text -> f (Maybe Text))
-> ListProfilingGroupsResponse -> f ListProfilingGroupsResponse
listProfilingGroupsResponse_nextToken = (ListProfilingGroupsResponse -> Maybe Text)
-> (ListProfilingGroupsResponse
    -> Maybe Text -> ListProfilingGroupsResponse)
-> Lens
     ListProfilingGroupsResponse
     ListProfilingGroupsResponse
     (Maybe Text)
     (Maybe Text)
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 :: (Maybe [ProfilingGroupDescription]
 -> f (Maybe [ProfilingGroupDescription]))
-> ListProfilingGroupsResponse -> f ListProfilingGroupsResponse
listProfilingGroupsResponse_profilingGroups = (ListProfilingGroupsResponse -> Maybe [ProfilingGroupDescription])
-> (ListProfilingGroupsResponse
    -> Maybe [ProfilingGroupDescription]
    -> ListProfilingGroupsResponse)
-> Lens
     ListProfilingGroupsResponse
     ListProfilingGroupsResponse
     (Maybe [ProfilingGroupDescription])
     (Maybe [ProfilingGroupDescription])
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) ((Maybe [ProfilingGroupDescription]
  -> f (Maybe [ProfilingGroupDescription]))
 -> ListProfilingGroupsResponse -> f ListProfilingGroupsResponse)
-> ((Maybe [ProfilingGroupDescription]
     -> f (Maybe [ProfilingGroupDescription]))
    -> Maybe [ProfilingGroupDescription]
    -> f (Maybe [ProfilingGroupDescription]))
-> (Maybe [ProfilingGroupDescription]
    -> f (Maybe [ProfilingGroupDescription]))
-> ListProfilingGroupsResponse
-> f ListProfilingGroupsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [ProfilingGroupDescription]
  [ProfilingGroupDescription]
  [ProfilingGroupDescription]
  [ProfilingGroupDescription]
-> Iso
     (Maybe [ProfilingGroupDescription])
     (Maybe [ProfilingGroupDescription])
     (Maybe [ProfilingGroupDescription])
     (Maybe [ProfilingGroupDescription])
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
  [ProfilingGroupDescription]
  [ProfilingGroupDescription]
  [ProfilingGroupDescription]
  [ProfilingGroupDescription]
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 :: (Int -> f Int)
-> ListProfilingGroupsResponse -> f ListProfilingGroupsResponse
listProfilingGroupsResponse_httpStatus = (ListProfilingGroupsResponse -> Int)
-> (ListProfilingGroupsResponse
    -> Int -> ListProfilingGroupsResponse)
-> Lens
     ListProfilingGroupsResponse ListProfilingGroupsResponse Int Int
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 :: ([Text] -> f [Text])
-> ListProfilingGroupsResponse -> f ListProfilingGroupsResponse
listProfilingGroupsResponse_profilingGroupNames = (ListProfilingGroupsResponse -> [Text])
-> (ListProfilingGroupsResponse
    -> [Text] -> ListProfilingGroupsResponse)
-> Lens
     ListProfilingGroupsResponse
     ListProfilingGroupsResponse
     [Text]
     [Text]
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) (([Text] -> f [Text])
 -> ListProfilingGroupsResponse -> f ListProfilingGroupsResponse)
-> (([Text] -> f [Text]) -> [Text] -> f [Text])
-> ([Text] -> f [Text])
-> ListProfilingGroupsResponse
-> f ListProfilingGroupsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([Text] -> f [Text]) -> [Text] -> f [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Prelude.NFData ListProfilingGroupsResponse