{-# 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.IAM.GetLoginProfile
(
getLoginProfile
, GetLoginProfile
, glpUserName
, getLoginProfileResponse
, GetLoginProfileResponse
, glprsResponseStatus
, glprsLoginProfile
) where
import Network.AWS.IAM.Types
import Network.AWS.IAM.Types.Product
import Network.AWS.Lens
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
newtype GetLoginProfile = GetLoginProfile'
{ _glpUserName :: Text
} deriving (Eq,Read,Show,Data,Typeable,Generic)
getLoginProfile
:: Text
-> GetLoginProfile
getLoginProfile pUserName_ =
GetLoginProfile'
{ _glpUserName = pUserName_
}
glpUserName :: Lens' GetLoginProfile Text
glpUserName = lens _glpUserName (\ s a -> s{_glpUserName = a});
instance AWSRequest GetLoginProfile where
type Rs GetLoginProfile = GetLoginProfileResponse
request = postQuery iam
response
= receiveXMLWrapper "GetLoginProfileResult"
(\ s h x ->
GetLoginProfileResponse' <$>
(pure (fromEnum s)) <*> (x .@ "LoginProfile"))
instance Hashable GetLoginProfile
instance NFData GetLoginProfile
instance ToHeaders GetLoginProfile where
toHeaders = const mempty
instance ToPath GetLoginProfile where
toPath = const "/"
instance ToQuery GetLoginProfile where
toQuery GetLoginProfile'{..}
= mconcat
["Action" =: ("GetLoginProfile" :: ByteString),
"Version" =: ("2010-05-08" :: ByteString),
"UserName" =: _glpUserName]
data GetLoginProfileResponse = GetLoginProfileResponse'
{ _glprsResponseStatus :: !Int
, _glprsLoginProfile :: !LoginProfile
} deriving (Eq,Read,Show,Data,Typeable,Generic)
getLoginProfileResponse
:: Int
-> LoginProfile
-> GetLoginProfileResponse
getLoginProfileResponse pResponseStatus_ pLoginProfile_ =
GetLoginProfileResponse'
{ _glprsResponseStatus = pResponseStatus_
, _glprsLoginProfile = pLoginProfile_
}
glprsResponseStatus :: Lens' GetLoginProfileResponse Int
glprsResponseStatus = lens _glprsResponseStatus (\ s a -> s{_glprsResponseStatus = a});
glprsLoginProfile :: Lens' GetLoginProfileResponse LoginProfile
glprsLoginProfile = lens _glprsLoginProfile (\ s a -> s{_glprsLoginProfile = a});
instance NFData GetLoginProfileResponse