{-# 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.DeleteGroup
(
deleteGroup
, DeleteGroup
, dggOrganizationId
, dggGroupId
, deleteGroupResponse
, DeleteGroupResponse
, dgrsResponseStatus
) 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 DeleteGroup = DeleteGroup'
{ _dggOrganizationId :: !Text
, _dggGroupId :: !Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
deleteGroup
:: Text
-> Text
-> DeleteGroup
deleteGroup pOrganizationId_ pGroupId_ =
DeleteGroup' {_dggOrganizationId = pOrganizationId_, _dggGroupId = pGroupId_}
dggOrganizationId :: Lens' DeleteGroup Text
dggOrganizationId = lens _dggOrganizationId (\ s a -> s{_dggOrganizationId = a})
dggGroupId :: Lens' DeleteGroup Text
dggGroupId = lens _dggGroupId (\ s a -> s{_dggGroupId = a})
instance AWSRequest DeleteGroup where
type Rs DeleteGroup = DeleteGroupResponse
request = postJSON workMail
response
= receiveEmpty
(\ s h x ->
DeleteGroupResponse' <$> (pure (fromEnum s)))
instance Hashable DeleteGroup where
instance NFData DeleteGroup where
instance ToHeaders DeleteGroup where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("WorkMailService.DeleteGroup" :: ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON DeleteGroup where
toJSON DeleteGroup'{..}
= object
(catMaybes
[Just ("OrganizationId" .= _dggOrganizationId),
Just ("GroupId" .= _dggGroupId)])
instance ToPath DeleteGroup where
toPath = const "/"
instance ToQuery DeleteGroup where
toQuery = const mempty
newtype DeleteGroupResponse = DeleteGroupResponse'
{ _dgrsResponseStatus :: Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
deleteGroupResponse
:: Int
-> DeleteGroupResponse
deleteGroupResponse pResponseStatus_ =
DeleteGroupResponse' {_dgrsResponseStatus = pResponseStatus_}
dgrsResponseStatus :: Lens' DeleteGroupResponse Int
dgrsResponseStatus = lens _dgrsResponseStatus (\ s a -> s{_dgrsResponseStatus = a})
instance NFData DeleteGroupResponse where