{-# 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.WorkSpaces.UpdateRulesOfIPGroup
(
updateRulesOfIPGroup
, UpdateRulesOfIPGroup
, uroigGroupId
, uroigUserRules
, updateRulesOfIPGroupResponse
, UpdateRulesOfIPGroupResponse
, uroigrsResponseStatus
) where
import Network.AWS.Lens
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
import Network.AWS.WorkSpaces.Types
import Network.AWS.WorkSpaces.Types.Product
data UpdateRulesOfIPGroup = UpdateRulesOfIPGroup'
{ _uroigGroupId :: !Text
, _uroigUserRules :: ![IPRuleItem]
} deriving (Eq, Read, Show, Data, Typeable, Generic)
updateRulesOfIPGroup
:: Text
-> UpdateRulesOfIPGroup
updateRulesOfIPGroup pGroupId_ =
UpdateRulesOfIPGroup' {_uroigGroupId = pGroupId_, _uroigUserRules = mempty}
uroigGroupId :: Lens' UpdateRulesOfIPGroup Text
uroigGroupId = lens _uroigGroupId (\ s a -> s{_uroigGroupId = a})
uroigUserRules :: Lens' UpdateRulesOfIPGroup [IPRuleItem]
uroigUserRules = lens _uroigUserRules (\ s a -> s{_uroigUserRules = a}) . _Coerce
instance AWSRequest UpdateRulesOfIPGroup where
type Rs UpdateRulesOfIPGroup =
UpdateRulesOfIPGroupResponse
request = postJSON workSpaces
response
= receiveEmpty
(\ s h x ->
UpdateRulesOfIPGroupResponse' <$>
(pure (fromEnum s)))
instance Hashable UpdateRulesOfIPGroup where
instance NFData UpdateRulesOfIPGroup where
instance ToHeaders UpdateRulesOfIPGroup where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("WorkspacesService.UpdateRulesOfIpGroup" ::
ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON UpdateRulesOfIPGroup where
toJSON UpdateRulesOfIPGroup'{..}
= object
(catMaybes
[Just ("GroupId" .= _uroigGroupId),
Just ("UserRules" .= _uroigUserRules)])
instance ToPath UpdateRulesOfIPGroup where
toPath = const "/"
instance ToQuery UpdateRulesOfIPGroup where
toQuery = const mempty
newtype UpdateRulesOfIPGroupResponse = UpdateRulesOfIPGroupResponse'
{ _uroigrsResponseStatus :: Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
updateRulesOfIPGroupResponse
:: Int
-> UpdateRulesOfIPGroupResponse
updateRulesOfIPGroupResponse pResponseStatus_ =
UpdateRulesOfIPGroupResponse' {_uroigrsResponseStatus = pResponseStatus_}
uroigrsResponseStatus :: Lens' UpdateRulesOfIPGroupResponse Int
uroigrsResponseStatus = lens _uroigrsResponseStatus (\ s a -> s{_uroigrsResponseStatus = a})
instance NFData UpdateRulesOfIPGroupResponse where