listFunctionVersionsByCapacityProvider method

Future<ListFunctionVersionsByCapacityProviderResponse> listFunctionVersionsByCapacityProvider({
  1. required String capacityProviderName,
  2. String? marker,
  3. int? maxItems,
})

Returns a list of function versions that are configured to use a specific capacity provider.

May throw InvalidParameterValueException. May throw ResourceNotFoundException. May throw ServiceException. May throw TooManyRequestsException.

Parameter capacityProviderName : The name of the capacity provider to list function versions for.

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 function versions to return in the response.

Implementation

Future<ListFunctionVersionsByCapacityProviderResponse>
    listFunctionVersionsByCapacityProvider({
  required String capacityProviderName,
  String? marker,
  int? maxItems,
}) async {
  _s.validateNumRange(
    'maxItems',
    maxItems,
    1,
    50,
  );
  final $query = <String, List<String>>{
    if (marker != null) 'Marker': [marker],
    if (maxItems != null) 'MaxItems': [maxItems.toString()],
  };
  final response = await _protocol.send(
    payload: null,
    method: 'GET',
    requestUri:
        '/2025-11-30/capacity-providers/${Uri.encodeComponent(capacityProviderName)}/function-versions',
    queryParams: $query,
    exceptionFnMap: _exceptionFns,
  );
  return ListFunctionVersionsByCapacityProviderResponse.fromJson(response);
}