listBuildBatches method

Future<ListBuildBatchesOutput> listBuildBatches({
  1. BuildBatchFilter? filter,
  2. int? maxResults,
  3. String? nextToken,
  4. SortOrderType? sortOrder,
})

Retrieves the identifiers of your build batches in the current region.

May throw InvalidInputException.

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 ListBuildBatches. This specifies the next item to return. To return the beginning of the list, exclude this parameter.

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<ListBuildBatchesOutput> listBuildBatches({
  BuildBatchFilter? filter,
  int? maxResults,
  String? nextToken,
  SortOrderType? sortOrder,
}) async {
  _s.validateNumRange(
    'maxResults',
    maxResults,
    1,
    100,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'CodeBuild_20161006.ListBuildBatches'
  };
  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 (sortOrder != null) 'sortOrder': sortOrder.toValue(),
    },
  );

  return ListBuildBatchesOutput.fromJson(jsonResponse.body);
}