{-# 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.EC2.RevokeSecurityGroupEgress
(
revokeSecurityGroupEgress
, RevokeSecurityGroupEgress
, rsgeFromPort
, rsgeIPPermissions
, rsgeIPProtocol
, rsgeToPort
, rsgeCidrIP
, rsgeSourceSecurityGroupOwnerId
, rsgeSourceSecurityGroupName
, rsgeDryRun
, rsgeGroupId
, revokeSecurityGroupEgressResponse
, RevokeSecurityGroupEgressResponse
) where
import Network.AWS.EC2.Types
import Network.AWS.EC2.Types.Product
import Network.AWS.Lens
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
data RevokeSecurityGroupEgress = RevokeSecurityGroupEgress'
{ _rsgeFromPort :: !(Maybe Int)
, _rsgeIPPermissions :: !(Maybe [IPPermission])
, _rsgeIPProtocol :: !(Maybe Text)
, _rsgeToPort :: !(Maybe Int)
, _rsgeCidrIP :: !(Maybe Text)
, _rsgeSourceSecurityGroupOwnerId :: !(Maybe Text)
, _rsgeSourceSecurityGroupName :: !(Maybe Text)
, _rsgeDryRun :: !(Maybe Bool)
, _rsgeGroupId :: !Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
revokeSecurityGroupEgress
:: Text
-> RevokeSecurityGroupEgress
revokeSecurityGroupEgress pGroupId_ =
RevokeSecurityGroupEgress'
{ _rsgeFromPort = Nothing
, _rsgeIPPermissions = Nothing
, _rsgeIPProtocol = Nothing
, _rsgeToPort = Nothing
, _rsgeCidrIP = Nothing
, _rsgeSourceSecurityGroupOwnerId = Nothing
, _rsgeSourceSecurityGroupName = Nothing
, _rsgeDryRun = Nothing
, _rsgeGroupId = pGroupId_
}
rsgeFromPort :: Lens' RevokeSecurityGroupEgress (Maybe Int)
rsgeFromPort = lens _rsgeFromPort (\ s a -> s{_rsgeFromPort = a})
rsgeIPPermissions :: Lens' RevokeSecurityGroupEgress [IPPermission]
rsgeIPPermissions = lens _rsgeIPPermissions (\ s a -> s{_rsgeIPPermissions = a}) . _Default . _Coerce
rsgeIPProtocol :: Lens' RevokeSecurityGroupEgress (Maybe Text)
rsgeIPProtocol = lens _rsgeIPProtocol (\ s a -> s{_rsgeIPProtocol = a})
rsgeToPort :: Lens' RevokeSecurityGroupEgress (Maybe Int)
rsgeToPort = lens _rsgeToPort (\ s a -> s{_rsgeToPort = a})
rsgeCidrIP :: Lens' RevokeSecurityGroupEgress (Maybe Text)
rsgeCidrIP = lens _rsgeCidrIP (\ s a -> s{_rsgeCidrIP = a})
rsgeSourceSecurityGroupOwnerId :: Lens' RevokeSecurityGroupEgress (Maybe Text)
rsgeSourceSecurityGroupOwnerId = lens _rsgeSourceSecurityGroupOwnerId (\ s a -> s{_rsgeSourceSecurityGroupOwnerId = a})
rsgeSourceSecurityGroupName :: Lens' RevokeSecurityGroupEgress (Maybe Text)
rsgeSourceSecurityGroupName = lens _rsgeSourceSecurityGroupName (\ s a -> s{_rsgeSourceSecurityGroupName = a})
rsgeDryRun :: Lens' RevokeSecurityGroupEgress (Maybe Bool)
rsgeDryRun = lens _rsgeDryRun (\ s a -> s{_rsgeDryRun = a})
rsgeGroupId :: Lens' RevokeSecurityGroupEgress Text
rsgeGroupId = lens _rsgeGroupId (\ s a -> s{_rsgeGroupId = a})
instance AWSRequest RevokeSecurityGroupEgress where
type Rs RevokeSecurityGroupEgress =
RevokeSecurityGroupEgressResponse
request = postQuery ec2
response
= receiveNull RevokeSecurityGroupEgressResponse'
instance Hashable RevokeSecurityGroupEgress where
instance NFData RevokeSecurityGroupEgress where
instance ToHeaders RevokeSecurityGroupEgress where
toHeaders = const mempty
instance ToPath RevokeSecurityGroupEgress where
toPath = const "/"
instance ToQuery RevokeSecurityGroupEgress where
toQuery RevokeSecurityGroupEgress'{..}
= mconcat
["Action" =:
("RevokeSecurityGroupEgress" :: ByteString),
"Version" =: ("2016-11-15" :: ByteString),
"FromPort" =: _rsgeFromPort,
toQuery
(toQueryList "IpPermissions" <$> _rsgeIPPermissions),
"IpProtocol" =: _rsgeIPProtocol,
"ToPort" =: _rsgeToPort, "CidrIp" =: _rsgeCidrIP,
"SourceSecurityGroupOwnerId" =:
_rsgeSourceSecurityGroupOwnerId,
"SourceSecurityGroupName" =:
_rsgeSourceSecurityGroupName,
"DryRun" =: _rsgeDryRun, "GroupId" =: _rsgeGroupId]
data RevokeSecurityGroupEgressResponse =
RevokeSecurityGroupEgressResponse'
deriving (Eq, Read, Show, Data, Typeable, Generic)
revokeSecurityGroupEgressResponse
:: RevokeSecurityGroupEgressResponse
revokeSecurityGroupEgressResponse = RevokeSecurityGroupEgressResponse'
instance NFData RevokeSecurityGroupEgressResponse
where