list method Null safety

Future<ListReposResponse> list(
  1. String name,
  2. {int? pageSize,
  3. String? pageToken,
  4. String? $fields}

Returns all repos belonging to a project.

The sizes of the repos are not set by ListRepos. To get the size of a repo, use GetRepo.

Request parameters:

name - The project ID whose repos should be listed. Values are of the form projects/. Value must have pattern ^projects/\[^/\]+$.

pageSize - Maximum number of repositories to return; between 1 and 500. If not set or zero, defaults to 100 at the server.

pageToken - Resume listing repositories where a prior ListReposResponse left off. This is an opaque token that must be obtained from a recent, prior ListReposResponse's next_page_token field.

$fields - Selector specifying which fields to include in a partial response.

Completes with a ListReposResponse.

Completes with a commons.ApiRequestError if the API endpoint returned an error.

If the used http.Client completes with an error when making a REST call, this method will complete with the same error.


async.Future<ListReposResponse> list(
  core.String name, { pageSize,
  core.String? pageToken,
  core.String? $fields,
}) async {
  final _queryParams = <core.String, core.List<core.String>>{
    if (pageSize != null) 'pageSize': ['${pageSize}'],
    if (pageToken != null) 'pageToken': [pageToken],
    if ($fields != null) 'fields': [$fields],

  final _url = 'v1/' + core.Uri.encodeFull('$name') + '/repos';

  final _response = await _requester.request(
    queryParams: _queryParams,
  return ListReposResponse.fromJson(
      _response as core.Map<core.String, core.dynamic>);