list method Null safety

Future<GoogleExampleLibraryagentV1ListShelvesResponse> list(
  1. {int? pageSize,
  2. String? pageToken,
  3. String? $fields}
)

Lists shelves.

The order is unspecified but deterministic. Newly created shelves will not necessarily be added to the end of this list.

Request parameters:

pageSize - Requested page size. Server may return fewer shelves than requested. If unspecified, server will pick an appropriate default.

pageToken - A token identifying a page of results the server should return. Typically, this is the value of ListShelvesResponse.next_page_token returned from the previous call to ListShelves method.

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

Completes with a GoogleExampleLibraryagentV1ListShelvesResponse.

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.

Implementation

async.Future<GoogleExampleLibraryagentV1ListShelvesResponse> list({
  core.int? 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],
  };

  const _url = 'v1/shelves';

  final _response = await _requester.request(
    _url,
    'GET',
    queryParams: _queryParams,
  );
  return GoogleExampleLibraryagentV1ListShelvesResponse.fromJson(
      _response as core.Map<core.String, core.dynamic>);
}