listTargetGroups method

Future<ListTargetGroupsResponse> listTargetGroups({
  1. int? maxResults,
  2. String? nextToken,
  3. TargetGroupType? targetGroupType,
  4. String? vpcIdentifier,
})

Lists your target groups. You can narrow your search by using the filters below in your request.

May throw AccessDeniedException. May throw InternalServerException. May throw ThrottlingException. May throw ValidationException.

Parameter maxResults : The maximum number of results to return.

Parameter nextToken : A pagination token for the next page of results.

Parameter targetGroupType : The target group type.

Parameter vpcIdentifier : The ID or ARN of the VPC.

Implementation

Future<ListTargetGroupsResponse> listTargetGroups({
  int? maxResults,
  String? nextToken,
  TargetGroupType? targetGroupType,
  String? vpcIdentifier,
}) async {
  _s.validateNumRange(
    'maxResults',
    maxResults,
    1,
    100,
  );
  final $query = <String, List<String>>{
    if (maxResults != null) 'maxResults': [maxResults.toString()],
    if (nextToken != null) 'nextToken': [nextToken],
    if (targetGroupType != null) 'targetGroupType': [targetGroupType.value],
    if (vpcIdentifier != null) 'vpcIdentifier': [vpcIdentifier],
  };
  final response = await _protocol.send(
    payload: null,
    method: 'GET',
    requestUri: '/targetgroups',
    queryParams: $query,
    exceptionFnMap: _exceptionFns,
  );
  return ListTargetGroupsResponse.fromJson(response);
}