module Network.AWS.DirectConnect.AllocatePrivateVirtualInterface
(
allocatePrivateVirtualInterface
, AllocatePrivateVirtualInterface
, apviConnectionId
, apviOwnerAccount
, apviNewPrivateVirtualInterfaceAllocation
, virtualInterface
, VirtualInterface
, viVirtualGatewayId
, viRouteFilterPrefixes
, viCustomerAddress
, viVlan
, viLocation
, viAmazonAddress
, viVirtualInterfaceState
, viConnectionId
, viVirtualInterfaceType
, viAsn
, viAuthKey
, viCustomerRouterConfig
, viOwnerAccount
, viVirtualInterfaceName
, viVirtualInterfaceId
) where
import Network.AWS.DirectConnect.Types
import Network.AWS.DirectConnect.Types.Product
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
data AllocatePrivateVirtualInterface = AllocatePrivateVirtualInterface'
{ _apviConnectionId :: !Text
, _apviOwnerAccount :: !Text
, _apviNewPrivateVirtualInterfaceAllocation :: !NewPrivateVirtualInterfaceAllocation
} deriving (Eq,Read,Show,Data,Typeable,Generic)
allocatePrivateVirtualInterface
:: Text
-> Text
-> NewPrivateVirtualInterfaceAllocation
-> AllocatePrivateVirtualInterface
allocatePrivateVirtualInterface pConnectionId_ pOwnerAccount_ pNewPrivateVirtualInterfaceAllocation_ =
AllocatePrivateVirtualInterface'
{ _apviConnectionId = pConnectionId_
, _apviOwnerAccount = pOwnerAccount_
, _apviNewPrivateVirtualInterfaceAllocation = pNewPrivateVirtualInterfaceAllocation_
}
apviConnectionId :: Lens' AllocatePrivateVirtualInterface Text
apviConnectionId = lens _apviConnectionId (\ s a -> s{_apviConnectionId = a});
apviOwnerAccount :: Lens' AllocatePrivateVirtualInterface Text
apviOwnerAccount = lens _apviOwnerAccount (\ s a -> s{_apviOwnerAccount = a});
apviNewPrivateVirtualInterfaceAllocation :: Lens' AllocatePrivateVirtualInterface NewPrivateVirtualInterfaceAllocation
apviNewPrivateVirtualInterfaceAllocation = lens _apviNewPrivateVirtualInterfaceAllocation (\ s a -> s{_apviNewPrivateVirtualInterfaceAllocation = a});
instance AWSRequest AllocatePrivateVirtualInterface
where
type Rs AllocatePrivateVirtualInterface =
VirtualInterface
request = postJSON directConnect
response = receiveJSON (\ s h x -> eitherParseJSON x)
instance ToHeaders AllocatePrivateVirtualInterface
where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("OvertureService.AllocatePrivateVirtualInterface" ::
ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON AllocatePrivateVirtualInterface where
toJSON AllocatePrivateVirtualInterface'{..}
= object
(catMaybes
[Just ("connectionId" .= _apviConnectionId),
Just ("ownerAccount" .= _apviOwnerAccount),
Just
("newPrivateVirtualInterfaceAllocation" .=
_apviNewPrivateVirtualInterfaceAllocation)])
instance ToPath AllocatePrivateVirtualInterface where
toPath = const "/"
instance ToQuery AllocatePrivateVirtualInterface
where
toQuery = const mempty