listCapacityProviders method
Returns a list of capacity providers in your account.
May throw InvalidParameterValueException.
May throw ServiceException.
May throw TooManyRequestsException.
Parameter marker :
Specify the pagination token that's returned by a previous request to
retrieve the next page of results.
Parameter maxItems :
The maximum number of capacity providers to return.
Parameter state :
Filter capacity providers by their current state.
Implementation
Future<ListCapacityProvidersResponse> listCapacityProviders({
String? marker,
int? maxItems,
CapacityProviderState? state,
}) async {
_s.validateNumRange(
'maxItems',
maxItems,
1,
50,
);
final $query = <String, List<String>>{
if (marker != null) 'Marker': [marker],
if (maxItems != null) 'MaxItems': [maxItems.toString()],
if (state != null) 'State': [state.value],
};
final response = await _protocol.send(
payload: null,
method: 'GET',
requestUri: '/2025-11-30/capacity-providers',
queryParams: $query,
exceptionFnMap: _exceptionFns,
);
return ListCapacityProvidersResponse.fromJson(response);
}