{-# 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 #-}
module Amazonka.CodeGuruProfiler.ListProfilingGroups
(
ListProfilingGroups (..),
newListProfilingGroups,
listProfilingGroups_includeDescription,
listProfilingGroups_maxResults,
listProfilingGroups_nextToken,
ListProfilingGroupsResponse (..),
newListProfilingGroupsResponse,
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
data ListProfilingGroups = ListProfilingGroups'
{
ListProfilingGroups -> Maybe Bool
includeDescription :: Prelude.Maybe Prelude.Bool,
ListProfilingGroups -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
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)
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
}
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)
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)
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
]
data ListProfilingGroupsResponse = ListProfilingGroupsResponse'
{
ListProfilingGroupsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
ListProfilingGroupsResponse -> Maybe [ProfilingGroupDescription]
profilingGroups :: Prelude.Maybe [ProfilingGroupDescription],
ListProfilingGroupsResponse -> Int
httpStatus :: Prelude.Int,
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)
newListProfilingGroupsResponse ::
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
}
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)
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
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)
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