listCustomRoutingPortMappingsByDestination method

Future<ListCustomRoutingPortMappingsByDestinationResponse> listCustomRoutingPortMappingsByDestination({
  1. required String destinationAddress,
  2. required String endpointId,
  3. int? maxResults,
  4. String? nextToken,
})

List the port mappings for a specific EC2 instance (destination) in a VPC subnet endpoint. The response is the mappings for one destination IP address. This is useful when your subnet endpoint has mappings that span multiple custom routing accelerators in your account, or for scenarios where you only want to list the port mappings for a specific destination instance.

May throw InvalidArgumentException. May throw InvalidNextTokenException. May throw EndpointNotFoundException. May throw InternalServiceErrorException.

Parameter destinationAddress : The endpoint IP address in a virtual private cloud (VPC) subnet for which you want to receive back port mappings.

Parameter endpointId : The ID for the virtual private cloud (VPC) subnet.

Parameter maxResults : The number of destination port mappings that you want to return with this call. The default value is 10.

Parameter nextToken : The token for the next set of results. You receive this token from a previous call.

Implementation

Future<ListCustomRoutingPortMappingsByDestinationResponse>
    listCustomRoutingPortMappingsByDestination({
  required String destinationAddress,
  required String endpointId,
  int? maxResults,
  String? nextToken,
}) async {
  ArgumentError.checkNotNull(destinationAddress, 'destinationAddress');
  _s.validateStringLength(
    'destinationAddress',
    destinationAddress,
    0,
    255,
    isRequired: true,
  );
  ArgumentError.checkNotNull(endpointId, 'endpointId');
  _s.validateStringLength(
    'endpointId',
    endpointId,
    0,
    255,
    isRequired: true,
  );
  _s.validateNumRange(
    'maxResults',
    maxResults,
    1,
    20000,
  );
  _s.validateStringLength(
    'nextToken',
    nextToken,
    0,
    255,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target':
        'GlobalAccelerator_V20180706.ListCustomRoutingPortMappingsByDestination'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'DestinationAddress': destinationAddress,
      'EndpointId': endpointId,
      if (maxResults != null) 'MaxResults': maxResults,
      if (nextToken != null) 'NextToken': nextToken,
    },
  );

  return ListCustomRoutingPortMappingsByDestinationResponse.fromJson(
      jsonResponse.body);
}