listCustomRoutingEndpointGroups method

Future<ListCustomRoutingEndpointGroupsResponse> listCustomRoutingEndpointGroups({
  1. required String listenerArn,
  2. int? maxResults,
  3. String? nextToken,
})

List the endpoint groups that are associated with a listener for a custom routing accelerator.

May throw ListenerNotFoundException. May throw InvalidNextTokenException. May throw InvalidArgumentException. May throw InternalServiceErrorException.

Parameter listenerArn : The Amazon Resource Name (ARN) of the listener to list endpoint groups for.

Parameter maxResults : The number of endpoint group objects 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<ListCustomRoutingEndpointGroupsResponse>
    listCustomRoutingEndpointGroups({
  required String listenerArn,
  int? maxResults,
  String? nextToken,
}) async {
  ArgumentError.checkNotNull(listenerArn, 'listenerArn');
  _s.validateStringLength(
    'listenerArn',
    listenerArn,
    0,
    255,
    isRequired: true,
  );
  _s.validateNumRange(
    'maxResults',
    maxResults,
    1,
    100,
  );
  _s.validateStringLength(
    'nextToken',
    nextToken,
    0,
    255,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target':
        'GlobalAccelerator_V20180706.ListCustomRoutingEndpointGroups'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'ListenerArn': listenerArn,
      if (maxResults != null) 'MaxResults': maxResults,
      if (nextToken != null) 'NextToken': nextToken,
    },
  );

  return ListCustomRoutingEndpointGroupsResponse.fromJson(jsonResponse.body);
}