{-# 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.DisassociateVPCCidrBlock
(
disassociateVPCCidrBlock
, DisassociateVPCCidrBlock
, dvcbAssociationId
, disassociateVPCCidrBlockResponse
, DisassociateVPCCidrBlockResponse
, dvcbrsVPCId
, dvcbrsCidrBlockAssociation
, dvcbrsIPv6CidrBlockAssociation
, dvcbrsResponseStatus
) 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
newtype DisassociateVPCCidrBlock = DisassociateVPCCidrBlock'
{ _dvcbAssociationId :: Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
disassociateVPCCidrBlock
:: Text
-> DisassociateVPCCidrBlock
disassociateVPCCidrBlock pAssociationId_ =
DisassociateVPCCidrBlock' {_dvcbAssociationId = pAssociationId_}
dvcbAssociationId :: Lens' DisassociateVPCCidrBlock Text
dvcbAssociationId = lens _dvcbAssociationId (\ s a -> s{_dvcbAssociationId = a})
instance AWSRequest DisassociateVPCCidrBlock where
type Rs DisassociateVPCCidrBlock =
DisassociateVPCCidrBlockResponse
request = postQuery ec2
response
= receiveXML
(\ s h x ->
DisassociateVPCCidrBlockResponse' <$>
(x .@? "vpcId") <*> (x .@? "cidrBlockAssociation")
<*> (x .@? "ipv6CidrBlockAssociation")
<*> (pure (fromEnum s)))
instance Hashable DisassociateVPCCidrBlock where
instance NFData DisassociateVPCCidrBlock where
instance ToHeaders DisassociateVPCCidrBlock where
toHeaders = const mempty
instance ToPath DisassociateVPCCidrBlock where
toPath = const "/"
instance ToQuery DisassociateVPCCidrBlock where
toQuery DisassociateVPCCidrBlock'{..}
= mconcat
["Action" =:
("DisassociateVpcCidrBlock" :: ByteString),
"Version" =: ("2016-11-15" :: ByteString),
"AssociationId" =: _dvcbAssociationId]
data DisassociateVPCCidrBlockResponse = DisassociateVPCCidrBlockResponse'
{ _dvcbrsVPCId :: !(Maybe Text)
, _dvcbrsCidrBlockAssociation :: !(Maybe VPCCidrBlockAssociation)
, _dvcbrsIPv6CidrBlockAssociation :: !(Maybe VPCIPv6CidrBlockAssociation)
, _dvcbrsResponseStatus :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
disassociateVPCCidrBlockResponse
:: Int
-> DisassociateVPCCidrBlockResponse
disassociateVPCCidrBlockResponse pResponseStatus_ =
DisassociateVPCCidrBlockResponse'
{ _dvcbrsVPCId = Nothing
, _dvcbrsCidrBlockAssociation = Nothing
, _dvcbrsIPv6CidrBlockAssociation = Nothing
, _dvcbrsResponseStatus = pResponseStatus_
}
dvcbrsVPCId :: Lens' DisassociateVPCCidrBlockResponse (Maybe Text)
dvcbrsVPCId = lens _dvcbrsVPCId (\ s a -> s{_dvcbrsVPCId = a})
dvcbrsCidrBlockAssociation :: Lens' DisassociateVPCCidrBlockResponse (Maybe VPCCidrBlockAssociation)
dvcbrsCidrBlockAssociation = lens _dvcbrsCidrBlockAssociation (\ s a -> s{_dvcbrsCidrBlockAssociation = a})
dvcbrsIPv6CidrBlockAssociation :: Lens' DisassociateVPCCidrBlockResponse (Maybe VPCIPv6CidrBlockAssociation)
dvcbrsIPv6CidrBlockAssociation = lens _dvcbrsIPv6CidrBlockAssociation (\ s a -> s{_dvcbrsIPv6CidrBlockAssociation = a})
dvcbrsResponseStatus :: Lens' DisassociateVPCCidrBlockResponse Int
dvcbrsResponseStatus = lens _dvcbrsResponseStatus (\ s a -> s{_dvcbrsResponseStatus = a})
instance NFData DisassociateVPCCidrBlockResponse
where