describeCapacityProviders method

Future<DescribeCapacityProvidersResponse> describeCapacityProviders({
  1. List<String>? capacityProviders,
  2. List<CapacityProviderField>? include,
  3. int? maxResults,
  4. String? nextToken,
})

Describes one or more of your capacity providers.

May throw ServerException. May throw ClientException. May throw InvalidParameterException.

Parameter capacityProviders : The short name or full Amazon Resource Name (ARN) of one or more capacity providers. Up to 100 capacity providers can be described in an action.

Parameter include : Specifies whether or not you want to see the resource tags for the capacity provider. If TAGS is specified, the tags are included in the response. If this field is omitted, tags are not included in the response.

Parameter maxResults : The maximum number of account setting results returned by DescribeCapacityProviders in paginated output. When this parameter is used, DescribeCapacityProviders only returns maxResults results in a single page along with a nextToken response element. The remaining results of the initial request can be seen by sending another DescribeCapacityProviders request with the returned nextToken value. This value can be between 1 and 10. If this parameter is not used, then DescribeCapacityProviders returns up to 10 results and a nextToken value if applicable.

Parameter nextToken : The nextToken value returned from a previous paginated DescribeCapacityProviders request where maxResults was used and the results exceeded the value of that parameter. Pagination continues from the end of the previous results that returned the nextToken value.

Implementation

Future<DescribeCapacityProvidersResponse> describeCapacityProviders({
  List<String>? capacityProviders,
  List<CapacityProviderField>? include,
  int? maxResults,
  String? nextToken,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target':
        'AmazonEC2ContainerServiceV20141113.DescribeCapacityProviders'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      if (capacityProviders != null) 'capacityProviders': capacityProviders,
      if (include != null)
        'include': include.map((e) => e.toValue()).toList(),
      if (maxResults != null) 'maxResults': maxResults,
      if (nextToken != null) 'nextToken': nextToken,
    },
  );

  return DescribeCapacityProvidersResponse.fromJson(jsonResponse.body);
}