{-# 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.DescribeUserProfile
(
describeUserProfile
, DescribeUserProfile
, dupUserARN
, describeUserProfileResponse
, DescribeUserProfileResponse
, duprsSshPublicKey
, duprsEmailAddress
, duprsDisplayName
, duprsResponseStatus
, duprsUserARN
, duprsCreatedTimestamp
, duprsLastModifiedTimestamp
) 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
newtype DescribeUserProfile = DescribeUserProfile'
{ _dupUserARN :: Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
describeUserProfile
:: Text
-> DescribeUserProfile
describeUserProfile pUserARN_ = DescribeUserProfile' {_dupUserARN = pUserARN_}
dupUserARN :: Lens' DescribeUserProfile Text
dupUserARN = lens _dupUserARN (\ s a -> s{_dupUserARN = a})
instance AWSRequest DescribeUserProfile where
type Rs DescribeUserProfile =
DescribeUserProfileResponse
request = postJSON codeStar
response
= receiveJSON
(\ s h x ->
DescribeUserProfileResponse' <$>
(x .?> "sshPublicKey") <*> (x .?> "emailAddress") <*>
(x .?> "displayName")
<*> (pure (fromEnum s))
<*> (x .:> "userArn")
<*> (x .:> "createdTimestamp")
<*> (x .:> "lastModifiedTimestamp"))
instance Hashable DescribeUserProfile where
instance NFData DescribeUserProfile where
instance ToHeaders DescribeUserProfile where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("CodeStar_20170419.DescribeUserProfile" ::
ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON DescribeUserProfile where
toJSON DescribeUserProfile'{..}
= object
(catMaybes [Just ("userArn" .= _dupUserARN)])
instance ToPath DescribeUserProfile where
toPath = const "/"
instance ToQuery DescribeUserProfile where
toQuery = const mempty
data DescribeUserProfileResponse = DescribeUserProfileResponse'
{ _duprsSshPublicKey :: !(Maybe Text)
, _duprsEmailAddress :: !(Maybe (Sensitive Text))
, _duprsDisplayName :: !(Maybe Text)
, _duprsResponseStatus :: !Int
, _duprsUserARN :: !Text
, _duprsCreatedTimestamp :: !POSIX
, _duprsLastModifiedTimestamp :: !POSIX
} deriving (Eq, Show, Data, Typeable, Generic)
describeUserProfileResponse
:: Int
-> Text
-> UTCTime
-> UTCTime
-> DescribeUserProfileResponse
describeUserProfileResponse pResponseStatus_ pUserARN_ pCreatedTimestamp_ pLastModifiedTimestamp_ =
DescribeUserProfileResponse'
{ _duprsSshPublicKey = Nothing
, _duprsEmailAddress = Nothing
, _duprsDisplayName = Nothing
, _duprsResponseStatus = pResponseStatus_
, _duprsUserARN = pUserARN_
, _duprsCreatedTimestamp = _Time # pCreatedTimestamp_
, _duprsLastModifiedTimestamp = _Time # pLastModifiedTimestamp_
}
duprsSshPublicKey :: Lens' DescribeUserProfileResponse (Maybe Text)
duprsSshPublicKey = lens _duprsSshPublicKey (\ s a -> s{_duprsSshPublicKey = a})
duprsEmailAddress :: Lens' DescribeUserProfileResponse (Maybe Text)
duprsEmailAddress = lens _duprsEmailAddress (\ s a -> s{_duprsEmailAddress = a}) . mapping _Sensitive
duprsDisplayName :: Lens' DescribeUserProfileResponse (Maybe Text)
duprsDisplayName = lens _duprsDisplayName (\ s a -> s{_duprsDisplayName = a})
duprsResponseStatus :: Lens' DescribeUserProfileResponse Int
duprsResponseStatus = lens _duprsResponseStatus (\ s a -> s{_duprsResponseStatus = a})
duprsUserARN :: Lens' DescribeUserProfileResponse Text
duprsUserARN = lens _duprsUserARN (\ s a -> s{_duprsUserARN = a})
duprsCreatedTimestamp :: Lens' DescribeUserProfileResponse UTCTime
duprsCreatedTimestamp = lens _duprsCreatedTimestamp (\ s a -> s{_duprsCreatedTimestamp = a}) . _Time
duprsLastModifiedTimestamp :: Lens' DescribeUserProfileResponse UTCTime
duprsLastModifiedTimestamp = lens _duprsLastModifiedTimestamp (\ s a -> s{_duprsLastModifiedTimestamp = a}) . _Time
instance NFData DescribeUserProfileResponse where