{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE TypeFamilies #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
module Network.AWS.CodeStar.ListUserProfiles
(
listUserProfiles
, ListUserProfiles
, lupNextToken
, lupMaxResults
, listUserProfilesResponse
, ListUserProfilesResponse
, luprsNextToken
, luprsResponseStatus
, luprsUserProfiles
) where
import Network.AWS.CodeStar.Types
import Network.AWS.CodeStar.Types.Product
import Network.AWS.Lens
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
data ListUserProfiles = ListUserProfiles'
{ _lupNextToken :: !(Maybe Text)
, _lupMaxResults :: !(Maybe Nat)
} deriving (Eq, Read, Show, Data, Typeable, Generic)
listUserProfiles
:: ListUserProfiles
listUserProfiles =
ListUserProfiles' {_lupNextToken = Nothing, _lupMaxResults = Nothing}
lupNextToken :: Lens' ListUserProfiles (Maybe Text)
lupNextToken = lens _lupNextToken (\ s a -> s{_lupNextToken = a})
lupMaxResults :: Lens' ListUserProfiles (Maybe Natural)
lupMaxResults = lens _lupMaxResults (\ s a -> s{_lupMaxResults = a}) . mapping _Nat
instance AWSRequest ListUserProfiles where
type Rs ListUserProfiles = ListUserProfilesResponse
request = postJSON codeStar
response
= receiveJSON
(\ s h x ->
ListUserProfilesResponse' <$>
(x .?> "nextToken") <*> (pure (fromEnum s)) <*>
(x .?> "userProfiles" .!@ mempty))
instance Hashable ListUserProfiles where
instance NFData ListUserProfiles where
instance ToHeaders ListUserProfiles where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("CodeStar_20170419.ListUserProfiles" :: ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON ListUserProfiles where
toJSON ListUserProfiles'{..}
= object
(catMaybes
[("nextToken" .=) <$> _lupNextToken,
("maxResults" .=) <$> _lupMaxResults])
instance ToPath ListUserProfiles where
toPath = const "/"
instance ToQuery ListUserProfiles where
toQuery = const mempty
data ListUserProfilesResponse = ListUserProfilesResponse'
{ _luprsNextToken :: !(Maybe Text)
, _luprsResponseStatus :: !Int
, _luprsUserProfiles :: ![UserProfileSummary]
} deriving (Eq, Show, Data, Typeable, Generic)
listUserProfilesResponse
:: Int
-> ListUserProfilesResponse
listUserProfilesResponse pResponseStatus_ =
ListUserProfilesResponse'
{ _luprsNextToken = Nothing
, _luprsResponseStatus = pResponseStatus_
, _luprsUserProfiles = mempty
}
luprsNextToken :: Lens' ListUserProfilesResponse (Maybe Text)
luprsNextToken = lens _luprsNextToken (\ s a -> s{_luprsNextToken = a})
luprsResponseStatus :: Lens' ListUserProfilesResponse Int
luprsResponseStatus = lens _luprsResponseStatus (\ s a -> s{_luprsResponseStatus = a})
luprsUserProfiles :: Lens' ListUserProfilesResponse [UserProfileSummary]
luprsUserProfiles = lens _luprsUserProfiles (\ s a -> s{_luprsUserProfiles = a}) . _Coerce
instance NFData ListUserProfilesResponse where