module Network.AWS.CognitoIdentityProvider.AdminResetUserPassword
(
adminResetUserPassword
, AdminResetUserPassword
, arupUserPoolId
, arupUsername
, adminResetUserPasswordResponse
, AdminResetUserPasswordResponse
, aruprsResponseStatus
) where
import Network.AWS.CognitoIdentityProvider.Types
import Network.AWS.CognitoIdentityProvider.Types.Product
import Network.AWS.Lens
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
data AdminResetUserPassword = AdminResetUserPassword'
{ _arupUserPoolId :: !Text
, _arupUsername :: !(Sensitive Text)
} deriving (Eq,Read,Show,Data,Typeable,Generic)
adminResetUserPassword
:: Text
-> Text
-> AdminResetUserPassword
adminResetUserPassword pUserPoolId_ pUsername_ =
AdminResetUserPassword'
{ _arupUserPoolId = pUserPoolId_
, _arupUsername = _Sensitive # pUsername_
}
arupUserPoolId :: Lens' AdminResetUserPassword Text
arupUserPoolId = lens _arupUserPoolId (\ s a -> s{_arupUserPoolId = a});
arupUsername :: Lens' AdminResetUserPassword Text
arupUsername = lens _arupUsername (\ s a -> s{_arupUsername = a}) . _Sensitive;
instance AWSRequest AdminResetUserPassword where
type Rs AdminResetUserPassword =
AdminResetUserPasswordResponse
request = postJSON cognitoIdentityProvider
response
= receiveEmpty
(\ s h x ->
AdminResetUserPasswordResponse' <$>
(pure (fromEnum s)))
instance Hashable AdminResetUserPassword
instance NFData AdminResetUserPassword
instance ToHeaders AdminResetUserPassword where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("AWSCognitoIdentityProviderService.AdminResetUserPassword"
:: ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON AdminResetUserPassword where
toJSON AdminResetUserPassword'{..}
= object
(catMaybes
[Just ("UserPoolId" .= _arupUserPoolId),
Just ("Username" .= _arupUsername)])
instance ToPath AdminResetUserPassword where
toPath = const "/"
instance ToQuery AdminResetUserPassword where
toQuery = const mempty
newtype AdminResetUserPasswordResponse = AdminResetUserPasswordResponse'
{ _aruprsResponseStatus :: Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
adminResetUserPasswordResponse
:: Int
-> AdminResetUserPasswordResponse
adminResetUserPasswordResponse pResponseStatus_ =
AdminResetUserPasswordResponse'
{ _aruprsResponseStatus = pResponseStatus_
}
aruprsResponseStatus :: Lens' AdminResetUserPasswordResponse Int
aruprsResponseStatus = lens _aruprsResponseStatus (\ s a -> s{_aruprsResponseStatus = a});
instance NFData AdminResetUserPasswordResponse