{-# 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.CodeStar.ListUserProfiles
(
ListUserProfiles (..),
newListUserProfiles,
listUserProfiles_maxResults,
listUserProfiles_nextToken,
ListUserProfilesResponse (..),
newListUserProfilesResponse,
listUserProfilesResponse_nextToken,
listUserProfilesResponse_httpStatus,
listUserProfilesResponse_userProfiles,
)
where
import Amazonka.CodeStar.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 ListUserProfiles = ListUserProfiles'
{
ListUserProfiles -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
ListUserProfiles -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text
}
deriving (ListUserProfiles -> ListUserProfiles -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListUserProfiles -> ListUserProfiles -> Bool
$c/= :: ListUserProfiles -> ListUserProfiles -> Bool
== :: ListUserProfiles -> ListUserProfiles -> Bool
$c== :: ListUserProfiles -> ListUserProfiles -> Bool
Prelude.Eq, ReadPrec [ListUserProfiles]
ReadPrec ListUserProfiles
Int -> ReadS ListUserProfiles
ReadS [ListUserProfiles]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListUserProfiles]
$creadListPrec :: ReadPrec [ListUserProfiles]
readPrec :: ReadPrec ListUserProfiles
$creadPrec :: ReadPrec ListUserProfiles
readList :: ReadS [ListUserProfiles]
$creadList :: ReadS [ListUserProfiles]
readsPrec :: Int -> ReadS ListUserProfiles
$creadsPrec :: Int -> ReadS ListUserProfiles
Prelude.Read, Int -> ListUserProfiles -> ShowS
[ListUserProfiles] -> ShowS
ListUserProfiles -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListUserProfiles] -> ShowS
$cshowList :: [ListUserProfiles] -> ShowS
show :: ListUserProfiles -> String
$cshow :: ListUserProfiles -> String
showsPrec :: Int -> ListUserProfiles -> ShowS
$cshowsPrec :: Int -> ListUserProfiles -> ShowS
Prelude.Show, forall x. Rep ListUserProfiles x -> ListUserProfiles
forall x. ListUserProfiles -> Rep ListUserProfiles x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListUserProfiles x -> ListUserProfiles
$cfrom :: forall x. ListUserProfiles -> Rep ListUserProfiles x
Prelude.Generic)
newListUserProfiles ::
ListUserProfiles
newListUserProfiles :: ListUserProfiles
newListUserProfiles =
ListUserProfiles'
{ $sel:maxResults:ListUserProfiles' :: Maybe Natural
maxResults = forall a. Maybe a
Prelude.Nothing,
$sel:nextToken:ListUserProfiles' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing
}
listUserProfiles_maxResults :: Lens.Lens' ListUserProfiles (Prelude.Maybe Prelude.Natural)
listUserProfiles_maxResults :: Lens' ListUserProfiles (Maybe Natural)
listUserProfiles_maxResults = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListUserProfiles' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListUserProfiles' :: ListUserProfiles -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListUserProfiles
s@ListUserProfiles' {} Maybe Natural
a -> ListUserProfiles
s {$sel:maxResults:ListUserProfiles' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListUserProfiles)
listUserProfiles_nextToken :: Lens.Lens' ListUserProfiles (Prelude.Maybe Prelude.Text)
listUserProfiles_nextToken :: Lens' ListUserProfiles (Maybe Text)
listUserProfiles_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListUserProfiles' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListUserProfiles' :: ListUserProfiles -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListUserProfiles
s@ListUserProfiles' {} Maybe Text
a -> ListUserProfiles
s {$sel:nextToken:ListUserProfiles' :: Maybe Text
nextToken = Maybe Text
a} :: ListUserProfiles)
instance Core.AWSPager ListUserProfiles where
page :: ListUserProfiles
-> AWSResponse ListUserProfiles -> Maybe ListUserProfiles
page ListUserProfiles
rq AWSResponse ListUserProfiles
rs
| forall a. AWSTruncated a => a -> Bool
Core.stop
( AWSResponse ListUserProfiles
rs
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListUserProfilesResponse (Maybe Text)
listUserProfilesResponse_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 ListUserProfiles
rs forall s a. s -> Getting a s a -> a
Lens.^. Lens' ListUserProfilesResponse [UserProfileSummary]
listUserProfilesResponse_userProfiles) =
forall a. Maybe a
Prelude.Nothing
| Bool
Prelude.otherwise =
forall a. a -> Maybe a
Prelude.Just
forall a b. (a -> b) -> a -> b
Prelude.$ ListUserProfiles
rq
forall a b. a -> (a -> b) -> b
Prelude.& Lens' ListUserProfiles (Maybe Text)
listUserProfiles_nextToken
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListUserProfiles
rs
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListUserProfilesResponse (Maybe Text)
listUserProfilesResponse_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 ListUserProfiles where
type
AWSResponse ListUserProfiles =
ListUserProfilesResponse
request :: (Service -> Service)
-> ListUserProfiles -> Request ListUserProfiles
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 ListUserProfiles
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ListUserProfiles)))
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
-> Int -> [UserProfileSummary] -> ListUserProfilesResponse
ListUserProfilesResponse'
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.<*> (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
"userProfiles" forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty)
)
instance Prelude.Hashable ListUserProfiles where
hashWithSalt :: Int -> ListUserProfiles -> Int
hashWithSalt Int
_salt ListUserProfiles' {Maybe Natural
Maybe Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:nextToken:ListUserProfiles' :: ListUserProfiles -> Maybe Text
$sel:maxResults:ListUserProfiles' :: ListUserProfiles -> Maybe Natural
..} =
Int
_salt
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 ListUserProfiles where
rnf :: ListUserProfiles -> ()
rnf ListUserProfiles' {Maybe Natural
Maybe Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:nextToken:ListUserProfiles' :: ListUserProfiles -> Maybe Text
$sel:maxResults:ListUserProfiles' :: ListUserProfiles -> Maybe Natural
..} =
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 ListUserProfiles where
toHeaders :: ListUserProfiles -> 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
"CodeStar_20170419.ListUserProfiles" ::
Prelude.ByteString
),
HeaderName
"Content-Type"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Data.ToJSON ListUserProfiles where
toJSON :: ListUserProfiles -> Value
toJSON ListUserProfiles' {Maybe Natural
Maybe Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:nextToken:ListUserProfiles' :: ListUserProfiles -> Maybe Text
$sel:maxResults:ListUserProfiles' :: ListUserProfiles -> Maybe Natural
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (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 ListUserProfiles where
toPath :: ListUserProfiles -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery ListUserProfiles where
toQuery :: ListUserProfiles -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data ListUserProfilesResponse = ListUserProfilesResponse'
{
ListUserProfilesResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
ListUserProfilesResponse -> Int
httpStatus :: Prelude.Int,
ListUserProfilesResponse -> [UserProfileSummary]
userProfiles :: [UserProfileSummary]
}
deriving (ListUserProfilesResponse -> ListUserProfilesResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListUserProfilesResponse -> ListUserProfilesResponse -> Bool
$c/= :: ListUserProfilesResponse -> ListUserProfilesResponse -> Bool
== :: ListUserProfilesResponse -> ListUserProfilesResponse -> Bool
$c== :: ListUserProfilesResponse -> ListUserProfilesResponse -> Bool
Prelude.Eq, Int -> ListUserProfilesResponse -> ShowS
[ListUserProfilesResponse] -> ShowS
ListUserProfilesResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListUserProfilesResponse] -> ShowS
$cshowList :: [ListUserProfilesResponse] -> ShowS
show :: ListUserProfilesResponse -> String
$cshow :: ListUserProfilesResponse -> String
showsPrec :: Int -> ListUserProfilesResponse -> ShowS
$cshowsPrec :: Int -> ListUserProfilesResponse -> ShowS
Prelude.Show, forall x.
Rep ListUserProfilesResponse x -> ListUserProfilesResponse
forall x.
ListUserProfilesResponse -> Rep ListUserProfilesResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListUserProfilesResponse x -> ListUserProfilesResponse
$cfrom :: forall x.
ListUserProfilesResponse -> Rep ListUserProfilesResponse x
Prelude.Generic)
newListUserProfilesResponse ::
Prelude.Int ->
ListUserProfilesResponse
newListUserProfilesResponse :: Int -> ListUserProfilesResponse
newListUserProfilesResponse Int
pHttpStatus_ =
ListUserProfilesResponse'
{ $sel:nextToken:ListUserProfilesResponse' :: Maybe Text
nextToken =
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:ListUserProfilesResponse' :: Int
httpStatus = Int
pHttpStatus_,
$sel:userProfiles:ListUserProfilesResponse' :: [UserProfileSummary]
userProfiles = forall a. Monoid a => a
Prelude.mempty
}
listUserProfilesResponse_nextToken :: Lens.Lens' ListUserProfilesResponse (Prelude.Maybe Prelude.Text)
listUserProfilesResponse_nextToken :: Lens' ListUserProfilesResponse (Maybe Text)
listUserProfilesResponse_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListUserProfilesResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListUserProfilesResponse' :: ListUserProfilesResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListUserProfilesResponse
s@ListUserProfilesResponse' {} Maybe Text
a -> ListUserProfilesResponse
s {$sel:nextToken:ListUserProfilesResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListUserProfilesResponse)
listUserProfilesResponse_httpStatus :: Lens.Lens' ListUserProfilesResponse Prelude.Int
listUserProfilesResponse_httpStatus :: Lens' ListUserProfilesResponse Int
listUserProfilesResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListUserProfilesResponse' {Int
httpStatus :: Int
$sel:httpStatus:ListUserProfilesResponse' :: ListUserProfilesResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: ListUserProfilesResponse
s@ListUserProfilesResponse' {} Int
a -> ListUserProfilesResponse
s {$sel:httpStatus:ListUserProfilesResponse' :: Int
httpStatus = Int
a} :: ListUserProfilesResponse)
listUserProfilesResponse_userProfiles :: Lens.Lens' ListUserProfilesResponse [UserProfileSummary]
listUserProfilesResponse_userProfiles :: Lens' ListUserProfilesResponse [UserProfileSummary]
listUserProfilesResponse_userProfiles = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListUserProfilesResponse' {[UserProfileSummary]
userProfiles :: [UserProfileSummary]
$sel:userProfiles:ListUserProfilesResponse' :: ListUserProfilesResponse -> [UserProfileSummary]
userProfiles} -> [UserProfileSummary]
userProfiles) (\s :: ListUserProfilesResponse
s@ListUserProfilesResponse' {} [UserProfileSummary]
a -> ListUserProfilesResponse
s {$sel:userProfiles:ListUserProfilesResponse' :: [UserProfileSummary]
userProfiles = [UserProfileSummary]
a} :: ListUserProfilesResponse) 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 ListUserProfilesResponse where
rnf :: ListUserProfilesResponse -> ()
rnf ListUserProfilesResponse' {Int
[UserProfileSummary]
Maybe Text
userProfiles :: [UserProfileSummary]
httpStatus :: Int
nextToken :: Maybe Text
$sel:userProfiles:ListUserProfilesResponse' :: ListUserProfilesResponse -> [UserProfileSummary]
$sel:httpStatus:ListUserProfilesResponse' :: ListUserProfilesResponse -> Int
$sel:nextToken:ListUserProfilesResponse' :: ListUserProfilesResponse -> 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 Int
httpStatus
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf [UserProfileSummary]
userProfiles