allocateTransitVirtualInterface method

Future<AllocateTransitVirtualInterfaceResult> allocateTransitVirtualInterface({
  1. required String connectionId,
  2. required NewTransitVirtualInterfaceAllocation newTransitVirtualInterfaceAllocation,
  3. required String ownerAccount,
})

Provisions a transit virtual interface to be owned by the specified AWS account. Use this type of interface to connect a transit gateway to your Direct Connect gateway.

The owner of a connection provisions a transit virtual interface to be owned by the specified AWS account.

After you create a transit virtual interface, it must be confirmed by the owner using ConfirmTransitVirtualInterface. Until this step has been completed, the transit virtual interface is in the requested state and is not available to handle traffic.

May throw DuplicateTagKeysException. May throw TooManyTagsException. May throw DirectConnectServerException. May throw DirectConnectClientException.

Parameter connectionId : The ID of the connection on which the transit virtual interface is provisioned.

Parameter newTransitVirtualInterfaceAllocation : Information about the transit virtual interface.

Parameter ownerAccount : The ID of the AWS account that owns the transit virtual interface.

Implementation

Future<AllocateTransitVirtualInterfaceResult>
    allocateTransitVirtualInterface({
  required String connectionId,
  required NewTransitVirtualInterfaceAllocation
      newTransitVirtualInterfaceAllocation,
  required String ownerAccount,
}) async {
  ArgumentError.checkNotNull(connectionId, 'connectionId');
  ArgumentError.checkNotNull(newTransitVirtualInterfaceAllocation,
      'newTransitVirtualInterfaceAllocation');
  ArgumentError.checkNotNull(ownerAccount, 'ownerAccount');
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'OvertureService.AllocateTransitVirtualInterface'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'connectionId': connectionId,
      'newTransitVirtualInterfaceAllocation':
          newTransitVirtualInterfaceAllocation,
      'ownerAccount': ownerAccount,
    },
  );

  return AllocateTransitVirtualInterfaceResult.fromJson(jsonResponse.body);
}