{-# 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.WorkMail.ResetPassword
(
resetPassword
, ResetPassword
, rpOrganizationId
, rpUserId
, rpPassword
, resetPasswordResponse
, ResetPasswordResponse
, rprsResponseStatus
) where
import Network.AWS.Lens
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
import Network.AWS.WorkMail.Types
import Network.AWS.WorkMail.Types.Product
data ResetPassword = ResetPassword'
{ _rpOrganizationId :: !Text
, _rpUserId :: !Text
, _rpPassword :: !(Sensitive Text)
} deriving (Eq, Show, Data, Typeable, Generic)
resetPassword
:: Text
-> Text
-> Text
-> ResetPassword
resetPassword pOrganizationId_ pUserId_ pPassword_ =
ResetPassword'
{ _rpOrganizationId = pOrganizationId_
, _rpUserId = pUserId_
, _rpPassword = _Sensitive # pPassword_
}
rpOrganizationId :: Lens' ResetPassword Text
rpOrganizationId = lens _rpOrganizationId (\ s a -> s{_rpOrganizationId = a})
rpUserId :: Lens' ResetPassword Text
rpUserId = lens _rpUserId (\ s a -> s{_rpUserId = a})
rpPassword :: Lens' ResetPassword Text
rpPassword = lens _rpPassword (\ s a -> s{_rpPassword = a}) . _Sensitive
instance AWSRequest ResetPassword where
type Rs ResetPassword = ResetPasswordResponse
request = postJSON workMail
response
= receiveEmpty
(\ s h x ->
ResetPasswordResponse' <$> (pure (fromEnum s)))
instance Hashable ResetPassword where
instance NFData ResetPassword where
instance ToHeaders ResetPassword where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("WorkMailService.ResetPassword" :: ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON ResetPassword where
toJSON ResetPassword'{..}
= object
(catMaybes
[Just ("OrganizationId" .= _rpOrganizationId),
Just ("UserId" .= _rpUserId),
Just ("Password" .= _rpPassword)])
instance ToPath ResetPassword where
toPath = const "/"
instance ToQuery ResetPassword where
toQuery = const mempty
newtype ResetPasswordResponse = ResetPasswordResponse'
{ _rprsResponseStatus :: Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
resetPasswordResponse
:: Int
-> ResetPasswordResponse
resetPasswordResponse pResponseStatus_ =
ResetPasswordResponse' {_rprsResponseStatus = pResponseStatus_}
rprsResponseStatus :: Lens' ResetPasswordResponse Int
rprsResponseStatus = lens _rprsResponseStatus (\ s a -> s{_rprsResponseStatus = a})
instance NFData ResetPasswordResponse where