module Network.AWS.ElastiCache.AuthorizeCacheSecurityGroupIngress
(
AuthorizeCacheSecurityGroupIngress
, authorizeCacheSecurityGroupIngress
, acsgiCacheSecurityGroupName
, acsgiEC2SecurityGroupName
, acsgiEC2SecurityGroupOwnerId
, AuthorizeCacheSecurityGroupIngressResponse
, authorizeCacheSecurityGroupIngressResponse
, acsgirCacheSecurityGroup
) where
import Network.AWS.Prelude
import Network.AWS.Request.Query
import Network.AWS.ElastiCache.Types
import qualified GHC.Exts
data AuthorizeCacheSecurityGroupIngress = AuthorizeCacheSecurityGroupIngress
{ _acsgiCacheSecurityGroupName :: Text
, _acsgiEC2SecurityGroupName :: Text
, _acsgiEC2SecurityGroupOwnerId :: Text
} deriving (Eq, Ord, Show)
authorizeCacheSecurityGroupIngress :: Text
-> Text
-> Text
-> AuthorizeCacheSecurityGroupIngress
authorizeCacheSecurityGroupIngress p1 p2 p3 = AuthorizeCacheSecurityGroupIngress
{ _acsgiCacheSecurityGroupName = p1
, _acsgiEC2SecurityGroupName = p2
, _acsgiEC2SecurityGroupOwnerId = p3
}
acsgiCacheSecurityGroupName :: Lens' AuthorizeCacheSecurityGroupIngress Text
acsgiCacheSecurityGroupName =
lens _acsgiCacheSecurityGroupName
(\s a -> s { _acsgiCacheSecurityGroupName = a })
acsgiEC2SecurityGroupName :: Lens' AuthorizeCacheSecurityGroupIngress Text
acsgiEC2SecurityGroupName =
lens _acsgiEC2SecurityGroupName
(\s a -> s { _acsgiEC2SecurityGroupName = a })
acsgiEC2SecurityGroupOwnerId :: Lens' AuthorizeCacheSecurityGroupIngress Text
acsgiEC2SecurityGroupOwnerId =
lens _acsgiEC2SecurityGroupOwnerId
(\s a -> s { _acsgiEC2SecurityGroupOwnerId = a })
newtype AuthorizeCacheSecurityGroupIngressResponse = AuthorizeCacheSecurityGroupIngressResponse
{ _acsgirCacheSecurityGroup :: Maybe CacheSecurityGroup
} deriving (Eq, Show)
authorizeCacheSecurityGroupIngressResponse :: AuthorizeCacheSecurityGroupIngressResponse
authorizeCacheSecurityGroupIngressResponse = AuthorizeCacheSecurityGroupIngressResponse
{ _acsgirCacheSecurityGroup = Nothing
}
acsgirCacheSecurityGroup :: Lens' AuthorizeCacheSecurityGroupIngressResponse (Maybe CacheSecurityGroup)
acsgirCacheSecurityGroup =
lens _acsgirCacheSecurityGroup
(\s a -> s { _acsgirCacheSecurityGroup = a })
instance ToPath AuthorizeCacheSecurityGroupIngress where
toPath = const "/"
instance ToQuery AuthorizeCacheSecurityGroupIngress where
toQuery AuthorizeCacheSecurityGroupIngress{..} = mconcat
[ "CacheSecurityGroupName" =? _acsgiCacheSecurityGroupName
, "EC2SecurityGroupName" =? _acsgiEC2SecurityGroupName
, "EC2SecurityGroupOwnerId" =? _acsgiEC2SecurityGroupOwnerId
]
instance ToHeaders AuthorizeCacheSecurityGroupIngress
instance AWSRequest AuthorizeCacheSecurityGroupIngress where
type Sv AuthorizeCacheSecurityGroupIngress = ElastiCache
type Rs AuthorizeCacheSecurityGroupIngress = AuthorizeCacheSecurityGroupIngressResponse
request = post "AuthorizeCacheSecurityGroupIngress"
response = xmlResponse
instance FromXML AuthorizeCacheSecurityGroupIngressResponse where
parseXML = withElement "AuthorizeCacheSecurityGroupIngressResult" $ \x -> AuthorizeCacheSecurityGroupIngressResponse
<$> x .@? "CacheSecurityGroup"