nodes: 0, module; 1, function_definition; 2, function_name:list_documents; 3, parameters; 4, block; 5, identifier:self; 6, identifier:parent; 7, identifier:collection_id; 8, default_parameter; 9, default_parameter; 10, default_parameter; 11, default_parameter; 12, default_parameter; 13, default_parameter; 14, default_parameter; 15, default_parameter; 16, default_parameter; 17, expression_statement; 18, comment:# Wrap the transport method to add retry and timeout logic.; 19, if_statement; 20, comment:# Sanity check: We have some fields which are mutually exclusive;; 21, comment:# raise ValueError if more than one is sent.; 22, expression_statement; 23, expression_statement; 24, expression_statement; 25, return_statement; 26, identifier:page_size; 27, None; 28, identifier:order_by; 29, None; 30, identifier:mask; 31, None; 32, identifier:transaction; 33, None; 34, identifier:read_time; 35, None; 36, identifier:show_missing; 37, None; 38, identifier:retry; 39, attribute; 40, identifier:timeout; 41, attribute; 42, identifier:metadata; 43, None; 44, comment:"""
          Lists documents.
  
          Example:
              >>> from google.cloud import firestore_v1beta1
              >>>
              >>> client = firestore_v1beta1.FirestoreClient()
              >>>
              >>> parent = client.any_path_path('[PROJECT]', '[DATABASE]', '[DOCUMENT]', '[ANY_PATH]')
              >>>
              >>> # TODO: Initialize `collection_id`:
              >>> collection_id = ''
              >>>
              >>> # Iterate over all results
              >>> for element in client.list_documents(parent, collection_id):
              ...     # process element
              ...     pass
              >>>
              >>>
              >>> # Alternatively:
              >>>
              >>> # Iterate over results one page at a time
              >>> for page in client.list_documents(parent, collection_id).pages:
              ...     for element in page:
              ...         # process element
              ...         pass
  
          Args:
              parent (str): 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``
              collection_id (str): The collection ID, relative to ``parent``, to list. For example:
                  ``chatrooms`` or ``messages``.
              page_size (int): The maximum number of resources contained in the
                  underlying API response. If page streaming is performed per-
                  resource, this parameter does not affect the return value. If page
                  streaming is performed per-page, this determines the maximum number
                  of resources in a page.
              order_by (str): The order to sort results by. For example: ``priority desc, name``.
              mask (Union[dict, ~google.cloud.firestore_v1beta1.types.DocumentMask]): The fields to return. If not set, returns all fields.
  
                  If a document has a field that is not present in this mask, that field
                  will not be returned in the response.
  
                  If a dict is provided, it must be of the same form as the protobuf
                  message :class:`~google.cloud.firestore_v1beta1.types.DocumentMask`
              transaction (bytes): Reads documents in a transaction.
              read_time (Union[dict, ~google.cloud.firestore_v1beta1.types.Timestamp]): Reads documents as they were at the given time.
                  This may not be older than 60 seconds.
  
                  If a dict is provided, it must be of the same form as the protobuf
                  message :class:`~google.cloud.firestore_v1beta1.types.Timestamp`
              show_missing (bool): 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``.
              retry (Optional[google.api_core.retry.Retry]):  A retry object used
                  to retry requests. If ``None`` is specified, requests will not
                  be retried.
              timeout (Optional[float]): The amount of time, in seconds, to wait
                  for the request to complete. Note that if ``retry`` is
                  specified, the timeout applies to each individual attempt.
              metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata
                  that is provided to the method.
  
          Returns:
              A :class:`~google.gax.PageIterator` instance. By default, this
              is an iterable of :class:`~google.cloud.firestore_v1beta1.types.Document` instances.
              This object can also be configured to iterate over the pages
              of the response through the `options` parameter.
  
          Raises:
              google.api_core.exceptions.GoogleAPICallError: If the request
                      failed for any reason.
              google.api_core.exceptions.RetryError: If the request failed due
                      to a retryable error and retry attempts failed.
              ValueError: If the parameters are invalid.
          """; 45, comparison_operator:"list_documents" not in self._inner_api_calls; 46, block; 47, call; 48, assignment; 49, assignment; 50, identifier:iterator; 51, attribute; 52, identifier:DEFAULT; 53, attribute; 54, identifier:DEFAULT; 55, string:"list_documents"; 56, attribute; 57, expression_statement; 58, attribute; 59, argument_list; 60, identifier:request; 61, call; 62, identifier:iterator; 63, call; 64, attribute; 65, identifier:method; 66, attribute; 67, identifier:method; 68, identifier:self; 69, identifier:_inner_api_calls; 70, assignment; 71, attribute; 72, identifier:check_oneof; 73, keyword_argument; 74, keyword_argument; 75, attribute; 76, argument_list; 77, attribute; 78, argument_list; 79, attribute; 80, identifier:gapic_v1; 81, attribute; 82, identifier:gapic_v1; 83, subscript; 84, call; 85, attribute; 86, identifier:protobuf_helpers; 87, identifier:transaction; 88, identifier:transaction; 89, identifier:read_time; 90, identifier:read_time; 91, identifier:firestore_pb2; 92, identifier:ListDocumentsRequest; 93, keyword_argument; 94, keyword_argument; 95, keyword_argument; 96, keyword_argument; 97, keyword_argument; 98, keyword_argument; 99, keyword_argument; 100, keyword_argument; 101, attribute; 102, identifier:GRPCIterator; 103, keyword_argument; 104, keyword_argument; 105, keyword_argument; 106, keyword_argument; 107, keyword_argument; 108, keyword_argument; 109, identifier:google; 110, identifier:api_core; 111, identifier:google; 112, identifier:api_core; 113, attribute; 114, string:"list_documents"; 115, attribute; 116, argument_list; 117, identifier:google; 118, identifier:api_core; 119, identifier:parent; 120, identifier:parent; 121, identifier:collection_id; 122, identifier:collection_id; 123, identifier:page_size; 124, identifier:page_size; 125, identifier:order_by; 126, identifier:order_by; 127, identifier:mask; 128, identifier:mask; 129, identifier:transaction; 130, identifier:transaction; 131, identifier:read_time; 132, identifier:read_time; 133, identifier:show_missing; 134, identifier:show_missing; 135, attribute; 136, identifier:page_iterator; 137, identifier:client; 138, None; 139, identifier:method; 140, call; 141, identifier:request; 142, identifier:request; 143, identifier:items_field; 144, string:"documents"; 145, identifier:request_token_field; 146, string:"page_token"; 147, identifier:response_token_field; 148, string:"next_page_token"; 149, identifier:self; 150, identifier:_inner_api_calls; 151, attribute; 152, identifier:wrap_method; 153, attribute; 154, keyword_argument; 155, keyword_argument; 156, keyword_argument; 157, identifier:google; 158, identifier:api_core; 159, attribute; 160, argument_list; 161, attribute; 162, identifier:method; 163, attribute; 164, identifier:list_documents; 165, identifier:default_retry; 166, attribute; 167, identifier:default_timeout; 168, attribute; 169, identifier:client_info; 170, attribute; 171, identifier:functools; 172, identifier:partial; 173, subscript; 174, keyword_argument; 175, keyword_argument; 176, keyword_argument; 177, attribute; 178, identifier:gapic_v1; 179, identifier:self; 180, identifier:transport; 181, subscript; 182, identifier:retry; 183, subscript; 184, identifier:timeout; 185, identifier:self; 186, identifier:_client_info; 187, attribute; 188, string:"list_documents"; 189, identifier:retry; 190, identifier:retry; 191, identifier:timeout; 192, identifier:timeout; 193, identifier:metadata; 194, identifier:metadata; 195, identifier:google; 196, identifier:api_core; 197, attribute; 198, string:"ListDocuments"; 199, attribute; 200, string:"ListDocuments"; 201, identifier:self; 202, identifier:_inner_api_calls; 203, identifier:self; 204, identifier:_method_configs; 205, identifier:self; 206, identifier:_method_configs
code: def list_documents(
          self,
          parent,
          collection_id,
          page_size=None,
          order_by=None,
          mask=None,
          transaction=None,
          read_time=None,
          show_missing=None,
          retry=google.api_core.gapic_v1.method.DEFAULT,
          timeout=google.api_core.gapic_v1.method.DEFAULT,
          metadata=None,
      ):
          """
          Lists documents.
  
          Example:
              >>> from google.cloud import firestore_v1beta1
              >>>
              >>> client = firestore_v1beta1.FirestoreClient()
              >>>
              >>> parent = client.any_path_path('[PROJECT]', '[DATABASE]', '[DOCUMENT]', '[ANY_PATH]')
              >>>
              >>> # TODO: Initialize `collection_id`:
              >>> collection_id = ''
              >>>
              >>> # Iterate over all results
              >>> for element in client.list_documents(parent, collection_id):
              ...     # process element
              ...     pass
              >>>
              >>>
              >>> # Alternatively:
              >>>
              >>> # Iterate over results one page at a time
              >>> for page in client.list_documents(parent, collection_id).pages:
              ...     for element in page:
              ...         # process element
              ...         pass
  
          Args:
              parent (str): 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``
              collection_id (str): The collection ID, relative to ``parent``, to list. For example:
                  ``chatrooms`` or ``messages``.
              page_size (int): The maximum number of resources contained in the
                  underlying API response. If page streaming is performed per-
                  resource, this parameter does not affect the return value. If page
                  streaming is performed per-page, this determines the maximum number
                  of resources in a page.
              order_by (str): The order to sort results by. For example: ``priority desc, name``.
              mask (Union[dict, ~google.cloud.firestore_v1beta1.types.DocumentMask]): The fields to return. If not set, returns all fields.
  
                  If a document has a field that is not present in this mask, that field
                  will not be returned in the response.
  
                  If a dict is provided, it must be of the same form as the protobuf
                  message :class:`~google.cloud.firestore_v1beta1.types.DocumentMask`
              transaction (bytes): Reads documents in a transaction.
              read_time (Union[dict, ~google.cloud.firestore_v1beta1.types.Timestamp]): Reads documents as they were at the given time.
                  This may not be older than 60 seconds.
  
                  If a dict is provided, it must be of the same form as the protobuf
                  message :class:`~google.cloud.firestore_v1beta1.types.Timestamp`
              show_missing (bool): 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``.
              retry (Optional[google.api_core.retry.Retry]):  A retry object used
                  to retry requests. If ``None`` is specified, requests will not
                  be retried.
              timeout (Optional[float]): The amount of time, in seconds, to wait
                  for the request to complete. Note that if ``retry`` is
                  specified, the timeout applies to each individual attempt.
              metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata
                  that is provided to the method.
  
          Returns:
              A :class:`~google.gax.PageIterator` instance. By default, this
              is an iterable of :class:`~google.cloud.firestore_v1beta1.types.Document` instances.
              This object can also be configured to iterate over the pages
              of the response through the `options` parameter.
  
          Raises:
              google.api_core.exceptions.GoogleAPICallError: If the request
                      failed for any reason.
              google.api_core.exceptions.RetryError: If the request failed due
                      to a retryable error and retry attempts failed.
              ValueError: If the parameters are invalid.
          """
          # Wrap the transport method to add retry and timeout logic.
          if "list_documents" not in self._inner_api_calls:
              self._inner_api_calls[
                  "list_documents"
              ] = google.api_core.gapic_v1.method.wrap_method(
                  self.transport.list_documents,
                  default_retry=self._method_configs["ListDocuments"].retry,
                  default_timeout=self._method_configs["ListDocuments"].timeout,
                  client_info=self._client_info,
              )
  
          # Sanity check: We have some fields which are mutually exclusive;
          # raise ValueError if more than one is sent.
          google.api_core.protobuf_helpers.check_oneof(
              transaction=transaction, read_time=read_time
          )
  
          request = firestore_pb2.ListDocumentsRequest(
              parent=parent,
              collection_id=collection_id,
              page_size=page_size,
              order_by=order_by,
              mask=mask,
              transaction=transaction,
              read_time=read_time,
              show_missing=show_missing,
          )
          iterator = google.api_core.page_iterator.GRPCIterator(
              client=None,
              method=functools.partial(
                  self._inner_api_calls["list_documents"],
                  retry=retry,
                  timeout=timeout,
                  metadata=metadata,
              ),
              request=request,
              items_field="documents",
              request_token_field="page_token",
              response_token_field="next_page_token",
          )
          return iterator