{-# 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.AssociateVirtualInterface
(
associateVirtualInterface
, AssociateVirtualInterface
, aviVirtualInterfaceId
, aviConnectionId
, virtualInterface
, VirtualInterface
, viBgpPeers
, viVirtualGatewayId
, viRouteFilterPrefixes
, viCustomerAddress
, viVlan
, viLocation
, viAmazonAddress
, viAddressFamily
, viVirtualInterfaceState
, viConnectionId
, viDirectConnectGatewayId
, viAmazonSideASN
, viVirtualInterfaceType
, viAsn
, viAuthKey
, viCustomerRouterConfig
, viOwnerAccount
, viVirtualInterfaceName
, viVirtualInterfaceId
) 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 AssociateVirtualInterface = AssociateVirtualInterface'
{ _aviVirtualInterfaceId :: !Text
, _aviConnectionId :: !Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
associateVirtualInterface
:: Text
-> Text
-> AssociateVirtualInterface
associateVirtualInterface pVirtualInterfaceId_ pConnectionId_ =
AssociateVirtualInterface'
{ _aviVirtualInterfaceId = pVirtualInterfaceId_
, _aviConnectionId = pConnectionId_
}
aviVirtualInterfaceId :: Lens' AssociateVirtualInterface Text
aviVirtualInterfaceId = lens _aviVirtualInterfaceId (\ s a -> s{_aviVirtualInterfaceId = a})
aviConnectionId :: Lens' AssociateVirtualInterface Text
aviConnectionId = lens _aviConnectionId (\ s a -> s{_aviConnectionId = a})
instance AWSRequest AssociateVirtualInterface where
type Rs AssociateVirtualInterface = VirtualInterface
request = postJSON directConnect
response = receiveJSON (\ s h x -> eitherParseJSON x)
instance Hashable AssociateVirtualInterface where
instance NFData AssociateVirtualInterface where
instance ToHeaders AssociateVirtualInterface where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("OvertureService.AssociateVirtualInterface" ::
ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON AssociateVirtualInterface where
toJSON AssociateVirtualInterface'{..}
= object
(catMaybes
[Just
("virtualInterfaceId" .= _aviVirtualInterfaceId),
Just ("connectionId" .= _aviConnectionId)])
instance ToPath AssociateVirtualInterface where
toPath = const "/"
instance ToQuery AssociateVirtualInterface where
toQuery = const mempty