listBuilds method

Future<ListBuildsOutput> listBuilds({
  1. String? nextToken,
  2. SortOrderType? sortOrder,
})

Gets a list of build IDs, with each build ID representing a single build.

May throw InvalidInputException.

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<ListBuildsOutput> listBuilds({
  String? nextToken,
  SortOrderType? sortOrder,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'CodeBuild_20161006.ListBuilds'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      if (nextToken != null) 'nextToken': nextToken,
      if (sortOrder != null) 'sortOrder': sortOrder.toValue(),
    },
  );

  return ListBuildsOutput.fromJson(jsonResponse.body);
}