listBuildsForProject method

Future<ListBuildsForProjectOutput> listBuildsForProject({
  1. required String projectName,
  2. String? nextToken,
  3. SortOrderType? sortOrder,
})

Gets a list of build IDs for the specified build project, with each build ID representing a single build.

May throw InvalidInputException. May throw ResourceNotFoundException.

Parameter projectName : The name of the AWS CodeBuild project.

Parameter nextToken : During a previous call, if there are more than 100 items in the list, only the first 100 items are returned, along with a unique string called a nextToken. To get the next batch of items in the list, call this operation again, adding the next token to the call. To get all of the items in the list, keep calling this operation with each subsequent next token that is returned, until no more next tokens are returned.

Parameter sortOrder : The order to list build IDs. Valid values include:

  • ASCENDING: List the build IDs in ascending order by build ID.
  • DESCENDING: List the build IDs in descending order by build ID.

Implementation

Future<ListBuildsForProjectOutput> listBuildsForProject({
  required String projectName,
  String? nextToken,
  SortOrderType? sortOrder,
}) async {
  ArgumentError.checkNotNull(projectName, 'projectName');
  _s.validateStringLength(
    'projectName',
    projectName,
    1,
    1152921504606846976,
    isRequired: true,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'CodeBuild_20161006.ListBuildsForProject'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'projectName': projectName,
      if (nextToken != null) 'nextToken': nextToken,
      if (sortOrder != null) 'sortOrder': sortOrder.toValue(),
    },
  );

  return ListBuildsForProjectOutput.fromJson(jsonResponse.body);
}