{-# 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.DescribeSecurityGroupReferences
(
describeSecurityGroupReferences
, DescribeSecurityGroupReferences
, dsgrDryRun
, dsgrGroupId
, describeSecurityGroupReferencesResponse
, DescribeSecurityGroupReferencesResponse
, dsgrrsSecurityGroupReferenceSet
, dsgrrsResponseStatus
) 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 DescribeSecurityGroupReferences = DescribeSecurityGroupReferences'
{ _dsgrDryRun :: !(Maybe Bool)
, _dsgrGroupId :: ![Text]
} deriving (Eq, Read, Show, Data, Typeable, Generic)
describeSecurityGroupReferences
:: DescribeSecurityGroupReferences
describeSecurityGroupReferences =
DescribeSecurityGroupReferences'
{_dsgrDryRun = Nothing, _dsgrGroupId = mempty}
dsgrDryRun :: Lens' DescribeSecurityGroupReferences (Maybe Bool)
dsgrDryRun = lens _dsgrDryRun (\ s a -> s{_dsgrDryRun = a})
dsgrGroupId :: Lens' DescribeSecurityGroupReferences [Text]
dsgrGroupId = lens _dsgrGroupId (\ s a -> s{_dsgrGroupId = a}) . _Coerce
instance AWSRequest DescribeSecurityGroupReferences
where
type Rs DescribeSecurityGroupReferences =
DescribeSecurityGroupReferencesResponse
request = postQuery ec2
response
= receiveXML
(\ s h x ->
DescribeSecurityGroupReferencesResponse' <$>
(x .@? "securityGroupReferenceSet" .!@ mempty >>=
may (parseXMLList "item"))
<*> (pure (fromEnum s)))
instance Hashable DescribeSecurityGroupReferences
where
instance NFData DescribeSecurityGroupReferences where
instance ToHeaders DescribeSecurityGroupReferences
where
toHeaders = const mempty
instance ToPath DescribeSecurityGroupReferences where
toPath = const "/"
instance ToQuery DescribeSecurityGroupReferences
where
toQuery DescribeSecurityGroupReferences'{..}
= mconcat
["Action" =:
("DescribeSecurityGroupReferences" :: ByteString),
"Version" =: ("2016-11-15" :: ByteString),
"DryRun" =: _dsgrDryRun,
toQueryList "GroupId" _dsgrGroupId]
data DescribeSecurityGroupReferencesResponse = DescribeSecurityGroupReferencesResponse'
{ _dsgrrsSecurityGroupReferenceSet :: !(Maybe [SecurityGroupReference])
, _dsgrrsResponseStatus :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
describeSecurityGroupReferencesResponse
:: Int
-> DescribeSecurityGroupReferencesResponse
describeSecurityGroupReferencesResponse pResponseStatus_ =
DescribeSecurityGroupReferencesResponse'
{ _dsgrrsSecurityGroupReferenceSet = Nothing
, _dsgrrsResponseStatus = pResponseStatus_
}
dsgrrsSecurityGroupReferenceSet :: Lens' DescribeSecurityGroupReferencesResponse [SecurityGroupReference]
dsgrrsSecurityGroupReferenceSet = lens _dsgrrsSecurityGroupReferenceSet (\ s a -> s{_dsgrrsSecurityGroupReferenceSet = a}) . _Default . _Coerce
dsgrrsResponseStatus :: Lens' DescribeSecurityGroupReferencesResponse Int
dsgrrsResponseStatus = lens _dsgrrsResponseStatus (\ s a -> s{_dsgrrsResponseStatus = a})
instance NFData
DescribeSecurityGroupReferencesResponse
where