Module Expr Str Import alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias identifier ImportFrom alias ClassDef bases AttributeLoad NameLoad attr body Expr Str Assign NameStore Str Expr Str Assign NameStore Str Expr Str Assign NameStore Str Expr Str Assign NameStore TupleLoad Str Expr Str FunctionDef arguments args NameParam NameParam NameParam NameParam defaults NameLoad NameLoad NameLoad body Expr Call AttributeLoad Call NameLoad NameLoad NameLoad attr keyword NameLoad keyword NameLoad If CompareIs NameLoad NameLoad body TryExcept body Assign NameStore BinOpMod Str TupleLoad SubscriptLoad AttributeLoad NameLoad attr Index NameLoad handlers ExceptHandler type NameLoad body Assign NameStore AttributeLoad AttributeLoad NameLoad attr attr Assign AttributeStore NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults body Expr Str Assign NameStore Dict Str Str Str Str Call NameLoad Call NameLoad NameLoad AttributeLoad NameLoad attr Assign TupleStore NameStore NameStore Call AttributeLoad AttributeLoad NameLoad attr attr keyword Call AttributeLoad NameLoad attr keyword NameLoad keyword NameLoad keyword Str keyword NameLoad keyword NameLoad Assign NameStore SubscriptLoad NameLoad Index Str If CompareNotEq NameLoad Str body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Raise Call NameLoad NameLoad AttributeLoad NameLoad attr keyword NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr keyword NameLoad keyword NameLoad keyword Call AttributeLoad NameLoad attr Return Call AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam defaults NameLoad NameLoad body Expr Str Return Call AttributeLoad AttributeLoad NameLoad attr attr keyword BoolOpOr NameLoad AttributeLoad NameLoad attr keyword BoolOpOr NameLoad AttributeLoad NameLoad attr keyword NameLoad keyword NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam defaults NameLoad NameLoad body Expr Str Assign NameStore Call AttributeLoad NameLoad attr Expr Call NameLoad NameLoad NameLoad NameLoad Expr Call NameLoad AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad Str NameLoad AttributeLoad NameLoad attr Assign NameStore ListComp AttributeLoad NameLoad attr comprehension NameStore AttributeLoad NameLoad attr Assign NameStore ListComp AttributeLoad NameLoad attr comprehension NameStore AttributeLoad NameLoad attr Return TupleLoad NameLoad NameLoad Call NameLoad AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam defaults NameLoad NameLoad NameLoad body Expr Str Assign NameStore Call AttributeLoad NameLoad attr Expr Call NameLoad NameLoad NameLoad NameLoad If NameLoad body Assign AttributeStore AttributeLoad NameLoad attr attr NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad Str NameLoad AttributeLoad NameLoad attr Return TupleLoad ListComp AttributeLoad NameLoad attr comprehension NameStore AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad AttributeLoad NameLoad attr attr decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr NameLoad Str NameLoad AttributeLoad NameLoad attr Return AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults body Expr Str If NameLoad body Assign AttributeStore NameLoad attr AttributeLoad AttributeLoad NameLoad attr attr Assign AttributeStore NameLoad attr NameLoad orelse Assign AttributeStore NameLoad attr AttributeLoad AttributeLoad NameLoad attr attr Assign NameStore Call AttributeLoad NameLoad attr NameLoad Str NameLoad AttributeLoad NameLoad attr Return Call NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr NameLoad Str NameLoad AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr Expr Call NameLoad AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad Str NameLoad AttributeLoad NameLoad attr Return Call NameLoad AttributeLoad NameLoad attr decorator_list decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str If BoolOpAnd NameLoad CompareIsNot NameLoad NameLoad body Raise Call NameLoad Str Assign NameStore AttributeLoad NameLoad attr If NameLoad body Assign AttributeStore NameLoad attr AttributeLoad AttributeLoad NameLoad attr attr orelse If NameLoad body Assign AttributeStore NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str For NameStore NameLoad body Expr Call AttributeLoad Call AttributeLoad NameLoad attr attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore AttributeLoad NameLoad attr Assign NameStore AttributeLoad NameLoad attr Assign NameStore ListComp AttributeLoad NameLoad attr comprehension NameStore NameLoad Call AttributeLoad NameLoad attr Str Return TupleLoad NameLoad NameLoad decorator_list
N/A N/A Connections to gcloud datastore API servers. N/A os gcloud connection gcloud.environment_vars GCD_HOST gcloud.exceptions make_exception gcloud.datastore._generated datastore_pb2 _datastore_pb2 google.rpc status_pb2 Connection N/A N/A connection Connection N/A N/A A connection to the Google Cloud Datastore via the Protobuf API.

    This class should understand only the basic types (and protobufs)
    in method arguments, however should be capable of returning advanced types.

    :type credentials: :class:`oauth2client.client.OAuth2Credentials`
    :param credentials: The OAuth2 Credentials to use for this connection.

    :type http: :class:`httplib2.Http` or class that defines ``request()``.
    :param http: An optional HTTP object to make requests.

    :type api_base_url: string
    :param api_base_url: The base of the API call URL. Defaults to
                         :attr:`API_BASE_URL`.
     N/A API_BASE_URL https://datastore.googleapis.com N/A The base of the API call URL. N/A API_VERSION v1beta3 N/A The version of the API, used in building the API call's URL. N/A API_URL_TEMPLATE {api_base}/{api_version}/projects/{project}:{method} N/A A template for the URL of a particular API call. N/A SCOPE N/A https://www.googleapis.com/auth/datastore N/A The scopes required for authenticating as a Cloud Datastore consumer. __init__ N/A N/A self credentials http api_base_url N/A None None None N/A N/A N/A N/A N/A super Connection self __init__ credentials credentials http http N/A N/A api_base_url None N/A N/A N/A N/A api_base_url N/A %s/datastore N/A N/A N/A os environ N/A GCD_HOST N/A N/A N/A KeyError N/A N/A api_base_url N/A N/A self __class__ API_BASE_URL N/A N/A self api_base_url api_base_url N/A _request N/A N/A self project method data N/A N/A N/A Make a request over the Http transport to the Cloud Datastore API.

        :type project: string
        :param project: The project to make the request for.

        :type method: string
        :param method: The API call method name (ie, ``runQuery``,
                       ``lookup``, etc)

        :type data: string
        :param data: The data to send with the API call.
                     Typically this is a serialized Protobuf string.

        :rtype: string
        :returns: The string response content from the API call.
        :raises: :class:`gcloud.exceptions.GCloudError` if the response
                 code is not 200 OK.
         N/A headers N/A Content-Type Content-Length User-Agent application/x-protobuf N/A str N/A len data N/A self USER_AGENT N/A N/A headers content N/A N/A N/A self http request uri N/A N/A self build_api_url project project method method method POST headers headers body data N/A status N/A headers N/A status N/A N/A status 200 N/A N/A error_status N/A N/A N/A status_pb2 Status FromString content N/A N/A make_exception headers N/A error_status message use_json False N/A content N/A _rpc N/A N/A self project method request_pb response_pb_cls N/A N/A N/A Make a protobuf RPC request.

        :type project: string
        :param project: The project to connect to. This is
                        usually your project name in the cloud console.

        :type method: string
        :param method: The name of the method to invoke.

        :type request_pb: :class:`google.protobuf.message.Message` instance
        :param request_pb: the protobuf instance representing the request.

        :type response_pb_cls: A :class:`google.protobuf.message.Message'
                               subclass.
        :param response_pb_cls: The class used to unmarshall the response
                                protobuf.
         N/A response N/A N/A self _request project project method method data N/A N/A request_pb SerializeToString N/A N/A N/A response_pb_cls FromString response N/A build_api_url N/A N/A self project method base_url api_version N/A None None N/A N/A Construct the URL for a particular API call.

        This method is used internally to come up with the URL to use when
        making RPCs to the Cloud Datastore API.

        :type project: string
        :param project: The project to connect to. This is
                        usually your project name in the cloud console.

        :type method: string
        :param method: The API method to call (e.g. 'runQuery', 'lookup').

        :type base_url: string
        :param base_url: The base URL where the API lives.
                         You shouldn't have to provide this.

        :type api_version: string
        :param api_version: The version of the API to connect to.
                            You shouldn't have to provide this.
         N/A N/A N/A N/A self API_URL_TEMPLATE format api_base N/A base_url N/A self api_base_url api_version N/A api_version N/A self API_VERSION project project method method N/A lookup N/A N/A self project key_pbs eventual transaction_id N/A False None N/A N/A Lookup keys from a project in the Cloud Datastore.

        Maps the ``DatastoreService.Lookup`` protobuf RPC.

        This uses mostly protobufs
        (:class:`gcloud.datastore._generated.entity_pb2.Key` as input and
        :class:`gcloud.datastore._generated.entity_pb2.Entity` as output). It
        is used under the hood in
        :meth:`Client.get() <.datastore.client.Client.get>`:

        >>> from gcloud import datastore
        >>> client = datastore.Client(project='project')
        >>> key = client.key('MyKind', 1234)
        >>> client.get(key)
        [<Entity object>]

        Using a :class:`Connection` directly:

        >>> connection.lookup('project', [key.to_protobuf()])
        [<Entity protobuf>]

        :type project: string
        :param project: The project to look up the keys in.

        :type key_pbs: list of
                       :class:`gcloud.datastore._generated.entity_pb2.Key`
        :param key_pbs: The keys to retrieve from the datastore.

        :type eventual: bool
        :param eventual: If False (the default), request ``STRONG`` read
                         consistency.  If True, request ``EVENTUAL`` read
                         consistency.

        :type transaction_id: string
        :param transaction_id: If passed, make the request in the scope of
                               the given transaction.  Incompatible with
                               ``eventual==True``.

        :rtype: tuple
        :returns: A triple of (``results``, ``missing``, ``deferred``) where
                  both ``results`` and ``missing`` are lists of
                  :class:`gcloud.datastore._generated.entity_pb2.Entity` and
                  ``deferred`` is a list of
                  :class:`gcloud.datastore._generated.entity_pb2.Key`.
         N/A lookup_request N/A N/A _datastore_pb2 LookupRequest N/A N/A _set_read_options lookup_request eventual transaction_id N/A N/A _add_keys_to_request N/A lookup_request keys key_pbs N/A lookup_response N/A N/A self _rpc project lookup lookup_request N/A _datastore_pb2 LookupResponse N/A results N/A N/A result entity N/A result N/A lookup_response found N/A missing N/A N/A result entity N/A result N/A lookup_response missing N/A N/A results missing N/A list N/A lookup_response deferred N/A run_query N/A N/A self project query_pb namespace eventual transaction_id N/A None False None N/A N/A Run a query on the Cloud Datastore.

        Maps the ``DatastoreService.RunQuery`` protobuf RPC.

        Given a Query protobuf, sends a ``runQuery`` request to the
        Cloud Datastore API and returns a list of entity protobufs
        matching the query.

        You typically wouldn't use this method directly, in favor of the
        :meth:`gcloud.datastore.query.Query.fetch` method.

        Under the hood, the :class:`gcloud.datastore.query.Query` class
        uses this method to fetch data:

        >>> from gcloud import datastore
        >>> client = datastore.Client()
        >>> query = client.query(kind='MyKind')
        >>> query.add_filter('property', '=', 'val')

        Using the query iterator's
        :meth:`next_page() <.datastore.query.Iterator.next_page>` method:

        >>> query_iter = query.fetch()
        >>> entities, more_results, cursor = query_iter.next_page()
        >>> entities
        [<list of Entity unmarshalled from protobuf>]
        >>> more_results
        <boolean of more results>
        >>> cursor
        <string containing cursor where fetch stopped>

        Under the hood this is doing:

        >>> connection.run_query('project', query.to_protobuf())
        [<list of Entity Protobufs>], cursor, more_results, skipped_results

        :type project: string
        :param project: The project over which to run the query.

        :type query_pb: :class:`gcloud.datastore._generated.query_pb2.Query`
        :param query_pb: The Protobuf representing the query to run.

        :type namespace: string
        :param namespace: The namespace over which to run the query.

        :type eventual: bool
        :param eventual: If False (the default), request ``STRONG`` read
                         consistency.  If True, request ``EVENTUAL`` read
                         consistency.

        :type transaction_id: string
        :param transaction_id: If passed, make the request in the scope of
                               the given transaction.  Incompatible with
                               ``eventual==True``.
         N/A request N/A N/A _datastore_pb2 RunQueryRequest N/A N/A _set_read_options request eventual transaction_id N/A namespace N/A N/A N/A N/A request partition_id namespace_id namespace N/A N/A N/A N/A request query CopyFrom query_pb N/A response N/A N/A self _rpc project runQuery request N/A _datastore_pb2 RunQueryResponse N/A N/A N/A N/A e entity N/A e N/A N/A response batch entity_results N/A N/A response batch end_cursor N/A N/A response batch more_results N/A N/A response batch skipped_results N/A begin_transaction N/A N/A self project N/A N/A N/A Begin a transaction.

        Maps the ``DatastoreService.BeginTransaction`` protobuf RPC.

        :type project: string
        :param project: The project to which the transaction applies.

        :rtype: bytes
        :returns: The serialized transaction that was begun.
         N/A request N/A N/A _datastore_pb2 BeginTransactionRequest N/A response N/A N/A self _rpc project beginTransaction request N/A _datastore_pb2 BeginTransactionResponse N/A N/A response transaction N/A commit N/A N/A self project request transaction_id N/A N/A N/A Commit mutations in context of current transation (if any).

        Maps the ``DatastoreService.Commit`` protobuf RPC.

        :type project: string
        :param project: The project to which the transaction applies.

        :type request: :class:`._generated.datastore_pb2.CommitRequest`
        :param request: The protobuf with the mutations being committed.

        :type transaction_id: string or None
        :param transaction_id: The transaction ID returned from
                               :meth:`begin_transaction`.  Non-transactional
                               batches must pass ``None``.

        .. note::

            This method will mutate ``request`` before using it.

        :rtype: tuple
        :returns': The pair of the number of index updates and a list of
                   :class:`._generated.entity_pb2.Key` for each incomplete key
                   that was completed in the commit.
         N/A transaction_id N/A N/A N/A request mode N/A N/A _datastore_pb2 CommitRequest TRANSACTIONAL N/A N/A request transaction transaction_id N/A N/A N/A request mode N/A N/A _datastore_pb2 CommitRequest NON_TRANSACTIONAL N/A response N/A N/A self _rpc project commit request N/A _datastore_pb2 CommitResponse N/A N/A _parse_commit_response response N/A rollback N/A N/A self project transaction_id N/A N/A N/A Rollback the connection's existing transaction.

        Maps the ``DatastoreService.Rollback`` protobuf RPC.

        :type project: string
        :param project: The project to which the transaction belongs.

        :type transaction_id: string
        :param transaction_id: The transaction ID returned from
                               :meth:`begin_transaction`.
         N/A request N/A N/A _datastore_pb2 RollbackRequest N/A N/A request transaction transaction_id N/A N/A N/A self _rpc project rollback request N/A _datastore_pb2 RollbackResponse N/A allocate_ids N/A N/A self project key_pbs N/A N/A N/A Obtain backend-generated IDs for a set of keys.

        Maps the ``DatastoreService.AllocateIds`` protobuf RPC.

        :type project: string
        :param project: The project to which the transaction belongs.

        :type key_pbs: list of
                       :class:`gcloud.datastore._generated.entity_pb2.Key`
        :param key_pbs: The keys for which the backend should allocate IDs.

        :rtype: list of :class:`gcloud.datastore._generated.entity_pb2.Key`
        :returns: An equal number of keys,  with IDs filled in by the backend.
         N/A request N/A N/A _datastore_pb2 AllocateIdsRequest N/A N/A _add_keys_to_request N/A request keys key_pbs N/A response N/A N/A self _rpc project allocateIds request N/A _datastore_pb2 AllocateIdsResponse N/A N/A list N/A response keys N/A N/A _set_read_options N/A N/A request eventual transaction_id N/A N/A N/A Validate rules for read options, and assign to the request.

    Helper method for ``lookup()`` and ``run_query``.

    :raises: :class:`ValueError` if ``eventual`` is ``True`` and the
             ``transaction_id`` is not ``None``.
     N/A N/A eventual N/A transaction_id None N/A N/A N/A ValueError eventual must be False when in a transaction N/A opts N/A request read_options N/A eventual N/A N/A N/A opts read_consistency N/A N/A _datastore_pb2 ReadOptions EVENTUAL N/A N/A transaction_id N/A N/A N/A opts transaction transaction_id N/A _add_keys_to_request N/A N/A request_field_pb key_pbs N/A N/A N/A Add protobuf keys to a request object.

    :type request_field_pb: `RepeatedCompositeFieldContainer`
    :param request_field_pb: A repeated proto field that contains keys.

    :type key_pbs: list of :class:`gcloud.datastore._generated.entity_pb2.Key`
    :param key_pbs: The keys to add to a request.
     N/A key_pb key_pbs N/A N/A N/A N/A N/A N/A request_field_pb add CopyFrom key_pb N/A _parse_commit_response N/A N/A commit_response_pb N/A N/A N/A Extract response data from a commit response.

    :type commit_response_pb: :class:`._generated.datastore_pb2.CommitResponse`
    :param commit_response_pb: The protobuf response from a commit request.

    :rtype: tuple
    :returns': The pair of the number of index updates and a list of
               :class:`._generated.entity_pb2.Key` for each incomplete key
               that was completed in the commit.
     N/A mut_results N/A commit_response_pb mutation_results N/A index_updates N/A commit_response_pb index_updates N/A completed_keys N/A N/A mut_result key N/A mut_result mut_results N/A N/A mut_result HasField key N/A N/A index_updates completed_keys N/A