@@ -368,7 +368,40 @@ def get(self, key, missing=None, deferred=None, transaction=None, eventual=False
368368 return None
369369
370370 def get_entity_pb (self , key , missing = None , deferred = None , transaction = None , eventual = False ):
371- """Retrieve a single raw Entity Protobuf object from a datastore.
371+ """Retrieve a single Entity Protobuf object for the provided key.
372+
373+ .. note::
374+
375+ This method is the same as "get()" method, but it works with raw Entity Protobuf
376+ object (:class:`.entity_pb2.Entity`) instead of Entity Python class
377+ (:class:`google.cloud.datastore.entity.Entity`).
378+
379+ :type key: :class:`google.cloud.datastore.key.Key`
380+ :param key: The key to be retrieved from the datastore.
381+
382+ :type missing: list
383+ :param missing: (Optional) If a list is passed, the key-only entities
384+ returned by the backend as "missing" will be copied
385+ into it.
386+
387+ :type deferred: list
388+ :param deferred: (Optional) If a list is passed, the keys returned
389+ by the backend as "deferred" will be copied into it.
390+
391+ :type transaction:
392+ :class:`~google.cloud.datastore.transaction.Transaction`
393+ :param transaction: (Optional) Transaction to use for read consistency.
394+ If not passed, uses current transaction, if set.
395+
396+ :type eventual: bool
397+ :param eventual: (Optional) Defaults to strongly consistent (False).
398+ Setting True will use eventual consistency, but cannot
399+ be used inside a transaction or will raise ValueError.
400+
401+ :rtype: :class:`.entity_pb2.Entity` or ``NoneType``
402+ :returns: The requested entity protobuf object if it exists.
403+
404+ :raises: :class:`ValueError` if eventual is True and in a transaction.
372405 """
373406 entity_pbs = self .get_multi_entity_pb (
374407 keys = [key ],
@@ -425,6 +458,44 @@ def get_multi(
425458 def get_multi_entity_pb (
426459 self , keys , missing = None , deferred = None , transaction = None , eventual = False
427460 ):
461+ """Retrieve raw Entity protobuf objects for the provided keys.
462+
463+ .. note::
464+
465+ This method is the same as "get_multi()" method, but it works with raw Entity
466+ Protobuf object (:class:`.entity_pb2.Entity`) instead of Entity Python class
467+ (:class:`google.cloud.datastore.entity.Entity`).
468+
469+ :type keys: list of :class:`google.cloud.datastore.key.Key`
470+ :param keys: The keys to be retrieved from the datastore.
471+
472+ :type missing: list
473+ :param missing: (Optional) If a list is passed, the key-only entities
474+ returned by the backend as "missing" will be copied
475+ into it. If the list is not empty, an error will occur.
476+
477+ :type deferred: list
478+ :param deferred: (Optional) If a list is passed, the keys returned
479+ by the backend as "deferred" will be copied into it.
480+ If the list is not empty, an error will occur.
481+
482+ :type transaction:
483+ :class:`~google.cloud.datastore.transaction.Transaction`
484+ :param transaction: (Optional) Transaction to use for read consistency.
485+ If not passed, uses current transaction, if set.
486+
487+ :type eventual: bool
488+ :param eventual: (Optional) Defaults to strongly consistent (False).
489+ Setting True will use eventual consistency, but cannot
490+ be used inside a transaction or will raise ValueError.
491+
492+ :rtype: list of:class:`.entity_pb2.Entity`
493+ :returns: The requested entities (protobuf objects).
494+
495+ :raises: :class:`ValueError` if one or more of ``keys`` has a project
496+ which does not match our project.
497+ :raises: :class:`ValueError` if eventual is True and in a transaction.
498+ """
428499 return self ._get_multi (keys = keys , missing = missing , deferred = deferred ,
429500 transaction = transaction , eventual = eventual )
430501
@@ -445,6 +516,15 @@ def put(self, entity):
445516 def put_entity_pb (self , entity_pb ):
446517 """
447518 Save a single raw Entity Protobuf object in the Cloud Datastore.
519+
520+ .. note::
521+
522+ This method is the same as "put()" method, but it works with raw Entity Protobuf
523+ object (:class:`.entity_pb2.Entity`) instead of Entity Python class
524+ (:class:`google.cloud.datastore.entity.Entity`).
525+
526+ :type entity_pb: :class:`.entity_pb2.Entity`
527+ :param entity_pb: The entity to be saved to the datastore.
448528 """
449529 self .put_multi_entity_pbs (entity_pbs = [entity_pb ])
450530
@@ -478,6 +558,17 @@ def put_multi(self, entities):
478558 def put_multi_entity_pbs (self , entity_pbs ):
479559 """
480560 Save multiple raw Entity Protobuf objects in the Cloud Datastore.
561+
562+ .. note::
563+
564+ This method is the same as "put_multi()" method, but it works with raw Entity Protobuf
565+ object (:class:`.entity_pb2.Entity`) instead of Entity Python class
566+ (:class:`google.cloud.datastore.entity.Entity`).
567+
568+ :type entity_pbs: list of :class:`.entity_pb2.Entity`
569+ :param entity_pbs: The entities to be saved to the datastore.
570+
571+ :raises: :class:`ValueError` if ``entities`` is a single entity.
481572 """
482573 if not entity_pbs :
483574 return
0 commit comments