module Network.AWS.DirectConnect.AllocatePublicVirtualInterface
(
allocatePublicVirtualInterface
, AllocatePublicVirtualInterface
, aConnectionId
, aOwnerAccount
, aNewPublicVirtualInterfaceAllocation
, 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 AllocatePublicVirtualInterface = AllocatePublicVirtualInterface'
{ _aConnectionId :: !Text
, _aOwnerAccount :: !Text
, _aNewPublicVirtualInterfaceAllocation :: !NewPublicVirtualInterfaceAllocation
} deriving (Eq,Read,Show,Data,Typeable,Generic)
allocatePublicVirtualInterface
:: Text
-> Text
-> NewPublicVirtualInterfaceAllocation
-> AllocatePublicVirtualInterface
allocatePublicVirtualInterface pConnectionId_ pOwnerAccount_ pNewPublicVirtualInterfaceAllocation_ =
AllocatePublicVirtualInterface'
{ _aConnectionId = pConnectionId_
, _aOwnerAccount = pOwnerAccount_
, _aNewPublicVirtualInterfaceAllocation = pNewPublicVirtualInterfaceAllocation_
}
aConnectionId :: Lens' AllocatePublicVirtualInterface Text
aConnectionId = lens _aConnectionId (\ s a -> s{_aConnectionId = a});
aOwnerAccount :: Lens' AllocatePublicVirtualInterface Text
aOwnerAccount = lens _aOwnerAccount (\ s a -> s{_aOwnerAccount = a});
aNewPublicVirtualInterfaceAllocation :: Lens' AllocatePublicVirtualInterface NewPublicVirtualInterfaceAllocation
aNewPublicVirtualInterfaceAllocation = lens _aNewPublicVirtualInterfaceAllocation (\ s a -> s{_aNewPublicVirtualInterfaceAllocation = a});
instance AWSRequest AllocatePublicVirtualInterface
where
type Rs AllocatePublicVirtualInterface =
VirtualInterface
request = postJSON directConnect
response = receiveJSON (\ s h x -> eitherParseJSON x)
instance ToHeaders AllocatePublicVirtualInterface
where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("OvertureService.AllocatePublicVirtualInterface" ::
ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON AllocatePublicVirtualInterface where
toJSON AllocatePublicVirtualInterface'{..}
= object
(catMaybes
[Just ("connectionId" .= _aConnectionId),
Just ("ownerAccount" .= _aOwnerAccount),
Just
("newPublicVirtualInterfaceAllocation" .=
_aNewPublicVirtualInterfaceAllocation)])
instance ToPath AllocatePublicVirtualInterface where
toPath = const "/"
instance ToQuery AllocatePublicVirtualInterface where
toQuery = const mempty