module Network.AWS.EC2.DescribeMovingAddresses
(
describeMovingAddresses
, DescribeMovingAddresses
, dmaFilters
, dmaPublicIPs
, dmaNextToken
, dmaDryRun
, dmaMaxResults
, describeMovingAddressesResponse
, DescribeMovingAddressesResponse
, dmarsMovingAddressStatuses
, dmarsNextToken
, dmarsResponseStatus
) 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 DescribeMovingAddresses = DescribeMovingAddresses'
{ _dmaFilters :: !(Maybe [Filter])
, _dmaPublicIPs :: !(Maybe [Text])
, _dmaNextToken :: !(Maybe Text)
, _dmaDryRun :: !(Maybe Bool)
, _dmaMaxResults :: !(Maybe Int)
} deriving (Eq,Read,Show,Data,Typeable,Generic)
describeMovingAddresses
:: DescribeMovingAddresses
describeMovingAddresses =
DescribeMovingAddresses'
{ _dmaFilters = Nothing
, _dmaPublicIPs = Nothing
, _dmaNextToken = Nothing
, _dmaDryRun = Nothing
, _dmaMaxResults = Nothing
}
dmaFilters :: Lens' DescribeMovingAddresses [Filter]
dmaFilters = lens _dmaFilters (\ s a -> s{_dmaFilters = a}) . _Default . _Coerce;
dmaPublicIPs :: Lens' DescribeMovingAddresses [Text]
dmaPublicIPs = lens _dmaPublicIPs (\ s a -> s{_dmaPublicIPs = a}) . _Default . _Coerce;
dmaNextToken :: Lens' DescribeMovingAddresses (Maybe Text)
dmaNextToken = lens _dmaNextToken (\ s a -> s{_dmaNextToken = a});
dmaDryRun :: Lens' DescribeMovingAddresses (Maybe Bool)
dmaDryRun = lens _dmaDryRun (\ s a -> s{_dmaDryRun = a});
dmaMaxResults :: Lens' DescribeMovingAddresses (Maybe Int)
dmaMaxResults = lens _dmaMaxResults (\ s a -> s{_dmaMaxResults = a});
instance AWSRequest DescribeMovingAddresses where
type Rs DescribeMovingAddresses =
DescribeMovingAddressesResponse
request = postQuery eC2
response
= receiveXML
(\ s h x ->
DescribeMovingAddressesResponse' <$>
(x .@? "movingAddressStatusSet" .!@ mempty >>=
may (parseXMLList "item"))
<*> (x .@? "nextToken")
<*> (pure (fromEnum s)))
instance ToHeaders DescribeMovingAddresses where
toHeaders = const mempty
instance ToPath DescribeMovingAddresses where
toPath = const "/"
instance ToQuery DescribeMovingAddresses where
toQuery DescribeMovingAddresses'{..}
= mconcat
["Action" =:
("DescribeMovingAddresses" :: ByteString),
"Version" =: ("2015-04-15" :: ByteString),
toQuery (toQueryList "Filter" <$> _dmaFilters),
toQuery (toQueryList "PublicIp" <$> _dmaPublicIPs),
"NextToken" =: _dmaNextToken, "DryRun" =: _dmaDryRun,
"MaxResults" =: _dmaMaxResults]
data DescribeMovingAddressesResponse = DescribeMovingAddressesResponse'
{ _dmarsMovingAddressStatuses :: !(Maybe [MovingAddressStatus])
, _dmarsNextToken :: !(Maybe Text)
, _dmarsResponseStatus :: !Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
describeMovingAddressesResponse
:: Int
-> DescribeMovingAddressesResponse
describeMovingAddressesResponse pResponseStatus_ =
DescribeMovingAddressesResponse'
{ _dmarsMovingAddressStatuses = Nothing
, _dmarsNextToken = Nothing
, _dmarsResponseStatus = pResponseStatus_
}
dmarsMovingAddressStatuses :: Lens' DescribeMovingAddressesResponse [MovingAddressStatus]
dmarsMovingAddressStatuses = lens _dmarsMovingAddressStatuses (\ s a -> s{_dmarsMovingAddressStatuses = a}) . _Default . _Coerce;
dmarsNextToken :: Lens' DescribeMovingAddressesResponse (Maybe Text)
dmarsNextToken = lens _dmarsNextToken (\ s a -> s{_dmarsNextToken = a});
dmarsResponseStatus :: Lens' DescribeMovingAddressesResponse Int
dmarsResponseStatus = lens _dmarsResponseStatus (\ s a -> s{_dmarsResponseStatus = a});