module Network.AWS.IAM.ChangePassword
(
changePassword
, ChangePassword
, cpOldPassword
, cpNewPassword
, changePasswordResponse
, ChangePasswordResponse
) 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 ChangePassword = ChangePassword'
{ _cpOldPassword :: !(Sensitive Text)
, _cpNewPassword :: !(Sensitive Text)
} deriving (Eq,Read,Show,Data,Typeable,Generic)
changePassword
:: Text
-> Text
-> ChangePassword
changePassword pOldPassword_ pNewPassword_ =
ChangePassword'
{ _cpOldPassword = _Sensitive # pOldPassword_
, _cpNewPassword = _Sensitive # pNewPassword_
}
cpOldPassword :: Lens' ChangePassword Text
cpOldPassword = lens _cpOldPassword (\ s a -> s{_cpOldPassword = a}) . _Sensitive;
cpNewPassword :: Lens' ChangePassword Text
cpNewPassword = lens _cpNewPassword (\ s a -> s{_cpNewPassword = a}) . _Sensitive;
instance AWSRequest ChangePassword where
type Rs ChangePassword = ChangePasswordResponse
request = postQuery iam
response = receiveNull ChangePasswordResponse'
instance Hashable ChangePassword
instance NFData ChangePassword
instance ToHeaders ChangePassword where
toHeaders = const mempty
instance ToPath ChangePassword where
toPath = const "/"
instance ToQuery ChangePassword where
toQuery ChangePassword'{..}
= mconcat
["Action" =: ("ChangePassword" :: ByteString),
"Version" =: ("2010-05-08" :: ByteString),
"OldPassword" =: _cpOldPassword,
"NewPassword" =: _cpNewPassword]
data ChangePasswordResponse =
ChangePasswordResponse'
deriving (Eq,Read,Show,Data,Typeable,Generic)
changePasswordResponse
:: ChangePasswordResponse
changePasswordResponse = ChangePasswordResponse'
instance NFData ChangePasswordResponse