list method

Future<ListDocumentsResponse> list (String parent, { String collectionId, { bool showMissing, List<String> mask_fieldPaths, String pageToken int pageSize, String transaction String readTime String orderBy String $fields })

Lists documents.

Request parameters:

parent - The parent resource name. In the format: projects/{project_id}/databases/{database_id}/documents or projects/{project_id}/databases/{database_id}/documents/{document_path}. For example: projects/my-project/databases/my-database/documents or projects/my-project/databases/my-database/documents/chatrooms/my-chatroom Value must have pattern "^projects/^/+/databases/^/+/documents/^/+/.+$".

collectionId - The collection ID, relative to parent, to list. For example: chatrooms or messages.

showMissing - If the list should show missing documents. A missing document is a document that does not exist but has sub-documents. These documents will be returned with a key but will not have fields, Document.create_time, or Document.update_time set.

Requests with show_missing may not specify where or order_by.

mask_fieldPaths - The list of field paths in the mask. See Document.fields for a field path syntax reference.

pageToken - The next_page_token value returned from a previous List request, if any.

pageSize - The maximum number of documents to return.

transaction - Reads documents in a transaction.

readTime - Reads documents as they were at the given time. This may not be older than 60 seconds.

orderBy - The order to sort results by. For example: priority desc, name.

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

Completes with a ListDocumentsResponse.

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<ListDocumentsResponse> list(
    core.String parent, core.String collectionId,
    {core.bool showMissing,
    core.List<core.String> mask_fieldPaths,
    core.String pageToken,
    core.int pageSize,
    core.String transaction,
    core.String readTime,
    core.String orderBy,
    core.String $fields}) {
  var _url;
  var _queryParams = new core.Map<core.String, core.List<core.String>>();
  var _uploadMedia;
  var _uploadOptions;
  var _downloadOptions = commons.DownloadOptions.Metadata;
  var _body;

  if (parent == null) {
    throw new core.ArgumentError("Parameter parent is required.");
  }
  if (collectionId == null) {
    throw new core.ArgumentError("Parameter collectionId is required.");
  }
  if (showMissing != null) {
    _queryParams["showMissing"] = ["${showMissing}"];
  }
  if (mask_fieldPaths != null) {
    _queryParams["mask.fieldPaths"] = mask_fieldPaths;
  }
  if (pageToken != null) {
    _queryParams["pageToken"] = [pageToken];
  }
  if (pageSize != null) {
    _queryParams["pageSize"] = ["${pageSize}"];
  }
  if (transaction != null) {
    _queryParams["transaction"] = [transaction];
  }
  if (readTime != null) {
    _queryParams["readTime"] = [readTime];
  }
  if (orderBy != null) {
    _queryParams["orderBy"] = [orderBy];
  }
  if ($fields != null) {
    _queryParams["fields"] = [$fields];
  }

  _url = 'v1/' +
      commons.Escaper.ecapeVariableReserved('$parent') +
      '/' +
      commons.Escaper.ecapeVariable('$collectionId');

  var _response = _requester.request(_url, "GET",
      body: _body,
      queryParams: _queryParams,
      uploadOptions: _uploadOptions,
      uploadMedia: _uploadMedia,
      downloadOptions: _downloadOptions);
  return _response.then((data) => new ListDocumentsResponse.fromJson(data));
}