module Network.AWS.EC2.DescribeVPCAttribute
(
describeVPCAttribute
, DescribeVPCAttribute
, dvpcaAttribute
, dvpcaDryRun
, dvpcaVPCId
, describeVPCAttributeResponse
, DescribeVPCAttributeResponse
, dvpcarsEnableDNSHostnames
, dvpcarsEnableDNSSupport
, dvpcarsVPCId
, dvpcarsResponseStatus
) where
import Network.AWS.EC2.Types
import Network.AWS.EC2.Types.Product
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
data DescribeVPCAttribute = DescribeVPCAttribute'
{ _dvpcaAttribute :: !(Maybe VPCAttributeName)
, _dvpcaDryRun :: !(Maybe Bool)
, _dvpcaVPCId :: !Text
} deriving (Eq,Read,Show,Data,Typeable,Generic)
describeVPCAttribute
:: Text
-> DescribeVPCAttribute
describeVPCAttribute pVPCId_ =
DescribeVPCAttribute'
{ _dvpcaAttribute = Nothing
, _dvpcaDryRun = Nothing
, _dvpcaVPCId = pVPCId_
}
dvpcaAttribute :: Lens' DescribeVPCAttribute (Maybe VPCAttributeName)
dvpcaAttribute = lens _dvpcaAttribute (\ s a -> s{_dvpcaAttribute = a});
dvpcaDryRun :: Lens' DescribeVPCAttribute (Maybe Bool)
dvpcaDryRun = lens _dvpcaDryRun (\ s a -> s{_dvpcaDryRun = a});
dvpcaVPCId :: Lens' DescribeVPCAttribute Text
dvpcaVPCId = lens _dvpcaVPCId (\ s a -> s{_dvpcaVPCId = a});
instance AWSRequest DescribeVPCAttribute where
type Rs DescribeVPCAttribute =
DescribeVPCAttributeResponse
request = postQuery eC2
response
= receiveXML
(\ s h x ->
DescribeVPCAttributeResponse' <$>
(x .@? "enableDnsHostnames") <*>
(x .@? "enableDnsSupport")
<*> (x .@? "vpcId")
<*> (pure (fromEnum s)))
instance ToHeaders DescribeVPCAttribute where
toHeaders = const mempty
instance ToPath DescribeVPCAttribute where
toPath = const "/"
instance ToQuery DescribeVPCAttribute where
toQuery DescribeVPCAttribute'{..}
= mconcat
["Action" =: ("DescribeVpcAttribute" :: ByteString),
"Version" =: ("2015-10-01" :: ByteString),
"Attribute" =: _dvpcaAttribute,
"DryRun" =: _dvpcaDryRun, "VpcId" =: _dvpcaVPCId]
data DescribeVPCAttributeResponse = DescribeVPCAttributeResponse'
{ _dvpcarsEnableDNSHostnames :: !(Maybe AttributeBooleanValue)
, _dvpcarsEnableDNSSupport :: !(Maybe AttributeBooleanValue)
, _dvpcarsVPCId :: !(Maybe Text)
, _dvpcarsResponseStatus :: !Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
describeVPCAttributeResponse
:: Int
-> DescribeVPCAttributeResponse
describeVPCAttributeResponse pResponseStatus_ =
DescribeVPCAttributeResponse'
{ _dvpcarsEnableDNSHostnames = Nothing
, _dvpcarsEnableDNSSupport = Nothing
, _dvpcarsVPCId = Nothing
, _dvpcarsResponseStatus = pResponseStatus_
}
dvpcarsEnableDNSHostnames :: Lens' DescribeVPCAttributeResponse (Maybe AttributeBooleanValue)
dvpcarsEnableDNSHostnames = lens _dvpcarsEnableDNSHostnames (\ s a -> s{_dvpcarsEnableDNSHostnames = a});
dvpcarsEnableDNSSupport :: Lens' DescribeVPCAttributeResponse (Maybe AttributeBooleanValue)
dvpcarsEnableDNSSupport = lens _dvpcarsEnableDNSSupport (\ s a -> s{_dvpcarsEnableDNSSupport = a});
dvpcarsVPCId :: Lens' DescribeVPCAttributeResponse (Maybe Text)
dvpcarsVPCId = lens _dvpcarsVPCId (\ s a -> s{_dvpcarsVPCId = a});
dvpcarsResponseStatus :: Lens' DescribeVPCAttributeResponse Int
dvpcarsResponseStatus = lens _dvpcarsResponseStatus (\ s a -> s{_dvpcarsResponseStatus = a});