listRepositories method

Future<ListRepositoriesOutput> listRepositories({
  1. String? nextToken,
  2. OrderEnum? order,
  3. SortByEnum? sortBy,
})

Gets information about one or more repositories.

May throw InvalidSortByException. May throw InvalidOrderException. May throw InvalidContinuationTokenException.

Parameter nextToken : An enumeration token that allows the operation to batch the results of the operation. Batch sizes are 1,000 for list repository operations. When the client sends the token back to AWS CodeCommit, another page of 1,000 records is retrieved.

Parameter order : The order in which to sort the results of a list repositories operation.

Parameter sortBy : The criteria used to sort the results of a list repositories operation.

Implementation

Future<ListRepositoriesOutput> listRepositories({
  String? nextToken,
  OrderEnum? order,
  SortByEnum? sortBy,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'CodeCommit_20150413.ListRepositories'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      if (nextToken != null) 'nextToken': nextToken,
      if (order != null) 'order': order.toValue(),
      if (sortBy != null) 'sortBy': sortBy.toValue(),
    },
  );

  return ListRepositoriesOutput.fromJson(jsonResponse.body);
}