module Network.AWS.IAM.AttachUserPolicy
(
attachUserPolicy
, AttachUserPolicy
, aupUserName
, aupPolicyARN
, attachUserPolicyResponse
, AttachUserPolicyResponse
) 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
data AttachUserPolicy = AttachUserPolicy'
{ _aupUserName :: !Text
, _aupPolicyARN :: !Text
} deriving (Eq,Read,Show,Data,Typeable,Generic)
attachUserPolicy
:: Text
-> Text
-> AttachUserPolicy
attachUserPolicy pUserName_ pPolicyARN_ =
AttachUserPolicy'
{ _aupUserName = pUserName_
, _aupPolicyARN = pPolicyARN_
}
aupUserName :: Lens' AttachUserPolicy Text
aupUserName = lens _aupUserName (\ s a -> s{_aupUserName = a});
aupPolicyARN :: Lens' AttachUserPolicy Text
aupPolicyARN = lens _aupPolicyARN (\ s a -> s{_aupPolicyARN = a});
instance AWSRequest AttachUserPolicy where
type Rs AttachUserPolicy = AttachUserPolicyResponse
request = postQuery iam
response = receiveNull AttachUserPolicyResponse'
instance Hashable AttachUserPolicy
instance NFData AttachUserPolicy
instance ToHeaders AttachUserPolicy where
toHeaders = const mempty
instance ToPath AttachUserPolicy where
toPath = const "/"
instance ToQuery AttachUserPolicy where
toQuery AttachUserPolicy'{..}
= mconcat
["Action" =: ("AttachUserPolicy" :: ByteString),
"Version" =: ("2010-05-08" :: ByteString),
"UserName" =: _aupUserName,
"PolicyArn" =: _aupPolicyARN]
data AttachUserPolicyResponse =
AttachUserPolicyResponse'
deriving (Eq,Read,Show,Data,Typeable,Generic)
attachUserPolicyResponse
:: AttachUserPolicyResponse
attachUserPolicyResponse = AttachUserPolicyResponse'
instance NFData AttachUserPolicyResponse