{-# 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.MoveAddressToVPC
(
moveAddressToVPC
, MoveAddressToVPC
, matvDryRun
, matvPublicIP
, moveAddressToVPCResponse
, MoveAddressToVPCResponse
, matvrsStatus
, matvrsAllocationId
, matvrsResponseStatus
) 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 MoveAddressToVPC = MoveAddressToVPC'
{ _matvDryRun :: !(Maybe Bool)
, _matvPublicIP :: !Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
moveAddressToVPC
:: Text
-> MoveAddressToVPC
moveAddressToVPC pPublicIP_ =
MoveAddressToVPC' {_matvDryRun = Nothing, _matvPublicIP = pPublicIP_}
matvDryRun :: Lens' MoveAddressToVPC (Maybe Bool)
matvDryRun = lens _matvDryRun (\ s a -> s{_matvDryRun = a})
matvPublicIP :: Lens' MoveAddressToVPC Text
matvPublicIP = lens _matvPublicIP (\ s a -> s{_matvPublicIP = a})
instance AWSRequest MoveAddressToVPC where
type Rs MoveAddressToVPC = MoveAddressToVPCResponse
request = postQuery ec2
response
= receiveXML
(\ s h x ->
MoveAddressToVPCResponse' <$>
(x .@? "status") <*> (x .@? "allocationId") <*>
(pure (fromEnum s)))
instance Hashable MoveAddressToVPC where
instance NFData MoveAddressToVPC where
instance ToHeaders MoveAddressToVPC where
toHeaders = const mempty
instance ToPath MoveAddressToVPC where
toPath = const "/"
instance ToQuery MoveAddressToVPC where
toQuery MoveAddressToVPC'{..}
= mconcat
["Action" =: ("MoveAddressToVpc" :: ByteString),
"Version" =: ("2016-11-15" :: ByteString),
"DryRun" =: _matvDryRun, "PublicIp" =: _matvPublicIP]
data MoveAddressToVPCResponse = MoveAddressToVPCResponse'
{ _matvrsStatus :: !(Maybe AddressStatus)
, _matvrsAllocationId :: !(Maybe Text)
, _matvrsResponseStatus :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
moveAddressToVPCResponse
:: Int
-> MoveAddressToVPCResponse
moveAddressToVPCResponse pResponseStatus_ =
MoveAddressToVPCResponse'
{ _matvrsStatus = Nothing
, _matvrsAllocationId = Nothing
, _matvrsResponseStatus = pResponseStatus_
}
matvrsStatus :: Lens' MoveAddressToVPCResponse (Maybe AddressStatus)
matvrsStatus = lens _matvrsStatus (\ s a -> s{_matvrsStatus = a})
matvrsAllocationId :: Lens' MoveAddressToVPCResponse (Maybe Text)
matvrsAllocationId = lens _matvrsAllocationId (\ s a -> s{_matvrsAllocationId = a})
matvrsResponseStatus :: Lens' MoveAddressToVPCResponse Int
matvrsResponseStatus = lens _matvrsResponseStatus (\ s a -> s{_matvrsResponseStatus = a})
instance NFData MoveAddressToVPCResponse where