{-# 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.DescribeVPCAttribute
(
describeVPCAttribute
, DescribeVPCAttribute
, dvpcaDryRun
, dvpcaAttribute
, dvpcaVPCId
, describeVPCAttributeResponse
, DescribeVPCAttributeResponse
, dvpcarsEnableDNSHostnames
, dvpcarsEnableDNSSupport
, dvpcarsVPCId
, dvpcarsResponseStatus
) 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 DescribeVPCAttribute = DescribeVPCAttribute'
{ _dvpcaDryRun :: !(Maybe Bool)
, _dvpcaAttribute :: !VPCAttributeName
, _dvpcaVPCId :: !Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
describeVPCAttribute
:: VPCAttributeName
-> Text
-> DescribeVPCAttribute
describeVPCAttribute pAttribute_ pVPCId_ =
DescribeVPCAttribute'
{ _dvpcaDryRun = Nothing
, _dvpcaAttribute = pAttribute_
, _dvpcaVPCId = pVPCId_
}
dvpcaDryRun :: Lens' DescribeVPCAttribute (Maybe Bool)
dvpcaDryRun = lens _dvpcaDryRun (\ s a -> s{_dvpcaDryRun = a})
dvpcaAttribute :: Lens' DescribeVPCAttribute VPCAttributeName
dvpcaAttribute = lens _dvpcaAttribute (\ s a -> s{_dvpcaAttribute = 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 Hashable DescribeVPCAttribute where
instance NFData DescribeVPCAttribute where
instance ToHeaders DescribeVPCAttribute where
toHeaders = const mempty
instance ToPath DescribeVPCAttribute where
toPath = const "/"
instance ToQuery DescribeVPCAttribute where
toQuery DescribeVPCAttribute'{..}
= mconcat
["Action" =: ("DescribeVpcAttribute" :: ByteString),
"Version" =: ("2016-11-15" :: ByteString),
"DryRun" =: _dvpcaDryRun,
"Attribute" =: _dvpcaAttribute,
"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})
instance NFData DescribeVPCAttributeResponse where