module Network.AWS.DirectConnect.AllocatePrivateVirtualInterface
(
AllocatePrivateVirtualInterface
, allocatePrivateVirtualInterface
, apviConnectionId
, apviNewPrivateVirtualInterfaceAllocation
, apviOwnerAccount
, AllocatePrivateVirtualInterfaceResponse
, allocatePrivateVirtualInterfaceResponse
, apvirAmazonAddress
, apvirAsn
, apvirAuthKey
, apvirConnectionId
, apvirCustomerAddress
, apvirCustomerRouterConfig
, apvirLocation
, apvirOwnerAccount
, apvirRouteFilterPrefixes
, apvirVirtualGatewayId
, apvirVirtualInterfaceId
, apvirVirtualInterfaceName
, apvirVirtualInterfaceState
, apvirVirtualInterfaceType
, apvirVlan
) where
import Network.AWS.Data (Object)
import Network.AWS.Prelude
import Network.AWS.Request.JSON
import Network.AWS.DirectConnect.Types
import qualified GHC.Exts
data AllocatePrivateVirtualInterface = AllocatePrivateVirtualInterface
{ _apviConnectionId :: Text
, _apviNewPrivateVirtualInterfaceAllocation :: NewPrivateVirtualInterfaceAllocation
, _apviOwnerAccount :: Text
} deriving (Eq, Read, Show)
allocatePrivateVirtualInterface :: Text
-> Text
-> NewPrivateVirtualInterfaceAllocation
-> AllocatePrivateVirtualInterface
allocatePrivateVirtualInterface p1 p2 p3 = AllocatePrivateVirtualInterface
{ _apviConnectionId = p1
, _apviOwnerAccount = p2
, _apviNewPrivateVirtualInterfaceAllocation = p3
}
apviConnectionId :: Lens' AllocatePrivateVirtualInterface Text
apviConnectionId = lens _apviConnectionId (\s a -> s { _apviConnectionId = a })
apviNewPrivateVirtualInterfaceAllocation :: Lens' AllocatePrivateVirtualInterface NewPrivateVirtualInterfaceAllocation
apviNewPrivateVirtualInterfaceAllocation =
lens _apviNewPrivateVirtualInterfaceAllocation
(\s a -> s { _apviNewPrivateVirtualInterfaceAllocation = a })
apviOwnerAccount :: Lens' AllocatePrivateVirtualInterface Text
apviOwnerAccount = lens _apviOwnerAccount (\s a -> s { _apviOwnerAccount = a })
data AllocatePrivateVirtualInterfaceResponse = AllocatePrivateVirtualInterfaceResponse
{ _apvirAmazonAddress :: Maybe Text
, _apvirAsn :: Maybe Int
, _apvirAuthKey :: Maybe Text
, _apvirConnectionId :: Maybe Text
, _apvirCustomerAddress :: Maybe Text
, _apvirCustomerRouterConfig :: Maybe Text
, _apvirLocation :: Maybe Text
, _apvirOwnerAccount :: Maybe Text
, _apvirRouteFilterPrefixes :: List "routeFilterPrefixes" RouteFilterPrefix
, _apvirVirtualGatewayId :: Maybe Text
, _apvirVirtualInterfaceId :: Maybe Text
, _apvirVirtualInterfaceName :: Maybe Text
, _apvirVirtualInterfaceState :: Maybe VirtualInterfaceState
, _apvirVirtualInterfaceType :: Maybe Text
, _apvirVlan :: Maybe Int
} deriving (Eq, Read, Show)
allocatePrivateVirtualInterfaceResponse :: AllocatePrivateVirtualInterfaceResponse
allocatePrivateVirtualInterfaceResponse = AllocatePrivateVirtualInterfaceResponse
{ _apvirOwnerAccount = Nothing
, _apvirVirtualInterfaceId = Nothing
, _apvirLocation = Nothing
, _apvirConnectionId = Nothing
, _apvirVirtualInterfaceType = Nothing
, _apvirVirtualInterfaceName = Nothing
, _apvirVlan = Nothing
, _apvirAsn = Nothing
, _apvirAuthKey = Nothing
, _apvirAmazonAddress = Nothing
, _apvirCustomerAddress = Nothing
, _apvirVirtualInterfaceState = Nothing
, _apvirCustomerRouterConfig = Nothing
, _apvirVirtualGatewayId = Nothing
, _apvirRouteFilterPrefixes = mempty
}
apvirAmazonAddress :: Lens' AllocatePrivateVirtualInterfaceResponse (Maybe Text)
apvirAmazonAddress =
lens _apvirAmazonAddress (\s a -> s { _apvirAmazonAddress = a })
apvirAsn :: Lens' AllocatePrivateVirtualInterfaceResponse (Maybe Int)
apvirAsn = lens _apvirAsn (\s a -> s { _apvirAsn = a })
apvirAuthKey :: Lens' AllocatePrivateVirtualInterfaceResponse (Maybe Text)
apvirAuthKey = lens _apvirAuthKey (\s a -> s { _apvirAuthKey = a })
apvirConnectionId :: Lens' AllocatePrivateVirtualInterfaceResponse (Maybe Text)
apvirConnectionId =
lens _apvirConnectionId (\s a -> s { _apvirConnectionId = a })
apvirCustomerAddress :: Lens' AllocatePrivateVirtualInterfaceResponse (Maybe Text)
apvirCustomerAddress =
lens _apvirCustomerAddress (\s a -> s { _apvirCustomerAddress = a })
apvirCustomerRouterConfig :: Lens' AllocatePrivateVirtualInterfaceResponse (Maybe Text)
apvirCustomerRouterConfig =
lens _apvirCustomerRouterConfig
(\s a -> s { _apvirCustomerRouterConfig = a })
apvirLocation :: Lens' AllocatePrivateVirtualInterfaceResponse (Maybe Text)
apvirLocation = lens _apvirLocation (\s a -> s { _apvirLocation = a })
apvirOwnerAccount :: Lens' AllocatePrivateVirtualInterfaceResponse (Maybe Text)
apvirOwnerAccount =
lens _apvirOwnerAccount (\s a -> s { _apvirOwnerAccount = a })
apvirRouteFilterPrefixes :: Lens' AllocatePrivateVirtualInterfaceResponse [RouteFilterPrefix]
apvirRouteFilterPrefixes =
lens _apvirRouteFilterPrefixes
(\s a -> s { _apvirRouteFilterPrefixes = a })
. _List
apvirVirtualGatewayId :: Lens' AllocatePrivateVirtualInterfaceResponse (Maybe Text)
apvirVirtualGatewayId =
lens _apvirVirtualGatewayId (\s a -> s { _apvirVirtualGatewayId = a })
apvirVirtualInterfaceId :: Lens' AllocatePrivateVirtualInterfaceResponse (Maybe Text)
apvirVirtualInterfaceId =
lens _apvirVirtualInterfaceId (\s a -> s { _apvirVirtualInterfaceId = a })
apvirVirtualInterfaceName :: Lens' AllocatePrivateVirtualInterfaceResponse (Maybe Text)
apvirVirtualInterfaceName =
lens _apvirVirtualInterfaceName
(\s a -> s { _apvirVirtualInterfaceName = a })
apvirVirtualInterfaceState :: Lens' AllocatePrivateVirtualInterfaceResponse (Maybe VirtualInterfaceState)
apvirVirtualInterfaceState =
lens _apvirVirtualInterfaceState
(\s a -> s { _apvirVirtualInterfaceState = a })
apvirVirtualInterfaceType :: Lens' AllocatePrivateVirtualInterfaceResponse (Maybe Text)
apvirVirtualInterfaceType =
lens _apvirVirtualInterfaceType
(\s a -> s { _apvirVirtualInterfaceType = a })
apvirVlan :: Lens' AllocatePrivateVirtualInterfaceResponse (Maybe Int)
apvirVlan = lens _apvirVlan (\s a -> s { _apvirVlan = a })
instance ToPath AllocatePrivateVirtualInterface where
toPath = const "/"
instance ToQuery AllocatePrivateVirtualInterface where
toQuery = const mempty
instance ToHeaders AllocatePrivateVirtualInterface
instance ToJSON AllocatePrivateVirtualInterface where
toJSON AllocatePrivateVirtualInterface{..} = object
[ "connectionId" .= _apviConnectionId
, "ownerAccount" .= _apviOwnerAccount
, "newPrivateVirtualInterfaceAllocation" .= _apviNewPrivateVirtualInterfaceAllocation
]
instance AWSRequest AllocatePrivateVirtualInterface where
type Sv AllocatePrivateVirtualInterface = DirectConnect
type Rs AllocatePrivateVirtualInterface = AllocatePrivateVirtualInterfaceResponse
request = post "AllocatePrivateVirtualInterface"
response = jsonResponse
instance FromJSON AllocatePrivateVirtualInterfaceResponse where
parseJSON = withObject "AllocatePrivateVirtualInterfaceResponse" $ \o -> AllocatePrivateVirtualInterfaceResponse
<$> o .:? "amazonAddress"
<*> o .:? "asn"
<*> o .:? "authKey"
<*> o .:? "connectionId"
<*> o .:? "customerAddress"
<*> o .:? "customerRouterConfig"
<*> o .:? "location"
<*> o .:? "ownerAccount"
<*> o .:? "routeFilterPrefixes" .!= mempty
<*> o .:? "virtualGatewayId"
<*> o .:? "virtualInterfaceId"
<*> o .:? "virtualInterfaceName"
<*> o .:? "virtualInterfaceState"
<*> o .:? "virtualInterfaceType"
<*> o .:? "vlan"