diff --git a/spanner/google/cloud/spanner_admin_database_v1/gapic/transports/database_admin_grpc_transport.py b/spanner/google/cloud/spanner_admin_database_v1/gapic/transports/database_admin_grpc_transport.py index b352eb9b30b2..c2e38e62c42f 100644 --- a/spanner/google/cloud/spanner_admin_database_v1/gapic/transports/database_admin_grpc_transport.py +++ b/spanner/google/cloud/spanner_admin_database_v1/gapic/transports/database_admin_grpc_transport.py @@ -110,7 +110,7 @@ def channel(self): @property def list_databases(self): - """Return the gRPC stub for {$apiMethod.name}. + """Return the gRPC stub for :meth:`DatabaseAdminClient.list_databases`. Lists Cloud Spanner databases. @@ -123,7 +123,7 @@ def list_databases(self): @property def create_database(self): - """Return the gRPC stub for {$apiMethod.name}. + """Return the gRPC stub for :meth:`DatabaseAdminClient.create_database`. Creates a new Cloud Spanner database and starts to prepare it for serving. The returned ``long-running operation`` will have a name of the @@ -141,7 +141,7 @@ def create_database(self): @property def get_database(self): - """Return the gRPC stub for {$apiMethod.name}. + """Return the gRPC stub for :meth:`DatabaseAdminClient.get_database`. Gets the state of a Cloud Spanner database. @@ -154,7 +154,7 @@ def get_database(self): @property def update_database_ddl(self): - """Return the gRPC stub for {$apiMethod.name}. + """Return the gRPC stub for :meth:`DatabaseAdminClient.update_database_ddl`. Updates the schema of a Cloud Spanner database by creating/altering/dropping tables, columns, indexes, etc. The returned @@ -172,7 +172,7 @@ def update_database_ddl(self): @property def drop_database(self): - """Return the gRPC stub for {$apiMethod.name}. + """Return the gRPC stub for :meth:`DatabaseAdminClient.drop_database`. Drops (aka deletes) a Cloud Spanner database. @@ -185,7 +185,7 @@ def drop_database(self): @property def get_database_ddl(self): - """Return the gRPC stub for {$apiMethod.name}. + """Return the gRPC stub for :meth:`DatabaseAdminClient.get_database_ddl`. Returns the schema of a Cloud Spanner database as a list of formatted DDL statements. This method does not show pending schema updates, those @@ -200,7 +200,7 @@ def get_database_ddl(self): @property def set_iam_policy(self): - """Return the gRPC stub for {$apiMethod.name}. + """Return the gRPC stub for :meth:`DatabaseAdminClient.set_iam_policy`. Sets the access control policy on a database resource. Replaces any existing policy. @@ -217,7 +217,7 @@ def set_iam_policy(self): @property def get_iam_policy(self): - """Return the gRPC stub for {$apiMethod.name}. + """Return the gRPC stub for :meth:`DatabaseAdminClient.get_iam_policy`. Gets the access control policy for a database resource. Returns an empty policy if a database exists but does not have a policy set. @@ -234,7 +234,7 @@ def get_iam_policy(self): @property def test_iam_permissions(self): - """Return the gRPC stub for {$apiMethod.name}. + """Return the gRPC stub for :meth:`DatabaseAdminClient.test_iam_permissions`. Returns permissions that the caller has on the specified database resource. diff --git a/spanner/google/cloud/spanner_admin_instance_v1/gapic/transports/instance_admin_grpc_transport.py b/spanner/google/cloud/spanner_admin_instance_v1/gapic/transports/instance_admin_grpc_transport.py index 932a34e3788e..1686e810ba33 100644 --- a/spanner/google/cloud/spanner_admin_instance_v1/gapic/transports/instance_admin_grpc_transport.py +++ b/spanner/google/cloud/spanner_admin_instance_v1/gapic/transports/instance_admin_grpc_transport.py @@ -110,7 +110,7 @@ def channel(self): @property def list_instance_configs(self): - """Return the gRPC stub for {$apiMethod.name}. + """Return the gRPC stub for :meth:`InstanceAdminClient.list_instance_configs`. Lists the supported instance configurations for a given project. @@ -123,7 +123,7 @@ def list_instance_configs(self): @property def get_instance_config(self): - """Return the gRPC stub for {$apiMethod.name}. + """Return the gRPC stub for :meth:`InstanceAdminClient.get_instance_config`. Gets information about a particular instance configuration. @@ -136,7 +136,7 @@ def get_instance_config(self): @property def list_instances(self): - """Return the gRPC stub for {$apiMethod.name}. + """Return the gRPC stub for :meth:`InstanceAdminClient.list_instances`. Lists all instances in the given project. @@ -149,7 +149,7 @@ def list_instances(self): @property def get_instance(self): - """Return the gRPC stub for {$apiMethod.name}. + """Return the gRPC stub for :meth:`InstanceAdminClient.get_instance`. Gets information about a particular instance. @@ -162,7 +162,7 @@ def get_instance(self): @property def create_instance(self): - """Return the gRPC stub for {$apiMethod.name}. + """Return the gRPC stub for :meth:`InstanceAdminClient.create_instance`. Creates an instance and begins preparing it to begin serving. The returned ``long-running operation`` can be used to track the progress of @@ -205,7 +205,7 @@ def create_instance(self): @property def update_instance(self): - """Return the gRPC stub for {$apiMethod.name}. + """Return the gRPC stub for :meth:`InstanceAdminClient.update_instance`. Updates an instance, and begins allocating or releasing resources as requested. The returned ``long-running operation`` can be used to track @@ -253,7 +253,7 @@ def update_instance(self): @property def delete_instance(self): - """Return the gRPC stub for {$apiMethod.name}. + """Return the gRPC stub for :meth:`InstanceAdminClient.delete_instance`. Deletes an instance. @@ -276,7 +276,7 @@ def delete_instance(self): @property def set_iam_policy(self): - """Return the gRPC stub for {$apiMethod.name}. + """Return the gRPC stub for :meth:`InstanceAdminClient.set_iam_policy`. Sets the access control policy on an instance resource. Replaces any existing policy. @@ -293,7 +293,7 @@ def set_iam_policy(self): @property def get_iam_policy(self): - """Return the gRPC stub for {$apiMethod.name}. + """Return the gRPC stub for :meth:`InstanceAdminClient.get_iam_policy`. Gets the access control policy for an instance resource. Returns an empty policy if an instance exists but does not have a policy set. @@ -310,7 +310,7 @@ def get_iam_policy(self): @property def test_iam_permissions(self): - """Return the gRPC stub for {$apiMethod.name}. + """Return the gRPC stub for :meth:`InstanceAdminClient.test_iam_permissions`. Returns permissions that the caller has on the specified instance resource. diff --git a/spanner/google/cloud/spanner_v1/gapic/enums.py b/spanner/google/cloud/spanner_v1/gapic/enums.py index 079ad09f599b..90e412fc6692 100644 --- a/spanner/google/cloud/spanner_v1/gapic/enums.py +++ b/spanner/google/cloud/spanner_v1/gapic/enums.py @@ -77,6 +77,24 @@ class TypeCode(enum.IntEnum): STRUCT = 9 +class ExecuteSqlRequest(object): + class QueryMode(enum.IntEnum): + """ + Mode in which the statement must be processed. + + Attributes: + NORMAL (int): The default mode. Only the statement results are returned. + PLAN (int): This mode returns only the query plan, without any results or + execution statistics information. + PROFILE (int): This mode returns both the query plan and the execution statistics along + with the results. + """ + + NORMAL = 0 + PLAN = 1 + PROFILE = 2 + + class PlanNode(object): class Kind(enum.IntEnum): """ @@ -97,21 +115,3 @@ class Kind(enum.IntEnum): KIND_UNSPECIFIED = 0 RELATIONAL = 1 SCALAR = 2 - - -class ExecuteSqlRequest(object): - class QueryMode(enum.IntEnum): - """ - Mode in which the statement must be processed. - - Attributes: - NORMAL (int): The default mode. Only the statement results are returned. - PLAN (int): This mode returns only the query plan, without any results or - execution statistics information. - PROFILE (int): This mode returns both the query plan and the execution statistics along - with the results. - """ - - NORMAL = 0 - PLAN = 1 - PROFILE = 2 diff --git a/spanner/google/cloud/spanner_v1/gapic/transports/spanner_grpc_transport.py b/spanner/google/cloud/spanner_v1/gapic/transports/spanner_grpc_transport.py index 30a20d7ad66b..13a3fb7c281c 100644 --- a/spanner/google/cloud/spanner_v1/gapic/transports/spanner_grpc_transport.py +++ b/spanner/google/cloud/spanner_v1/gapic/transports/spanner_grpc_transport.py @@ -108,7 +108,7 @@ def channel(self): @property def create_session(self): - """Return the gRPC stub for {$apiMethod.name}. + """Return the gRPC stub for :meth:`SpannerClient.create_session`. Creates a new session. A session can be used to perform transactions that read and/or modify data in a Cloud Spanner database. Sessions are @@ -137,7 +137,7 @@ def create_session(self): @property def get_session(self): - """Return the gRPC stub for {$apiMethod.name}. + """Return the gRPC stub for :meth:`SpannerClient.get_session`. Gets a session. Returns ``NOT_FOUND`` if the session does not exist. This is mainly useful for determining whether a session is still alive. @@ -151,7 +151,7 @@ def get_session(self): @property def list_sessions(self): - """Return the gRPC stub for {$apiMethod.name}. + """Return the gRPC stub for :meth:`SpannerClient.list_sessions`. Lists all sessions in a given database. @@ -164,7 +164,7 @@ def list_sessions(self): @property def delete_session(self): - """Return the gRPC stub for {$apiMethod.name}. + """Return the gRPC stub for :meth:`SpannerClient.delete_session`. Ends a session, releasing server resources associated with it. @@ -177,7 +177,7 @@ def delete_session(self): @property def execute_sql(self): - """Return the gRPC stub for {$apiMethod.name}. + """Return the gRPC stub for :meth:`SpannerClient.execute_sql`. Executes an SQL statement, returning all results in a single reply. This method cannot be used to return a result set larger than 10 MiB; if the @@ -200,7 +200,7 @@ def execute_sql(self): @property def execute_streaming_sql(self): - """Return the gRPC stub for {$apiMethod.name}. + """Return the gRPC stub for :meth:`SpannerClient.execute_streaming_sql`. Like ``ExecuteSql``, except returns the result set as a stream. Unlike ``ExecuteSql``, there is no limit on the size of the returned result @@ -216,7 +216,7 @@ def execute_streaming_sql(self): @property def read(self): - """Return the gRPC stub for {$apiMethod.name}. + """Return the gRPC stub for :meth:`SpannerClient.read`. Reads rows from the database using key lookups and scans, as a simple key/value style alternative to ``ExecuteSql``. This method cannot be @@ -239,7 +239,7 @@ def read(self): @property def streaming_read(self): - """Return the gRPC stub for {$apiMethod.name}. + """Return the gRPC stub for :meth:`SpannerClient.streaming_read`. Like ``Read``, except returns the result set as a stream. Unlike ``Read``, there is no limit on the size of the returned result set. @@ -255,7 +255,7 @@ def streaming_read(self): @property def begin_transaction(self): - """Return the gRPC stub for {$apiMethod.name}. + """Return the gRPC stub for :meth:`SpannerClient.begin_transaction`. Begins a new transaction. This step can often be skipped: ``Read``, ``ExecuteSql`` and ``Commit`` can begin a new transaction as a @@ -270,7 +270,7 @@ def begin_transaction(self): @property def commit(self): - """Return the gRPC stub for {$apiMethod.name}. + """Return the gRPC stub for :meth:`SpannerClient.commit`. Commits a transaction. The request includes the mutations to be applied to rows in the database. @@ -290,7 +290,7 @@ def commit(self): @property def rollback(self): - """Return the gRPC stub for {$apiMethod.name}. + """Return the gRPC stub for :meth:`SpannerClient.rollback`. Rolls back a transaction, releasing any locks it holds. It is a good idea to call this for any transaction that includes one or more ``Read`` @@ -309,7 +309,7 @@ def rollback(self): @property def partition_query(self): - """Return the gRPC stub for {$apiMethod.name}. + """Return the gRPC stub for :meth:`SpannerClient.partition_query`. Creates a set of partition tokens that can be used to execute a query operation in parallel. Each of the returned partition tokens can be used @@ -332,7 +332,7 @@ def partition_query(self): @property def partition_read(self): - """Return the gRPC stub for {$apiMethod.name}. + """Return the gRPC stub for :meth:`SpannerClient.partition_read`. Creates a set of partition tokens that can be used to execute a read operation in parallel. Each of the returned partition tokens can be used diff --git a/spanner/synth.metadata b/spanner/synth.metadata index 22e5aad070d6..7b8007d501a6 100644 --- a/spanner/synth.metadata +++ b/spanner/synth.metadata @@ -1,19 +1,19 @@ { - "updateTime": "2018-12-07T13:26:48.951251Z", + "updateTime": "2019-01-04T18:38:23.269891Z", "sources": [ { "generator": { "name": "artman", - "version": "0.16.2", - "dockerImage": "googleapis/artman@sha256:2f6b261ee7fe1aedf238991c93a20b3820de37a343d0cacf3e3e9555c2aaf2ea" + "version": "0.16.4", + "dockerImage": "googleapis/artman@sha256:8b45fae963557c3299921037ecbb86f0689f41b1b4aea73408ebc50562cb2857" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "200fbbe59cc7b0077ae525eb5f3d6420c0c53e61", - "internalRef": "224174014" + "sha": "c050b8885af23bfbc4e2858858db47e33e311da7", + "internalRef": "227870263" } }, { diff --git a/spanner/synth.py b/spanner/synth.py index 5bd4fef1974f..7067ede55bc7 100644 --- a/spanner/synth.py +++ b/spanner/synth.py @@ -131,4 +131,13 @@ templated_files = common.py_library(unit_cov_level=97, cov_level=100) s.move(templated_files) +# Template's MANIFEST.in does not include the needed GAPIC config file. +# See PR #6928. +s.replace( + "MANIFEST.in", + "include README.rst LICENSE\n", + "include README.rst LICENSE\n" + "include google/cloud/spanner_v1/gapic/transports/spanner.grpc.config\n", +) + s.shell.run(["nox", "-s", "blacken"], hide_output=False)