18
18
19
19
In the hierarchy of API concepts
20
20
21
- * a :class:`~google.cloud .firestore_v1.client.Client` owns a
22
- :class:`~google.cloud .firestore_v1.collection.CollectionReference`
23
- * a :class:`~google.cloud .firestore_v1.client.Client` owns a
24
- :class:`~google.cloud .firestore_v1.document.DocumentReference`
21
+ * a :class:`~.firestore_v1.client.Client` owns a
22
+ :class:`~.firestore_v1.collection.CollectionReference`
23
+ * a :class:`~.firestore_v1.client.Client` owns a
24
+ :class:`~.firestore_v1.document.DocumentReference`
25
25
"""
26
26
from google .api_core .gapic_v1 import client_info
27
27
from google .cloud .client import ClientWithProject
40
40
41
41
42
42
DEFAULT_DATABASE = "(default)"
43
- """str: The default database used in a :class:`~google.cloud .firestore.client.Client`."""
43
+ """str: The default database used in a :class:`~.firestore.client.Client`."""
44
44
_BAD_OPTION_ERR = (
45
45
"Exactly one of ``last_update_time`` or ``exists`` " "must be provided."
46
46
)
@@ -108,7 +108,7 @@ def _firestore_api(self):
108
108
"""Lazy-loading getter GAPIC Firestore API.
109
109
110
110
Returns:
111
- ~google.cloud .gapic.firestore.v1.firestore_client.FirestoreClient: The
111
+ ~.gapic.firestore.v1.firestore_client.FirestoreClient: The
112
112
GAPIC client with the credentials of the current client.
113
113
"""
114
114
if self ._firestore_api_internal is None :
@@ -185,7 +185,7 @@ def collection(self, *collection_path):
185
185
* A tuple of collection path segments
186
186
187
187
Returns:
188
- ~google.cloud .firestore_v1.collection.CollectionReference: A reference
188
+ ~.firestore_v1.collection.CollectionReference: A reference
189
189
to a collection in the Firestore database.
190
190
"""
191
191
if len (collection_path ) == 1 :
@@ -248,7 +248,7 @@ def document(self, *document_path):
248
248
* A tuple of document path segments
249
249
250
250
Returns:
251
- ~google.cloud .firestore_v1.document.DocumentReference: A reference
251
+ ~.firestore_v1.document.DocumentReference: A reference
252
252
to a document in a collection.
253
253
"""
254
254
if len (document_path ) == 1 :
@@ -298,9 +298,9 @@ def field_path(*field_names):
298
298
def write_option (** kwargs ):
299
299
"""Create a write option for write operations.
300
300
301
- Write operations include :meth:`~google.cloud .DocumentReference.set`,
302
- :meth:`~google.cloud .DocumentReference.update` and
303
- :meth:`~google.cloud .DocumentReference.delete`.
301
+ Write operations include :meth:`~.DocumentReference.set`,
302
+ :meth:`~.DocumentReference.update` and
303
+ :meth:`~.DocumentReference.delete`.
304
304
305
305
One of the following keyword arguments must be provided:
306
306
@@ -352,7 +352,7 @@ def get_all(self, references, field_paths=None, transaction=None):
352
352
If multiple ``references`` refer to the same document, the server
353
353
will only return one result.
354
354
355
- See :meth:`~google.cloud .firestore_v1.client.Client.field_path` for
355
+ See :meth:`~.firestore_v1.client.Client.field_path` for
356
356
more information on **field paths**.
357
357
358
358
If a ``transaction`` is used and it already has write operations
@@ -366,7 +366,7 @@ def get_all(self, references, field_paths=None, transaction=None):
366
366
paths (``.``-delimited list of field names) to use as a
367
367
projection of document fields in the returned results. If
368
368
no value is provided, all fields will be returned.
369
- transaction (Optional[~google.cloud .firestore_v1.transaction.\
369
+ transaction (Optional[~.firestore_v1.transaction.\
370
370
Transaction]): An existing transaction that these
371
371
``references`` will be retrieved in.
372
372
@@ -391,7 +391,7 @@ def collections(self):
391
391
"""List top-level collections of the client's database.
392
392
393
393
Returns:
394
- Sequence[~google.cloud .firestore_v1.collection.CollectionReference]:
394
+ Sequence[~.firestore_v1.collection.CollectionReference]:
395
395
iterator of subcollections of the current document.
396
396
"""
397
397
iterator = self ._firestore_api .list_collection_ids (
@@ -405,7 +405,7 @@ def batch(self):
405
405
"""Get a batch instance from this client.
406
406
407
407
Returns:
408
- ~google.cloud .firestore_v1.batch.WriteBatch: A "write" batch to be
408
+ ~.firestore_v1.batch.WriteBatch: A "write" batch to be
409
409
used for accumulating document changes and sending the changes
410
410
all at once.
411
411
"""
@@ -414,17 +414,17 @@ def batch(self):
414
414
def transaction (self , ** kwargs ):
415
415
"""Get a transaction that uses this client.
416
416
417
- See :class:`~google.cloud .firestore_v1.transaction.Transaction` for
417
+ See :class:`~.firestore_v1.transaction.Transaction` for
418
418
more information on transactions and the constructor arguments.
419
419
420
420
Args:
421
421
kwargs (Dict[str, Any]): The keyword arguments (other than
422
422
``client``) to pass along to the
423
- :class:`~google.cloud .firestore_v1.transaction.Transaction`
423
+ :class:`~.firestore_v1.transaction.Transaction`
424
424
constructor.
425
425
426
426
Returns:
427
- ~google.cloud .firestore_v1.transaction.Transaction: A transaction
427
+ ~.firestore_v1.transaction.Transaction: A transaction
428
428
attached to this client.
429
429
"""
430
430
return Transaction (self , ** kwargs )
@@ -433,7 +433,7 @@ def transaction(self, **kwargs):
433
433
def _reference_info (references ):
434
434
"""Get information about document references.
435
435
436
- Helper for :meth:`~google.cloud .firestore_v1.client.Client.get_all`.
436
+ Helper for :meth:`~.firestore_v1.client.Client.get_all`.
437
437
438
438
Args:
439
439
references (List[.DocumentReference, ...]): Iterable of document
@@ -461,7 +461,7 @@ def _get_reference(document_path, reference_map):
461
461
"""Get a document reference from a dictionary.
462
462
463
463
This just wraps a simple dictionary look-up with a helpful error that is
464
- specific to :meth:`~google.cloud .firestore.client.Client.get_all`, the
464
+ specific to :meth:`~.firestore.client.Client.get_all`, the
465
465
**public** caller of this function.
466
466
467
467
Args:
@@ -493,7 +493,7 @@ def _parse_batch_get(get_doc_response, reference_map, client):
493
493
reference_map (Dict[str, .DocumentReference]): A mapping (produced
494
494
by :func:`_reference_info`) of fully-qualified document paths to
495
495
document references.
496
- client (~google.cloud .firestore_v1.client.Client): A client that has
496
+ client (~.firestore_v1.client.Client): A client that has
497
497
a document factory.
498
498
499
499
Returns:
0 commit comments