Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CHANGE ME] Re-generated datastore to pick up changes in the API or client library generator. #10261

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
[CHANGE ME] Re-generated datastore to pick up changes in the API or c…
…lient library generator.
  • Loading branch information
yoshi-automation committed Jan 30, 2020
commit 4aeb6ea077e65f73314cb6d87a14e5799d2ffc38
52 changes: 21 additions & 31 deletions datastore/google/cloud/datastore_v1/gapic/datastore_client.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
#
# Copyright 2019 Google LLC
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -219,8 +219,8 @@ def lookup(
>>> response = client.lookup(project_id, keys)

Args:
project_id (str): The ID of the project against which to make the request.
keys (list[Union[dict, ~google.cloud.datastore_v1.types.Key]]): Keys of entities to look up.
project_id (str): Required. The ID of the project against which to make the request.
keys (list[Union[dict, ~google.cloud.datastore_v1.types.Key]]): Required. Keys of entities to look up.

If a dict is provided, it must be of the same form as the protobuf
message :class:`~google.cloud.datastore_v1.types.Key`
Expand Down Expand Up @@ -281,7 +281,7 @@ def lookup(
def run_query(
self,
project_id,
partition_id,
partition_id=None,
read_options=None,
query=None,
gql_query=None,
Expand All @@ -300,13 +300,10 @@ def run_query(
>>> # TODO: Initialize `project_id`:
>>> project_id = ''
>>>
>>> # TODO: Initialize `partition_id`:
>>> partition_id = {}
>>>
>>> response = client.run_query(project_id, partition_id)
>>> response = client.run_query(project_id)

Args:
project_id (str): The ID of the project against which to make the request.
project_id (str): Required. The ID of the project against which to make the request.
partition_id (Union[dict, ~google.cloud.datastore_v1.types.PartitionId]): Entities are partitioned into subsets, identified by a partition ID.
Queries are scoped to a single partition.
This partition ID is normalized with the standard default context
Expand Down Expand Up @@ -406,7 +403,7 @@ def begin_transaction(
>>> response = client.begin_transaction(project_id)

Args:
project_id (str): The ID of the project against which to make the request.
project_id (str): Required. The ID of the project against which to make the request.
transaction_options (Union[dict, ~google.cloud.datastore_v1.types.TransactionOptions]): Options for a new transaction.

If a dict is provided, it must be of the same form as the protobuf
Expand Down Expand Up @@ -464,9 +461,9 @@ def begin_transaction(
def commit(
self,
project_id,
mode,
mutations,
mode=None,
transaction=None,
mutations=None,
retry=google.api_core.gapic_v1.method.DEFAULT,
timeout=google.api_core.gapic_v1.method.DEFAULT,
metadata=None,
Expand All @@ -477,24 +474,20 @@ def commit(

Example:
>>> from google.cloud import datastore_v1
>>> from google.cloud.datastore_v1 import enums
>>>
>>> client = datastore_v1.DatastoreClient()
>>>
>>> # TODO: Initialize `project_id`:
>>> project_id = ''
>>>
>>> # TODO: Initialize `mode`:
>>> mode = enums.CommitRequest.Mode.MODE_UNSPECIFIED
>>>
>>> # TODO: Initialize `mutations`:
>>> mutations = []
>>>
>>> response = client.commit(project_id, mode, mutations)
>>> response = client.commit(project_id)

Args:
project_id (str): The ID of the project against which to make the request.
project_id (str): Required. The ID of the project against which to make the request.
mode (~google.cloud.datastore_v1.types.Mode): The type of commit to perform. Defaults to ``TRANSACTIONAL``.
transaction (bytes): The identifier of the transaction associated with the commit. A
transaction identifier is returned by a call to
``Datastore.BeginTransaction``.
mutations (list[Union[dict, ~google.cloud.datastore_v1.types.Mutation]]): The mutations to perform.

When mode is ``TRANSACTIONAL``, mutations affecting a single entity are
Expand All @@ -511,9 +504,6 @@ def commit(

If a dict is provided, it must be of the same form as the protobuf
message :class:`~google.cloud.datastore_v1.types.Mutation`
transaction (bytes): The identifier of the transaction associated with the commit. A
transaction identifier is returned by a call to
``Datastore.BeginTransaction``.
retry (Optional[google.api_core.retry.Retry]): A retry object used
to retry requests. If ``None`` is specified, requests will
be retried using a default configuration.
Expand Down Expand Up @@ -551,8 +541,8 @@ def commit(
request = datastore_pb2.CommitRequest(
project_id=project_id,
mode=mode,
mutations=mutations,
transaction=transaction,
mutations=mutations,
)
if metadata is None:
metadata = []
Expand Down Expand Up @@ -596,8 +586,8 @@ def rollback(
>>> response = client.rollback(project_id, transaction)

Args:
project_id (str): The ID of the project against which to make the request.
transaction (bytes): The transaction identifier, returned by a call to
project_id (str): Required. The ID of the project against which to make the request.
transaction (bytes): Required. The transaction identifier, returned by a call to
``Datastore.BeginTransaction``.
retry (Optional[google.api_core.retry.Retry]): A retry object used
to retry requests. If ``None`` is specified, requests will
Expand Down Expand Up @@ -675,8 +665,8 @@ def allocate_ids(
>>> response = client.allocate_ids(project_id, keys)

Args:
project_id (str): The ID of the project against which to make the request.
keys (list[Union[dict, ~google.cloud.datastore_v1.types.Key]]): A list of keys with incomplete key paths for which to allocate IDs.
project_id (str): Required. The ID of the project against which to make the request.
keys (list[Union[dict, ~google.cloud.datastore_v1.types.Key]]): Required. A list of keys with incomplete key paths for which to allocate IDs.
No key may be reserved/read-only.

If a dict is provided, it must be of the same form as the protobuf
Expand Down Expand Up @@ -756,8 +746,8 @@ def reserve_ids(
>>> response = client.reserve_ids(project_id, keys)

Args:
project_id (str): The ID of the project against which to make the request.
keys (list[Union[dict, ~google.cloud.datastore_v1.types.Key]]): A list of keys with complete key paths whose numeric IDs should not be
project_id (str): Required. The ID of the project against which to make the request.
keys (list[Union[dict, ~google.cloud.datastore_v1.types.Key]]): Required. A list of keys with complete key paths whose numeric IDs should not be
auto-allocated.

If a dict is provided, it must be of the same form as the protobuf
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,21 @@
"initial_retry_delay_millis": 100,
"retry_delay_multiplier": 1.3,
"max_retry_delay_millis": 60000,
"initial_rpc_timeout_millis": 60000,
"initial_rpc_timeout_millis": 20000,
"rpc_timeout_multiplier": 1.0,
"max_rpc_timeout_millis": 60000,
"max_rpc_timeout_millis": 20000,
"total_timeout_millis": 600000,
}
},
"methods": {
"Lookup": {
"timeout_millis": 60000,
"retry_codes_name": "idempotent",
"retry_codes_name": "non_idempotent",
"retry_params_name": "default",
},
"RunQuery": {
"timeout_millis": 60000,
"retry_codes_name": "idempotent",
"retry_codes_name": "non_idempotent",
"retry_params_name": "default",
},
"BeginTransaction": {
Expand All @@ -49,7 +49,7 @@
},
"ReserveIds": {
"timeout_millis": 60000,
"retry_codes_name": "idempotent",
"retry_codes_name": "non_idempotent",
"retry_params_name": "default",
},
},
Expand Down
2 changes: 1 addition & 1 deletion datastore/google/cloud/datastore_v1/gapic/enums.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
#
# Copyright 2019 Google LLC
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
#
# Copyright 2019 Google LLC
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
Loading