acceptDirectConnectGatewayAssociationProposal method

Future<AcceptDirectConnectGatewayAssociationProposalResult> acceptDirectConnectGatewayAssociationProposal({
  1. required String associatedGatewayOwnerAccount,
  2. required String directConnectGatewayId,
  3. required String proposalId,
  4. List<RouteFilterPrefix>? overrideAllowedPrefixesToDirectConnectGateway,
})

Accepts a proposal request to attach a virtual private gateway or transit gateway to a Direct Connect gateway.

May throw DirectConnectServerException. May throw DirectConnectClientException.

Parameter associatedGatewayOwnerAccount : The ID of the AWS account that owns the virtual private gateway or transit gateway.

Parameter directConnectGatewayId : The ID of the Direct Connect gateway.

Parameter proposalId : The ID of the request proposal.

Parameter overrideAllowedPrefixesToDirectConnectGateway : Overrides the Amazon VPC prefixes advertised to the Direct Connect gateway.

For information about how to set the prefixes, see Allowed Prefixes in the AWS Direct Connect User Guide.

Implementation

Future<AcceptDirectConnectGatewayAssociationProposalResult>
    acceptDirectConnectGatewayAssociationProposal({
  required String associatedGatewayOwnerAccount,
  required String directConnectGatewayId,
  required String proposalId,
  List<RouteFilterPrefix>? overrideAllowedPrefixesToDirectConnectGateway,
}) async {
  ArgumentError.checkNotNull(
      associatedGatewayOwnerAccount, 'associatedGatewayOwnerAccount');
  ArgumentError.checkNotNull(
      directConnectGatewayId, 'directConnectGatewayId');
  ArgumentError.checkNotNull(proposalId, 'proposalId');
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target':
        'OvertureService.AcceptDirectConnectGatewayAssociationProposal'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'associatedGatewayOwnerAccount': associatedGatewayOwnerAccount,
      'directConnectGatewayId': directConnectGatewayId,
      'proposalId': proposalId,
      if (overrideAllowedPrefixesToDirectConnectGateway != null)
        'overrideAllowedPrefixesToDirectConnectGateway':
            overrideAllowedPrefixesToDirectConnectGateway,
    },
  );

  return AcceptDirectConnectGatewayAssociationProposalResult.fromJson(
      jsonResponse.body);
}