listBuildBatchesForProject method

Future<ListBuildBatchesForProjectOutput> listBuildBatchesForProject({
  1. BuildBatchFilter? filter,
  2. int? maxResults,
  3. String? nextToken,
  4. String? projectName,
  5. SortOrderType? sortOrder,
})

Retrieves the identifiers of the build batches for a specific project.

May throw InvalidInputException. May throw ResourceNotFoundException.

Parameter filter : A BuildBatchFilter object that specifies the filters for the search.

Parameter maxResults : The maximum number of results to return.

Parameter nextToken : The nextToken value returned from a previous call to ListBuildBatchesForProject. This specifies the next item to return. To return the beginning of the list, exclude this parameter.

Parameter projectName : The name of the project.

Parameter sortOrder : Specifies the sort order of the returned items. Valid values include:

  • ASCENDING: List the batch build identifiers in ascending order by identifier.
  • DESCENDING: List the batch build identifiers in descending order by identifier.

Implementation

Future<ListBuildBatchesForProjectOutput> listBuildBatchesForProject({
  BuildBatchFilter? filter,
  int? maxResults,
  String? nextToken,
  String? projectName,
  SortOrderType? sortOrder,
}) async {
  _s.validateNumRange(
    'maxResults',
    maxResults,
    1,
    100,
  );
  _s.validateStringLength(
    'projectName',
    projectName,
    1,
    1152921504606846976,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'CodeBuild_20161006.ListBuildBatchesForProject'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      if (filter != null) 'filter': filter,
      if (maxResults != null) 'maxResults': maxResults,
      if (nextToken != null) 'nextToken': nextToken,
      if (projectName != null) 'projectName': projectName,
      if (sortOrder != null) 'sortOrder': sortOrder.toValue(),
    },
  );

  return ListBuildBatchesForProjectOutput.fromJson(jsonResponse.body);
}