describeTargetGroups method

Future<DescribeTargetGroupsOutput> describeTargetGroups({
  1. String? loadBalancerArn,
  2. String? marker,
  3. List<String>? names,
  4. int? pageSize,
  5. List<String>? targetGroupArns,
})

Describes the specified target groups or all of your target groups. By default, all target groups are described. Alternatively, you can specify one of the following to filter the results: the ARN of the load balancer, the names of one or more target groups, or the ARNs of one or more target groups.

May throw LoadBalancerNotFoundException. May throw TargetGroupNotFoundException.

Parameter loadBalancerArn : The Amazon Resource Name (ARN) of the load balancer.

Parameter marker : The marker for the next set of results. (You received this marker from a previous call.)

Parameter names : The names of the target groups.

Parameter pageSize : The maximum number of results to return with this call.

Parameter targetGroupArns : The Amazon Resource Names (ARN) of the target groups.

Implementation

Future<DescribeTargetGroupsOutput> describeTargetGroups({
  String? loadBalancerArn,
  String? marker,
  List<String>? names,
  int? pageSize,
  List<String>? targetGroupArns,
}) async {
  _s.validateNumRange(
    'pageSize',
    pageSize,
    1,
    400,
  );
  final $request = <String, dynamic>{};
  loadBalancerArn?.also((arg) => $request['LoadBalancerArn'] = arg);
  marker?.also((arg) => $request['Marker'] = arg);
  names?.also((arg) => $request['Names'] = arg);
  pageSize?.also((arg) => $request['PageSize'] = arg);
  targetGroupArns?.also((arg) => $request['TargetGroupArns'] = arg);
  final $result = await _protocol.send(
    $request,
    action: 'DescribeTargetGroups',
    version: '2015-12-01',
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    shape: shapes['DescribeTargetGroupsInput'],
    shapes: shapes,
    resultWrapper: 'DescribeTargetGroupsResult',
  );
  return DescribeTargetGroupsOutput.fromXml($result);
}