{-# 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.DirectConnect.DescribeDirectConnectGatewayAssociations
(
describeDirectConnectGatewayAssociations
, DescribeDirectConnectGatewayAssociations
, ddcgaVirtualGatewayId
, ddcgaDirectConnectGatewayId
, ddcgaNextToken
, ddcgaMaxResults
, describeDirectConnectGatewayAssociationsResponse
, DescribeDirectConnectGatewayAssociationsResponse
, ddcgarsNextToken
, ddcgarsDirectConnectGatewayAssociations
, ddcgarsResponseStatus
) where
import Network.AWS.DirectConnect.Types
import Network.AWS.DirectConnect.Types.Product
import Network.AWS.Lens
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
data DescribeDirectConnectGatewayAssociations = DescribeDirectConnectGatewayAssociations'
{ _ddcgaVirtualGatewayId :: !(Maybe Text)
, _ddcgaDirectConnectGatewayId :: !(Maybe Text)
, _ddcgaNextToken :: !(Maybe Text)
, _ddcgaMaxResults :: !(Maybe Int)
} deriving (Eq, Read, Show, Data, Typeable, Generic)
describeDirectConnectGatewayAssociations
:: DescribeDirectConnectGatewayAssociations
describeDirectConnectGatewayAssociations =
DescribeDirectConnectGatewayAssociations'
{ _ddcgaVirtualGatewayId = Nothing
, _ddcgaDirectConnectGatewayId = Nothing
, _ddcgaNextToken = Nothing
, _ddcgaMaxResults = Nothing
}
ddcgaVirtualGatewayId :: Lens' DescribeDirectConnectGatewayAssociations (Maybe Text)
ddcgaVirtualGatewayId = lens _ddcgaVirtualGatewayId (\ s a -> s{_ddcgaVirtualGatewayId = a})
ddcgaDirectConnectGatewayId :: Lens' DescribeDirectConnectGatewayAssociations (Maybe Text)
ddcgaDirectConnectGatewayId = lens _ddcgaDirectConnectGatewayId (\ s a -> s{_ddcgaDirectConnectGatewayId = a})
ddcgaNextToken :: Lens' DescribeDirectConnectGatewayAssociations (Maybe Text)
ddcgaNextToken = lens _ddcgaNextToken (\ s a -> s{_ddcgaNextToken = a})
ddcgaMaxResults :: Lens' DescribeDirectConnectGatewayAssociations (Maybe Int)
ddcgaMaxResults = lens _ddcgaMaxResults (\ s a -> s{_ddcgaMaxResults = a})
instance AWSRequest
DescribeDirectConnectGatewayAssociations
where
type Rs DescribeDirectConnectGatewayAssociations =
DescribeDirectConnectGatewayAssociationsResponse
request = postJSON directConnect
response
= receiveJSON
(\ s h x ->
DescribeDirectConnectGatewayAssociationsResponse' <$>
(x .?> "nextToken") <*>
(x .?> "directConnectGatewayAssociations" .!@ mempty)
<*> (pure (fromEnum s)))
instance Hashable
DescribeDirectConnectGatewayAssociations
where
instance NFData
DescribeDirectConnectGatewayAssociations
where
instance ToHeaders
DescribeDirectConnectGatewayAssociations
where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("OvertureService.DescribeDirectConnectGatewayAssociations"
:: ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON
DescribeDirectConnectGatewayAssociations
where
toJSON DescribeDirectConnectGatewayAssociations'{..}
= object
(catMaybes
[("virtualGatewayId" .=) <$> _ddcgaVirtualGatewayId,
("directConnectGatewayId" .=) <$>
_ddcgaDirectConnectGatewayId,
("nextToken" .=) <$> _ddcgaNextToken,
("maxResults" .=) <$> _ddcgaMaxResults])
instance ToPath
DescribeDirectConnectGatewayAssociations
where
toPath = const "/"
instance ToQuery
DescribeDirectConnectGatewayAssociations
where
toQuery = const mempty
data DescribeDirectConnectGatewayAssociationsResponse = DescribeDirectConnectGatewayAssociationsResponse'
{ _ddcgarsNextToken :: !(Maybe Text)
, _ddcgarsDirectConnectGatewayAssociations :: !(Maybe [DirectConnectGatewayAssociation])
, _ddcgarsResponseStatus :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
describeDirectConnectGatewayAssociationsResponse
:: Int
-> DescribeDirectConnectGatewayAssociationsResponse
describeDirectConnectGatewayAssociationsResponse pResponseStatus_ =
DescribeDirectConnectGatewayAssociationsResponse'
{ _ddcgarsNextToken = Nothing
, _ddcgarsDirectConnectGatewayAssociations = Nothing
, _ddcgarsResponseStatus = pResponseStatus_
}
ddcgarsNextToken :: Lens' DescribeDirectConnectGatewayAssociationsResponse (Maybe Text)
ddcgarsNextToken = lens _ddcgarsNextToken (\ s a -> s{_ddcgarsNextToken = a})
ddcgarsDirectConnectGatewayAssociations :: Lens' DescribeDirectConnectGatewayAssociationsResponse [DirectConnectGatewayAssociation]
ddcgarsDirectConnectGatewayAssociations = lens _ddcgarsDirectConnectGatewayAssociations (\ s a -> s{_ddcgarsDirectConnectGatewayAssociations = a}) . _Default . _Coerce
ddcgarsResponseStatus :: Lens' DescribeDirectConnectGatewayAssociationsResponse Int
ddcgarsResponseStatus = lens _ddcgarsResponseStatus (\ s a -> s{_ddcgarsResponseStatus = a})
instance NFData
DescribeDirectConnectGatewayAssociationsResponse
where