{-# 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.DeleteUser
(
deleteUser
, DeleteUser
, delOrganizationId
, delUserId
, deleteUserResponse
, DeleteUserResponse
, delrsResponseStatus
) 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 DeleteUser = DeleteUser'
{ _delOrganizationId :: !Text
, _delUserId :: !Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
deleteUser
:: Text
-> Text
-> DeleteUser
deleteUser pOrganizationId_ pUserId_ =
DeleteUser' {_delOrganizationId = pOrganizationId_, _delUserId = pUserId_}
delOrganizationId :: Lens' DeleteUser Text
delOrganizationId = lens _delOrganizationId (\ s a -> s{_delOrganizationId = a})
delUserId :: Lens' DeleteUser Text
delUserId = lens _delUserId (\ s a -> s{_delUserId = a})
instance AWSRequest DeleteUser where
type Rs DeleteUser = DeleteUserResponse
request = postJSON workMail
response
= receiveEmpty
(\ s h x ->
DeleteUserResponse' <$> (pure (fromEnum s)))
instance Hashable DeleteUser where
instance NFData DeleteUser where
instance ToHeaders DeleteUser where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("WorkMailService.DeleteUser" :: ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON DeleteUser where
toJSON DeleteUser'{..}
= object
(catMaybes
[Just ("OrganizationId" .= _delOrganizationId),
Just ("UserId" .= _delUserId)])
instance ToPath DeleteUser where
toPath = const "/"
instance ToQuery DeleteUser where
toQuery = const mempty
newtype DeleteUserResponse = DeleteUserResponse'
{ _delrsResponseStatus :: Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
deleteUserResponse
:: Int
-> DeleteUserResponse
deleteUserResponse pResponseStatus_ =
DeleteUserResponse' {_delrsResponseStatus = pResponseStatus_}
delrsResponseStatus :: Lens' DeleteUserResponse Int
delrsResponseStatus = lens _delrsResponseStatus (\ s a -> s{_delrsResponseStatus = a})
instance NFData DeleteUserResponse where