From 0eaacb5f9b0f53ebee2e30c8145b6b83045d0706 Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Wed, 4 Feb 2026 23:07:17 +0000 Subject: [PATCH 1/2] feat(spanner): include cache updates into the ResultSet response docs: A comment for field `transaction_tag` in message `.google.spanner.v1.RequestOptions` is changed docs: A comment for field `params` in message `.google.spanner.v1.PartitionQueryRequest` is changed docs: A comment for field `param_types` in message `.google.spanner.v1.PartitionQueryRequest` is changed docs: A comment for field `commit_timestamp` in message `.google.spanner.v1.BatchWriteResponse` is changed PiperOrigin-RevId: 865546011 Source-Link: https://github.com/googleapis/googleapis/commit/8d30990fb3a5325bad2ece30382fe9f97c328eea Source-Link: https://github.com/googleapis/googleapis-gen/commit/3dd15331ef8d4f7376990bb551ea57ae191ffc90 Copy-Tag: eyJwIjoiZ29vZ2xlLWNsb3VkLXNwYW5uZXItdjEvLk93bEJvdC55YW1sIiwiaCI6IjNkZDE1MzMxZWY4ZDRmNzM3Njk5MGJiNTUxZWE1N2FlMTkxZmZjOTAifQ== --- .../google-cloud-spanner-v1/.gitignore | 22 + .../.repo-metadata.json | 18 + .../google-cloud-spanner-v1/.rubocop.yml | 33 + .../google-cloud-spanner-v1/.toys.rb | 28 + .../google-cloud-spanner-v1/.yardopts | 12 + .../google-cloud-spanner-v1/AUTHENTICATION.md | 122 + .../google-cloud-spanner-v1/CHANGELOG.md | 2 + .../google-cloud-spanner-v1/Gemfile | 11 + .../google-cloud-spanner-v1/LICENSE.md | 201 ++ .../google-cloud-spanner-v1/README.md | 153 + .../google-cloud-spanner-v1/Rakefile | 169 ++ .../gapic_metadata.json | 98 + .../google-cloud-spanner-v1.gemspec | 28 + .../lib/google-cloud-spanner-v1.rb | 21 + .../lib/google/cloud/spanner/v1.rb | 40 + .../lib/google/cloud/spanner/v1/spanner.rb | 52 + .../google/cloud/spanner/v1/spanner/client.rb | 2622 +++++++++++++++++ .../cloud/spanner/v1/spanner/credentials.rb | 52 + .../google/cloud/spanner/v1/spanner/paths.rb | 73 + .../lib/google/cloud/spanner/v1/version.rb | 28 + .../lib/google/spanner/v1/change_stream_pb.rb | 61 + .../google/spanner/v1/commit_response_pb.rb | 48 + .../lib/google/spanner/v1/keys_pb.rb | 46 + .../lib/google/spanner/v1/location_pb.rb | 58 + .../lib/google/spanner/v1/mutation_pb.rb | 54 + .../lib/google/spanner/v1/query_plan_pb.rb | 52 + .../lib/google/spanner/v1/result_set_pb.rb | 57 + .../lib/google/spanner/v1/spanner_pb.rb | 104 + .../google/spanner/v1/spanner_services_pb.rb | 216 ++ .../lib/google/spanner/v1/transaction_pb.rb | 56 + .../lib/google/spanner/v1/type_pb.rb | 48 + .../proto_docs/README.md | 4 + .../proto_docs/google/api/client.rb | 473 +++ .../proto_docs/google/api/field_behavior.rb | 85 + .../proto_docs/google/api/launch_stage.rb | 71 + .../proto_docs/google/api/resource.rb | 227 ++ .../proto_docs/google/protobuf/any.rb | 145 + .../proto_docs/google/protobuf/duration.rb | 98 + .../proto_docs/google/protobuf/empty.rb | 34 + .../proto_docs/google/protobuf/struct.rb | 108 + .../proto_docs/google/protobuf/timestamp.rb | 127 + .../proto_docs/google/rpc/status.rb | 48 + .../google/spanner/v1/change_stream.rb | 488 +++ .../google/spanner/v1/commit_response.rb | 65 + .../proto_docs/google/spanner/v1/keys.rb | 170 ++ .../proto_docs/google/spanner/v1/location.rb | 417 +++ .../proto_docs/google/spanner/v1/mutation.rb | 178 ++ .../google/spanner/v1/query_plan.rb | 180 ++ .../google/spanner/v1/result_set.rb | 265 ++ .../proto_docs/google/spanner/v1/spanner.rb | 1187 ++++++++ .../google/spanner/v1/transaction.rb | 338 +++ .../proto_docs/google/spanner/v1/type.rb | 222 ++ .../google-cloud-spanner-v1/snippets/Gemfile | 32 + .../snippet_metadata_google.spanner.v1.json | 655 ++++ .../snippets/spanner/batch_create_sessions.rb | 47 + .../snippets/spanner/batch_write.rb | 50 + .../snippets/spanner/begin_transaction.rb | 47 + .../snippets/spanner/commit.rb | 47 + .../snippets/spanner/create_session.rb | 47 + .../snippets/spanner/delete_session.rb | 47 + .../snippets/spanner/execute_batch_dml.rb | 47 + .../snippets/spanner/execute_sql.rb | 47 + .../snippets/spanner/execute_streaming_sql.rb | 50 + .../snippets/spanner/get_session.rb | 47 + .../snippets/spanner/list_sessions.rb | 51 + .../snippets/spanner/partition_query.rb | 47 + .../snippets/spanner/partition_read.rb | 47 + .../snippets/spanner/read.rb | 47 + .../snippets/spanner/rollback.rb | 47 + .../snippets/spanner/streaming_read.rb | 50 + .../cloud/spanner/v1/spanner_paths_test.rb | 67 + .../google/cloud/spanner/v1/spanner_test.rb | 1265 ++++++++ .../google-cloud-spanner-v1/test/helper.rb | 25 + 73 files changed, 12324 insertions(+) create mode 100644 owl-bot-staging/google-cloud-spanner-v1/.gitignore create mode 100644 owl-bot-staging/google-cloud-spanner-v1/.repo-metadata.json create mode 100644 owl-bot-staging/google-cloud-spanner-v1/.rubocop.yml create mode 100644 owl-bot-staging/google-cloud-spanner-v1/.toys.rb create mode 100644 owl-bot-staging/google-cloud-spanner-v1/.yardopts create mode 100644 owl-bot-staging/google-cloud-spanner-v1/AUTHENTICATION.md create mode 100644 owl-bot-staging/google-cloud-spanner-v1/CHANGELOG.md create mode 100644 owl-bot-staging/google-cloud-spanner-v1/Gemfile create mode 100644 owl-bot-staging/google-cloud-spanner-v1/LICENSE.md create mode 100644 owl-bot-staging/google-cloud-spanner-v1/README.md create mode 100644 owl-bot-staging/google-cloud-spanner-v1/Rakefile create mode 100644 owl-bot-staging/google-cloud-spanner-v1/gapic_metadata.json create mode 100644 owl-bot-staging/google-cloud-spanner-v1/google-cloud-spanner-v1.gemspec create mode 100644 owl-bot-staging/google-cloud-spanner-v1/lib/google-cloud-spanner-v1.rb create mode 100644 owl-bot-staging/google-cloud-spanner-v1/lib/google/cloud/spanner/v1.rb create mode 100644 owl-bot-staging/google-cloud-spanner-v1/lib/google/cloud/spanner/v1/spanner.rb create mode 100644 owl-bot-staging/google-cloud-spanner-v1/lib/google/cloud/spanner/v1/spanner/client.rb create mode 100644 owl-bot-staging/google-cloud-spanner-v1/lib/google/cloud/spanner/v1/spanner/credentials.rb create mode 100644 owl-bot-staging/google-cloud-spanner-v1/lib/google/cloud/spanner/v1/spanner/paths.rb create mode 100644 owl-bot-staging/google-cloud-spanner-v1/lib/google/cloud/spanner/v1/version.rb create mode 100644 owl-bot-staging/google-cloud-spanner-v1/lib/google/spanner/v1/change_stream_pb.rb create mode 100644 owl-bot-staging/google-cloud-spanner-v1/lib/google/spanner/v1/commit_response_pb.rb create mode 100644 owl-bot-staging/google-cloud-spanner-v1/lib/google/spanner/v1/keys_pb.rb create mode 100644 owl-bot-staging/google-cloud-spanner-v1/lib/google/spanner/v1/location_pb.rb create mode 100644 owl-bot-staging/google-cloud-spanner-v1/lib/google/spanner/v1/mutation_pb.rb create mode 100644 owl-bot-staging/google-cloud-spanner-v1/lib/google/spanner/v1/query_plan_pb.rb create mode 100644 owl-bot-staging/google-cloud-spanner-v1/lib/google/spanner/v1/result_set_pb.rb create mode 100644 owl-bot-staging/google-cloud-spanner-v1/lib/google/spanner/v1/spanner_pb.rb create mode 100644 owl-bot-staging/google-cloud-spanner-v1/lib/google/spanner/v1/spanner_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-spanner-v1/lib/google/spanner/v1/transaction_pb.rb create mode 100644 owl-bot-staging/google-cloud-spanner-v1/lib/google/spanner/v1/type_pb.rb create mode 100644 owl-bot-staging/google-cloud-spanner-v1/proto_docs/README.md create mode 100644 owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/api/client.rb create mode 100644 owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/api/field_behavior.rb create mode 100644 owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/api/launch_stage.rb create mode 100644 owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/api/resource.rb create mode 100644 owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/protobuf/any.rb create mode 100644 owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/protobuf/duration.rb create mode 100644 owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/protobuf/empty.rb create mode 100644 owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/protobuf/struct.rb create mode 100644 owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/protobuf/timestamp.rb create mode 100644 owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/rpc/status.rb create mode 100644 owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/spanner/v1/change_stream.rb create mode 100644 owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/spanner/v1/commit_response.rb create mode 100644 owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/spanner/v1/keys.rb create mode 100644 owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/spanner/v1/location.rb create mode 100644 owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/spanner/v1/mutation.rb create mode 100644 owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/spanner/v1/query_plan.rb create mode 100644 owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/spanner/v1/result_set.rb create mode 100644 owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/spanner/v1/spanner.rb create mode 100644 owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/spanner/v1/transaction.rb create mode 100644 owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/spanner/v1/type.rb create mode 100644 owl-bot-staging/google-cloud-spanner-v1/snippets/Gemfile create mode 100644 owl-bot-staging/google-cloud-spanner-v1/snippets/snippet_metadata_google.spanner.v1.json create mode 100644 owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/batch_create_sessions.rb create mode 100644 owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/batch_write.rb create mode 100644 owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/begin_transaction.rb create mode 100644 owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/commit.rb create mode 100644 owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/create_session.rb create mode 100644 owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/delete_session.rb create mode 100644 owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/execute_batch_dml.rb create mode 100644 owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/execute_sql.rb create mode 100644 owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/execute_streaming_sql.rb create mode 100644 owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/get_session.rb create mode 100644 owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/list_sessions.rb create mode 100644 owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/partition_query.rb create mode 100644 owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/partition_read.rb create mode 100644 owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/read.rb create mode 100644 owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/rollback.rb create mode 100644 owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/streaming_read.rb create mode 100644 owl-bot-staging/google-cloud-spanner-v1/test/google/cloud/spanner/v1/spanner_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-spanner-v1/test/google/cloud/spanner/v1/spanner_test.rb create mode 100644 owl-bot-staging/google-cloud-spanner-v1/test/helper.rb diff --git a/owl-bot-staging/google-cloud-spanner-v1/.gitignore b/owl-bot-staging/google-cloud-spanner-v1/.gitignore new file mode 100644 index 000000000000..0135b6bc6cfc --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-v1/.gitignore @@ -0,0 +1,22 @@ +# Ignore bundler lockfiles +Gemfile.lock +gems.locked + +# Ignore documentation output +doc/* +.yardoc/* + +# Ignore test output +coverage/* + +# Ignore build artifacts +pkg/* + +# Ignore files commonly present in certain dev environments +.vagrant +.DS_STORE +.idea +*.iml + +# Ignore synth output +__pycache__ diff --git a/owl-bot-staging/google-cloud-spanner-v1/.repo-metadata.json b/owl-bot-staging/google-cloud-spanner-v1/.repo-metadata.json new file mode 100644 index 000000000000..97ae30d48f35 --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-v1/.repo-metadata.json @@ -0,0 +1,18 @@ +{ + "api_id": "spanner.googleapis.com", + "api_shortname": "spanner", + "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-spanner-v1/latest", + "distribution_name": "google-cloud-spanner-v1", + "is_cloud": true, + "language": "ruby", + "name": "spanner", + "name_pretty": "Cloud Spanner V1 API", + "product_documentation": "https://cloud.google.com/spanner", + "release_level": "unreleased", + "repo": "googleapis/google-cloud-ruby", + "requires_billing": true, + "ruby-cloud-description": "Cloud Spanner is a managed, mission-critical, globally consistent and scalable relational database service. Note that google-cloud-spanner-v1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-spanner instead. See the readme for more details.", + "ruby-cloud-env-prefix": "SPANNER", + "ruby-cloud-product-url": "https://cloud.google.com/spanner", + "library_type": "GAPIC_AUTO" +} diff --git a/owl-bot-staging/google-cloud-spanner-v1/.rubocop.yml b/owl-bot-staging/google-cloud-spanner-v1/.rubocop.yml new file mode 100644 index 000000000000..c29064123444 --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-v1/.rubocop.yml @@ -0,0 +1,33 @@ +inherit_gem: + google-style: google-style.yml + +AllCops: + Exclude: + - "google-cloud-spanner-v1.gemspec" + - "lib/**/*_pb.rb" + - "proto_docs/**/*" + - "test/**/*" + - "acceptance/**/*" + - "samples/acceptance/**/*" + - "Rakefile" + +Layout/LineLength: + Enabled: false +Metrics/AbcSize: + Enabled: false +Metrics/ClassLength: + Enabled: false +Metrics/CyclomaticComplexity: + Enabled: false +Metrics/MethodLength: + Enabled: false +Metrics/ModuleLength: + Enabled: false +Metrics/PerceivedComplexity: + Enabled: false +Naming/AccessorMethodName: + Exclude: + - "snippets/**/*.rb" +Naming/FileName: + Exclude: + - "lib/google-cloud-spanner-v1.rb" diff --git a/owl-bot-staging/google-cloud-spanner-v1/.toys.rb b/owl-bot-staging/google-cloud-spanner-v1/.toys.rb new file mode 100644 index 000000000000..177e22456e8a --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-v1/.toys.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +toys_version! ">= 0.15.3" + +if ENV["RUBY_COMMON_TOOLS"] + common_tools_dir = File.expand_path ENV["RUBY_COMMON_TOOLS"] + load File.join(common_tools_dir, "toys", "gapic") +else + load_git remote: "https://github.com/googleapis/ruby-common-tools.git", + path: "toys/gapic", + update: true +end diff --git a/owl-bot-staging/google-cloud-spanner-v1/.yardopts b/owl-bot-staging/google-cloud-spanner-v1/.yardopts new file mode 100644 index 000000000000..62c084b2c082 --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-v1/.yardopts @@ -0,0 +1,12 @@ +--no-private +--title="Cloud Spanner V1 API" +--exclude _pb\.rb$ +--markup markdown +--markup-provider redcarpet + +./lib/**/*.rb +./proto_docs/**/*.rb +- +README.md +LICENSE.md +AUTHENTICATION.md diff --git a/owl-bot-staging/google-cloud-spanner-v1/AUTHENTICATION.md b/owl-bot-staging/google-cloud-spanner-v1/AUTHENTICATION.md new file mode 100644 index 000000000000..a4d7b47836ad --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-v1/AUTHENTICATION.md @@ -0,0 +1,122 @@ +# Authentication + +The recommended way to authenticate to the google-cloud-spanner-v1 library is to use +[Application Default Credentials (ADC)](https://cloud.google.com/docs/authentication/application-default-credentials). +To review all of your authentication options, see [Credentials lookup](#credential-lookup). + +## Quickstart + +The following example shows how to set up authentication for a local development +environment with your user credentials. + +**NOTE:** This method is _not_ recommended for running in production. User credentials +should be used only during development. + +1. [Download and install the Google Cloud CLI](https://cloud.google.com/sdk). +2. Set up a local ADC file with your user credentials: + +```sh +gcloud auth application-default login +``` + +3. Write code as if already authenticated. + +For more information about setting up authentication for a local development environment, see +[Set up Application Default Credentials](https://cloud.google.com/docs/authentication/provide-credentials-adc#local-dev). + +## Credential Lookup + +The google-cloud-spanner-v1 library provides several mechanisms to configure your system. +Generally, using Application Default Credentials to facilitate automatic +credentials discovery is the easist method. But if you need to explicitly specify +credentials, there are several methods available to you. + +Credentials are accepted in the following ways, in the following order or precedence: + +1. Credentials specified in method arguments +2. Credentials specified in configuration +3. Credentials pointed to or included in environment variables +4. Credentials found in local ADC file +5. Credentials returned by the metadata server for the attached service account (GCP) + +### Configuration + +You can configure a path to a JSON credentials file, either for an individual client object or +globally, for all client objects. The JSON file can contain credentials created for +[workload identity federation](https://cloud.google.com/iam/docs/workload-identity-federation), +[workforce identity federation](https://cloud.google.com/iam/docs/workforce-identity-federation), or a +[service account key](https://cloud.google.com/docs/authentication/provide-credentials-adc#local-key). + +Note: Service account keys are a security risk if not managed correctly. You should +[choose a more secure alternative to service account keys](https://cloud.google.com/docs/authentication#auth-decision-tree) +whenever possible. + +To configure a credentials file for an individual client initialization: + +```ruby +require "google/cloud/spanner/v1" + +client = ::Google::Cloud::Spanner::V1::Spanner::Client.new do |config| + config.credentials = "path/to/credentialfile.json" +end +``` + +To configure a credentials file globally for all clients: + +```ruby +require "google/cloud/spanner/v1" + +::Google::Cloud::Spanner::V1::Spanner::Client.configure do |config| + config.credentials = "path/to/credentialfile.json" +end + +client = ::Google::Cloud::Spanner::V1::Spanner::Client.new +``` + +### Environment Variables + +You can also use an environment variable to provide a JSON credentials file. +The environment variable can contain a path to the credentials file or, for +environments such as Docker containers where writing files is not encouraged, +you can include the credentials file itself. + +The JSON file can contain credentials created for +[workload identity federation](https://cloud.google.com/iam/docs/workload-identity-federation), +[workforce identity federation](https://cloud.google.com/iam/docs/workforce-identity-federation), or a +[service account key](https://cloud.google.com/docs/authentication/provide-credentials-adc#local-key). + +Note: Service account keys are a security risk if not managed correctly. You should +[choose a more secure alternative to service account keys](https://cloud.google.com/docs/authentication#auth-decision-tree) +whenever possible. + +The environment variables that google-cloud-spanner-v1 +checks for credentials are: + +* `GOOGLE_CLOUD_CREDENTIALS` - Path to JSON file, or JSON contents +* `GOOGLE_APPLICATION_CREDENTIALS` - Path to JSON file + +```ruby +require "google/cloud/spanner/v1" + +ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" + +client = ::Google::Cloud::Spanner::V1::Spanner::Client.new +``` + +### Local ADC file + +You can set up a local ADC file with your user credentials for authentication during +development. If credentials are not provided in code or in environment variables, +then the local ADC credentials are discovered. + +Follow the steps in [Quickstart](#quickstart) to set up a local ADC file. + +### Google Cloud Platform environments + +When running on Google Cloud Platform (GCP), including Google Compute Engine +(GCE), Google Kubernetes Engine (GKE), Google App Engine (GAE), Google Cloud +Functions (GCF) and Cloud Run, credentials are retrieved from the attached +service account automatically. Code should be written as if already authenticated. + +For more information, see +[Set up ADC for Google Cloud services](https://cloud.google.com/docs/authentication/provide-credentials-adc#attached-sa). diff --git a/owl-bot-staging/google-cloud-spanner-v1/CHANGELOG.md b/owl-bot-staging/google-cloud-spanner-v1/CHANGELOG.md new file mode 100644 index 000000000000..f88957a62ba2 --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-v1/CHANGELOG.md @@ -0,0 +1,2 @@ +# Release History + diff --git a/owl-bot-staging/google-cloud-spanner-v1/Gemfile b/owl-bot-staging/google-cloud-spanner-v1/Gemfile new file mode 100644 index 000000000000..6442df18fa2f --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-v1/Gemfile @@ -0,0 +1,11 @@ +source "https://rubygems.org" + +gemspec + +gem "google-style", "~> 1.31.1" +gem "minitest", "~> 5.22" +gem "minitest-focus", "~> 1.4" +gem "minitest-rg", "~> 5.3" +gem "rake", ">= 13.0" +gem "redcarpet", "~> 3.6" +gem "yard", "~> 0.9" diff --git a/owl-bot-staging/google-cloud-spanner-v1/LICENSE.md b/owl-bot-staging/google-cloud-spanner-v1/LICENSE.md new file mode 100644 index 000000000000..c261857ba6ad --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-v1/LICENSE.md @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/owl-bot-staging/google-cloud-spanner-v1/README.md b/owl-bot-staging/google-cloud-spanner-v1/README.md new file mode 100644 index 000000000000..1ff29659d58a --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-v1/README.md @@ -0,0 +1,153 @@ +# Ruby Client for the Cloud Spanner V1 API + +Cloud Spanner is a managed, mission-critical, globally consistent and scalable relational database service. + + +https://github.com/googleapis/google-cloud-ruby + +This gem is a _versioned_ client. It provides basic client classes for a +specific version of the Cloud Spanner V1 API. Most users should consider using +the main client gem, +[google-cloud-spanner](https://rubygems.org/gems/google-cloud-spanner). +See the section below titled *Which client should I use?* for more information. + +## Installation + +``` +$ gem install google-cloud-spanner-v1 +``` + +## Before You Begin + +In order to use this library, you first need to go through the following steps: + +1. [Select or create a Cloud Platform project.](https://console.cloud.google.com/project) +1. [Enable billing for your project.](https://cloud.google.com/billing/docs/how-to/modify-project#enable_billing_for_a_project) +1. [Enable the API.](https://console.cloud.google.com/apis/library/spanner.googleapis.com) +1. [Set up authentication.](AUTHENTICATION.md) + +## Quick Start + +```ruby +require "google/cloud/spanner/v1" + +client = ::Google::Cloud::Spanner::V1::Spanner::Client.new +request = ::Google::Cloud::Spanner::V1::CreateSessionRequest.new # (request fields as keyword arguments...) +response = client.create_session request +``` + +View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-spanner-v1/latest) +for class and method documentation. + +See also the [Product Documentation](https://cloud.google.com/spanner) +for general usage information. + +## Debug Logging + +This library comes with opt-in Debug Logging that can help you troubleshoot +your application's integration with the API. When logging is activated, key +events such as requests and responses, along with data payloads and metadata +such as headers and client configuration, are logged to the standard error +stream. + +**WARNING:** Client Library Debug Logging includes your data payloads in +plaintext, which could include sensitive data such as PII for yourself or your +customers, private keys, or other security data that could be compromising if +leaked. Always practice good data hygiene with your application logs, and follow +the principle of least access. Google also recommends that Client Library Debug +Logging be enabled only temporarily during active debugging, and not used +permanently in production. + +To enable logging, set the environment variable `GOOGLE_SDK_RUBY_LOGGING_GEMS` +to the value `all`. Alternatively, you can set the value to a comma-delimited +list of client library gem names. This will select the default logging behavior, +which writes logs to the standard error stream. On a local workstation, this may +result in logs appearing on the console. When running on a Google Cloud hosting +service such as [Google Cloud Run](https://cloud.google.com/run), this generally +results in logs appearing alongside your application logs in the +[Google Cloud Logging](https://cloud.google.com/logging/) service. + +You can customize logging by modifying the `logger` configuration when +constructing a client object. For example: + +```ruby +require "google/cloud/spanner/v1" +require "logger" + +client = ::Google::Cloud::Spanner::V1::Spanner::Client.new do |config| + config.logger = Logger.new "my-app.log" +end +``` + +## Google Cloud Samples + +To browse ready to use code samples check [Google Cloud Samples](https://cloud.google.com/docs/samples). + +## Supported Ruby Versions + +This library is supported on Ruby 3.0+. + +Google provides official support for Ruby versions that are actively supported +by Ruby Core—that is, Ruby versions that are either in normal maintenance or +in security maintenance, and not end of life. Older versions of Ruby _may_ +still work, but are unsupported and not recommended. See +https://www.ruby-lang.org/en/downloads/branches/ for details about the Ruby +support schedule. + +## Which client should I use? + +Most modern Ruby client libraries for Google APIs come in two flavors: the main +client library with a name such as `google-cloud-spanner`, +and lower-level _versioned_ client libraries with names such as +`google-cloud-spanner-v1`. +_In most cases, you should install the main client._ + +### What's the difference between the main client and a versioned client? + +A _versioned client_ provides a basic set of data types and client classes for +a _single version_ of a specific service. (That is, for a service with multiple +versions, there might be a separate versioned client for each service version.) +Most versioned clients are written and maintained by a code generator. + +The _main client_ is designed to provide you with the _recommended_ client +interfaces for the service. There will be only one main client for any given +service, even a service with multiple versions. The main client includes +factory methods for constructing the client objects we recommend for most +users. In some cases, those will be classes provided by an underlying versioned +client; in other cases, they will be handwritten higher-level client objects +with additional capabilities, convenience methods, or best practices built in. +Generally, the main client will default to a recommended service version, +although in some cases you can override this if you need to talk to a specific +service version. + +### Why would I want to use the main client? + +We recommend that most users install the main client gem for a service. You can +identify this gem as the one _without_ a version in its name, e.g. +`google-cloud-spanner`. +The main client is recommended because it will embody the best practices for +accessing the service, and may also provide more convenient interfaces or +tighter integration into frameworks and third-party libraries. In addition, the +documentation and samples published by Google will generally demonstrate use of +the main client. + +### Why would I want to use a versioned client? + +You can use a versioned client if you are content with a possibly lower-level +class interface, you explicitly want to avoid features provided by the main +client, or you want to access a specific service version not be covered by the +main client. You can identify versioned client gems because the service version +is part of the name, e.g. `google-cloud-spanner-v1`. + +### What about the google-apis- clients? + +Client library gems with names that begin with `google-apis-` are based on an +older code generation technology. They talk to a REST/JSON backend (whereas +most modern clients talk to a [gRPC](https://grpc.io/) backend) and they may +not offer the same performance, features, and ease of use provided by more +modern clients. + +The `google-apis-` clients have wide coverage across Google services, so you +might need to use one if there is no modern client available for the service. +However, if a modern client is available, we generally recommend it over the +older `google-apis-` clients. diff --git a/owl-bot-staging/google-cloud-spanner-v1/Rakefile b/owl-bot-staging/google-cloud-spanner-v1/Rakefile new file mode 100644 index 000000000000..b18de45c0a03 --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-v1/Rakefile @@ -0,0 +1,169 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "bundler/setup" +require "bundler/gem_tasks" + +require "rubocop/rake_task" +RuboCop::RakeTask.new + +require "rake/testtask" +desc "Run tests." +Rake::TestTask.new do |t| + t.libs << "test" + t.test_files = FileList["test/**/*_test.rb"] + t.warning = false +end + +desc "Runs the smoke tests." +Rake::TestTask.new :smoke_test do |t| + t.test_files = FileList["acceptance/**/*smoke_test.rb"] + t.warning = false +end + +# Acceptance tests +desc "Run the google-cloud-spanner-v1 acceptance tests." +task :acceptance, :project, :keyfile do |t, args| + project = args[:project] + project ||= + ENV["SPANNER_TEST_PROJECT"] || + ENV["GCLOUD_TEST_PROJECT"] + keyfile = args[:keyfile] + keyfile ||= + ENV["SPANNER_TEST_KEYFILE"] || + ENV["GCLOUD_TEST_KEYFILE"] + if keyfile + keyfile = File.read keyfile + else + keyfile ||= + ENV["SPANNER_TEST_KEYFILE_JSON"] || + ENV["GCLOUD_TEST_KEYFILE_JSON"] + end + if project.nil? || keyfile.nil? + fail "You must provide a project and keyfile. e.g. rake acceptance[test123, /path/to/keyfile.json] or SPANNER_TEST_PROJECT=test123 SPANNER_TEST_KEYFILE=/path/to/keyfile.json rake acceptance" + end + require "google/cloud/spanner/v1/spanner/credentials" + ::Google::Cloud::Spanner::V1::Spanner::Credentials.env_vars.each do |path| + ENV[path] = nil + end + ENV["SPANNER_PROJECT"] = project + ENV["SPANNER_TEST_PROJECT"] = project + ENV["SPANNER_KEYFILE_JSON"] = keyfile + + Rake::Task["acceptance:run"].invoke +end + +namespace :acceptance do + task :run do + if File.directory? "acceptance" + Rake::Task[:smoke_test].invoke + else + puts "The google-cloud-spanner-v1 gem has no acceptance tests." + end + end + + desc "Run acceptance cleanup." + task :cleanup do + end +end + +task :samples do + Rake::Task["samples:latest"].invoke +end + +namespace :samples do + task :latest do + if File.directory? "samples" + Dir.chdir "samples" do + Bundler.with_clean_env do + ENV["GOOGLE_CLOUD_SAMPLES_TEST"] = "not_master" + sh "bundle update" + sh "bundle exec rake test" + end + end + else + puts "The google-cloud-spanner-v1 gem has no samples to test." + end + end + + task :master do + if File.directory? "samples" + Dir.chdir "samples" do + Bundler.with_clean_env do + ENV["GOOGLE_CLOUD_SAMPLES_TEST"] = "master" + sh "bundle update" + sh "bundle exec rake test" + end + end + else + puts "The google-cloud-spanner-v1 gem has no samples to test." + end + end +end + +require "yard" +require "yard/rake/yardoc_task" +YARD::Rake::YardocTask.new do |y| + y.options << "--fail-on-warning" +end + +desc "Run yard-doctest example tests." +task :doctest do + puts "The google-cloud-spanner-v1 gem does not have doctest tests." +end + +desc "Run the CI build" +task :ci do + header "BUILDING google-cloud-spanner-v1" + header "google-cloud-spanner-v1 rubocop", "*" + Rake::Task[:rubocop].invoke + header "google-cloud-spanner-v1 yard", "*" + Rake::Task[:yard].invoke + header "google-cloud-spanner-v1 test", "*" + Rake::Task[:test].invoke +end + +namespace :ci do + desc "Run the CI build, with smoke tests." + task :smoke_test do + Rake::Task[:ci].invoke + header "google-cloud-spanner-v1 smoke_test", "*" + Rake::Task[:smoke_test].invoke + end + desc "Run the CI build, with acceptance tests." + task :acceptance do + Rake::Task[:ci].invoke + header "google-cloud-spanner-v1 acceptance", "*" + Rake::Task[:acceptance].invoke + end + task :a do + # This is a handy shortcut to save typing + Rake::Task["ci:acceptance"].invoke + end +end + +task default: :test + +def header str, token = "#" + line_length = str.length + 8 + puts "" + puts token * line_length + puts "#{token * 3} #{str} #{token * 3}" + puts token * line_length + puts "" +end diff --git a/owl-bot-staging/google-cloud-spanner-v1/gapic_metadata.json b/owl-bot-staging/google-cloud-spanner-v1/gapic_metadata.json new file mode 100644 index 000000000000..5d46cd55f5fb --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-v1/gapic_metadata.json @@ -0,0 +1,98 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "ruby", + "protoPackage": "google.spanner.v1", + "libraryPackage": "::Google::Cloud::Spanner::V1", + "services": { + "Spanner": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::Spanner::V1::Spanner::Client", + "rpcs": { + "CreateSession": { + "methods": [ + "create_session" + ] + }, + "BatchCreateSessions": { + "methods": [ + "batch_create_sessions" + ] + }, + "GetSession": { + "methods": [ + "get_session" + ] + }, + "ListSessions": { + "methods": [ + "list_sessions" + ] + }, + "DeleteSession": { + "methods": [ + "delete_session" + ] + }, + "ExecuteSql": { + "methods": [ + "execute_sql" + ] + }, + "ExecuteStreamingSql": { + "methods": [ + "execute_streaming_sql" + ] + }, + "ExecuteBatchDml": { + "methods": [ + "execute_batch_dml" + ] + }, + "Read": { + "methods": [ + "read" + ] + }, + "StreamingRead": { + "methods": [ + "streaming_read" + ] + }, + "BeginTransaction": { + "methods": [ + "begin_transaction" + ] + }, + "Commit": { + "methods": [ + "commit" + ] + }, + "Rollback": { + "methods": [ + "rollback" + ] + }, + "PartitionQuery": { + "methods": [ + "partition_query" + ] + }, + "PartitionRead": { + "methods": [ + "partition_read" + ] + }, + "BatchWrite": { + "methods": [ + "batch_write" + ] + } + } + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-spanner-v1/google-cloud-spanner-v1.gemspec b/owl-bot-staging/google-cloud-spanner-v1/google-cloud-spanner-v1.gemspec new file mode 100644 index 000000000000..aa059c10b7aa --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-v1/google-cloud-spanner-v1.gemspec @@ -0,0 +1,28 @@ +# -*- ruby -*- +# encoding: utf-8 + +require File.expand_path("lib/google/cloud/spanner/v1/version", __dir__) + +Gem::Specification.new do |gem| + gem.name = "google-cloud-spanner-v1" + gem.version = Google::Cloud::Spanner::V1::VERSION + + gem.authors = ["Google LLC"] + gem.email = "googleapis-packages@google.com" + gem.description = "Cloud Spanner is a managed, mission-critical, globally consistent and scalable relational database service. Note that google-cloud-spanner-v1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-spanner instead. See the readme for more details." + gem.summary = "Cloud Spanner is a managed, mission-critical, globally consistent and scalable relational database service." + gem.homepage = "https://github.com/googleapis/google-cloud-ruby" + gem.license = "Apache-2.0" + + gem.platform = Gem::Platform::RUBY + + gem.files = `git ls-files -- lib/*`.split("\n") + + `git ls-files -- proto_docs/*`.split("\n") + + ["README.md", "LICENSE.md", "AUTHENTICATION.md", ".yardopts"] + gem.require_paths = ["lib"] + + gem.required_ruby_version = ">= 3.1" + + gem.add_dependency "gapic-common", "~> 1.2" + gem.add_dependency "google-cloud-errors", "~> 1.0" +end diff --git a/owl-bot-staging/google-cloud-spanner-v1/lib/google-cloud-spanner-v1.rb b/owl-bot-staging/google-cloud-spanner-v1/lib/google-cloud-spanner-v1.rb new file mode 100644 index 000000000000..2f3a79fec01f --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-v1/lib/google-cloud-spanner-v1.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# This gem does not autoload during Bundler.require. To load this gem, +# issue explicit require statements for the packages desired, e.g.: +# require "google/cloud/spanner/v1" diff --git a/owl-bot-staging/google-cloud-spanner-v1/lib/google/cloud/spanner/v1.rb b/owl-bot-staging/google-cloud-spanner-v1/lib/google/cloud/spanner/v1.rb new file mode 100644 index 000000000000..031d8a0b49f6 --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-v1/lib/google/cloud/spanner/v1.rb @@ -0,0 +1,40 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/spanner/v1/spanner" +require "google/cloud/spanner/v1/version" + +module Google + module Cloud + module Spanner + ## + # API client module. + # + # @example Load this package, including all its services, and instantiate a gRPC client + # + # require "google/cloud/spanner/v1" + # client = ::Google::Cloud::Spanner::V1::Spanner::Client.new + # + module V1 + end + end + end +end + +helper_path = ::File.join __dir__, "v1", "_helpers.rb" +require "google/cloud/spanner/v1/_helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-spanner-v1/lib/google/cloud/spanner/v1/spanner.rb b/owl-bot-staging/google-cloud-spanner-v1/lib/google/cloud/spanner/v1/spanner.rb new file mode 100644 index 000000000000..50df58fbcc65 --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-v1/lib/google/cloud/spanner/v1/spanner.rb @@ -0,0 +1,52 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/common" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/spanner/v1/version" + +require "google/cloud/spanner/v1/spanner/credentials" +require "google/cloud/spanner/v1/spanner/paths" +require "google/cloud/spanner/v1/spanner/client" + +module Google + module Cloud + module Spanner + module V1 + ## + # Cloud Spanner API + # + # The Cloud Spanner API can be used to manage sessions and execute + # transactions on data stored in Cloud Spanner databases. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/spanner/v1/spanner" + # client = ::Google::Cloud::Spanner::V1::Spanner::Client.new + # + module Spanner + end + end + end + end +end + +helper_path = ::File.join __dir__, "spanner", "helpers.rb" +require "google/cloud/spanner/v1/spanner/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-spanner-v1/lib/google/cloud/spanner/v1/spanner/client.rb b/owl-bot-staging/google-cloud-spanner-v1/lib/google/cloud/spanner/v1/spanner/client.rb new file mode 100644 index 000000000000..ccd5101e705a --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-v1/lib/google/cloud/spanner/v1/spanner/client.rb @@ -0,0 +1,2622 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/spanner/v1/spanner_pb" + +module Google + module Cloud + module Spanner + module V1 + module Spanner + ## + # Client for the Spanner service. + # + # Cloud Spanner API + # + # The Cloud Spanner API can be used to manage sessions and execute + # transactions on data stored in Cloud Spanner databases. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "spanner.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :spanner_stub + + ## + # Configure the Spanner Client class. + # + # See {::Google::Cloud::Spanner::V1::Spanner::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all Spanner clients + # ::Google::Cloud::Spanner::V1::Spanner::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "Spanner", "V1"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get parent_name + break parent_const.configure if parent_const.respond_to? :configure + namespace.pop + end + default_config = Client::Configuration.new parent_config + + default_config.rpcs.create_session.timeout = 30.0 + default_config.rpcs.create_session.retry_policy = { + initial_delay: 0.25, max_delay: 32.0, multiplier: 1.3, retry_codes: [14, 8] + } + + default_config.rpcs.batch_create_sessions.timeout = 60.0 + default_config.rpcs.batch_create_sessions.retry_policy = { + initial_delay: 0.25, max_delay: 32.0, multiplier: 1.3, retry_codes: [14, 8] + } + + default_config.rpcs.get_session.timeout = 30.0 + default_config.rpcs.get_session.retry_policy = { + initial_delay: 0.25, max_delay: 32.0, multiplier: 1.3, retry_codes: [14, 8] + } + + default_config.rpcs.list_sessions.timeout = 3600.0 + default_config.rpcs.list_sessions.retry_policy = { + initial_delay: 0.25, max_delay: 32.0, multiplier: 1.3, retry_codes: [14, 8] + } + + default_config.rpcs.delete_session.timeout = 30.0 + default_config.rpcs.delete_session.retry_policy = { + initial_delay: 0.25, max_delay: 32.0, multiplier: 1.3, retry_codes: [14, 8] + } + + default_config.rpcs.execute_sql.timeout = 30.0 + default_config.rpcs.execute_sql.retry_policy = { + initial_delay: 0.25, max_delay: 32.0, multiplier: 1.3, retry_codes: [14, 8] + } + + default_config.rpcs.execute_streaming_sql.timeout = 3600.0 + + default_config.rpcs.execute_batch_dml.timeout = 30.0 + default_config.rpcs.execute_batch_dml.retry_policy = { + initial_delay: 0.25, max_delay: 32.0, multiplier: 1.3, retry_codes: [14, 8] + } + + default_config.rpcs.read.timeout = 30.0 + default_config.rpcs.read.retry_policy = { + initial_delay: 0.25, max_delay: 32.0, multiplier: 1.3, retry_codes: [14, 8] + } + + default_config.rpcs.streaming_read.timeout = 3600.0 + + default_config.rpcs.begin_transaction.timeout = 30.0 + default_config.rpcs.begin_transaction.retry_policy = { + initial_delay: 0.25, max_delay: 32.0, multiplier: 1.3, retry_codes: [14, 8] + } + + default_config.rpcs.commit.timeout = 3600.0 + default_config.rpcs.commit.retry_policy = { + initial_delay: 0.25, max_delay: 32.0, multiplier: 1.3, retry_codes: [14, 8] + } + + default_config.rpcs.rollback.timeout = 30.0 + default_config.rpcs.rollback.retry_policy = { + initial_delay: 0.25, max_delay: 32.0, multiplier: 1.3, retry_codes: [14, 8] + } + + default_config.rpcs.partition_query.timeout = 30.0 + default_config.rpcs.partition_query.retry_policy = { + initial_delay: 0.25, max_delay: 32.0, multiplier: 1.3, retry_codes: [14, 8] + } + + default_config.rpcs.partition_read.timeout = 30.0 + default_config.rpcs.partition_read.retry_policy = { + initial_delay: 0.25, max_delay: 32.0, multiplier: 1.3, retry_codes: [14, 8] + } + + default_config.rpcs.batch_write.timeout = 3600.0 + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the Spanner Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::Spanner::V1::Spanner::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @spanner_stub.universe_domain + end + + ## + # Create a new Spanner client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Spanner::V1::Spanner::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Spanner::V1::Spanner::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Spanner client. + # @yieldparam config [Client::Configuration] + # + def initialize + # These require statements are intentionally placed here to initialize + # the gRPC module only when it's required. + # See https://github.com/googleapis/toolkit/issues/446 + require "gapic/grpc" + require "google/spanner/v1/spanner_services_pb" + + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint.nil? || + (@config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-")) + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @spanner_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::Spanner::V1::Spanner::Stub, + credentials: credentials, + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + channel_args: @config.channel_args, + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool, + logger: @config.logger + ) + + @spanner_stub.stub_logger&.info do |entry| + entry.set_system_name + entry.set_service + entry.message = "Created client for #{entry.service}" + entry.set_credentials_fields credentials + entry.set "customEndpoint", @config.endpoint if @config.endpoint + entry.set "defaultTimeout", @config.timeout if @config.timeout + entry.set "quotaProject", @quota_project_id if @quota_project_id + end + end + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @spanner_stub.logger + end + + # Service calls + + ## + # 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 meant to be reused for many consecutive + # transactions. + # + # Sessions can only execute one transaction at a time. To execute + # multiple concurrent read-write/write-only transactions, create + # multiple sessions. Note that standalone reads and queries use a + # transaction internally, and count toward the one transaction + # limit. + # + # Active sessions use additional server resources, so it's a good idea to + # delete idle and unneeded sessions. + # Aside from explicit deletes, Cloud Spanner can delete sessions when no + # operations are sent for more than an hour. If a session is deleted, + # requests to it return `NOT_FOUND`. + # + # Idle sessions can be kept alive by sending a trivial SQL query + # periodically, for example, `"SELECT 1"`. + # + # @overload create_session(request, options = nil) + # Pass arguments to `create_session` via a request object, either of type + # {::Google::Cloud::Spanner::V1::CreateSessionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Spanner::V1::CreateSessionRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload create_session(database: nil, session: nil) + # Pass arguments to `create_session` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param database [::String] + # Required. The database in which the new session is created. + # @param session [::Google::Cloud::Spanner::V1::Session, ::Hash] + # Required. The session to create. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Spanner::V1::Session] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Spanner::V1::Session] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/spanner/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Spanner::V1::Spanner::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Spanner::V1::CreateSessionRequest.new + # + # # Call the create_session method. + # result = client.create_session request + # + # # The returned object is of type Google::Cloud::Spanner::V1::Session. + # p result + # + def create_session request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::V1::CreateSessionRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.create_session.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Spanner::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.database + header_params["database"] = request.database + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.create_session.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_session.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @spanner_stub.call_rpc :create_session, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates multiple new sessions. + # + # This API can be used to initialize a session cache on the clients. + # See https://goo.gl/TgSFN2 for best practices on session cache management. + # + # @overload batch_create_sessions(request, options = nil) + # Pass arguments to `batch_create_sessions` via a request object, either of type + # {::Google::Cloud::Spanner::V1::BatchCreateSessionsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Spanner::V1::BatchCreateSessionsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload batch_create_sessions(database: nil, session_template: nil, session_count: nil) + # Pass arguments to `batch_create_sessions` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param database [::String] + # Required. The database in which the new sessions are created. + # @param session_template [::Google::Cloud::Spanner::V1::Session, ::Hash] + # Parameters to apply to each created session. + # @param session_count [::Integer] + # Required. The number of sessions to be created in this batch call. At least + # one session is created. The API can return fewer than the requested number + # of sessions. If a specific number of sessions are desired, the client can + # make additional calls to `BatchCreateSessions` (adjusting + # {::Google::Cloud::Spanner::V1::BatchCreateSessionsRequest#session_count session_count} + # as necessary). + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Spanner::V1::BatchCreateSessionsResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Spanner::V1::BatchCreateSessionsResponse] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/spanner/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Spanner::V1::Spanner::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Spanner::V1::BatchCreateSessionsRequest.new + # + # # Call the batch_create_sessions method. + # result = client.batch_create_sessions request + # + # # The returned object is of type Google::Cloud::Spanner::V1::BatchCreateSessionsResponse. + # p result + # + def batch_create_sessions request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::V1::BatchCreateSessionsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.batch_create_sessions.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Spanner::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.database + header_params["database"] = request.database + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.batch_create_sessions.timeout, + metadata: metadata, + retry_policy: @config.rpcs.batch_create_sessions.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @spanner_stub.call_rpc :batch_create_sessions, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets a session. Returns `NOT_FOUND` if the session doesn't exist. + # This is mainly useful for determining whether a session is still + # alive. + # + # @overload get_session(request, options = nil) + # Pass arguments to `get_session` via a request object, either of type + # {::Google::Cloud::Spanner::V1::GetSessionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Spanner::V1::GetSessionRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_session(name: nil) + # Pass arguments to `get_session` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the session to retrieve. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Spanner::V1::Session] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Spanner::V1::Session] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/spanner/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Spanner::V1::Spanner::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Spanner::V1::GetSessionRequest.new + # + # # Call the get_session method. + # result = client.get_session request + # + # # The returned object is of type Google::Cloud::Spanner::V1::Session. + # p result + # + def get_session request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::V1::GetSessionRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_session.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Spanner::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_session.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_session.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @spanner_stub.call_rpc :get_session, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists all sessions in a given database. + # + # @overload list_sessions(request, options = nil) + # Pass arguments to `list_sessions` via a request object, either of type + # {::Google::Cloud::Spanner::V1::ListSessionsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Spanner::V1::ListSessionsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_sessions(database: nil, page_size: nil, page_token: nil, filter: nil) + # Pass arguments to `list_sessions` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param database [::String] + # Required. The database in which to list sessions. + # @param page_size [::Integer] + # Number of sessions to be returned in the response. If 0 or less, defaults + # to the server's maximum allowed page size. + # @param page_token [::String] + # If non-empty, `page_token` should contain a + # {::Google::Cloud::Spanner::V1::ListSessionsResponse#next_page_token next_page_token} + # from a previous + # {::Google::Cloud::Spanner::V1::ListSessionsResponse ListSessionsResponse}. + # @param filter [::String] + # An expression for filtering the results of the request. Filter rules are + # case insensitive. The fields eligible for filtering are: + # + # * `labels.key` where key is the name of a label + # + # Some examples of using filters are: + # + # * `labels.env:*` --> The session has the label "env". + # * `labels.env:dev` --> The session has the label "env" and the value of + # the label contains the string "dev". + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Spanner::V1::Session>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::Spanner::V1::Session>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/spanner/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Spanner::V1::Spanner::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Spanner::V1::ListSessionsRequest.new + # + # # Call the list_sessions method. + # result = client.list_sessions request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Spanner::V1::Session. + # p item + # end + # + def list_sessions request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::V1::ListSessionsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_sessions.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Spanner::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.database + header_params["database"] = request.database + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_sessions.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_sessions.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @spanner_stub.call_rpc :list_sessions, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @spanner_stub, :list_sessions, request, response, operation, options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Ends a session, releasing server resources associated with it. This + # asynchronously triggers the cancellation of any operations that are running + # with this session. + # + # @overload delete_session(request, options = nil) + # Pass arguments to `delete_session` via a request object, either of type + # {::Google::Cloud::Spanner::V1::DeleteSessionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Spanner::V1::DeleteSessionRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload delete_session(name: nil) + # Pass arguments to `delete_session` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the session to delete. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::Empty] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/spanner/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Spanner::V1::Spanner::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Spanner::V1::DeleteSessionRequest.new + # + # # Call the delete_session method. + # result = client.delete_session request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_session request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::V1::DeleteSessionRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.delete_session.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Spanner::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.delete_session.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_session.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @spanner_stub.call_rpc :delete_session, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Executes an SQL statement, returning all results in a single reply. This + # method can't be used to return a result set larger than 10 MiB; + # if the query yields more data than that, the query fails with + # a `FAILED_PRECONDITION` error. + # + # Operations inside read-write transactions might return `ABORTED`. If + # this occurs, the application should restart the transaction from + # the beginning. See {::Google::Cloud::Spanner::V1::Transaction Transaction} for more + # details. + # + # Larger result sets can be fetched in streaming fashion by calling + # {::Google::Cloud::Spanner::V1::Spanner::Client#execute_streaming_sql ExecuteStreamingSql} + # instead. + # + # The query string can be SQL or [Graph Query Language + # (GQL)](https://cloud.google.com/spanner/docs/reference/standard-sql/graph-intro). + # + # @overload execute_sql(request, options = nil) + # Pass arguments to `execute_sql` via a request object, either of type + # {::Google::Cloud::Spanner::V1::ExecuteSqlRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Spanner::V1::ExecuteSqlRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload execute_sql(session: nil, transaction: nil, sql: nil, params: nil, param_types: nil, resume_token: nil, query_mode: nil, partition_token: nil, seqno: nil, query_options: nil, request_options: nil, directed_read_options: nil, data_boost_enabled: nil, last_statement: nil, routing_hint: nil) + # Pass arguments to `execute_sql` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param session [::String] + # Required. The session in which the SQL query should be performed. + # @param transaction [::Google::Cloud::Spanner::V1::TransactionSelector, ::Hash] + # The transaction to use. + # + # For queries, if none is provided, the default is a temporary read-only + # transaction with strong concurrency. + # + # Standard DML statements require a read-write transaction. To protect + # against replays, single-use transactions are not supported. The caller + # must either supply an existing transaction ID or begin a new transaction. + # + # Partitioned DML requires an existing Partitioned DML transaction ID. + # @param sql [::String] + # Required. The SQL string. + # @param params [::Google::Protobuf::Struct, ::Hash] + # Parameter names and values that bind to placeholders in the SQL string. + # + # A parameter placeholder consists of the `@` character followed by the + # parameter name (for example, `@firstName`). Parameter names must conform + # to the naming requirements of identifiers as specified at + # https://cloud.google.com/spanner/docs/lexical#identifiers. + # + # Parameters can appear anywhere that a literal value is expected. The same + # parameter name can be used more than once, for example: + # + # `"WHERE id > @msg_id AND id < @msg_id + 100"` + # + # It's an error to execute a SQL statement with unbound parameters. + # @param param_types [::Hash{::String => ::Google::Cloud::Spanner::V1::Type, ::Hash}] + # It isn't always possible for Cloud Spanner to infer the right SQL type + # from a JSON value. For example, values of type `BYTES` and values + # of type `STRING` both appear in + # {::Google::Cloud::Spanner::V1::ExecuteSqlRequest#params params} as JSON strings. + # + # In these cases, you can use `param_types` to specify the exact + # SQL type for some or all of the SQL statement parameters. See the + # definition of {::Google::Cloud::Spanner::V1::Type Type} for more information + # about SQL types. + # @param resume_token [::String] + # If this request is resuming a previously interrupted SQL statement + # execution, `resume_token` should be copied from the last + # {::Google::Cloud::Spanner::V1::PartialResultSet PartialResultSet} yielded before the + # interruption. Doing this enables the new SQL statement execution to resume + # where the last one left off. The rest of the request parameters must + # exactly match the request that yielded this token. + # @param query_mode [::Google::Cloud::Spanner::V1::ExecuteSqlRequest::QueryMode] + # Used to control the amount of debugging information returned in + # {::Google::Cloud::Spanner::V1::ResultSetStats ResultSetStats}. If + # {::Google::Cloud::Spanner::V1::ExecuteSqlRequest#partition_token partition_token} is + # set, {::Google::Cloud::Spanner::V1::ExecuteSqlRequest#query_mode query_mode} can only + # be set to + # {::Google::Cloud::Spanner::V1::ExecuteSqlRequest::QueryMode::NORMAL QueryMode.NORMAL}. + # @param partition_token [::String] + # If present, results are restricted to the specified partition + # previously created using `PartitionQuery`. There must be an exact + # match for the values of fields common to this message and the + # `PartitionQueryRequest` message used to create this `partition_token`. + # @param seqno [::Integer] + # A per-transaction sequence number used to identify this request. This field + # makes each request idempotent such that if the request is received multiple + # times, at most one succeeds. + # + # The sequence number must be monotonically increasing within the + # transaction. If a request arrives for the first time with an out-of-order + # sequence number, the transaction can be aborted. Replays of previously + # handled requests yield the same response as the first execution. + # + # Required for DML statements. Ignored for queries. + # @param query_options [::Google::Cloud::Spanner::V1::ExecuteSqlRequest::QueryOptions, ::Hash] + # Query optimizer configuration to use for the given query. + # @param request_options [::Google::Cloud::Spanner::V1::RequestOptions, ::Hash] + # Common options for this request. + # @param directed_read_options [::Google::Cloud::Spanner::V1::DirectedReadOptions, ::Hash] + # Directed read options for this request. + # @param data_boost_enabled [::Boolean] + # If this is for a partitioned query and this field is set to `true`, the + # request is executed with Spanner Data Boost independent compute resources. + # + # If the field is set to `true` but the request doesn't set + # `partition_token`, the API returns an `INVALID_ARGUMENT` error. + # @param last_statement [::Boolean] + # Optional. If set to `true`, this statement marks the end of the + # transaction. After this statement executes, you must commit or abort the + # transaction. Attempts to execute any other requests against this + # transaction (including reads and queries) are rejected. + # + # For DML statements, setting this option might cause some error reporting to + # be deferred until commit time (for example, validation of unique + # constraints). Given this, successful execution of a DML statement shouldn't + # be assumed until a subsequent `Commit` call completes successfully. + # @param routing_hint [::Google::Cloud::Spanner::V1::RoutingHint, ::Hash] + # Optional. If present, it makes the Spanner requests location-aware. + # + # It gives the server hints that can be used to route the request + # to an appropriate server, potentially significantly decreasing latency and + # improving throughput. To achieve improved performance, most fields must be + # filled in with accurate values. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Spanner::V1::ResultSet] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Spanner::V1::ResultSet] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/spanner/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Spanner::V1::Spanner::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Spanner::V1::ExecuteSqlRequest.new + # + # # Call the execute_sql method. + # result = client.execute_sql request + # + # # The returned object is of type Google::Cloud::Spanner::V1::ResultSet. + # p result + # + def execute_sql request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::V1::ExecuteSqlRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.execute_sql.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Spanner::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.session + header_params["session"] = request.session + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.execute_sql.timeout, + metadata: metadata, + retry_policy: @config.rpcs.execute_sql.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @spanner_stub.call_rpc :execute_sql, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Like {::Google::Cloud::Spanner::V1::Spanner::Client#execute_sql ExecuteSql}, except returns the + # result set as a stream. Unlike + # {::Google::Cloud::Spanner::V1::Spanner::Client#execute_sql ExecuteSql}, there is no limit on + # the size of the returned result set. However, no individual row in the + # result set can exceed 100 MiB, and no column value can exceed 10 MiB. + # + # The query string can be SQL or [Graph Query Language + # (GQL)](https://cloud.google.com/spanner/docs/reference/standard-sql/graph-intro). + # + # @overload execute_streaming_sql(request, options = nil) + # Pass arguments to `execute_streaming_sql` via a request object, either of type + # {::Google::Cloud::Spanner::V1::ExecuteSqlRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Spanner::V1::ExecuteSqlRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload execute_streaming_sql(session: nil, transaction: nil, sql: nil, params: nil, param_types: nil, resume_token: nil, query_mode: nil, partition_token: nil, seqno: nil, query_options: nil, request_options: nil, directed_read_options: nil, data_boost_enabled: nil, last_statement: nil, routing_hint: nil) + # Pass arguments to `execute_streaming_sql` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param session [::String] + # Required. The session in which the SQL query should be performed. + # @param transaction [::Google::Cloud::Spanner::V1::TransactionSelector, ::Hash] + # The transaction to use. + # + # For queries, if none is provided, the default is a temporary read-only + # transaction with strong concurrency. + # + # Standard DML statements require a read-write transaction. To protect + # against replays, single-use transactions are not supported. The caller + # must either supply an existing transaction ID or begin a new transaction. + # + # Partitioned DML requires an existing Partitioned DML transaction ID. + # @param sql [::String] + # Required. The SQL string. + # @param params [::Google::Protobuf::Struct, ::Hash] + # Parameter names and values that bind to placeholders in the SQL string. + # + # A parameter placeholder consists of the `@` character followed by the + # parameter name (for example, `@firstName`). Parameter names must conform + # to the naming requirements of identifiers as specified at + # https://cloud.google.com/spanner/docs/lexical#identifiers. + # + # Parameters can appear anywhere that a literal value is expected. The same + # parameter name can be used more than once, for example: + # + # `"WHERE id > @msg_id AND id < @msg_id + 100"` + # + # It's an error to execute a SQL statement with unbound parameters. + # @param param_types [::Hash{::String => ::Google::Cloud::Spanner::V1::Type, ::Hash}] + # It isn't always possible for Cloud Spanner to infer the right SQL type + # from a JSON value. For example, values of type `BYTES` and values + # of type `STRING` both appear in + # {::Google::Cloud::Spanner::V1::ExecuteSqlRequest#params params} as JSON strings. + # + # In these cases, you can use `param_types` to specify the exact + # SQL type for some or all of the SQL statement parameters. See the + # definition of {::Google::Cloud::Spanner::V1::Type Type} for more information + # about SQL types. + # @param resume_token [::String] + # If this request is resuming a previously interrupted SQL statement + # execution, `resume_token` should be copied from the last + # {::Google::Cloud::Spanner::V1::PartialResultSet PartialResultSet} yielded before the + # interruption. Doing this enables the new SQL statement execution to resume + # where the last one left off. The rest of the request parameters must + # exactly match the request that yielded this token. + # @param query_mode [::Google::Cloud::Spanner::V1::ExecuteSqlRequest::QueryMode] + # Used to control the amount of debugging information returned in + # {::Google::Cloud::Spanner::V1::ResultSetStats ResultSetStats}. If + # {::Google::Cloud::Spanner::V1::ExecuteSqlRequest#partition_token partition_token} is + # set, {::Google::Cloud::Spanner::V1::ExecuteSqlRequest#query_mode query_mode} can only + # be set to + # {::Google::Cloud::Spanner::V1::ExecuteSqlRequest::QueryMode::NORMAL QueryMode.NORMAL}. + # @param partition_token [::String] + # If present, results are restricted to the specified partition + # previously created using `PartitionQuery`. There must be an exact + # match for the values of fields common to this message and the + # `PartitionQueryRequest` message used to create this `partition_token`. + # @param seqno [::Integer] + # A per-transaction sequence number used to identify this request. This field + # makes each request idempotent such that if the request is received multiple + # times, at most one succeeds. + # + # The sequence number must be monotonically increasing within the + # transaction. If a request arrives for the first time with an out-of-order + # sequence number, the transaction can be aborted. Replays of previously + # handled requests yield the same response as the first execution. + # + # Required for DML statements. Ignored for queries. + # @param query_options [::Google::Cloud::Spanner::V1::ExecuteSqlRequest::QueryOptions, ::Hash] + # Query optimizer configuration to use for the given query. + # @param request_options [::Google::Cloud::Spanner::V1::RequestOptions, ::Hash] + # Common options for this request. + # @param directed_read_options [::Google::Cloud::Spanner::V1::DirectedReadOptions, ::Hash] + # Directed read options for this request. + # @param data_boost_enabled [::Boolean] + # If this is for a partitioned query and this field is set to `true`, the + # request is executed with Spanner Data Boost independent compute resources. + # + # If the field is set to `true` but the request doesn't set + # `partition_token`, the API returns an `INVALID_ARGUMENT` error. + # @param last_statement [::Boolean] + # Optional. If set to `true`, this statement marks the end of the + # transaction. After this statement executes, you must commit or abort the + # transaction. Attempts to execute any other requests against this + # transaction (including reads and queries) are rejected. + # + # For DML statements, setting this option might cause some error reporting to + # be deferred until commit time (for example, validation of unique + # constraints). Given this, successful execution of a DML statement shouldn't + # be assumed until a subsequent `Commit` call completes successfully. + # @param routing_hint [::Google::Cloud::Spanner::V1::RoutingHint, ::Hash] + # Optional. If present, it makes the Spanner requests location-aware. + # + # It gives the server hints that can be used to route the request + # to an appropriate server, potentially significantly decreasing latency and + # improving throughput. To achieve improved performance, most fields must be + # filled in with accurate values. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Enumerable<::Google::Cloud::Spanner::V1::PartialResultSet>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Enumerable<::Google::Cloud::Spanner::V1::PartialResultSet>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/spanner/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Spanner::V1::Spanner::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Spanner::V1::ExecuteSqlRequest.new + # + # # Call the execute_streaming_sql method to start streaming. + # output = client.execute_streaming_sql request + # + # # The returned object is a streamed enumerable yielding elements of type + # # ::Google::Cloud::Spanner::V1::PartialResultSet + # output.each do |current_response| + # p current_response + # end + # + def execute_streaming_sql request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::V1::ExecuteSqlRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.execute_streaming_sql.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Spanner::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.session + header_params["session"] = request.session + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.execute_streaming_sql.timeout, + metadata: metadata, + retry_policy: @config.rpcs.execute_streaming_sql.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @spanner_stub.call_rpc :execute_streaming_sql, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Executes a batch of SQL DML statements. This method allows many statements + # to be run with lower latency than submitting them sequentially with + # {::Google::Cloud::Spanner::V1::Spanner::Client#execute_sql ExecuteSql}. + # + # Statements are executed in sequential order. A request can succeed even if + # a statement fails. The + # {::Google::Cloud::Spanner::V1::ExecuteBatchDmlResponse#status ExecuteBatchDmlResponse.status} + # field in the response provides information about the statement that failed. + # Clients must inspect this field to determine whether an error occurred. + # + # Execution stops after the first failed statement; the remaining statements + # are not executed. + # + # @overload execute_batch_dml(request, options = nil) + # Pass arguments to `execute_batch_dml` via a request object, either of type + # {::Google::Cloud::Spanner::V1::ExecuteBatchDmlRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Spanner::V1::ExecuteBatchDmlRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload execute_batch_dml(session: nil, transaction: nil, statements: nil, seqno: nil, request_options: nil, last_statements: nil) + # Pass arguments to `execute_batch_dml` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param session [::String] + # Required. The session in which the DML statements should be performed. + # @param transaction [::Google::Cloud::Spanner::V1::TransactionSelector, ::Hash] + # Required. The transaction to use. Must be a read-write transaction. + # + # To protect against replays, single-use transactions are not supported. The + # caller must either supply an existing transaction ID or begin a new + # transaction. + # @param statements [::Array<::Google::Cloud::Spanner::V1::ExecuteBatchDmlRequest::Statement, ::Hash>] + # Required. The list of statements to execute in this batch. Statements are + # executed serially, such that the effects of statement `i` are visible to + # statement `i+1`. Each statement must be a DML statement. Execution stops at + # the first failed statement; the remaining statements are not executed. + # + # Callers must provide at least one statement. + # @param seqno [::Integer] + # Required. A per-transaction sequence number used to identify this request. + # This field makes each request idempotent such that if the request is + # received multiple times, at most one succeeds. + # + # The sequence number must be monotonically increasing within the + # transaction. If a request arrives for the first time with an out-of-order + # sequence number, the transaction might be aborted. Replays of previously + # handled requests yield the same response as the first execution. + # @param request_options [::Google::Cloud::Spanner::V1::RequestOptions, ::Hash] + # Common options for this request. + # @param last_statements [::Boolean] + # Optional. If set to `true`, this request marks the end of the transaction. + # After these statements execute, you must commit or abort the transaction. + # Attempts to execute any other requests against this transaction + # (including reads and queries) are rejected. + # + # Setting this option might cause some error reporting to be deferred until + # commit time (for example, validation of unique constraints). Given this, + # successful execution of statements shouldn't be assumed until a subsequent + # `Commit` call completes successfully. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Spanner::V1::ExecuteBatchDmlResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Spanner::V1::ExecuteBatchDmlResponse] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/spanner/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Spanner::V1::Spanner::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Spanner::V1::ExecuteBatchDmlRequest.new + # + # # Call the execute_batch_dml method. + # result = client.execute_batch_dml request + # + # # The returned object is of type Google::Cloud::Spanner::V1::ExecuteBatchDmlResponse. + # p result + # + def execute_batch_dml request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::V1::ExecuteBatchDmlRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.execute_batch_dml.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Spanner::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.session + header_params["session"] = request.session + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.execute_batch_dml.timeout, + metadata: metadata, + retry_policy: @config.rpcs.execute_batch_dml.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @spanner_stub.call_rpc :execute_batch_dml, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Reads rows from the database using key lookups and scans, as a + # simple key/value style alternative to + # {::Google::Cloud::Spanner::V1::Spanner::Client#execute_sql ExecuteSql}. This method can't be + # used to return a result set larger than 10 MiB; if the read matches more + # data than that, the read fails with a `FAILED_PRECONDITION` + # error. + # + # Reads inside read-write transactions might return `ABORTED`. If + # this occurs, the application should restart the transaction from + # the beginning. See {::Google::Cloud::Spanner::V1::Transaction Transaction} for more + # details. + # + # Larger result sets can be yielded in streaming fashion by calling + # {::Google::Cloud::Spanner::V1::Spanner::Client#streaming_read StreamingRead} instead. + # + # @overload read(request, options = nil) + # Pass arguments to `read` via a request object, either of type + # {::Google::Cloud::Spanner::V1::ReadRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Spanner::V1::ReadRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload read(session: nil, transaction: nil, table: nil, index: nil, columns: nil, key_set: nil, limit: nil, resume_token: nil, partition_token: nil, request_options: nil, directed_read_options: nil, data_boost_enabled: nil, order_by: nil, lock_hint: nil, routing_hint: nil) + # Pass arguments to `read` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param session [::String] + # Required. The session in which the read should be performed. + # @param transaction [::Google::Cloud::Spanner::V1::TransactionSelector, ::Hash] + # The transaction to use. If none is provided, the default is a + # temporary read-only transaction with strong concurrency. + # @param table [::String] + # Required. The name of the table in the database to be read. + # @param index [::String] + # If non-empty, the name of an index on + # {::Google::Cloud::Spanner::V1::ReadRequest#table table}. This index is used instead of + # the table primary key when interpreting + # {::Google::Cloud::Spanner::V1::ReadRequest#key_set key_set} and sorting result rows. + # See {::Google::Cloud::Spanner::V1::ReadRequest#key_set key_set} for further + # information. + # @param columns [::Array<::String>] + # Required. The columns of {::Google::Cloud::Spanner::V1::ReadRequest#table table} to be + # returned for each row matching this request. + # @param key_set [::Google::Cloud::Spanner::V1::KeySet, ::Hash] + # Required. `key_set` identifies the rows to be yielded. `key_set` names the + # primary keys of the rows in {::Google::Cloud::Spanner::V1::ReadRequest#table table} to + # be yielded, unless {::Google::Cloud::Spanner::V1::ReadRequest#index index} is present. + # If {::Google::Cloud::Spanner::V1::ReadRequest#index index} is present, then + # {::Google::Cloud::Spanner::V1::ReadRequest#key_set key_set} instead names index keys + # in {::Google::Cloud::Spanner::V1::ReadRequest#index index}. + # + # If the {::Google::Cloud::Spanner::V1::ReadRequest#partition_token partition_token} + # field is empty, rows are yielded in table primary key order (if + # {::Google::Cloud::Spanner::V1::ReadRequest#index index} is empty) or index key order + # (if {::Google::Cloud::Spanner::V1::ReadRequest#index index} is non-empty). If the + # {::Google::Cloud::Spanner::V1::ReadRequest#partition_token partition_token} field + # isn't empty, rows are yielded in an unspecified order. + # + # It isn't an error for the `key_set` to name rows that don't + # exist in the database. Read yields nothing for nonexistent rows. + # @param limit [::Integer] + # If greater than zero, only the first `limit` rows are yielded. If `limit` + # is zero, the default is no limit. A limit can't be specified if + # `partition_token` is set. + # @param resume_token [::String] + # If this request is resuming a previously interrupted read, + # `resume_token` should be copied from the last + # {::Google::Cloud::Spanner::V1::PartialResultSet PartialResultSet} yielded before the + # interruption. Doing this enables the new read to resume where the last read + # left off. The rest of the request parameters must exactly match the request + # that yielded this token. + # @param partition_token [::String] + # If present, results are restricted to the specified partition + # previously created using `PartitionRead`. There must be an exact + # match for the values of fields common to this message and the + # PartitionReadRequest message used to create this partition_token. + # @param request_options [::Google::Cloud::Spanner::V1::RequestOptions, ::Hash] + # Common options for this request. + # @param directed_read_options [::Google::Cloud::Spanner::V1::DirectedReadOptions, ::Hash] + # Directed read options for this request. + # @param data_boost_enabled [::Boolean] + # If this is for a partitioned read and this field is set to `true`, the + # request is executed with Spanner Data Boost independent compute resources. + # + # If the field is set to `true` but the request doesn't set + # `partition_token`, the API returns an `INVALID_ARGUMENT` error. + # @param order_by [::Google::Cloud::Spanner::V1::ReadRequest::OrderBy] + # Optional. Order for the returned rows. + # + # By default, Spanner returns result rows in primary key order except for + # PartitionRead requests. For applications that don't require rows to be + # returned in primary key (`ORDER_BY_PRIMARY_KEY`) order, setting + # `ORDER_BY_NO_ORDER` option allows Spanner to optimize row retrieval, + # resulting in lower latencies in certain cases (for example, bulk point + # lookups). + # @param lock_hint [::Google::Cloud::Spanner::V1::ReadRequest::LockHint] + # Optional. Lock Hint for the request, it can only be used with read-write + # transactions. + # @param routing_hint [::Google::Cloud::Spanner::V1::RoutingHint, ::Hash] + # Optional. If present, it makes the Spanner requests location-aware. + # + # It gives the server hints that can be used to route the request + # to an appropriate server, potentially significantly decreasing latency and + # improving throughput. To achieve improved performance, most fields must be + # filled in with accurate values. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Spanner::V1::ResultSet] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Spanner::V1::ResultSet] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/spanner/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Spanner::V1::Spanner::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Spanner::V1::ReadRequest.new + # + # # Call the read method. + # result = client.read request + # + # # The returned object is of type Google::Cloud::Spanner::V1::ResultSet. + # p result + # + def read request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::V1::ReadRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.read.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Spanner::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.session + header_params["session"] = request.session + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.read.timeout, + metadata: metadata, + retry_policy: @config.rpcs.read.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @spanner_stub.call_rpc :read, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Like {::Google::Cloud::Spanner::V1::Spanner::Client#read Read}, except returns the result set + # as a stream. Unlike {::Google::Cloud::Spanner::V1::Spanner::Client#read Read}, there is no + # limit on the size of the returned result set. However, no individual row in + # the result set can exceed 100 MiB, and no column value can exceed + # 10 MiB. + # + # @overload streaming_read(request, options = nil) + # Pass arguments to `streaming_read` via a request object, either of type + # {::Google::Cloud::Spanner::V1::ReadRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Spanner::V1::ReadRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload streaming_read(session: nil, transaction: nil, table: nil, index: nil, columns: nil, key_set: nil, limit: nil, resume_token: nil, partition_token: nil, request_options: nil, directed_read_options: nil, data_boost_enabled: nil, order_by: nil, lock_hint: nil, routing_hint: nil) + # Pass arguments to `streaming_read` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param session [::String] + # Required. The session in which the read should be performed. + # @param transaction [::Google::Cloud::Spanner::V1::TransactionSelector, ::Hash] + # The transaction to use. If none is provided, the default is a + # temporary read-only transaction with strong concurrency. + # @param table [::String] + # Required. The name of the table in the database to be read. + # @param index [::String] + # If non-empty, the name of an index on + # {::Google::Cloud::Spanner::V1::ReadRequest#table table}. This index is used instead of + # the table primary key when interpreting + # {::Google::Cloud::Spanner::V1::ReadRequest#key_set key_set} and sorting result rows. + # See {::Google::Cloud::Spanner::V1::ReadRequest#key_set key_set} for further + # information. + # @param columns [::Array<::String>] + # Required. The columns of {::Google::Cloud::Spanner::V1::ReadRequest#table table} to be + # returned for each row matching this request. + # @param key_set [::Google::Cloud::Spanner::V1::KeySet, ::Hash] + # Required. `key_set` identifies the rows to be yielded. `key_set` names the + # primary keys of the rows in {::Google::Cloud::Spanner::V1::ReadRequest#table table} to + # be yielded, unless {::Google::Cloud::Spanner::V1::ReadRequest#index index} is present. + # If {::Google::Cloud::Spanner::V1::ReadRequest#index index} is present, then + # {::Google::Cloud::Spanner::V1::ReadRequest#key_set key_set} instead names index keys + # in {::Google::Cloud::Spanner::V1::ReadRequest#index index}. + # + # If the {::Google::Cloud::Spanner::V1::ReadRequest#partition_token partition_token} + # field is empty, rows are yielded in table primary key order (if + # {::Google::Cloud::Spanner::V1::ReadRequest#index index} is empty) or index key order + # (if {::Google::Cloud::Spanner::V1::ReadRequest#index index} is non-empty). If the + # {::Google::Cloud::Spanner::V1::ReadRequest#partition_token partition_token} field + # isn't empty, rows are yielded in an unspecified order. + # + # It isn't an error for the `key_set` to name rows that don't + # exist in the database. Read yields nothing for nonexistent rows. + # @param limit [::Integer] + # If greater than zero, only the first `limit` rows are yielded. If `limit` + # is zero, the default is no limit. A limit can't be specified if + # `partition_token` is set. + # @param resume_token [::String] + # If this request is resuming a previously interrupted read, + # `resume_token` should be copied from the last + # {::Google::Cloud::Spanner::V1::PartialResultSet PartialResultSet} yielded before the + # interruption. Doing this enables the new read to resume where the last read + # left off. The rest of the request parameters must exactly match the request + # that yielded this token. + # @param partition_token [::String] + # If present, results are restricted to the specified partition + # previously created using `PartitionRead`. There must be an exact + # match for the values of fields common to this message and the + # PartitionReadRequest message used to create this partition_token. + # @param request_options [::Google::Cloud::Spanner::V1::RequestOptions, ::Hash] + # Common options for this request. + # @param directed_read_options [::Google::Cloud::Spanner::V1::DirectedReadOptions, ::Hash] + # Directed read options for this request. + # @param data_boost_enabled [::Boolean] + # If this is for a partitioned read and this field is set to `true`, the + # request is executed with Spanner Data Boost independent compute resources. + # + # If the field is set to `true` but the request doesn't set + # `partition_token`, the API returns an `INVALID_ARGUMENT` error. + # @param order_by [::Google::Cloud::Spanner::V1::ReadRequest::OrderBy] + # Optional. Order for the returned rows. + # + # By default, Spanner returns result rows in primary key order except for + # PartitionRead requests. For applications that don't require rows to be + # returned in primary key (`ORDER_BY_PRIMARY_KEY`) order, setting + # `ORDER_BY_NO_ORDER` option allows Spanner to optimize row retrieval, + # resulting in lower latencies in certain cases (for example, bulk point + # lookups). + # @param lock_hint [::Google::Cloud::Spanner::V1::ReadRequest::LockHint] + # Optional. Lock Hint for the request, it can only be used with read-write + # transactions. + # @param routing_hint [::Google::Cloud::Spanner::V1::RoutingHint, ::Hash] + # Optional. If present, it makes the Spanner requests location-aware. + # + # It gives the server hints that can be used to route the request + # to an appropriate server, potentially significantly decreasing latency and + # improving throughput. To achieve improved performance, most fields must be + # filled in with accurate values. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Enumerable<::Google::Cloud::Spanner::V1::PartialResultSet>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Enumerable<::Google::Cloud::Spanner::V1::PartialResultSet>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/spanner/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Spanner::V1::Spanner::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Spanner::V1::ReadRequest.new + # + # # Call the streaming_read method to start streaming. + # output = client.streaming_read request + # + # # The returned object is a streamed enumerable yielding elements of type + # # ::Google::Cloud::Spanner::V1::PartialResultSet + # output.each do |current_response| + # p current_response + # end + # + def streaming_read request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::V1::ReadRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.streaming_read.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Spanner::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.session + header_params["session"] = request.session + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.streaming_read.timeout, + metadata: metadata, + retry_policy: @config.rpcs.streaming_read.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @spanner_stub.call_rpc :streaming_read, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Begins a new transaction. This step can often be skipped: + # {::Google::Cloud::Spanner::V1::Spanner::Client#read Read}, + # {::Google::Cloud::Spanner::V1::Spanner::Client#execute_sql ExecuteSql} and + # {::Google::Cloud::Spanner::V1::Spanner::Client#commit Commit} can begin a new transaction as a + # side-effect. + # + # @overload begin_transaction(request, options = nil) + # Pass arguments to `begin_transaction` via a request object, either of type + # {::Google::Cloud::Spanner::V1::BeginTransactionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Spanner::V1::BeginTransactionRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload begin_transaction(session: nil, options: nil, request_options: nil, mutation_key: nil) + # Pass arguments to `begin_transaction` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param session [::String] + # Required. The session in which the transaction runs. + # @param options [::Google::Cloud::Spanner::V1::TransactionOptions, ::Hash] + # Required. Options for the new transaction. + # @param request_options [::Google::Cloud::Spanner::V1::RequestOptions, ::Hash] + # Common options for this request. + # Priority is ignored for this request. Setting the priority in this + # `request_options` struct doesn't do anything. To set the priority for a + # transaction, set it on the reads and writes that are part of this + # transaction instead. + # @param mutation_key [::Google::Cloud::Spanner::V1::Mutation, ::Hash] + # Optional. Required for read-write transactions on a multiplexed session + # that commit mutations but don't perform any reads or queries. You must + # randomly select one of the mutations from the mutation set and send it as a + # part of this request. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Spanner::V1::Transaction] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Spanner::V1::Transaction] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/spanner/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Spanner::V1::Spanner::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Spanner::V1::BeginTransactionRequest.new + # + # # Call the begin_transaction method. + # result = client.begin_transaction request + # + # # The returned object is of type Google::Cloud::Spanner::V1::Transaction. + # p result + # + def begin_transaction request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::V1::BeginTransactionRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.begin_transaction.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Spanner::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.session + header_params["session"] = request.session + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.begin_transaction.timeout, + metadata: metadata, + retry_policy: @config.rpcs.begin_transaction.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @spanner_stub.call_rpc :begin_transaction, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Commits a transaction. The request includes the mutations to be + # applied to rows in the database. + # + # `Commit` might return an `ABORTED` error. This can occur at any time; + # commonly, the cause is conflicts with concurrent + # transactions. However, it can also happen for a variety of other + # reasons. If `Commit` returns `ABORTED`, the caller should retry + # the transaction from the beginning, reusing the same session. + # + # On very rare occasions, `Commit` might return `UNKNOWN`. This can happen, + # for example, if the client job experiences a 1+ hour networking failure. + # At that point, Cloud Spanner has lost track of the transaction outcome and + # we recommend that you perform another read from the database to see the + # state of things as they are now. + # + # @overload commit(request, options = nil) + # Pass arguments to `commit` via a request object, either of type + # {::Google::Cloud::Spanner::V1::CommitRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Spanner::V1::CommitRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload commit(session: nil, transaction_id: nil, single_use_transaction: nil, mutations: nil, return_commit_stats: nil, max_commit_delay: nil, request_options: nil, precommit_token: nil) + # Pass arguments to `commit` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param session [::String] + # Required. The session in which the transaction to be committed is running. + # @param transaction_id [::String] + # Commit a previously-started transaction. + # + # Note: The following parameters are mutually exclusive: `transaction_id`, `single_use_transaction`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one. + # @param single_use_transaction [::Google::Cloud::Spanner::V1::TransactionOptions, ::Hash] + # Execute mutations in a temporary transaction. Note that unlike + # commit of a previously-started transaction, commit with a + # temporary transaction is non-idempotent. That is, if the + # `CommitRequest` is sent to Cloud Spanner more than once (for + # instance, due to retries in the application, or in the + # transport library), it's possible that the mutations are + # executed more than once. If this is undesirable, use + # {::Google::Cloud::Spanner::V1::Spanner::Client#begin_transaction BeginTransaction} and + # {::Google::Cloud::Spanner::V1::Spanner::Client#commit Commit} instead. + # + # Note: The following parameters are mutually exclusive: `single_use_transaction`, `transaction_id`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one. + # @param mutations [::Array<::Google::Cloud::Spanner::V1::Mutation, ::Hash>] + # The mutations to be executed when this transaction commits. All + # mutations are applied atomically, in the order they appear in + # this list. + # @param return_commit_stats [::Boolean] + # If `true`, then statistics related to the transaction is included in + # the {::Google::Cloud::Spanner::V1::CommitResponse#commit_stats CommitResponse}. + # Default value is `false`. + # @param max_commit_delay [::Google::Protobuf::Duration, ::Hash] + # Optional. The amount of latency this request is configured to incur in + # order to improve throughput. If this field isn't set, Spanner assumes + # requests are relatively latency sensitive and automatically determines an + # appropriate delay time. You can specify a commit delay value between 0 and + # 500 ms. + # @param request_options [::Google::Cloud::Spanner::V1::RequestOptions, ::Hash] + # Common options for this request. + # @param precommit_token [::Google::Cloud::Spanner::V1::MultiplexedSessionPrecommitToken, ::Hash] + # Optional. If the read-write transaction was executed on a multiplexed + # session, then you must include the precommit token with the highest + # sequence number received in this transaction attempt. Failing to do so + # results in a `FailedPrecondition` error. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Spanner::V1::CommitResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Spanner::V1::CommitResponse] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/spanner/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Spanner::V1::Spanner::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Spanner::V1::CommitRequest.new + # + # # Call the commit method. + # result = client.commit request + # + # # The returned object is of type Google::Cloud::Spanner::V1::CommitResponse. + # p result + # + def commit request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::V1::CommitRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.commit.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Spanner::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.session + header_params["session"] = request.session + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.commit.timeout, + metadata: metadata, + retry_policy: @config.rpcs.commit.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @spanner_stub.call_rpc :commit, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Rolls back a transaction, releasing any locks it holds. It's a good + # idea to call this for any transaction that includes one or more + # {::Google::Cloud::Spanner::V1::Spanner::Client#read Read} or + # {::Google::Cloud::Spanner::V1::Spanner::Client#execute_sql ExecuteSql} requests and ultimately + # decides not to commit. + # + # `Rollback` returns `OK` if it successfully aborts the transaction, the + # transaction was already aborted, or the transaction isn't + # found. `Rollback` never returns `ABORTED`. + # + # @overload rollback(request, options = nil) + # Pass arguments to `rollback` via a request object, either of type + # {::Google::Cloud::Spanner::V1::RollbackRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Spanner::V1::RollbackRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload rollback(session: nil, transaction_id: nil) + # Pass arguments to `rollback` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param session [::String] + # Required. The session in which the transaction to roll back is running. + # @param transaction_id [::String] + # Required. The transaction to roll back. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::Empty] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/spanner/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Spanner::V1::Spanner::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Spanner::V1::RollbackRequest.new + # + # # Call the rollback method. + # result = client.rollback request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def rollback request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::V1::RollbackRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.rollback.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Spanner::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.session + header_params["session"] = request.session + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.rollback.timeout, + metadata: metadata, + retry_policy: @config.rpcs.rollback.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @spanner_stub.call_rpc :rollback, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # 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 + # by {::Google::Cloud::Spanner::V1::Spanner::Client#execute_streaming_sql ExecuteStreamingSql} to + # specify a subset of the query result to read. The same session and + # read-only transaction must be used by the `PartitionQueryRequest` used to + # create the partition tokens and the `ExecuteSqlRequests` that use the + # partition tokens. + # + # Partition tokens become invalid when the session used to create them + # is deleted, is idle for too long, begins a new transaction, or becomes too + # old. When any of these happen, it isn't possible to resume the query, and + # the whole operation must be restarted from the beginning. + # + # @overload partition_query(request, options = nil) + # Pass arguments to `partition_query` via a request object, either of type + # {::Google::Cloud::Spanner::V1::PartitionQueryRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Spanner::V1::PartitionQueryRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload partition_query(session: nil, transaction: nil, sql: nil, params: nil, param_types: nil, partition_options: nil) + # Pass arguments to `partition_query` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param session [::String] + # Required. The session used to create the partitions. + # @param transaction [::Google::Cloud::Spanner::V1::TransactionSelector, ::Hash] + # Read-only snapshot transactions are supported, read and write and + # single-use transactions are not. + # @param sql [::String] + # Required. The query request to generate partitions for. The request fails + # if the query isn't root partitionable. For a query to be root + # partitionable, it needs to satisfy a few conditions. For example, if the + # query execution plan contains a distributed union operator, then it must be + # the first operator in the plan. For more information about other + # conditions, see [Read data in + # parallel](https://cloud.google.com/spanner/docs/reads#read_data_in_parallel). + # + # The query request must not contain DML commands, such as `INSERT`, + # `UPDATE`, or `DELETE`. Use + # {::Google::Cloud::Spanner::V1::Spanner::Client#execute_streaming_sql `ExecuteStreamingSql`} with + # a `PartitionedDml` transaction for large, partition-friendly DML + # operations. + # @param params [::Google::Protobuf::Struct, ::Hash] + # Optional. Parameter names and values that bind to placeholders in the SQL + # string. + # + # A parameter placeholder consists of the `@` character followed by the + # parameter name (for example, `@firstName`). Parameter names can contain + # letters, numbers, and underscores. + # + # Parameters can appear anywhere that a literal value is expected. The same + # parameter name can be used more than once, for example: + # + # `"WHERE id > @msg_id AND id < @msg_id + 100"` + # + # It's an error to execute a SQL statement with unbound parameters. + # @param param_types [::Hash{::String => ::Google::Cloud::Spanner::V1::Type, ::Hash}] + # Optional. It isn't always possible for Cloud Spanner to infer the right SQL + # type from a JSON value. For example, values of type `BYTES` and values of + # type `STRING` both appear in + # {::Google::Cloud::Spanner::V1::PartitionQueryRequest#params params} as JSON strings. + # + # In these cases, `param_types` can be used to specify the exact + # SQL type for some or all of the SQL query parameters. See the + # definition of {::Google::Cloud::Spanner::V1::Type Type} for more information + # about SQL types. + # @param partition_options [::Google::Cloud::Spanner::V1::PartitionOptions, ::Hash] + # Additional options that affect how many partitions are created. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Spanner::V1::PartitionResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Spanner::V1::PartitionResponse] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/spanner/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Spanner::V1::Spanner::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Spanner::V1::PartitionQueryRequest.new + # + # # Call the partition_query method. + # result = client.partition_query request + # + # # The returned object is of type Google::Cloud::Spanner::V1::PartitionResponse. + # p result + # + def partition_query request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::V1::PartitionQueryRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.partition_query.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Spanner::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.session + header_params["session"] = request.session + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.partition_query.timeout, + metadata: metadata, + retry_policy: @config.rpcs.partition_query.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @spanner_stub.call_rpc :partition_query, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # 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 + # by {::Google::Cloud::Spanner::V1::Spanner::Client#streaming_read StreamingRead} to specify a + # subset of the read result to read. The same session and read-only + # transaction must be used by the `PartitionReadRequest` used to create the + # partition tokens and the `ReadRequests` that use the partition tokens. + # There are no ordering guarantees on rows returned among the returned + # partition tokens, or even within each individual `StreamingRead` call + # issued with a `partition_token`. + # + # Partition tokens become invalid when the session used to create them + # is deleted, is idle for too long, begins a new transaction, or becomes too + # old. When any of these happen, it isn't possible to resume the read, and + # the whole operation must be restarted from the beginning. + # + # @overload partition_read(request, options = nil) + # Pass arguments to `partition_read` via a request object, either of type + # {::Google::Cloud::Spanner::V1::PartitionReadRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Spanner::V1::PartitionReadRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload partition_read(session: nil, transaction: nil, table: nil, index: nil, columns: nil, key_set: nil, partition_options: nil) + # Pass arguments to `partition_read` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param session [::String] + # Required. The session used to create the partitions. + # @param transaction [::Google::Cloud::Spanner::V1::TransactionSelector, ::Hash] + # Read only snapshot transactions are supported, read/write and single use + # transactions are not. + # @param table [::String] + # Required. The name of the table in the database to be read. + # @param index [::String] + # If non-empty, the name of an index on + # {::Google::Cloud::Spanner::V1::PartitionReadRequest#table table}. This index is used + # instead of the table primary key when interpreting + # {::Google::Cloud::Spanner::V1::PartitionReadRequest#key_set key_set} and sorting + # result rows. See {::Google::Cloud::Spanner::V1::PartitionReadRequest#key_set key_set} + # for further information. + # @param columns [::Array<::String>] + # The columns of {::Google::Cloud::Spanner::V1::PartitionReadRequest#table table} to be + # returned for each row matching this request. + # @param key_set [::Google::Cloud::Spanner::V1::KeySet, ::Hash] + # Required. `key_set` identifies the rows to be yielded. `key_set` names the + # primary keys of the rows in + # {::Google::Cloud::Spanner::V1::PartitionReadRequest#table table} to be yielded, unless + # {::Google::Cloud::Spanner::V1::PartitionReadRequest#index index} is present. If + # {::Google::Cloud::Spanner::V1::PartitionReadRequest#index index} is present, then + # {::Google::Cloud::Spanner::V1::PartitionReadRequest#key_set key_set} instead names + # index keys in {::Google::Cloud::Spanner::V1::PartitionReadRequest#index index}. + # + # It isn't an error for the `key_set` to name rows that don't + # exist in the database. Read yields nothing for nonexistent rows. + # @param partition_options [::Google::Cloud::Spanner::V1::PartitionOptions, ::Hash] + # Additional options that affect how many partitions are created. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Spanner::V1::PartitionResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Spanner::V1::PartitionResponse] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/spanner/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Spanner::V1::Spanner::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Spanner::V1::PartitionReadRequest.new + # + # # Call the partition_read method. + # result = client.partition_read request + # + # # The returned object is of type Google::Cloud::Spanner::V1::PartitionResponse. + # p result + # + def partition_read request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::V1::PartitionReadRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.partition_read.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Spanner::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.session + header_params["session"] = request.session + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.partition_read.timeout, + metadata: metadata, + retry_policy: @config.rpcs.partition_read.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @spanner_stub.call_rpc :partition_read, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Batches the supplied mutation groups in a collection of efficient + # transactions. All mutations in a group are committed atomically. However, + # mutations across groups can be committed non-atomically in an unspecified + # order and thus, they must be independent of each other. Partial failure is + # possible, that is, some groups might have been committed successfully, + # while some might have failed. The results of individual batches are + # streamed into the response as the batches are applied. + # + # `BatchWrite` requests are not replay protected, meaning that each mutation + # group can be applied more than once. Replays of non-idempotent mutations + # can have undesirable effects. For example, replays of an insert mutation + # can produce an already exists error or if you use generated or commit + # timestamp-based keys, it can result in additional rows being added to the + # mutation's table. We recommend structuring your mutation groups to be + # idempotent to avoid this issue. + # + # @overload batch_write(request, options = nil) + # Pass arguments to `batch_write` via a request object, either of type + # {::Google::Cloud::Spanner::V1::BatchWriteRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Spanner::V1::BatchWriteRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload batch_write(session: nil, request_options: nil, mutation_groups: nil, exclude_txn_from_change_streams: nil) + # Pass arguments to `batch_write` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param session [::String] + # Required. The session in which the batch request is to be run. + # @param request_options [::Google::Cloud::Spanner::V1::RequestOptions, ::Hash] + # Common options for this request. + # @param mutation_groups [::Array<::Google::Cloud::Spanner::V1::BatchWriteRequest::MutationGroup, ::Hash>] + # Required. The groups of mutations to be applied. + # @param exclude_txn_from_change_streams [::Boolean] + # Optional. If you don't set the `exclude_txn_from_change_streams` option or + # if it's set to `false`, then any change streams monitoring columns modified + # by transactions will capture the updates made within that transaction. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Enumerable<::Google::Cloud::Spanner::V1::BatchWriteResponse>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Enumerable<::Google::Cloud::Spanner::V1::BatchWriteResponse>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/spanner/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Spanner::V1::Spanner::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Spanner::V1::BatchWriteRequest.new + # + # # Call the batch_write method to start streaming. + # output = client.batch_write request + # + # # The returned object is a streamed enumerable yielding elements of type + # # ::Google::Cloud::Spanner::V1::BatchWriteResponse + # output.each do |current_response| + # p current_response + # end + # + def batch_write request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::V1::BatchWriteRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.batch_write.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Spanner::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.session + header_params["session"] = request.session + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.batch_write.timeout, + metadata: metadata, + retry_policy: @config.rpcs.batch_write.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @spanner_stub.call_rpc :batch_write, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the Spanner API. + # + # This class represents the configuration for Spanner, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::Spanner::V1::Spanner::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # create_session to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Spanner::V1::Spanner::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.create_session.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Spanner::V1::Spanner::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.create_session.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # + # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials + # is deprecated. Providing an unvalidated credential configuration to + # Google APIs can compromise the security of your systems and data. + # + # @example + # + # # The recommended way to provide credentials is to use the `make_creds` method + # # on the appropriate credentials class for your environment. + # + # require "googleauth" + # + # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( + # json_key_io: ::File.open("/path/to/keyfile.json") + # ) + # + # client = ::Google::Cloud::Spanner::V1::Spanner::Client.new do |config| + # config.credentials = credentials + # end + # + # @note Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "spanner.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the Spanner API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `create_session` + # @return [::Gapic::Config::Method] + # + attr_reader :create_session + ## + # RPC-specific configuration for `batch_create_sessions` + # @return [::Gapic::Config::Method] + # + attr_reader :batch_create_sessions + ## + # RPC-specific configuration for `get_session` + # @return [::Gapic::Config::Method] + # + attr_reader :get_session + ## + # RPC-specific configuration for `list_sessions` + # @return [::Gapic::Config::Method] + # + attr_reader :list_sessions + ## + # RPC-specific configuration for `delete_session` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_session + ## + # RPC-specific configuration for `execute_sql` + # @return [::Gapic::Config::Method] + # + attr_reader :execute_sql + ## + # RPC-specific configuration for `execute_streaming_sql` + # @return [::Gapic::Config::Method] + # + attr_reader :execute_streaming_sql + ## + # RPC-specific configuration for `execute_batch_dml` + # @return [::Gapic::Config::Method] + # + attr_reader :execute_batch_dml + ## + # RPC-specific configuration for `read` + # @return [::Gapic::Config::Method] + # + attr_reader :read + ## + # RPC-specific configuration for `streaming_read` + # @return [::Gapic::Config::Method] + # + attr_reader :streaming_read + ## + # RPC-specific configuration for `begin_transaction` + # @return [::Gapic::Config::Method] + # + attr_reader :begin_transaction + ## + # RPC-specific configuration for `commit` + # @return [::Gapic::Config::Method] + # + attr_reader :commit + ## + # RPC-specific configuration for `rollback` + # @return [::Gapic::Config::Method] + # + attr_reader :rollback + ## + # RPC-specific configuration for `partition_query` + # @return [::Gapic::Config::Method] + # + attr_reader :partition_query + ## + # RPC-specific configuration for `partition_read` + # @return [::Gapic::Config::Method] + # + attr_reader :partition_read + ## + # RPC-specific configuration for `batch_write` + # @return [::Gapic::Config::Method] + # + attr_reader :batch_write + + # @private + def initialize parent_rpcs = nil + create_session_config = parent_rpcs.create_session if parent_rpcs.respond_to? :create_session + @create_session = ::Gapic::Config::Method.new create_session_config + batch_create_sessions_config = parent_rpcs.batch_create_sessions if parent_rpcs.respond_to? :batch_create_sessions + @batch_create_sessions = ::Gapic::Config::Method.new batch_create_sessions_config + get_session_config = parent_rpcs.get_session if parent_rpcs.respond_to? :get_session + @get_session = ::Gapic::Config::Method.new get_session_config + list_sessions_config = parent_rpcs.list_sessions if parent_rpcs.respond_to? :list_sessions + @list_sessions = ::Gapic::Config::Method.new list_sessions_config + delete_session_config = parent_rpcs.delete_session if parent_rpcs.respond_to? :delete_session + @delete_session = ::Gapic::Config::Method.new delete_session_config + execute_sql_config = parent_rpcs.execute_sql if parent_rpcs.respond_to? :execute_sql + @execute_sql = ::Gapic::Config::Method.new execute_sql_config + execute_streaming_sql_config = parent_rpcs.execute_streaming_sql if parent_rpcs.respond_to? :execute_streaming_sql + @execute_streaming_sql = ::Gapic::Config::Method.new execute_streaming_sql_config + execute_batch_dml_config = parent_rpcs.execute_batch_dml if parent_rpcs.respond_to? :execute_batch_dml + @execute_batch_dml = ::Gapic::Config::Method.new execute_batch_dml_config + read_config = parent_rpcs.read if parent_rpcs.respond_to? :read + @read = ::Gapic::Config::Method.new read_config + streaming_read_config = parent_rpcs.streaming_read if parent_rpcs.respond_to? :streaming_read + @streaming_read = ::Gapic::Config::Method.new streaming_read_config + begin_transaction_config = parent_rpcs.begin_transaction if parent_rpcs.respond_to? :begin_transaction + @begin_transaction = ::Gapic::Config::Method.new begin_transaction_config + commit_config = parent_rpcs.commit if parent_rpcs.respond_to? :commit + @commit = ::Gapic::Config::Method.new commit_config + rollback_config = parent_rpcs.rollback if parent_rpcs.respond_to? :rollback + @rollback = ::Gapic::Config::Method.new rollback_config + partition_query_config = parent_rpcs.partition_query if parent_rpcs.respond_to? :partition_query + @partition_query = ::Gapic::Config::Method.new partition_query_config + partition_read_config = parent_rpcs.partition_read if parent_rpcs.respond_to? :partition_read + @partition_read = ::Gapic::Config::Method.new partition_read_config + batch_write_config = parent_rpcs.batch_write if parent_rpcs.respond_to? :batch_write + @batch_write = ::Gapic::Config::Method.new batch_write_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-spanner-v1/lib/google/cloud/spanner/v1/spanner/credentials.rb b/owl-bot-staging/google-cloud-spanner-v1/lib/google/cloud/spanner/v1/spanner/credentials.rb new file mode 100644 index 000000000000..1970ece8b929 --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-v1/lib/google/cloud/spanner/v1/spanner/credentials.rb @@ -0,0 +1,52 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Cloud + module Spanner + module V1 + module Spanner + # Credentials for the Spanner API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/spanner.data" + ] + self.env_vars = [ + "SPANNER_CREDENTIALS", + "SPANNER_KEYFILE", + "GOOGLE_CLOUD_CREDENTIALS", + "GOOGLE_CLOUD_KEYFILE", + "GCLOUD_KEYFILE", + "SPANNER_CREDENTIALS_JSON", + "SPANNER_KEYFILE_JSON", + "GOOGLE_CLOUD_CREDENTIALS_JSON", + "GOOGLE_CLOUD_KEYFILE_JSON", + "GCLOUD_KEYFILE_JSON" + ] + self.paths = [ + "~/.config/google_cloud/application_default_credentials.json" + ] + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-spanner-v1/lib/google/cloud/spanner/v1/spanner/paths.rb b/owl-bot-staging/google-cloud-spanner-v1/lib/google/cloud/spanner/v1/spanner/paths.rb new file mode 100644 index 000000000000..ef5cfd6c6bab --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-v1/lib/google/cloud/spanner/v1/spanner/paths.rb @@ -0,0 +1,73 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module Spanner + module V1 + module Spanner + # Path helper methods for the Spanner API. + module Paths + ## + # Create a fully-qualified Database resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/instances/{instance}/databases/{database}` + # + # @param project [String] + # @param instance [String] + # @param database [String] + # + # @return [::String] + def database_path project:, instance:, database: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "instance cannot contain /" if instance.to_s.include? "/" + + "projects/#{project}/instances/#{instance}/databases/#{database}" + end + + ## + # Create a fully-qualified Session resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/instances/{instance}/databases/{database}/sessions/{session}` + # + # @param project [String] + # @param instance [String] + # @param database [String] + # @param session [String] + # + # @return [::String] + def session_path project:, instance:, database:, session: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "instance cannot contain /" if instance.to_s.include? "/" + raise ::ArgumentError, "database cannot contain /" if database.to_s.include? "/" + + "projects/#{project}/instances/#{instance}/databases/#{database}/sessions/#{session}" + end + + extend self + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-spanner-v1/lib/google/cloud/spanner/v1/version.rb b/owl-bot-staging/google-cloud-spanner-v1/lib/google/cloud/spanner/v1/version.rb new file mode 100644 index 000000000000..d42f1a645d00 --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-v1/lib/google/cloud/spanner/v1/version.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module Spanner + module V1 + VERSION = "0.0.1" + end + end + end +end diff --git a/owl-bot-staging/google-cloud-spanner-v1/lib/google/spanner/v1/change_stream_pb.rb b/owl-bot-staging/google-cloud-spanner-v1/lib/google/spanner/v1/change_stream_pb.rb new file mode 100644 index 000000000000..7aadb137310b --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-v1/lib/google/spanner/v1/change_stream_pb.rb @@ -0,0 +1,61 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/spanner/v1/change_stream.proto + +require 'google/protobuf' + +require 'google/protobuf/struct_pb' +require 'google/protobuf/timestamp_pb' +require 'google/spanner/v1/type_pb' + + +descriptor_data = "\n%google/spanner/v1/change_stream.proto\x12\x11google.spanner.v1\x1a\x1cgoogle/protobuf/struct.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x1cgoogle/spanner/v1/type.proto\"\x96\x14\n\x12\x43hangeStreamRecord\x12T\n\x12\x64\x61ta_change_record\x18\x01 \x01(\x0b\x32\x36.google.spanner.v1.ChangeStreamRecord.DataChangeRecordH\x00\x12Q\n\x10heartbeat_record\x18\x02 \x01(\x0b\x32\x35.google.spanner.v1.ChangeStreamRecord.HeartbeatRecordH\x00\x12\\\n\x16partition_start_record\x18\x03 \x01(\x0b\x32:.google.spanner.v1.ChangeStreamRecord.PartitionStartRecordH\x00\x12X\n\x14partition_end_record\x18\x04 \x01(\x0b\x32\x38.google.spanner.v1.ChangeStreamRecord.PartitionEndRecordH\x00\x12\\\n\x16partition_event_record\x18\x05 \x01(\x0b\x32:.google.spanner.v1.ChangeStreamRecord.PartitionEventRecordH\x00\x1a\xd2\n\n\x10\x44\x61taChangeRecord\x12\x34\n\x10\x63ommit_timestamp\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x17\n\x0frecord_sequence\x18\x02 \x01(\t\x12\x1d\n\x15server_transaction_id\x18\x03 \x01(\t\x12\x32\n*is_last_record_in_transaction_in_partition\x18\x04 \x01(\x08\x12\r\n\x05table\x18\x05 \x01(\t\x12^\n\x0f\x63olumn_metadata\x18\x06 \x03(\x0b\x32\x45.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ColumnMetadata\x12H\n\x04mods\x18\x07 \x03(\x0b\x32:.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.Mod\x12P\n\x08mod_type\x18\x08 \x01(\x0e\x32>.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModType\x12\x63\n\x12value_capture_type\x18\t \x01(\x0e\x32G.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ValueCaptureType\x12(\n number_of_records_in_transaction\x18\n \x01(\x05\x12+\n#number_of_partitions_in_transaction\x18\x0b \x01(\x05\x12\x17\n\x0ftransaction_tag\x18\x0c \x01(\t\x12\x1d\n\x15is_system_transaction\x18\r \x01(\x08\x1aw\n\x0e\x43olumnMetadata\x12\x0c\n\x04name\x18\x01 \x01(\t\x12%\n\x04type\x18\x02 \x01(\x0b\x32\x17.google.spanner.v1.Type\x12\x16\n\x0eis_primary_key\x18\x03 \x01(\x08\x12\x18\n\x10ordinal_position\x18\x04 \x01(\x03\x1aP\n\x08ModValue\x12\x1d\n\x15\x63olumn_metadata_index\x18\x01 \x01(\x05\x12%\n\x05value\x18\x02 \x01(\x0b\x32\x16.google.protobuf.Value\x1a\xfe\x01\n\x03Mod\x12M\n\x04keys\x18\x01 \x03(\x0b\x32?.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue\x12S\n\nold_values\x18\x02 \x03(\x0b\x32?.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue\x12S\n\nnew_values\x18\x03 \x03(\x0b\x32?.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue\"G\n\x07ModType\x12\x18\n\x14MOD_TYPE_UNSPECIFIED\x10\x00\x12\n\n\x06INSERT\x10\n\x12\n\n\x06UPDATE\x10\x14\x12\n\n\x06\x44\x45LETE\x10\x1e\"\x87\x01\n\x10ValueCaptureType\x12\"\n\x1eVALUE_CAPTURE_TYPE_UNSPECIFIED\x10\x00\x12\x16\n\x12OLD_AND_NEW_VALUES\x10\n\x12\x0e\n\nNEW_VALUES\x10\x14\x12\x0b\n\x07NEW_ROW\x10\x1e\x12\x1a\n\x16NEW_ROW_AND_OLD_VALUES\x10(\x1a@\n\x0fHeartbeatRecord\x12-\n\ttimestamp\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x1a~\n\x14PartitionStartRecord\x12\x33\n\x0fstart_timestamp\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x17\n\x0frecord_sequence\x18\x02 \x01(\t\x12\x18\n\x10partition_tokens\x18\x03 \x03(\t\x1ay\n\x12PartitionEndRecord\x12\x31\n\rend_timestamp\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x17\n\x0frecord_sequence\x18\x02 \x01(\t\x12\x17\n\x0fpartition_token\x18\x03 \x01(\t\x1a\xa4\x03\n\x14PartitionEventRecord\x12\x34\n\x10\x63ommit_timestamp\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x17\n\x0frecord_sequence\x18\x02 \x01(\t\x12\x17\n\x0fpartition_token\x18\x03 \x01(\t\x12^\n\x0emove_in_events\x18\x04 \x03(\x0b\x32\x46.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveInEvent\x12`\n\x0fmove_out_events\x18\x05 \x03(\x0b\x32G.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveOutEvent\x1a-\n\x0bMoveInEvent\x12\x1e\n\x16source_partition_token\x18\x01 \x01(\t\x1a\x33\n\x0cMoveOutEvent\x12#\n\x1b\x64\x65stination_partition_token\x18\x01 \x01(\tB\x08\n\x06recordB\xb4\x01\n\x15\x63om.google.spanner.v1B\x11\x43hangeStreamProtoP\x01Z5cloud.google.com/go/spanner/apiv1/spannerpb;spannerpb\xaa\x02\x17Google.Cloud.Spanner.V1\xca\x02\x17Google\\Cloud\\Spanner\\V1\xea\x02\x1aGoogle::Cloud::Spanner::V1b\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], + ["google.spanner.v1.Type", "google/spanner/v1/type.proto"], + ["google.protobuf.Value", "google/protobuf/struct.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Cloud + module Spanner + module V1 + ChangeStreamRecord = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.ChangeStreamRecord").msgclass + ChangeStreamRecord::DataChangeRecord = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.ChangeStreamRecord.DataChangeRecord").msgclass + ChangeStreamRecord::DataChangeRecord::ColumnMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ColumnMetadata").msgclass + ChangeStreamRecord::DataChangeRecord::ModValue = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue").msgclass + ChangeStreamRecord::DataChangeRecord::Mod = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.ChangeStreamRecord.DataChangeRecord.Mod").msgclass + ChangeStreamRecord::DataChangeRecord::ModType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModType").enummodule + ChangeStreamRecord::DataChangeRecord::ValueCaptureType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ValueCaptureType").enummodule + ChangeStreamRecord::HeartbeatRecord = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.ChangeStreamRecord.HeartbeatRecord").msgclass + ChangeStreamRecord::PartitionStartRecord = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.ChangeStreamRecord.PartitionStartRecord").msgclass + ChangeStreamRecord::PartitionEndRecord = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.ChangeStreamRecord.PartitionEndRecord").msgclass + ChangeStreamRecord::PartitionEventRecord = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.ChangeStreamRecord.PartitionEventRecord").msgclass + ChangeStreamRecord::PartitionEventRecord::MoveInEvent = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveInEvent").msgclass + ChangeStreamRecord::PartitionEventRecord::MoveOutEvent = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveOutEvent").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-spanner-v1/lib/google/spanner/v1/commit_response_pb.rb b/owl-bot-staging/google-cloud-spanner-v1/lib/google/spanner/v1/commit_response_pb.rb new file mode 100644 index 000000000000..42faa7a00e43 --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-v1/lib/google/spanner/v1/commit_response_pb.rb @@ -0,0 +1,48 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/spanner/v1/commit_response.proto + +require 'google/protobuf' + +require 'google/protobuf/timestamp_pb' +require 'google/spanner/v1/transaction_pb' + + +descriptor_data = "\n\'google/spanner/v1/commit_response.proto\x12\x11google.spanner.v1\x1a\x1fgoogle/protobuf/timestamp.proto\x1a#google/spanner/v1/transaction.proto\"\xd5\x02\n\x0e\x43ommitResponse\x12\x34\n\x10\x63ommit_timestamp\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x43\n\x0c\x63ommit_stats\x18\x02 \x01(\x0b\x32-.google.spanner.v1.CommitResponse.CommitStats\x12N\n\x0fprecommit_token\x18\x04 \x01(\x0b\x32\x33.google.spanner.v1.MultiplexedSessionPrecommitTokenH\x00\x12\x36\n\x12snapshot_timestamp\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x1a%\n\x0b\x43ommitStats\x12\x16\n\x0emutation_count\x18\x01 \x01(\x03\x42\x19\n\x17MultiplexedSessionRetryB\xb6\x01\n\x15\x63om.google.spanner.v1B\x13\x43ommitResponseProtoP\x01Z5cloud.google.com/go/spanner/apiv1/spannerpb;spannerpb\xaa\x02\x17Google.Cloud.Spanner.V1\xca\x02\x17Google\\Cloud\\Spanner\\V1\xea\x02\x1aGoogle::Cloud::Spanner::V1b\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], + ["google.spanner.v1.MultiplexedSessionPrecommitToken", "google/spanner/v1/transaction.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Cloud + module Spanner + module V1 + CommitResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.CommitResponse").msgclass + CommitResponse::CommitStats = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.CommitResponse.CommitStats").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-spanner-v1/lib/google/spanner/v1/keys_pb.rb b/owl-bot-staging/google-cloud-spanner-v1/lib/google/spanner/v1/keys_pb.rb new file mode 100644 index 000000000000..d7789eca500e --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-v1/lib/google/spanner/v1/keys_pb.rb @@ -0,0 +1,46 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/spanner/v1/keys.proto + +require 'google/protobuf' + +require 'google/protobuf/struct_pb' + + +descriptor_data = "\n\x1cgoogle/spanner/v1/keys.proto\x12\x11google.spanner.v1\x1a\x1cgoogle/protobuf/struct.proto\"\xf4\x01\n\x08KeyRange\x12\x32\n\x0cstart_closed\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.ListValueH\x00\x12\x30\n\nstart_open\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.ListValueH\x00\x12\x30\n\nend_closed\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.ListValueH\x01\x12.\n\x08\x65nd_open\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.ListValueH\x01\x42\x10\n\x0estart_key_typeB\x0e\n\x0c\x65nd_key_type\"l\n\x06KeySet\x12(\n\x04keys\x18\x01 \x03(\x0b\x32\x1a.google.protobuf.ListValue\x12+\n\x06ranges\x18\x02 \x03(\x0b\x32\x1b.google.spanner.v1.KeyRange\x12\x0b\n\x03\x61ll\x18\x03 \x01(\x08\x42\xac\x01\n\x15\x63om.google.spanner.v1B\tKeysProtoP\x01Z5cloud.google.com/go/spanner/apiv1/spannerpb;spannerpb\xaa\x02\x17Google.Cloud.Spanner.V1\xca\x02\x17Google\\Cloud\\Spanner\\V1\xea\x02\x1aGoogle::Cloud::Spanner::V1b\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.protobuf.ListValue", "google/protobuf/struct.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Cloud + module Spanner + module V1 + KeyRange = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.KeyRange").msgclass + KeySet = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.KeySet").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-spanner-v1/lib/google/spanner/v1/location_pb.rb b/owl-bot-staging/google-cloud-spanner-v1/lib/google/spanner/v1/location_pb.rb new file mode 100644 index 000000000000..05b9569cbd13 --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-v1/lib/google/spanner/v1/location_pb.rb @@ -0,0 +1,58 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/spanner/v1/location.proto + +require 'google/protobuf' + +require 'google/protobuf/struct_pb' +require 'google/spanner/v1/type_pb' + + +descriptor_data = "\n google/spanner/v1/location.proto\x12\x11google.spanner.v1\x1a\x1cgoogle/protobuf/struct.proto\x1a\x1cgoogle/spanner/v1/type.proto\"f\n\x05Range\x12\x11\n\tstart_key\x18\x01 \x01(\x0c\x12\x11\n\tlimit_key\x18\x02 \x01(\x0c\x12\x11\n\tgroup_uid\x18\x03 \x01(\x04\x12\x10\n\x08split_id\x18\x04 \x01(\x04\x12\x12\n\ngeneration\x18\x05 \x01(\x0c\"\xe6\x01\n\x06Tablet\x12\x12\n\ntablet_uid\x18\x01 \x01(\x04\x12\x16\n\x0eserver_address\x18\x02 \x01(\t\x12\x10\n\x08location\x18\x03 \x01(\t\x12,\n\x04role\x18\x04 \x01(\x0e\x32\x1e.google.spanner.v1.Tablet.Role\x12\x13\n\x0bincarnation\x18\x05 \x01(\x0c\x12\x10\n\x08\x64istance\x18\x06 \x01(\r\x12\x0c\n\x04skip\x18\x07 \x01(\x08\";\n\x04Role\x12\x14\n\x10ROLE_UNSPECIFIED\x10\x00\x12\x0e\n\nREAD_WRITE\x10\x01\x12\r\n\tREAD_ONLY\x10\x02\"p\n\x05Group\x12\x11\n\tgroup_uid\x18\x01 \x01(\x04\x12*\n\x07tablets\x18\x02 \x03(\x0b\x32\x19.google.spanner.v1.Tablet\x12\x14\n\x0cleader_index\x18\x03 \x01(\x05\x12\x12\n\ngeneration\x18\x04 \x01(\x0c\"\xd3\x04\n\tKeyRecipe\x12\x14\n\ntable_name\x18\x01 \x01(\tH\x00\x12\x14\n\nindex_name\x18\x02 \x01(\tH\x00\x12\x17\n\roperation_uid\x18\x03 \x01(\x04H\x00\x12/\n\x04part\x18\x04 \x03(\x0b\x32!.google.spanner.v1.KeyRecipe.Part\x1a\xc5\x03\n\x04Part\x12\x0b\n\x03tag\x18\x01 \x01(\r\x12\x36\n\x05order\x18\x02 \x01(\x0e\x32\'.google.spanner.v1.KeyRecipe.Part.Order\x12?\n\nnull_order\x18\x03 \x01(\x0e\x32+.google.spanner.v1.KeyRecipe.Part.NullOrder\x12%\n\x04type\x18\x04 \x01(\x0b\x32\x17.google.spanner.v1.Type\x12\x14\n\nidentifier\x18\x05 \x01(\tH\x00\x12\'\n\x05value\x18\x06 \x01(\x0b\x32\x16.google.protobuf.ValueH\x00\x12\x10\n\x06random\x18\x08 \x01(\x08H\x00\x12\x1a\n\x12struct_identifiers\x18\x07 \x03(\x05\"=\n\x05Order\x12\x15\n\x11ORDER_UNSPECIFIED\x10\x00\x12\r\n\tASCENDING\x10\x01\x12\x0e\n\nDESCENDING\x10\x02\"V\n\tNullOrder\x12\x1a\n\x16NULL_ORDER_UNSPECIFIED\x10\x00\x12\x0f\n\x0bNULLS_FIRST\x10\x01\x12\x0e\n\nNULLS_LAST\x10\x02\x12\x0c\n\x08NOT_NULL\x10\x03\x42\x0c\n\nvalue_typeB\x08\n\x06target\"U\n\nRecipeList\x12\x19\n\x11schema_generation\x18\x01 \x01(\x0c\x12,\n\x06recipe\x18\x03 \x03(\x0b\x32\x1c.google.spanner.v1.KeyRecipe\"\xa8\x01\n\x0b\x43\x61\x63heUpdate\x12\x13\n\x0b\x64\x61tabase_id\x18\x01 \x01(\x04\x12\'\n\x05range\x18\x02 \x03(\x0b\x32\x18.google.spanner.v1.Range\x12\'\n\x05group\x18\x03 \x03(\x0b\x32\x18.google.spanner.v1.Group\x12\x32\n\x0bkey_recipes\x18\x05 \x01(\x0b\x32\x1d.google.spanner.v1.RecipeList\"\xca\x02\n\x0bRoutingHint\x12\x15\n\roperation_uid\x18\x01 \x01(\x04\x12\x13\n\x0b\x64\x61tabase_id\x18\x02 \x01(\x04\x12\x19\n\x11schema_generation\x18\x03 \x01(\x0c\x12\x0b\n\x03key\x18\x04 \x01(\x0c\x12\x11\n\tlimit_key\x18\x05 \x01(\x0c\x12\x11\n\tgroup_uid\x18\x06 \x01(\x04\x12\x10\n\x08split_id\x18\x07 \x01(\x04\x12\x12\n\ntablet_uid\x18\x08 \x01(\x04\x12H\n\x12skipped_tablet_uid\x18\t \x03(\x0b\x32,.google.spanner.v1.RoutingHint.SkippedTablet\x12\x17\n\x0f\x63lient_location\x18\n \x01(\t\x1a\x38\n\rSkippedTablet\x12\x12\n\ntablet_uid\x18\x01 \x01(\x04\x12\x13\n\x0bincarnation\x18\x02 \x01(\x0c\x42\xb0\x01\n\x15\x63om.google.spanner.v1B\rLocationProtoP\x01Z5cloud.google.com/go/spanner/apiv1/spannerpb;spannerpb\xaa\x02\x17Google.Cloud.Spanner.V1\xca\x02\x17Google\\Cloud\\Spanner\\V1\xea\x02\x1aGoogle::Cloud::Spanner::V1b\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.spanner.v1.Type", "google/spanner/v1/type.proto"], + ["google.protobuf.Value", "google/protobuf/struct.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Cloud + module Spanner + module V1 + Range = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.Range").msgclass + Tablet = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.Tablet").msgclass + Tablet::Role = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.Tablet.Role").enummodule + Group = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.Group").msgclass + KeyRecipe = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.KeyRecipe").msgclass + KeyRecipe::Part = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.KeyRecipe.Part").msgclass + KeyRecipe::Part::Order = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.KeyRecipe.Part.Order").enummodule + KeyRecipe::Part::NullOrder = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.KeyRecipe.Part.NullOrder").enummodule + RecipeList = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.RecipeList").msgclass + CacheUpdate = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.CacheUpdate").msgclass + RoutingHint = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.RoutingHint").msgclass + RoutingHint::SkippedTablet = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.RoutingHint.SkippedTablet").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-spanner-v1/lib/google/spanner/v1/mutation_pb.rb b/owl-bot-staging/google-cloud-spanner-v1/lib/google/spanner/v1/mutation_pb.rb new file mode 100644 index 000000000000..49b325292161 --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-v1/lib/google/spanner/v1/mutation_pb.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/spanner/v1/mutation.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/protobuf/struct_pb' +require 'google/protobuf/timestamp_pb' +require 'google/spanner/v1/keys_pb' + + +descriptor_data = "\n google/spanner/v1/mutation.proto\x12\x11google.spanner.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x1cgoogle/protobuf/struct.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x1cgoogle/spanner/v1/keys.proto\"\xc0\x06\n\x08Mutation\x12\x33\n\x06insert\x18\x01 \x01(\x0b\x32!.google.spanner.v1.Mutation.WriteH\x00\x12\x33\n\x06update\x18\x02 \x01(\x0b\x32!.google.spanner.v1.Mutation.WriteH\x00\x12=\n\x10insert_or_update\x18\x03 \x01(\x0b\x32!.google.spanner.v1.Mutation.WriteH\x00\x12\x34\n\x07replace\x18\x04 \x01(\x0b\x32!.google.spanner.v1.Mutation.WriteH\x00\x12\x34\n\x06\x64\x65lete\x18\x05 \x01(\x0b\x32\".google.spanner.v1.Mutation.DeleteH\x00\x12\x30\n\x04send\x18\x06 \x01(\x0b\x32 .google.spanner.v1.Mutation.SendH\x00\x12.\n\x03\x61\x63k\x18\x07 \x01(\x0b\x32\x1f.google.spanner.v1.Mutation.AckH\x00\x1aX\n\x05Write\x12\x12\n\x05table\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x0f\n\x07\x63olumns\x18\x02 \x03(\t\x12*\n\x06values\x18\x03 \x03(\x0b\x32\x1a.google.protobuf.ListValue\x1aM\n\x06\x44\x65lete\x12\x12\n\x05table\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12/\n\x07key_set\x18\x02 \x01(\x0b\x32\x19.google.spanner.v1.KeySetB\x03\xe0\x41\x02\x1a\xa3\x01\n\x04Send\x12\x12\n\x05queue\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12,\n\x03key\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.ListValueB\x03\xe0\x41\x02\x12\x30\n\x0c\x64\x65liver_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\'\n\x07payload\x18\x04 \x01(\x0b\x32\x16.google.protobuf.Value\x1a\x61\n\x03\x41\x63k\x12\x12\n\x05queue\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12,\n\x03key\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.ListValueB\x03\xe0\x41\x02\x12\x18\n\x10ignore_not_found\x18\x03 \x01(\x08\x42\x0b\n\toperationB\xb0\x01\n\x15\x63om.google.spanner.v1B\rMutationProtoP\x01Z5cloud.google.com/go/spanner/apiv1/spannerpb;spannerpb\xaa\x02\x17Google.Cloud.Spanner.V1\xca\x02\x17Google\\Cloud\\Spanner\\V1\xea\x02\x1aGoogle::Cloud::Spanner::V1b\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.protobuf.ListValue", "google/protobuf/struct.proto"], + ["google.spanner.v1.KeySet", "google/spanner/v1/keys.proto"], + ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Cloud + module Spanner + module V1 + Mutation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.Mutation").msgclass + Mutation::Write = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.Mutation.Write").msgclass + Mutation::Delete = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.Mutation.Delete").msgclass + Mutation::Send = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.Mutation.Send").msgclass + Mutation::Ack = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.Mutation.Ack").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-spanner-v1/lib/google/spanner/v1/query_plan_pb.rb b/owl-bot-staging/google-cloud-spanner-v1/lib/google/spanner/v1/query_plan_pb.rb new file mode 100644 index 000000000000..f7da0f94ab59 --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-v1/lib/google/spanner/v1/query_plan_pb.rb @@ -0,0 +1,52 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/spanner/v1/query_plan.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/protobuf/struct_pb' + + +descriptor_data = "\n\"google/spanner/v1/query_plan.proto\x12\x11google.spanner.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x1cgoogle/protobuf/struct.proto\"\xf8\x04\n\x08PlanNode\x12\r\n\x05index\x18\x01 \x01(\x05\x12.\n\x04kind\x18\x02 \x01(\x0e\x32 .google.spanner.v1.PlanNode.Kind\x12\x14\n\x0c\x64isplay_name\x18\x03 \x01(\t\x12:\n\x0b\x63hild_links\x18\x04 \x03(\x0b\x32%.google.spanner.v1.PlanNode.ChildLink\x12M\n\x14short_representation\x18\x05 \x01(\x0b\x32/.google.spanner.v1.PlanNode.ShortRepresentation\x12)\n\x08metadata\x18\x06 \x01(\x0b\x32\x17.google.protobuf.Struct\x12\x30\n\x0f\x65xecution_stats\x18\x07 \x01(\x0b\x32\x17.google.protobuf.Struct\x1a@\n\tChildLink\x12\x13\n\x0b\x63hild_index\x18\x01 \x01(\x05\x12\x0c\n\x04type\x18\x02 \x01(\t\x12\x10\n\x08variable\x18\x03 \x01(\t\x1a\xb2\x01\n\x13ShortRepresentation\x12\x13\n\x0b\x64\x65scription\x18\x01 \x01(\t\x12S\n\nsubqueries\x18\x02 \x03(\x0b\x32?.google.spanner.v1.PlanNode.ShortRepresentation.SubqueriesEntry\x1a\x31\n\x0fSubqueriesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\x05:\x02\x38\x01\"8\n\x04Kind\x12\x14\n\x10KIND_UNSPECIFIED\x10\x00\x12\x0e\n\nRELATIONAL\x10\x01\x12\n\n\x06SCALAR\x10\x02\"\xa4\x01\n\x12QueryAdvisorResult\x12L\n\x0cindex_advice\x18\x01 \x03(\x0b\x32\x31.google.spanner.v1.QueryAdvisorResult.IndexAdviceB\x03\xe0\x41\x01\x1a@\n\x0bIndexAdvice\x12\x10\n\x03\x64\x64l\x18\x01 \x03(\tB\x03\xe0\x41\x01\x12\x1f\n\x12improvement_factor\x18\x02 \x01(\x01\x42\x03\xe0\x41\x01\"~\n\tQueryPlan\x12/\n\nplan_nodes\x18\x01 \x03(\x0b\x32\x1b.google.spanner.v1.PlanNode\x12@\n\x0cquery_advice\x18\x02 \x01(\x0b\x32%.google.spanner.v1.QueryAdvisorResultB\x03\xe0\x41\x01\x42\xb1\x01\n\x15\x63om.google.spanner.v1B\x0eQueryPlanProtoP\x01Z5cloud.google.com/go/spanner/apiv1/spannerpb;spannerpb\xaa\x02\x17Google.Cloud.Spanner.V1\xca\x02\x17Google\\Cloud\\Spanner\\V1\xea\x02\x1aGoogle::Cloud::Spanner::V1b\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.protobuf.Struct", "google/protobuf/struct.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Cloud + module Spanner + module V1 + PlanNode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.PlanNode").msgclass + PlanNode::ChildLink = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.PlanNode.ChildLink").msgclass + PlanNode::ShortRepresentation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.PlanNode.ShortRepresentation").msgclass + PlanNode::Kind = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.PlanNode.Kind").enummodule + QueryAdvisorResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.QueryAdvisorResult").msgclass + QueryAdvisorResult::IndexAdvice = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.QueryAdvisorResult.IndexAdvice").msgclass + QueryPlan = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.QueryPlan").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-spanner-v1/lib/google/spanner/v1/result_set_pb.rb b/owl-bot-staging/google-cloud-spanner-v1/lib/google/spanner/v1/result_set_pb.rb new file mode 100644 index 000000000000..dbd8ff5a6221 --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-v1/lib/google/spanner/v1/result_set_pb.rb @@ -0,0 +1,57 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/spanner/v1/result_set.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/protobuf/struct_pb' +require 'google/spanner/v1/location_pb' +require 'google/spanner/v1/query_plan_pb' +require 'google/spanner/v1/transaction_pb' +require 'google/spanner/v1/type_pb' + + +descriptor_data = "\n\"google/spanner/v1/result_set.proto\x12\x11google.spanner.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x1cgoogle/protobuf/struct.proto\x1a google/spanner/v1/location.proto\x1a\"google/spanner/v1/query_plan.proto\x1a#google/spanner/v1/transaction.proto\x1a\x1cgoogle/spanner/v1/type.proto\"\xad\x02\n\tResultSet\x12\x36\n\x08metadata\x18\x01 \x01(\x0b\x32$.google.spanner.v1.ResultSetMetadata\x12(\n\x04rows\x18\x02 \x03(\x0b\x32\x1a.google.protobuf.ListValue\x12\x30\n\x05stats\x18\x03 \x01(\x0b\x32!.google.spanner.v1.ResultSetStats\x12Q\n\x0fprecommit_token\x18\x05 \x01(\x0b\x32\x33.google.spanner.v1.MultiplexedSessionPrecommitTokenB\x03\xe0\x41\x01\x12\x39\n\x0c\x63\x61\x63he_update\x18\x06 \x01(\x0b\x32\x1e.google.spanner.v1.CacheUpdateB\x03\xe0\x41\x01\"\xf2\x02\n\x10PartialResultSet\x12\x36\n\x08metadata\x18\x01 \x01(\x0b\x32$.google.spanner.v1.ResultSetMetadata\x12&\n\x06values\x18\x02 \x03(\x0b\x32\x16.google.protobuf.Value\x12\x15\n\rchunked_value\x18\x03 \x01(\x08\x12\x14\n\x0cresume_token\x18\x04 \x01(\x0c\x12\x30\n\x05stats\x18\x05 \x01(\x0b\x32!.google.spanner.v1.ResultSetStats\x12Q\n\x0fprecommit_token\x18\x08 \x01(\x0b\x32\x33.google.spanner.v1.MultiplexedSessionPrecommitTokenB\x03\xe0\x41\x01\x12\x11\n\x04last\x18\t \x01(\x08\x42\x03\xe0\x41\x01\x12\x39\n\x0c\x63\x61\x63he_update\x18\n \x01(\x0b\x32\x1e.google.spanner.v1.CacheUpdateB\x03\xe0\x41\x01\"\xb7\x01\n\x11ResultSetMetadata\x12/\n\x08row_type\x18\x01 \x01(\x0b\x32\x1d.google.spanner.v1.StructType\x12\x33\n\x0btransaction\x18\x02 \x01(\x0b\x32\x1e.google.spanner.v1.Transaction\x12<\n\x15undeclared_parameters\x18\x03 \x01(\x0b\x32\x1d.google.spanner.v1.StructType\"\xb9\x01\n\x0eResultSetStats\x12\x30\n\nquery_plan\x18\x01 \x01(\x0b\x32\x1c.google.spanner.v1.QueryPlan\x12,\n\x0bquery_stats\x18\x02 \x01(\x0b\x32\x17.google.protobuf.Struct\x12\x19\n\x0frow_count_exact\x18\x03 \x01(\x03H\x00\x12\x1f\n\x15row_count_lower_bound\x18\x04 \x01(\x03H\x00\x42\x0b\n\trow_countB\xb1\x01\n\x15\x63om.google.spanner.v1B\x0eResultSetProtoP\x01Z5cloud.google.com/go/spanner/apiv1/spannerpb;spannerpb\xaa\x02\x17Google.Cloud.Spanner.V1\xca\x02\x17Google\\Cloud\\Spanner\\V1\xea\x02\x1aGoogle::Cloud::Spanner::V1b\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.protobuf.ListValue", "google/protobuf/struct.proto"], + ["google.spanner.v1.MultiplexedSessionPrecommitToken", "google/spanner/v1/transaction.proto"], + ["google.spanner.v1.CacheUpdate", "google/spanner/v1/location.proto"], + ["google.spanner.v1.StructType", "google/spanner/v1/type.proto"], + ["google.spanner.v1.QueryPlan", "google/spanner/v1/query_plan.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Cloud + module Spanner + module V1 + ResultSet = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.ResultSet").msgclass + PartialResultSet = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.PartialResultSet").msgclass + ResultSetMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.ResultSetMetadata").msgclass + ResultSetStats = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.ResultSetStats").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-spanner-v1/lib/google/spanner/v1/spanner_pb.rb b/owl-bot-staging/google-cloud-spanner-v1/lib/google/spanner/v1/spanner_pb.rb new file mode 100644 index 000000000000..106d38e306e9 --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-v1/lib/google/spanner/v1/spanner_pb.rb @@ -0,0 +1,104 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/spanner/v1/spanner.proto + +require 'google/protobuf' + +require 'google/spanner/v1/commit_response_pb' +require 'google/api/annotations_pb' +require 'google/api/client_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/protobuf/duration_pb' +require 'google/protobuf/empty_pb' +require 'google/protobuf/struct_pb' +require 'google/protobuf/timestamp_pb' +require 'google/rpc/status_pb' +require 'google/spanner/v1/keys_pb' +require 'google/spanner/v1/location_pb' +require 'google/spanner/v1/mutation_pb' +require 'google/spanner/v1/result_set_pb' +require 'google/spanner/v1/transaction_pb' +require 'google/spanner/v1/type_pb' + + +descriptor_data = "\n\x1fgoogle/spanner/v1/spanner.proto\x12\x11google.spanner.v1\x1a\'google/spanner/v1/commit_response.proto\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a\x1cgoogle/protobuf/struct.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x17google/rpc/status.proto\x1a\x1cgoogle/spanner/v1/keys.proto\x1a google/spanner/v1/location.proto\x1a google/spanner/v1/mutation.proto\x1a\"google/spanner/v1/result_set.proto\x1a#google/spanner/v1/transaction.proto\x1a\x1cgoogle/spanner/v1/type.proto\"\x83\x01\n\x14\x43reateSessionRequest\x12\x39\n\x08\x64\x61tabase\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1fspanner.googleapis.com/Database\x12\x30\n\x07session\x18\x02 \x01(\x0b\x32\x1a.google.spanner.v1.SessionB\x03\xe0\x41\x02\"\xa9\x01\n\x1a\x42\x61tchCreateSessionsRequest\x12\x39\n\x08\x64\x61tabase\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1fspanner.googleapis.com/Database\x12\x34\n\x10session_template\x18\x02 \x01(\x0b\x32\x1a.google.spanner.v1.Session\x12\x1a\n\rsession_count\x18\x03 \x01(\x05\x42\x03\xe0\x41\x02\"J\n\x1b\x42\x61tchCreateSessionsResponse\x12+\n\x07session\x18\x01 \x03(\x0b\x32\x1a.google.spanner.v1.Session\"\xb8\x03\n\x07Session\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x36\n\x06labels\x18\x02 \x03(\x0b\x32&.google.spanner.v1.Session.LabelsEntry\x12\x34\n\x0b\x63reate_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x42\n\x19\x61pproximate_last_use_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x14\n\x0c\x63reator_role\x18\x05 \x01(\t\x12\x18\n\x0bmultiplexed\x18\x06 \x01(\x08\x42\x03\xe0\x41\x01\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01:\x88\x01\xea\x41\x84\x01\n\x1espanner.googleapis.com/Session\x12Oprojects/{project}/instances/{instance}/databases/{database}/sessions/{session}*\x08sessions2\x07session\"I\n\x11GetSessionRequest\x12\x34\n\x04name\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1espanner.googleapis.com/Session\"\x87\x01\n\x13ListSessionsRequest\x12\x39\n\x08\x64\x61tabase\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1fspanner.googleapis.com/Database\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\x12\x0e\n\x06\x66ilter\x18\x04 \x01(\t\"]\n\x14ListSessionsResponse\x12,\n\x08sessions\x18\x01 \x03(\x0b\x32\x1a.google.spanner.v1.Session\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"L\n\x14\x44\x65leteSessionRequest\x12\x34\n\x04name\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1espanner.googleapis.com/Session\"\xeb\x03\n\x0eRequestOptions\x12<\n\x08priority\x18\x01 \x01(\x0e\x32*.google.spanner.v1.RequestOptions.Priority\x12\x13\n\x0brequest_tag\x18\x02 \x01(\t\x12\x17\n\x0ftransaction_tag\x18\x03 \x01(\t\x12L\n\x0e\x63lient_context\x18\x04 \x01(\x0b\x32/.google.spanner.v1.RequestOptions.ClientContextB\x03\xe0\x41\x01\x1a\xbe\x01\n\rClientContext\x12_\n\x0esecure_context\x18\x01 \x03(\x0b\x32\x42.google.spanner.v1.RequestOptions.ClientContext.SecureContextEntryB\x03\xe0\x41\x01\x1aL\n\x12SecureContextEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12%\n\x05value\x18\x02 \x01(\x0b\x32\x16.google.protobuf.Value:\x02\x38\x01\"^\n\x08Priority\x12\x18\n\x14PRIORITY_UNSPECIFIED\x10\x00\x12\x10\n\x0cPRIORITY_LOW\x10\x01\x12\x13\n\x0fPRIORITY_MEDIUM\x10\x02\x12\x11\n\rPRIORITY_HIGH\x10\x03\"\xea\x04\n\x13\x44irectedReadOptions\x12R\n\x10include_replicas\x18\x01 \x01(\x0b\x32\x36.google.spanner.v1.DirectedReadOptions.IncludeReplicasH\x00\x12R\n\x10\x65xclude_replicas\x18\x02 \x01(\x0b\x32\x36.google.spanner.v1.DirectedReadOptions.ExcludeReplicasH\x00\x1a\xad\x01\n\x10ReplicaSelection\x12\x10\n\x08location\x18\x01 \x01(\t\x12J\n\x04type\x18\x02 \x01(\x0e\x32<.google.spanner.v1.DirectedReadOptions.ReplicaSelection.Type\";\n\x04Type\x12\x14\n\x10TYPE_UNSPECIFIED\x10\x00\x12\x0e\n\nREAD_WRITE\x10\x01\x12\r\n\tREAD_ONLY\x10\x02\x1a\x86\x01\n\x0fIncludeReplicas\x12S\n\x12replica_selections\x18\x01 \x03(\x0b\x32\x37.google.spanner.v1.DirectedReadOptions.ReplicaSelection\x12\x1e\n\x16\x61uto_failover_disabled\x18\x02 \x01(\x08\x1a\x66\n\x0f\x45xcludeReplicas\x12S\n\x12replica_selections\x18\x01 \x03(\x0b\x32\x37.google.spanner.v1.DirectedReadOptions.ReplicaSelectionB\n\n\x08replicas\"\xc8\x07\n\x11\x45xecuteSqlRequest\x12\x37\n\x07session\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1espanner.googleapis.com/Session\x12;\n\x0btransaction\x18\x02 \x01(\x0b\x32&.google.spanner.v1.TransactionSelector\x12\x10\n\x03sql\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12\'\n\x06params\x18\x04 \x01(\x0b\x32\x17.google.protobuf.Struct\x12I\n\x0bparam_types\x18\x05 \x03(\x0b\x32\x34.google.spanner.v1.ExecuteSqlRequest.ParamTypesEntry\x12\x14\n\x0cresume_token\x18\x06 \x01(\x0c\x12\x42\n\nquery_mode\x18\x07 \x01(\x0e\x32..google.spanner.v1.ExecuteSqlRequest.QueryMode\x12\x17\n\x0fpartition_token\x18\x08 \x01(\x0c\x12\r\n\x05seqno\x18\t \x01(\x03\x12H\n\rquery_options\x18\n \x01(\x0b\x32\x31.google.spanner.v1.ExecuteSqlRequest.QueryOptions\x12:\n\x0frequest_options\x18\x0b \x01(\x0b\x32!.google.spanner.v1.RequestOptions\x12\x45\n\x15\x64irected_read_options\x18\x0f \x01(\x0b\x32&.google.spanner.v1.DirectedReadOptions\x12\x1a\n\x12\x64\x61ta_boost_enabled\x18\x10 \x01(\x08\x12\x1b\n\x0elast_statement\x18\x11 \x01(\x08\x42\x03\xe0\x41\x01\x12\x39\n\x0crouting_hint\x18\x12 \x01(\x0b\x32\x1e.google.spanner.v1.RoutingHintB\x03\xe0\x41\x01\x1aO\n\x0cQueryOptions\x12\x19\n\x11optimizer_version\x18\x01 \x01(\t\x12$\n\x1coptimizer_statistics_package\x18\x02 \x01(\t\x1aJ\n\x0fParamTypesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12&\n\x05value\x18\x02 \x01(\x0b\x32\x17.google.spanner.v1.Type:\x02\x38\x01\"W\n\tQueryMode\x12\n\n\x06NORMAL\x10\x00\x12\x08\n\x04PLAN\x10\x01\x12\x0b\n\x07PROFILE\x10\x02\x12\x0e\n\nWITH_STATS\x10\x03\x12\x17\n\x13WITH_PLAN_AND_STATS\x10\x04\"\xbe\x04\n\x16\x45xecuteBatchDmlRequest\x12\x37\n\x07session\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1espanner.googleapis.com/Session\x12@\n\x0btransaction\x18\x02 \x01(\x0b\x32&.google.spanner.v1.TransactionSelectorB\x03\xe0\x41\x02\x12L\n\nstatements\x18\x03 \x03(\x0b\x32\x33.google.spanner.v1.ExecuteBatchDmlRequest.StatementB\x03\xe0\x41\x02\x12\x12\n\x05seqno\x18\x04 \x01(\x03\x42\x03\xe0\x41\x02\x12:\n\x0frequest_options\x18\x05 \x01(\x0b\x32!.google.spanner.v1.RequestOptions\x12\x1c\n\x0flast_statements\x18\x06 \x01(\x08\x42\x03\xe0\x41\x01\x1a\xec\x01\n\tStatement\x12\x10\n\x03sql\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\'\n\x06params\x18\x02 \x01(\x0b\x32\x17.google.protobuf.Struct\x12X\n\x0bparam_types\x18\x03 \x03(\x0b\x32\x43.google.spanner.v1.ExecuteBatchDmlRequest.Statement.ParamTypesEntry\x1aJ\n\x0fParamTypesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12&\n\x05value\x18\x02 \x01(\x0b\x32\x17.google.spanner.v1.Type:\x02\x38\x01\"\xc3\x01\n\x17\x45xecuteBatchDmlResponse\x12\x31\n\x0bresult_sets\x18\x01 \x03(\x0b\x32\x1c.google.spanner.v1.ResultSet\x12\"\n\x06status\x18\x02 \x01(\x0b\x32\x12.google.rpc.Status\x12Q\n\x0fprecommit_token\x18\x03 \x01(\x0b\x32\x33.google.spanner.v1.MultiplexedSessionPrecommitTokenB\x03\xe0\x41\x01\"H\n\x10PartitionOptions\x12\x1c\n\x14partition_size_bytes\x18\x01 \x01(\x03\x12\x16\n\x0emax_partitions\x18\x02 \x01(\x03\"\xad\x03\n\x15PartitionQueryRequest\x12\x37\n\x07session\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1espanner.googleapis.com/Session\x12;\n\x0btransaction\x18\x02 \x01(\x0b\x32&.google.spanner.v1.TransactionSelector\x12\x10\n\x03sql\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12,\n\x06params\x18\x04 \x01(\x0b\x32\x17.google.protobuf.StructB\x03\xe0\x41\x01\x12R\n\x0bparam_types\x18\x05 \x03(\x0b\x32\x38.google.spanner.v1.PartitionQueryRequest.ParamTypesEntryB\x03\xe0\x41\x01\x12>\n\x11partition_options\x18\x06 \x01(\x0b\x32#.google.spanner.v1.PartitionOptions\x1aJ\n\x0fParamTypesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12&\n\x05value\x18\x02 \x01(\x0b\x32\x17.google.spanner.v1.Type:\x02\x38\x01\"\xb1\x02\n\x14PartitionReadRequest\x12\x37\n\x07session\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1espanner.googleapis.com/Session\x12;\n\x0btransaction\x18\x02 \x01(\x0b\x32&.google.spanner.v1.TransactionSelector\x12\x12\n\x05table\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12\r\n\x05index\x18\x04 \x01(\t\x12\x0f\n\x07\x63olumns\x18\x05 \x03(\t\x12/\n\x07key_set\x18\x06 \x01(\x0b\x32\x19.google.spanner.v1.KeySetB\x03\xe0\x41\x02\x12>\n\x11partition_options\x18\t \x01(\x0b\x32#.google.spanner.v1.PartitionOptions\"$\n\tPartition\x12\x17\n\x0fpartition_token\x18\x01 \x01(\x0c\"z\n\x11PartitionResponse\x12\x30\n\npartitions\x18\x01 \x03(\x0b\x32\x1c.google.spanner.v1.Partition\x12\x33\n\x0btransaction\x18\x02 \x01(\x0b\x32\x1e.google.spanner.v1.Transaction\"\xb1\x06\n\x0bReadRequest\x12\x37\n\x07session\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1espanner.googleapis.com/Session\x12;\n\x0btransaction\x18\x02 \x01(\x0b\x32&.google.spanner.v1.TransactionSelector\x12\x12\n\x05table\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12\r\n\x05index\x18\x04 \x01(\t\x12\x14\n\x07\x63olumns\x18\x05 \x03(\tB\x03\xe0\x41\x02\x12/\n\x07key_set\x18\x06 \x01(\x0b\x32\x19.google.spanner.v1.KeySetB\x03\xe0\x41\x02\x12\r\n\x05limit\x18\x08 \x01(\x03\x12\x14\n\x0cresume_token\x18\t \x01(\x0c\x12\x17\n\x0fpartition_token\x18\n \x01(\x0c\x12:\n\x0frequest_options\x18\x0b \x01(\x0b\x32!.google.spanner.v1.RequestOptions\x12\x45\n\x15\x64irected_read_options\x18\x0e \x01(\x0b\x32&.google.spanner.v1.DirectedReadOptions\x12\x1a\n\x12\x64\x61ta_boost_enabled\x18\x0f \x01(\x08\x12=\n\x08order_by\x18\x10 \x01(\x0e\x32&.google.spanner.v1.ReadRequest.OrderByB\x03\xe0\x41\x01\x12?\n\tlock_hint\x18\x11 \x01(\x0e\x32\'.google.spanner.v1.ReadRequest.LockHintB\x03\xe0\x41\x01\x12\x39\n\x0crouting_hint\x18\x12 \x01(\x0b\x32\x1e.google.spanner.v1.RoutingHintB\x03\xe0\x41\x01\"T\n\x07OrderBy\x12\x18\n\x14ORDER_BY_UNSPECIFIED\x10\x00\x12\x18\n\x14ORDER_BY_PRIMARY_KEY\x10\x01\x12\x15\n\x11ORDER_BY_NO_ORDER\x10\x02\"T\n\x08LockHint\x12\x19\n\x15LOCK_HINT_UNSPECIFIED\x10\x00\x12\x14\n\x10LOCK_HINT_SHARED\x10\x01\x12\x17\n\x13LOCK_HINT_EXCLUSIVE\x10\x02\"\x83\x02\n\x17\x42\x65ginTransactionRequest\x12\x37\n\x07session\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1espanner.googleapis.com/Session\x12;\n\x07options\x18\x02 \x01(\x0b\x32%.google.spanner.v1.TransactionOptionsB\x03\xe0\x41\x02\x12:\n\x0frequest_options\x18\x03 \x01(\x0b\x32!.google.spanner.v1.RequestOptions\x12\x36\n\x0cmutation_key\x18\x04 \x01(\x0b\x32\x1b.google.spanner.v1.MutationB\x03\xe0\x41\x01\"\xd0\x03\n\rCommitRequest\x12\x37\n\x07session\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1espanner.googleapis.com/Session\x12\x18\n\x0etransaction_id\x18\x02 \x01(\x0cH\x00\x12G\n\x16single_use_transaction\x18\x03 \x01(\x0b\x32%.google.spanner.v1.TransactionOptionsH\x00\x12.\n\tmutations\x18\x04 \x03(\x0b\x32\x1b.google.spanner.v1.Mutation\x12\x1b\n\x13return_commit_stats\x18\x05 \x01(\x08\x12\x38\n\x10max_commit_delay\x18\x08 \x01(\x0b\x32\x19.google.protobuf.DurationB\x03\xe0\x41\x01\x12:\n\x0frequest_options\x18\x06 \x01(\x0b\x32!.google.spanner.v1.RequestOptions\x12Q\n\x0fprecommit_token\x18\t \x01(\x0b\x32\x33.google.spanner.v1.MultiplexedSessionPrecommitTokenB\x03\xe0\x41\x01\x42\r\n\x0btransaction\"g\n\x0fRollbackRequest\x12\x37\n\x07session\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1espanner.googleapis.com/Session\x12\x1b\n\x0etransaction_id\x18\x02 \x01(\x0c\x42\x03\xe0\x41\x02\"\xce\x02\n\x11\x42\x61tchWriteRequest\x12\x37\n\x07session\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1espanner.googleapis.com/Session\x12:\n\x0frequest_options\x18\x03 \x01(\x0b\x32!.google.spanner.v1.RequestOptions\x12P\n\x0fmutation_groups\x18\x04 \x03(\x0b\x32\x32.google.spanner.v1.BatchWriteRequest.MutationGroupB\x03\xe0\x41\x02\x12,\n\x1f\x65xclude_txn_from_change_streams\x18\x05 \x01(\x08\x42\x03\xe0\x41\x01\x1a\x44\n\rMutationGroup\x12\x33\n\tmutations\x18\x01 \x03(\x0b\x32\x1b.google.spanner.v1.MutationB\x03\xe0\x41\x02\"\x7f\n\x12\x42\x61tchWriteResponse\x12\x0f\n\x07indexes\x18\x01 \x03(\x05\x12\"\n\x06status\x18\x02 \x01(\x0b\x32\x12.google.rpc.Status\x12\x34\n\x10\x63ommit_timestamp\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp2\x8b\x18\n\x07Spanner\x12\xa6\x01\n\rCreateSession\x12\'.google.spanner.v1.CreateSessionRequest\x1a\x1a.google.spanner.v1.Session\"P\xda\x41\x08\x64\x61tabase\x82\xd3\xe4\x93\x02?\":/v1/{database=projects/*/instances/*/databases/*}/sessions:\x01*\x12\xe0\x01\n\x13\x42\x61tchCreateSessions\x12-.google.spanner.v1.BatchCreateSessionsRequest\x1a..google.spanner.v1.BatchCreateSessionsResponse\"j\xda\x41\x16\x64\x61tabase,session_count\x82\xd3\xe4\x93\x02K\"F/v1/{database=projects/*/instances/*/databases/*}/sessions:batchCreate:\x01*\x12\x97\x01\n\nGetSession\x12$.google.spanner.v1.GetSessionRequest\x1a\x1a.google.spanner.v1.Session\"G\xda\x41\x04name\x82\xd3\xe4\x93\x02:\x12\x38/v1/{name=projects/*/instances/*/databases/*/sessions/*}\x12\xae\x01\n\x0cListSessions\x12&.google.spanner.v1.ListSessionsRequest\x1a\'.google.spanner.v1.ListSessionsResponse\"M\xda\x41\x08\x64\x61tabase\x82\xd3\xe4\x93\x02<\x12:/v1/{database=projects/*/instances/*/databases/*}/sessions\x12\x99\x01\n\rDeleteSession\x12\'.google.spanner.v1.DeleteSessionRequest\x1a\x16.google.protobuf.Empty\"G\xda\x41\x04name\x82\xd3\xe4\x93\x02:*8/v1/{name=projects/*/instances/*/databases/*/sessions/*}\x12\xa3\x01\n\nExecuteSql\x12$.google.spanner.v1.ExecuteSqlRequest\x1a\x1c.google.spanner.v1.ResultSet\"Q\x82\xd3\xe4\x93\x02K\"F/v1/{session=projects/*/instances/*/databases/*/sessions/*}:executeSql:\x01*\x12\xbe\x01\n\x13\x45xecuteStreamingSql\x12$.google.spanner.v1.ExecuteSqlRequest\x1a#.google.spanner.v1.PartialResultSet\"Z\x82\xd3\xe4\x93\x02T\"O/v1/{session=projects/*/instances/*/databases/*/sessions/*}:executeStreamingSql:\x01*0\x01\x12\xc0\x01\n\x0f\x45xecuteBatchDml\x12).google.spanner.v1.ExecuteBatchDmlRequest\x1a*.google.spanner.v1.ExecuteBatchDmlResponse\"V\x82\xd3\xe4\x93\x02P\"K/v1/{session=projects/*/instances/*/databases/*/sessions/*}:executeBatchDml:\x01*\x12\x91\x01\n\x04Read\x12\x1e.google.spanner.v1.ReadRequest\x1a\x1c.google.spanner.v1.ResultSet\"K\x82\xd3\xe4\x93\x02\x45\"@/v1/{session=projects/*/instances/*/databases/*/sessions/*}:read:\x01*\x12\xac\x01\n\rStreamingRead\x12\x1e.google.spanner.v1.ReadRequest\x1a#.google.spanner.v1.PartialResultSet\"T\x82\xd3\xe4\x93\x02N\"I/v1/{session=projects/*/instances/*/databases/*/sessions/*}:streamingRead:\x01*0\x01\x12\xc9\x01\n\x10\x42\x65ginTransaction\x12*.google.spanner.v1.BeginTransactionRequest\x1a\x1e.google.spanner.v1.Transaction\"i\xda\x41\x0fsession,options\x82\xd3\xe4\x93\x02Q\"L/v1/{session=projects/*/instances/*/databases/*/sessions/*}:beginTransaction:\x01*\x12\xeb\x01\n\x06\x43ommit\x12 .google.spanner.v1.CommitRequest\x1a!.google.spanner.v1.CommitResponse\"\x9b\x01\xda\x41 session,transaction_id,mutations\xda\x41(session,single_use_transaction,mutations\x82\xd3\xe4\x93\x02G\"B/v1/{session=projects/*/instances/*/databases/*/sessions/*}:commit:\x01*\x12\xb0\x01\n\x08Rollback\x12\".google.spanner.v1.RollbackRequest\x1a\x16.google.protobuf.Empty\"h\xda\x41\x16session,transaction_id\x82\xd3\xe4\x93\x02I\"D/v1/{session=projects/*/instances/*/databases/*/sessions/*}:rollback:\x01*\x12\xb7\x01\n\x0ePartitionQuery\x12(.google.spanner.v1.PartitionQueryRequest\x1a$.google.spanner.v1.PartitionResponse\"U\x82\xd3\xe4\x93\x02O\"J/v1/{session=projects/*/instances/*/databases/*/sessions/*}:partitionQuery:\x01*\x12\xb4\x01\n\rPartitionRead\x12\'.google.spanner.v1.PartitionReadRequest\x1a$.google.spanner.v1.PartitionResponse\"T\x82\xd3\xe4\x93\x02N\"I/v1/{session=projects/*/instances/*/databases/*/sessions/*}:partitionRead:\x01*\x12\xc8\x01\n\nBatchWrite\x12$.google.spanner.v1.BatchWriteRequest\x1a%.google.spanner.v1.BatchWriteResponse\"k\xda\x41\x17session,mutation_groups\x82\xd3\xe4\x93\x02K\"F/v1/{session=projects/*/instances/*/databases/*/sessions/*}:batchWrite:\x01*0\x01\x1aw\xca\x41\x16spanner.googleapis.com\xd2\x41[https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/spanner.dataB\x91\x02\n\x15\x63om.google.spanner.v1B\x0cSpannerProtoP\x01Z5cloud.google.com/go/spanner/apiv1/spannerpb;spannerpb\xaa\x02\x17Google.Cloud.Spanner.V1\xca\x02\x17Google\\Cloud\\Spanner\\V1\xea\x02\x1aGoogle::Cloud::Spanner::V1\xea\x41_\n\x1fspanner.googleapis.com/Database\x12\n\x0ftype_annotation\x18\x04 \x01(\x0e\x32%.google.spanner.v1.TypeAnnotationCode\x12\x16\n\x0eproto_type_fqn\x18\x05 \x01(\t\"\x7f\n\nStructType\x12\x33\n\x06\x66ields\x18\x01 \x03(\x0b\x32#.google.spanner.v1.StructType.Field\x1a<\n\x05\x46ield\x12\x0c\n\x04name\x18\x01 \x01(\t\x12%\n\x04type\x18\x02 \x01(\x0b\x32\x17.google.spanner.v1.Type*\xdf\x01\n\x08TypeCode\x12\x19\n\x15TYPE_CODE_UNSPECIFIED\x10\x00\x12\x08\n\x04\x42OOL\x10\x01\x12\t\n\x05INT64\x10\x02\x12\x0b\n\x07\x46LOAT64\x10\x03\x12\x0b\n\x07\x46LOAT32\x10\x0f\x12\r\n\tTIMESTAMP\x10\x04\x12\x08\n\x04\x44\x41TE\x10\x05\x12\n\n\x06STRING\x10\x06\x12\t\n\x05\x42YTES\x10\x07\x12\t\n\x05\x41RRAY\x10\x08\x12\n\n\x06STRUCT\x10\t\x12\x0b\n\x07NUMERIC\x10\n\x12\x08\n\x04JSON\x10\x0b\x12\t\n\x05PROTO\x10\r\x12\x08\n\x04\x45NUM\x10\x0e\x12\x0c\n\x08INTERVAL\x10\x10\x12\x08\n\x04UUID\x10\x11*d\n\x12TypeAnnotationCode\x12$\n TYPE_ANNOTATION_CODE_UNSPECIFIED\x10\x00\x12\x0e\n\nPG_NUMERIC\x10\x02\x12\x0c\n\x08PG_JSONB\x10\x03\x12\n\n\x06PG_OID\x10\x04\x42\xac\x01\n\x15\x63om.google.spanner.v1B\tTypeProtoP\x01Z5cloud.google.com/go/spanner/apiv1/spannerpb;spannerpb\xaa\x02\x17Google.Cloud.Spanner.V1\xca\x02\x17Google\\Cloud\\Spanner\\V1\xea\x02\x1aGoogle::Cloud::Spanner::V1b\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Cloud + module Spanner + module V1 + Type = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.Type").msgclass + StructType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.StructType").msgclass + StructType::Field = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.StructType.Field").msgclass + TypeCode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.TypeCode").enummodule + TypeAnnotationCode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.TypeAnnotationCode").enummodule + end + end + end +end diff --git a/owl-bot-staging/google-cloud-spanner-v1/proto_docs/README.md b/owl-bot-staging/google-cloud-spanner-v1/proto_docs/README.md new file mode 100644 index 000000000000..9e764966d911 --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-v1/proto_docs/README.md @@ -0,0 +1,4 @@ +# Cloud Spanner V1 Protocol Buffer Documentation + +These files are for the YARD documentation of the generated protobuf files. +They are not intended to be required or loaded at runtime. diff --git a/owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/api/client.rb b/owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..d59ba51a5612 --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/api/client.rb @@ -0,0 +1,473 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @deprecated This field is deprecated and may be removed in the next major version update. + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + # @!attribute [rw] selective_gapic_generation + # @return [::Google::Api::SelectiveGapicGeneration] + # Configuration for which RPCs should be generated in the GAPIC client. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. This is the full protobuf + # package for the API, ending in the version element. + # Examples: "google.cloud.speech.v1" and "google.spanner.admin.database.v1". + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a *public* URI where users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + # @!attribute [rw] proto_reference_documentation_uri + # @return [::String] + # Optional link to proto reference documentation. Example: + # https://cloud.google.com/pubsub/lite/docs/reference/rpc + # @!attribute [rw] rest_reference_documentation_uri + # @return [::String] + # Optional link to REST reference documentation. Example: + # https://cloud.google.com/pubsub/lite/docs/reference/rest + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + # @!attribute [rw] experimental_features + # @return [::Google::Api::PythonSettings::ExperimentalFeatures] + # Experimental features to be included during client library generation. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Experimental features to be included during client library generation. + # These fields will be deprecated once the feature graduates and is enabled + # by default. + # @!attribute [rw] rest_async_io_enabled + # @return [::Boolean] + # Enables generation of asynchronous REST clients if `rest` transport is + # enabled. By default, asynchronous REST clients will not be generated. + # This feature will be enabled by default 1 month after launching the + # feature in preview packages. + # @!attribute [rw] protobuf_pythonic_types_enabled + # @return [::Boolean] + # Enables generation of protobuf code using new types that are more + # Pythonic which are included in `protobuf>=5.29.x`. This feature will be + # enabled by default 1 month after launching the feature in preview + # packages. + # @!attribute [rw] unversioned_package_disabled + # @return [::Boolean] + # Disables generation of an unversioned Python package for this client + # library. This means that the module names will need to be versioned in + # import statements. For example `import google.cloud.library_v2` instead + # of `import google.cloud.library`. + class ExperimentalFeatures + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + # @!attribute [rw] renamed_services + # @return [::Google::Protobuf::Map{::String => ::String}] + # Map from original service names to renamed versions. + # This is used when the default generated types + # would cause a naming conflict. (Neither name is + # fully-qualified.) + # Example: Subscriber to SubscriberServiceApi. + # @!attribute [rw] renamed_resources + # @return [::Google::Protobuf::Map{::String => ::String}] + # Map from full resource types to the effective short name + # for the resource. This is used when otherwise resource + # named from different services would cause naming collisions. + # Example entry: + # "datalabeling.googleapis.com/Dataset": "DataLabelingDataset" + # @!attribute [rw] ignored_resources + # @return [::Array<::String>] + # List of full resource types to ignore during generation. + # This is typically used for API-specific Location resources, + # which should be handled by the generator as if they were actually + # the common Location resources. + # Example entry: "documentai.googleapis.com/Location" + # @!attribute [rw] forced_namespace_aliases + # @return [::Array<::String>] + # Namespaces which must be aliased in snippets due to + # a known (but non-generator-predictable) naming collision + # @!attribute [rw] handwritten_signatures + # @return [::Array<::String>] + # Method signatures (in the form "service.method(signature)") + # which are provided separately, so shouldn't be generated. + # Snippets *calling* these methods are still generated, however. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class RenamedServicesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class RenamedResourcesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + # @!attribute [rw] renamed_services + # @return [::Google::Protobuf::Map{::String => ::String}] + # Map of service names to renamed services. Keys are the package relative + # service names and values are the name to be used for the service client + # and call options. + # + # publishing: + # go_settings: + # renamed_services: + # Publisher: TopicAdmin + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class RenamedServicesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # + # Example: + # + # publishing: + # method_settings: + # - selector: google.storage.control.v2.StorageControl.CreateFolder + # # method settings for CreateFolder... + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_settings: + # - selector: google.cloud.speech.v2.Speech.BatchRecognize + # long_running: + # initial_poll_delay: 60s # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: 360s # 6 minutes + # total_poll_timeout: 54000s # 90 minutes + # @!attribute [rw] auto_populated_fields + # @return [::Array<::String>] + # List of top-level fields of the request message, that should be + # automatically populated by the client libraries based on their + # (google.api.field_info).format. Currently supported format: UUID4. + # + # Example of a YAML configuration: + # + # publishing: + # method_settings: + # - selector: google.example.v1.ExampleService.CreateExample + # auto_populated_fields: + # - request_id + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # This message is used to configure the generation of a subset of the RPCs in + # a service for client libraries. + # @!attribute [rw] methods + # @return [::Array<::String>] + # An allowlist of the fully qualified names of RPCs that should be included + # on public client surfaces. + # @!attribute [rw] generate_omitted_as_internal + # @return [::Boolean] + # Setting this to true indicates to the client generators that methods + # that would be excluded from the generation should instead be generated + # in a way that indicates these methods should not be consumed by + # end users. How this is expressed is up to individual language + # implementations to decide. Some examples may be: added annotations, + # obfuscated identifiers, or other language idiomatic patterns. + class SelectiveGapicGeneration + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + + # Shopping Org. + SHOPPING = 5 + + # Geo Org. + GEO = 6 + + # Generative AI - https://developers.generativeai.google + GENERATIVE_AI = 7 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + end +end diff --git a/owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/api/field_behavior.rb b/owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/api/field_behavior.rb new file mode 100644 index 000000000000..582be187d115 --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/api/field_behavior.rb @@ -0,0 +1,85 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # An indicator of the behavior of a given field (for example, that a field + # is required in requests, or given as output but ignored as input). + # This **does not** change the behavior in protocol buffers itself; it only + # denotes the behavior and may affect how API tooling handles the field. + # + # Note: This enum **may** receive new values in the future. + module FieldBehavior + # Conventional default for enums. Do not use this. + FIELD_BEHAVIOR_UNSPECIFIED = 0 + + # Specifically denotes a field as optional. + # While all fields in protocol buffers are optional, this may be specified + # for emphasis if appropriate. + OPTIONAL = 1 + + # Denotes a field as required. + # This indicates that the field **must** be provided as part of the request, + # and failure to do so will cause an error (usually `INVALID_ARGUMENT`). + REQUIRED = 2 + + # Denotes a field as output only. + # This indicates that the field is provided in responses, but including the + # field in a request does nothing (the server *must* ignore it and + # *must not* throw an error as a result of the field's presence). + OUTPUT_ONLY = 3 + + # Denotes a field as input only. + # This indicates that the field is provided in requests, and the + # corresponding field is not included in output. + INPUT_ONLY = 4 + + # Denotes a field as immutable. + # This indicates that the field may be set once in a request to create a + # resource, but may not be changed thereafter. + IMMUTABLE = 5 + + # Denotes that a (repeated) field is an unordered list. + # This indicates that the service may provide the elements of the list + # in any arbitrary order, rather than the order the user originally + # provided. Additionally, the list's order may or may not be stable. + UNORDERED_LIST = 6 + + # Denotes that this field returns a non-empty default value if not set. + # This indicates that if the user provides the empty value in a request, + # a non-empty value will be returned. The user will not be aware of what + # non-empty value to expect. + NON_EMPTY_DEFAULT = 7 + + # Denotes that the field in a resource (a message annotated with + # google.api.resource) is used in the resource name to uniquely identify the + # resource. For AIP-compliant APIs, this should only be applied to the + # `name` field on the resource. + # + # This behavior should not be applied to references to other resources within + # the message. + # + # The identifier field of resources often have different field behavior + # depending on the request it is embedded in (e.g. for Create methods name + # is optional and unused, while for Update methods it is required). Instead + # of method-specific annotations, only `IDENTIFIER` is required. + IDENTIFIER = 8 + end + end +end diff --git a/owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/api/launch_stage.rb b/owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..9392a413fb1b --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/api/launch_stage.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # The launch stage as defined by [Google Cloud Platform + # Launch Stages](https://cloud.google.com/terms/launch-stages). + module LaunchStage + # Do not use this default value. + LAUNCH_STAGE_UNSPECIFIED = 0 + + # The feature is not yet implemented. Users can not use it. + UNIMPLEMENTED = 6 + + # Prelaunch features are hidden from users and are only visible internally. + PRELAUNCH = 7 + + # Early Access features are limited to a closed group of testers. To use + # these features, you must sign up in advance and sign a Trusted Tester + # agreement (which includes confidentiality provisions). These features may + # be unstable, changed in backward-incompatible ways, and are not + # guaranteed to be released. + EARLY_ACCESS = 1 + + # Alpha is a limited availability test for releases before they are cleared + # for widespread use. By Alpha, all significant design issues are resolved + # and we are in the process of verifying functionality. Alpha customers + # need to apply for access, agree to applicable terms, and have their + # projects allowlisted. Alpha releases don't have to be feature complete, + # no SLAs are provided, and there are no technical support obligations, but + # they will be far enough along that customers can actually use them in + # test environments or for limited-use tests -- just like they would in + # normal production cases. + ALPHA = 2 + + # Beta is the point at which we are ready to open a release for any + # customer to use. There are no SLA or technical support obligations in a + # Beta release. Products will be complete from a feature perspective, but + # may have some open outstanding issues. Beta releases are suitable for + # limited production use cases. + BETA = 3 + + # GA features are open to all developers and are considered stable and + # fully qualified for production use. + GA = 4 + + # Deprecated features are scheduled to be shut down and removed. For more + # information, see the "Deprecation Policy" section of our [Terms of + # Service](https://cloud.google.com/terms/) + # and the [Google Cloud Platform Subject to the Deprecation + # Policy](https://cloud.google.com/terms/deprecation) documentation. + DEPRECATED = 5 + end + end +end diff --git a/owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/api/resource.rb b/owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/api/resource.rb new file mode 100644 index 000000000000..25dec4847ac1 --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/api/resource.rb @@ -0,0 +1,227 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # A simple descriptor of a resource type. + # + # ResourceDescriptor annotates a resource message (either by means of a + # protobuf annotation or use in the service config), and associates the + # resource's schema, the resource type, and the pattern of the resource name. + # + # Example: + # + # message Topic { + # // Indicates this message defines a resource schema. + # // Declares the resource type in the format of {service}/{kind}. + # // For Kubernetes resources, the format is {api group}/{kind}. + # option (google.api.resource) = { + # type: "pubsub.googleapis.com/Topic" + # pattern: "projects/{project}/topics/{topic}" + # }; + # } + # + # The ResourceDescriptor Yaml config will look like: + # + # resources: + # - type: "pubsub.googleapis.com/Topic" + # pattern: "projects/{project}/topics/{topic}" + # + # Sometimes, resources have multiple patterns, typically because they can + # live under multiple parents. + # + # Example: + # + # message LogEntry { + # option (google.api.resource) = { + # type: "logging.googleapis.com/LogEntry" + # pattern: "projects/{project}/logs/{log}" + # pattern: "folders/{folder}/logs/{log}" + # pattern: "organizations/{organization}/logs/{log}" + # pattern: "billingAccounts/{billing_account}/logs/{log}" + # }; + # } + # + # The ResourceDescriptor Yaml config will look like: + # + # resources: + # - type: 'logging.googleapis.com/LogEntry' + # pattern: "projects/{project}/logs/{log}" + # pattern: "folders/{folder}/logs/{log}" + # pattern: "organizations/{organization}/logs/{log}" + # pattern: "billingAccounts/{billing_account}/logs/{log}" + # @!attribute [rw] type + # @return [::String] + # The resource type. It must be in the format of + # \\{service_name}/\\{resource_type_kind}. The `resource_type_kind` must be + # singular and must not include version numbers. + # + # Example: `storage.googleapis.com/Bucket` + # + # The value of the resource_type_kind must follow the regular expression + # /[A-Za-z][a-zA-Z0-9]+/. It should start with an upper case character and + # should use PascalCase (UpperCamelCase). The maximum number of + # characters allowed for the `resource_type_kind` is 100. + # @!attribute [rw] pattern + # @return [::Array<::String>] + # Optional. The relative resource name pattern associated with this resource + # type. The DNS prefix of the full resource name shouldn't be specified here. + # + # The path pattern must follow the syntax, which aligns with HTTP binding + # syntax: + # + # Template = Segment { "/" Segment } ; + # Segment = LITERAL | Variable ; + # Variable = "{" LITERAL "}" ; + # + # Examples: + # + # - "projects/\\{project}/topics/\\{topic}" + # - "projects/\\{project}/knowledgeBases/\\{knowledge_base}" + # + # The components in braces correspond to the IDs for each resource in the + # hierarchy. It is expected that, if multiple patterns are provided, + # the same component name (e.g. "project") refers to IDs of the same + # type of resource. + # @!attribute [rw] name_field + # @return [::String] + # Optional. The field on the resource that designates the resource name + # field. If omitted, this is assumed to be "name". + # @!attribute [rw] history + # @return [::Google::Api::ResourceDescriptor::History] + # Optional. The historical or future-looking state of the resource pattern. + # + # Example: + # + # // The InspectTemplate message originally only supported resource + # // names with organization, and project was added later. + # message InspectTemplate { + # option (google.api.resource) = { + # type: "dlp.googleapis.com/InspectTemplate" + # pattern: + # "organizations/{organization}/inspectTemplates/{inspect_template}" + # pattern: "projects/{project}/inspectTemplates/{inspect_template}" + # history: ORIGINALLY_SINGLE_PATTERN + # }; + # } + # @!attribute [rw] plural + # @return [::String] + # The plural name used in the resource name and permission names, such as + # 'projects' for the resource name of 'projects/\\{project}' and the permission + # name of 'cloudresourcemanager.googleapis.com/projects.get'. One exception + # to this is for Nested Collections that have stuttering names, as defined + # in [AIP-122](https://google.aip.dev/122#nested-collections), where the + # collection ID in the resource name pattern does not necessarily directly + # match the `plural` value. + # + # It is the same concept of the `plural` field in k8s CRD spec + # https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/ + # + # Note: The plural form is required even for singleton resources. See + # https://aip.dev/156 + # @!attribute [rw] singular + # @return [::String] + # The same concept of the `singular` field in k8s CRD spec + # https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/ + # Such as "project" for the `resourcemanager.googleapis.com/Project` type. + # @!attribute [rw] style + # @return [::Array<::Google::Api::ResourceDescriptor::Style>] + # Style flag(s) for this resource. + # These indicate that a resource is expected to conform to a given + # style. See the specific style flags for additional information. + class ResourceDescriptor + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # A description of the historical or future-looking state of the + # resource pattern. + module History + # The "unset" value. + HISTORY_UNSPECIFIED = 0 + + # The resource originally had one pattern and launched as such, and + # additional patterns were added later. + ORIGINALLY_SINGLE_PATTERN = 1 + + # The resource has one pattern, but the API owner expects to add more + # later. (This is the inverse of ORIGINALLY_SINGLE_PATTERN, and prevents + # that from being necessary once there are multiple patterns.) + FUTURE_MULTI_PATTERN = 2 + end + + # A flag representing a specific style that a resource claims to conform to. + module Style + # The unspecified value. Do not use. + STYLE_UNSPECIFIED = 0 + + # This resource is intended to be "declarative-friendly". + # + # Declarative-friendly resources must be more strictly consistent, and + # setting this to true communicates to tools that this resource should + # adhere to declarative-friendly expectations. + # + # Note: This is used by the API linter (linter.aip.dev) to enable + # additional checks. + DECLARATIVE_FRIENDLY = 1 + end + end + + # Defines a proto annotation that describes a string field that refers to + # an API resource. + # @!attribute [rw] type + # @return [::String] + # The resource type that the annotated field references. + # + # Example: + # + # message Subscription { + # string topic = 2 [(google.api.resource_reference) = { + # type: "pubsub.googleapis.com/Topic" + # }]; + # } + # + # Occasionally, a field may reference an arbitrary resource. In this case, + # APIs use the special value * in their resource reference. + # + # Example: + # + # message GetIamPolicyRequest { + # string resource = 2 [(google.api.resource_reference) = { + # type: "*" + # }]; + # } + # @!attribute [rw] child_type + # @return [::String] + # The resource type of a child collection that the annotated field + # references. This is useful for annotating the `parent` field that + # doesn't have a fixed resource type. + # + # Example: + # + # message ListLogEntriesRequest { + # string parent = 1 [(google.api.resource_reference) = { + # child_type: "logging.googleapis.com/LogEntry" + # }; + # } + class ResourceReference + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/protobuf/any.rb b/owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/protobuf/any.rb new file mode 100644 index 000000000000..58691995f02e --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/protobuf/any.rb @@ -0,0 +1,145 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # `Any` contains an arbitrary serialized protocol buffer message along with a + # URL that describes the type of the serialized message. + # + # Protobuf library provides support to pack/unpack Any values in the form + # of utility functions or additional generated methods of the Any type. + # + # Example 1: Pack and unpack a message in C++. + # + # Foo foo = ...; + # Any any; + # any.PackFrom(foo); + # ... + # if (any.UnpackTo(&foo)) { + # ... + # } + # + # Example 2: Pack and unpack a message in Java. + # + # Foo foo = ...; + # Any any = Any.pack(foo); + # ... + # if (any.is(Foo.class)) { + # foo = any.unpack(Foo.class); + # } + # // or ... + # if (any.isSameTypeAs(Foo.getDefaultInstance())) { + # foo = any.unpack(Foo.getDefaultInstance()); + # } + # + # Example 3: Pack and unpack a message in Python. + # + # foo = Foo(...) + # any = Any() + # any.Pack(foo) + # ... + # if any.Is(Foo.DESCRIPTOR): + # any.Unpack(foo) + # ... + # + # Example 4: Pack and unpack a message in Go + # + # foo := &pb.Foo{...} + # any, err := anypb.New(foo) + # if err != nil { + # ... + # } + # ... + # foo := &pb.Foo{} + # if err := any.UnmarshalTo(foo); err != nil { + # ... + # } + # + # The pack methods provided by protobuf library will by default use + # 'type.googleapis.com/full.type.name' as the type URL and the unpack + # methods only use the fully qualified type name after the last '/' + # in the type URL, for example "foo.bar.com/x/y.z" will yield type + # name "y.z". + # + # JSON + # ==== + # The JSON representation of an `Any` value uses the regular + # representation of the deserialized, embedded message, with an + # additional field `@type` which contains the type URL. Example: + # + # package google.profile; + # message Person { + # string first_name = 1; + # string last_name = 2; + # } + # + # { + # "@type": "type.googleapis.com/google.profile.Person", + # "firstName": , + # "lastName": + # } + # + # If the embedded message type is well-known and has a custom JSON + # representation, that representation will be embedded adding a field + # `value` which holds the custom JSON in addition to the `@type` + # field. Example (for message [google.protobuf.Duration][]): + # + # { + # "@type": "type.googleapis.com/google.protobuf.Duration", + # "value": "1.212s" + # } + # @!attribute [rw] type_url + # @return [::String] + # A URL/resource name that uniquely identifies the type of the serialized + # protocol buffer message. This string must contain at least + # one "/" character. The last segment of the URL's path must represent + # the fully qualified name of the type (as in + # `path/google.protobuf.Duration`). The name should be in a canonical form + # (e.g., leading "." is not accepted). + # + # In practice, teams usually precompile into the binary all types that they + # expect it to use in the context of Any. However, for URLs which use the + # scheme `http`, `https`, or no scheme, one can optionally set up a type + # server that maps type URLs to message definitions as follows: + # + # * If no scheme is provided, `https` is assumed. + # * An HTTP GET on the URL must yield a [google.protobuf.Type][] + # value in binary format, or produce an error. + # * Applications are allowed to cache lookup results based on the + # URL, or have them precompiled into a binary to avoid any + # lookup. Therefore, binary compatibility needs to be preserved + # on changes to types. (Use versioned type names to manage + # breaking changes.) + # + # Note: this functionality is not currently available in the official + # protobuf release, and it is not used for type URLs beginning with + # type.googleapis.com. As of May 2023, there are no widely used type server + # implementations and no plans to implement one. + # + # Schemes other than `http`, `https` (or the empty scheme) might be + # used with implementation specific semantics. + # @!attribute [rw] value + # @return [::String] + # Must be a valid serialized protocol buffer of the above specified type. + class Any + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/protobuf/duration.rb b/owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/protobuf/duration.rb new file mode 100644 index 000000000000..ea59f1f91daf --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/protobuf/duration.rb @@ -0,0 +1,98 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # A Duration represents a signed, fixed-length span of time represented + # as a count of seconds and fractions of seconds at nanosecond + # resolution. It is independent of any calendar and concepts like "day" + # or "month". It is related to Timestamp in that the difference between + # two Timestamp values is a Duration and it can be added or subtracted + # from a Timestamp. Range is approximately +-10,000 years. + # + # # Examples + # + # Example 1: Compute Duration from two Timestamps in pseudo code. + # + # Timestamp start = ...; + # Timestamp end = ...; + # Duration duration = ...; + # + # duration.seconds = end.seconds - start.seconds; + # duration.nanos = end.nanos - start.nanos; + # + # if (duration.seconds < 0 && duration.nanos > 0) { + # duration.seconds += 1; + # duration.nanos -= 1000000000; + # } else if (duration.seconds > 0 && duration.nanos < 0) { + # duration.seconds -= 1; + # duration.nanos += 1000000000; + # } + # + # Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. + # + # Timestamp start = ...; + # Duration duration = ...; + # Timestamp end = ...; + # + # end.seconds = start.seconds + duration.seconds; + # end.nanos = start.nanos + duration.nanos; + # + # if (end.nanos < 0) { + # end.seconds -= 1; + # end.nanos += 1000000000; + # } else if (end.nanos >= 1000000000) { + # end.seconds += 1; + # end.nanos -= 1000000000; + # } + # + # Example 3: Compute Duration from datetime.timedelta in Python. + # + # td = datetime.timedelta(days=3, minutes=10) + # duration = Duration() + # duration.FromTimedelta(td) + # + # # JSON Mapping + # + # In JSON format, the Duration type is encoded as a string rather than an + # object, where the string ends in the suffix "s" (indicating seconds) and + # is preceded by the number of seconds, with nanoseconds expressed as + # fractional seconds. For example, 3 seconds with 0 nanoseconds should be + # encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should + # be expressed in JSON format as "3.000000001s", and 3 seconds and 1 + # microsecond should be expressed in JSON format as "3.000001s". + # @!attribute [rw] seconds + # @return [::Integer] + # Signed seconds of the span of time. Must be from -315,576,000,000 + # to +315,576,000,000 inclusive. Note: these bounds are computed from: + # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years + # @!attribute [rw] nanos + # @return [::Integer] + # Signed fractions of a second at nanosecond resolution of the span + # of time. Durations less than one second are represented with a 0 + # `seconds` field and a positive or negative `nanos` field. For durations + # of one second or more, a non-zero value for the `nanos` field must be + # of the same sign as the `seconds` field. Must be from -999,999,999 + # to +999,999,999 inclusive. + class Duration + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/protobuf/empty.rb b/owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/protobuf/empty.rb new file mode 100644 index 000000000000..83e4481834a6 --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/protobuf/empty.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # A generic empty message that you can re-use to avoid defining duplicated + # empty messages in your APIs. A typical example is to use it as the request + # or the response type of an API method. For instance: + # + # service Foo { + # rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); + # } + class Empty + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/protobuf/struct.rb b/owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/protobuf/struct.rb new file mode 100644 index 000000000000..39e1aca868d2 --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/protobuf/struct.rb @@ -0,0 +1,108 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # `Struct` represents a structured data value, consisting of fields + # which map to dynamically typed values. In some languages, `Struct` + # might be supported by a native representation. For example, in + # scripting languages like JS a struct is represented as an + # object. The details of that representation are described together + # with the proto support for the language. + # + # The JSON representation for `Struct` is JSON object. + # @!attribute [rw] fields + # @return [::Google::Protobuf::Map{::String => ::Google::Protobuf::Value}] + # Unordered map of dynamically typed values. + class Struct + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::Google::Protobuf::Value] + class FieldsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # `Value` represents a dynamically typed value which can be either + # null, a number, a string, a boolean, a recursive struct value, or a + # list of values. A producer of value is expected to set one of these + # variants. Absence of any variant indicates an error. + # + # The JSON representation for `Value` is JSON value. + # @!attribute [rw] null_value + # @return [::Google::Protobuf::NullValue] + # Represents a null value. + # + # Note: The following fields are mutually exclusive: `null_value`, `number_value`, `string_value`, `bool_value`, `struct_value`, `list_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] number_value + # @return [::Float] + # Represents a double value. + # + # Note: The following fields are mutually exclusive: `number_value`, `null_value`, `string_value`, `bool_value`, `struct_value`, `list_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] string_value + # @return [::String] + # Represents a string value. + # + # Note: The following fields are mutually exclusive: `string_value`, `null_value`, `number_value`, `bool_value`, `struct_value`, `list_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] bool_value + # @return [::Boolean] + # Represents a boolean value. + # + # Note: The following fields are mutually exclusive: `bool_value`, `null_value`, `number_value`, `string_value`, `struct_value`, `list_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] struct_value + # @return [::Google::Protobuf::Struct] + # Represents a structured value. + # + # Note: The following fields are mutually exclusive: `struct_value`, `null_value`, `number_value`, `string_value`, `bool_value`, `list_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] list_value + # @return [::Google::Protobuf::ListValue] + # Represents a repeated `Value`. + # + # Note: The following fields are mutually exclusive: `list_value`, `null_value`, `number_value`, `string_value`, `bool_value`, `struct_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. + class Value + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `ListValue` is a wrapper around a repeated field of values. + # + # The JSON representation for `ListValue` is JSON array. + # @!attribute [rw] values + # @return [::Array<::Google::Protobuf::Value>] + # Repeated field of dynamically typed values. + class ListValue + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `NullValue` is a singleton enumeration to represent the null value for the + # `Value` type union. + # + # The JSON representation for `NullValue` is JSON `null`. + module NullValue + # Null value. + NULL_VALUE = 0 + end + end +end diff --git a/owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/protobuf/timestamp.rb b/owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/protobuf/timestamp.rb new file mode 100644 index 000000000000..74352be9c58c --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/protobuf/timestamp.rb @@ -0,0 +1,127 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # A Timestamp represents a point in time independent of any time zone or local + # calendar, encoded as a count of seconds and fractions of seconds at + # nanosecond resolution. The count is relative to an epoch at UTC midnight on + # January 1, 1970, in the proleptic Gregorian calendar which extends the + # Gregorian calendar backwards to year one. + # + # All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + # second table is needed for interpretation, using a [24-hour linear + # smear](https://developers.google.com/time/smear). + # + # The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + # restricting to that range, we ensure that we can convert to and from [RFC + # 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. + # + # # Examples + # + # Example 1: Compute Timestamp from POSIX `time()`. + # + # Timestamp timestamp; + # timestamp.set_seconds(time(NULL)); + # timestamp.set_nanos(0); + # + # Example 2: Compute Timestamp from POSIX `gettimeofday()`. + # + # struct timeval tv; + # gettimeofday(&tv, NULL); + # + # Timestamp timestamp; + # timestamp.set_seconds(tv.tv_sec); + # timestamp.set_nanos(tv.tv_usec * 1000); + # + # Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + # + # FILETIME ft; + # GetSystemTimeAsFileTime(&ft); + # UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + # + # // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + # // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + # Timestamp timestamp; + # timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + # timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + # + # Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + # + # long millis = System.currentTimeMillis(); + # + # Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + # .setNanos((int) ((millis % 1000) * 1000000)).build(); + # + # Example 5: Compute Timestamp from Java `Instant.now()`. + # + # Instant now = Instant.now(); + # + # Timestamp timestamp = + # Timestamp.newBuilder().setSeconds(now.getEpochSecond()) + # .setNanos(now.getNano()).build(); + # + # Example 6: Compute Timestamp from current time in Python. + # + # timestamp = Timestamp() + # timestamp.GetCurrentTime() + # + # # JSON Mapping + # + # In JSON format, the Timestamp type is encoded as a string in the + # [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the + # format is "\\{year}-\\{month}-\\{day}T\\{hour}:\\{min}:\\{sec}[.\\{frac_sec}]Z" + # where \\{year} is always expressed using four digits while \\{month}, \\{day}, + # \\{hour}, \\{min}, and \\{sec} are zero-padded to two digits each. The fractional + # seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), + # are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone + # is required. A proto3 JSON serializer should always use UTC (as indicated by + # "Z") when printing the Timestamp type and a proto3 JSON parser should be + # able to accept both UTC and other timezones (as indicated by an offset). + # + # For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past + # 01:30 UTC on January 15, 2017. + # + # In JavaScript, one can convert a Date object to this format using the + # standard + # [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + # method. In Python, a standard `datetime.datetime` object can be converted + # to this format using + # [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with + # the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use + # the Joda Time's [`ISODateTimeFormat.dateTime()`]( + # http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() + # ) to obtain a formatter capable of generating timestamps in this format. + # @!attribute [rw] seconds + # @return [::Integer] + # Represents seconds of UTC time since Unix epoch + # 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to + # 9999-12-31T23:59:59Z inclusive. + # @!attribute [rw] nanos + # @return [::Integer] + # Non-negative fractions of a second at nanosecond resolution. Negative + # second values with fractions must still have non-negative nanos values + # that count forward in time. Must be from 0 to 999,999,999 + # inclusive. + class Timestamp + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/rpc/status.rb b/owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/rpc/status.rb new file mode 100644 index 000000000000..c1a1c07eb2db --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/rpc/status.rb @@ -0,0 +1,48 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Rpc + # The `Status` type defines a logical error model that is suitable for + # different programming environments, including REST APIs and RPC APIs. It is + # used by [gRPC](https://github.com/grpc). Each `Status` message contains + # three pieces of data: error code, error message, and error details. + # + # You can find out more about this error model and how to work with it in the + # [API Design Guide](https://cloud.google.com/apis/design/errors). + # @!attribute [rw] code + # @return [::Integer] + # The status code, which should be an enum value of + # [google.rpc.Code][google.rpc.Code]. + # @!attribute [rw] message + # @return [::String] + # A developer-facing error message, which should be in English. Any + # user-facing error message should be localized and sent in the + # {::Google::Rpc::Status#details google.rpc.Status.details} field, or localized + # by the client. + # @!attribute [rw] details + # @return [::Array<::Google::Protobuf::Any>] + # A list of messages that carry the error details. There is a common set of + # message types for APIs to use. + class Status + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/spanner/v1/change_stream.rb b/owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/spanner/v1/change_stream.rb new file mode 100644 index 000000000000..977e81d500bc --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/spanner/v1/change_stream.rb @@ -0,0 +1,488 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module Spanner + module V1 + # Spanner Change Streams enable customers to capture and stream out changes to + # their Spanner databases in real-time. A change stream + # can be created with option partition_mode='IMMUTABLE_KEY_RANGE' or + # partition_mode='MUTABLE_KEY_RANGE'. + # + # This message is only used in Change Streams created with the option + # partition_mode='MUTABLE_KEY_RANGE'. Spanner automatically creates a special + # Table-Valued Function (TVF) along with each Change Streams. The function + # provides access to the change stream's records. The function is named + # READ_ (where is the + # name of the change stream), and it returns a table with only one column + # called ChangeRecord. + # @!attribute [rw] data_change_record + # @return [::Google::Cloud::Spanner::V1::ChangeStreamRecord::DataChangeRecord] + # Data change record describing a data change for a change stream + # partition. + # + # Note: The following fields are mutually exclusive: `data_change_record`, `heartbeat_record`, `partition_start_record`, `partition_end_record`, `partition_event_record`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] heartbeat_record + # @return [::Google::Cloud::Spanner::V1::ChangeStreamRecord::HeartbeatRecord] + # Heartbeat record describing a heartbeat for a change stream partition. + # + # Note: The following fields are mutually exclusive: `heartbeat_record`, `data_change_record`, `partition_start_record`, `partition_end_record`, `partition_event_record`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] partition_start_record + # @return [::Google::Cloud::Spanner::V1::ChangeStreamRecord::PartitionStartRecord] + # Partition start record describing a new change stream partition. + # + # Note: The following fields are mutually exclusive: `partition_start_record`, `data_change_record`, `heartbeat_record`, `partition_end_record`, `partition_event_record`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] partition_end_record + # @return [::Google::Cloud::Spanner::V1::ChangeStreamRecord::PartitionEndRecord] + # Partition end record describing a terminated change stream partition. + # + # Note: The following fields are mutually exclusive: `partition_end_record`, `data_change_record`, `heartbeat_record`, `partition_start_record`, `partition_event_record`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] partition_event_record + # @return [::Google::Cloud::Spanner::V1::ChangeStreamRecord::PartitionEventRecord] + # Partition event record describing key range changes for a change stream + # partition. + # + # Note: The following fields are mutually exclusive: `partition_event_record`, `data_change_record`, `heartbeat_record`, `partition_start_record`, `partition_end_record`. If a field in that set is populated, all other fields in the set will automatically be cleared. + class ChangeStreamRecord + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # A data change record contains a set of changes to a table with the same + # modification type (insert, update, or delete) committed at the same commit + # timestamp in one change stream partition for the same transaction. Multiple + # data change records can be returned for the same transaction across + # multiple change stream partitions. + # @!attribute [rw] commit_timestamp + # @return [::Google::Protobuf::Timestamp] + # Indicates the timestamp in which the change was committed. + # DataChangeRecord.commit_timestamps, + # PartitionStartRecord.start_timestamps, + # PartitionEventRecord.commit_timestamps, and + # PartitionEndRecord.end_timestamps can have the same value in the same + # partition. + # @!attribute [rw] record_sequence + # @return [::String] + # Record sequence numbers are unique and monotonically increasing (but not + # necessarily contiguous) for a specific timestamp across record + # types in the same partition. To guarantee ordered processing, the reader + # should process records (of potentially different types) in + # record_sequence order for a specific timestamp in the same partition. + # + # The record sequence number ordering across partitions is only meaningful + # in the context of a specific transaction. Record sequence numbers are + # unique across partitions for a specific transaction. Sort the + # DataChangeRecords for the same + # {::Google::Cloud::Spanner::V1::ChangeStreamRecord::DataChangeRecord#server_transaction_id server_transaction_id} + # by + # {::Google::Cloud::Spanner::V1::ChangeStreamRecord::DataChangeRecord#record_sequence record_sequence} + # to reconstruct the ordering of the changes within the transaction. + # @!attribute [rw] server_transaction_id + # @return [::String] + # Provides a globally unique string that represents the transaction in + # which the change was committed. Multiple transactions can have the same + # commit timestamp, but each transaction has a unique + # server_transaction_id. + # @!attribute [rw] is_last_record_in_transaction_in_partition + # @return [::Boolean] + # Indicates whether this is the last record for a transaction in the + # current partition. Clients can use this field to determine when all + # records for a transaction in the current partition have been received. + # @!attribute [rw] table + # @return [::String] + # Name of the table affected by the change. + # @!attribute [rw] column_metadata + # @return [::Array<::Google::Cloud::Spanner::V1::ChangeStreamRecord::DataChangeRecord::ColumnMetadata>] + # Provides metadata describing the columns associated with the + # {::Google::Cloud::Spanner::V1::ChangeStreamRecord::DataChangeRecord#mods mods} listed + # below. + # @!attribute [rw] mods + # @return [::Array<::Google::Cloud::Spanner::V1::ChangeStreamRecord::DataChangeRecord::Mod>] + # Describes the changes that were made. + # @!attribute [rw] mod_type + # @return [::Google::Cloud::Spanner::V1::ChangeStreamRecord::DataChangeRecord::ModType] + # Describes the type of change. + # @!attribute [rw] value_capture_type + # @return [::Google::Cloud::Spanner::V1::ChangeStreamRecord::DataChangeRecord::ValueCaptureType] + # Describes the value capture type that was specified in the change stream + # configuration when this change was captured. + # @!attribute [rw] number_of_records_in_transaction + # @return [::Integer] + # Indicates the number of data change records that are part of this + # transaction across all change stream partitions. This value can be used + # to assemble all the records associated with a particular transaction. + # @!attribute [rw] number_of_partitions_in_transaction + # @return [::Integer] + # Indicates the number of partitions that return data change records for + # this transaction. This value can be helpful in assembling all records + # associated with a particular transaction. + # @!attribute [rw] transaction_tag + # @return [::String] + # Indicates the transaction tag associated with this transaction. + # @!attribute [rw] is_system_transaction + # @return [::Boolean] + # Indicates whether the transaction is a system transaction. System + # transactions include those issued by time-to-live (TTL), column backfill, + # etc. + class DataChangeRecord + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Metadata for a column. + # @!attribute [rw] name + # @return [::String] + # Name of the column. + # @!attribute [rw] type + # @return [::Google::Cloud::Spanner::V1::Type] + # Type of the column. + # @!attribute [rw] is_primary_key + # @return [::Boolean] + # Indicates whether the column is a primary key column. + # @!attribute [rw] ordinal_position + # @return [::Integer] + # Ordinal position of the column based on the original table definition + # in the schema starting with a value of 1. + class ColumnMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Returns the value and associated metadata for a particular field of the + # {::Google::Cloud::Spanner::V1::ChangeStreamRecord::DataChangeRecord::Mod Mod}. + # @!attribute [rw] column_metadata_index + # @return [::Integer] + # Index within the repeated + # {::Google::Cloud::Spanner::V1::ChangeStreamRecord::DataChangeRecord#column_metadata column_metadata} + # field, to obtain the column metadata for the column that was modified. + # @!attribute [rw] value + # @return [::Google::Protobuf::Value] + # The value of the column. + class ModValue + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A mod describes all data changes in a watched table row. + # @!attribute [rw] keys + # @return [::Array<::Google::Cloud::Spanner::V1::ChangeStreamRecord::DataChangeRecord::ModValue>] + # Returns the value of the primary key of the modified row. + # @!attribute [rw] old_values + # @return [::Array<::Google::Cloud::Spanner::V1::ChangeStreamRecord::DataChangeRecord::ModValue>] + # Returns the old values before the change for the modified columns. + # Always empty for + # {::Google::Cloud::Spanner::V1::ChangeStreamRecord::DataChangeRecord::ModType::INSERT INSERT}, + # or if old values are not being captured specified by + # {::Google::Cloud::Spanner::V1::ChangeStreamRecord::DataChangeRecord::ValueCaptureType value_capture_type}. + # @!attribute [rw] new_values + # @return [::Array<::Google::Cloud::Spanner::V1::ChangeStreamRecord::DataChangeRecord::ModValue>] + # Returns the new values after the change for the modified columns. + # Always empty for + # {::Google::Cloud::Spanner::V1::ChangeStreamRecord::DataChangeRecord::ModType::DELETE DELETE}. + class Mod + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Mod type describes the type of change Spanner applied to the data. For + # example, if the client submits an INSERT_OR_UPDATE request, Spanner will + # perform an insert if there is no existing row and return ModType INSERT. + # Alternatively, if there is an existing row, Spanner will perform an + # update and return ModType UPDATE. + module ModType + # Not specified. + MOD_TYPE_UNSPECIFIED = 0 + + # Indicates data was inserted. + INSERT = 10 + + # Indicates existing data was updated. + UPDATE = 20 + + # Indicates existing data was deleted. + DELETE = 30 + end + + # Value capture type describes which values are recorded in the data + # change record. + module ValueCaptureType + # Not specified. + VALUE_CAPTURE_TYPE_UNSPECIFIED = 0 + + # Records both old and new values of the modified watched columns. + OLD_AND_NEW_VALUES = 10 + + # Records only new values of the modified watched columns. + NEW_VALUES = 20 + + # Records new values of all watched columns, including modified and + # unmodified columns. + NEW_ROW = 30 + + # Records the new values of all watched columns, including modified and + # unmodified columns. Also records the old values of the modified + # columns. + NEW_ROW_AND_OLD_VALUES = 40 + end + end + + # A heartbeat record is returned as a progress indicator, when there are no + # data changes or any other partition record types in the change stream + # partition. + # @!attribute [rw] timestamp + # @return [::Google::Protobuf::Timestamp] + # Indicates the timestamp at which the query has returned all the records + # in the change stream partition with timestamp <= heartbeat timestamp. + # The heartbeat timestamp will not be the same as the timestamps of other + # record types in the same partition. + class HeartbeatRecord + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A partition start record serves as a notification that the client should + # schedule the partitions to be queried. PartitionStartRecord returns + # information about one or more partitions. + # @!attribute [rw] start_timestamp + # @return [::Google::Protobuf::Timestamp] + # Start timestamp at which the partitions should be queried to return + # change stream records with timestamps >= start_timestamp. + # DataChangeRecord.commit_timestamps, + # PartitionStartRecord.start_timestamps, + # PartitionEventRecord.commit_timestamps, and + # PartitionEndRecord.end_timestamps can have the same value in the same + # partition. + # @!attribute [rw] record_sequence + # @return [::String] + # Record sequence numbers are unique and monotonically increasing (but not + # necessarily contiguous) for a specific timestamp across record + # types in the same partition. To guarantee ordered processing, the reader + # should process records (of potentially different types) in + # record_sequence order for a specific timestamp in the same partition. + # @!attribute [rw] partition_tokens + # @return [::Array<::String>] + # Unique partition identifiers to be used in queries. + class PartitionStartRecord + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A partition end record serves as a notification that the client should stop + # reading the partition. No further records are expected to be retrieved on + # it. + # @!attribute [rw] end_timestamp + # @return [::Google::Protobuf::Timestamp] + # End timestamp at which the change stream partition is terminated. All + # changes generated by this partition will have timestamps <= + # end_timestamp. DataChangeRecord.commit_timestamps, + # PartitionStartRecord.start_timestamps, + # PartitionEventRecord.commit_timestamps, and + # PartitionEndRecord.end_timestamps can have the same value in the same + # partition. PartitionEndRecord is the last record returned for a + # partition. + # @!attribute [rw] record_sequence + # @return [::String] + # Record sequence numbers are unique and monotonically increasing (but not + # necessarily contiguous) for a specific timestamp across record + # types in the same partition. To guarantee ordered processing, the reader + # should process records (of potentially different types) in + # record_sequence order for a specific timestamp in the same partition. + # @!attribute [rw] partition_token + # @return [::String] + # Unique partition identifier describing the terminated change stream + # partition. + # {::Google::Cloud::Spanner::V1::ChangeStreamRecord::PartitionEndRecord#partition_token partition_token} + # is equal to the partition token of the change stream partition currently + # queried to return this PartitionEndRecord. + class PartitionEndRecord + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A partition event record describes key range changes for a change stream + # partition. The changes to a row defined by its primary key can be captured + # in one change stream partition for a specific time range, and then be + # captured in a different change stream partition for a different time range. + # This movement of key ranges across change stream partitions is a reflection + # of activities, such as Spanner's dynamic splitting and load balancing, etc. + # Processing this event is needed if users want to guarantee processing of + # the changes for any key in timestamp order. If time ordered processing of + # changes for a primary key is not needed, this event can be ignored. + # To guarantee time ordered processing for each primary key, if the event + # describes move-ins, the reader of this partition needs to wait until the + # readers of the source partitions have processed all records with timestamps + # <= this PartitionEventRecord.commit_timestamp, before advancing beyond this + # PartitionEventRecord. If the event describes move-outs, the reader can + # notify the readers of the destination partitions that they can continue + # processing. + # @!attribute [rw] commit_timestamp + # @return [::Google::Protobuf::Timestamp] + # Indicates the commit timestamp at which the key range change occurred. + # DataChangeRecord.commit_timestamps, + # PartitionStartRecord.start_timestamps, + # PartitionEventRecord.commit_timestamps, and + # PartitionEndRecord.end_timestamps can have the same value in the same + # partition. + # @!attribute [rw] record_sequence + # @return [::String] + # Record sequence numbers are unique and monotonically increasing (but not + # necessarily contiguous) for a specific timestamp across record + # types in the same partition. To guarantee ordered processing, the reader + # should process records (of potentially different types) in + # record_sequence order for a specific timestamp in the same partition. + # @!attribute [rw] partition_token + # @return [::String] + # Unique partition identifier describing the partition this event + # occurred on. + # {::Google::Cloud::Spanner::V1::ChangeStreamRecord::PartitionEventRecord#partition_token partition_token} + # is equal to the partition token of the change stream partition currently + # queried to return this PartitionEventRecord. + # @!attribute [rw] move_in_events + # @return [::Array<::Google::Cloud::Spanner::V1::ChangeStreamRecord::PartitionEventRecord::MoveInEvent>] + # Set when one or more key ranges are moved into the change stream + # partition identified by + # {::Google::Cloud::Spanner::V1::ChangeStreamRecord::PartitionEventRecord#partition_token partition_token}. + # + # Example: Two key ranges are moved into partition (P1) from partition (P2) + # and partition (P3) in a single transaction at timestamp T. + # + # The PartitionEventRecord returned in P1 will reflect the move as: + # + # PartitionEventRecord { + # commit_timestamp: T + # partition_token: "P1" + # move_in_events { + # source_partition_token: "P2" + # } + # move_in_events { + # source_partition_token: "P3" + # } + # } + # + # The PartitionEventRecord returned in P2 will reflect the move as: + # + # PartitionEventRecord { + # commit_timestamp: T + # partition_token: "P2" + # move_out_events { + # destination_partition_token: "P1" + # } + # } + # + # The PartitionEventRecord returned in P3 will reflect the move as: + # + # PartitionEventRecord { + # commit_timestamp: T + # partition_token: "P3" + # move_out_events { + # destination_partition_token: "P1" + # } + # } + # @!attribute [rw] move_out_events + # @return [::Array<::Google::Cloud::Spanner::V1::ChangeStreamRecord::PartitionEventRecord::MoveOutEvent>] + # Set when one or more key ranges are moved out of the change stream + # partition identified by + # {::Google::Cloud::Spanner::V1::ChangeStreamRecord::PartitionEventRecord#partition_token partition_token}. + # + # Example: Two key ranges are moved out of partition (P1) to partition (P2) + # and partition (P3) in a single transaction at timestamp T. + # + # The PartitionEventRecord returned in P1 will reflect the move as: + # + # PartitionEventRecord { + # commit_timestamp: T + # partition_token: "P1" + # move_out_events { + # destination_partition_token: "P2" + # } + # move_out_events { + # destination_partition_token: "P3" + # } + # } + # + # The PartitionEventRecord returned in P2 will reflect the move as: + # + # PartitionEventRecord { + # commit_timestamp: T + # partition_token: "P2" + # move_in_events { + # source_partition_token: "P1" + # } + # } + # + # The PartitionEventRecord returned in P3 will reflect the move as: + # + # PartitionEventRecord { + # commit_timestamp: T + # partition_token: "P3" + # move_in_events { + # source_partition_token: "P1" + # } + # } + class PartitionEventRecord + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes move-in of the key ranges into the change stream partition + # identified by + # {::Google::Cloud::Spanner::V1::ChangeStreamRecord::PartitionEventRecord#partition_token partition_token}. + # + # To maintain processing the changes for a particular key in timestamp + # order, the query processing the change stream partition identified by + # {::Google::Cloud::Spanner::V1::ChangeStreamRecord::PartitionEventRecord#partition_token partition_token} + # should not advance beyond the partition event record commit timestamp + # until the queries processing the source change stream partitions have + # processed all change stream records with timestamps <= the partition + # event record commit timestamp. + # @!attribute [rw] source_partition_token + # @return [::String] + # An unique partition identifier describing the source change stream + # partition that recorded changes for the key range that is moving + # into this partition. + class MoveInEvent + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes move-out of the key ranges out of the change stream partition + # identified by + # {::Google::Cloud::Spanner::V1::ChangeStreamRecord::PartitionEventRecord#partition_token partition_token}. + # + # To maintain processing the changes for a particular key in timestamp + # order, the query processing the + # {::Google::Cloud::Spanner::V1::ChangeStreamRecord::PartitionEventRecord::MoveOutEvent MoveOutEvent} + # in the partition identified by + # {::Google::Cloud::Spanner::V1::ChangeStreamRecord::PartitionEventRecord#partition_token partition_token} + # should inform the queries processing the destination partitions that + # they can unblock and proceed processing records past the + # {::Google::Cloud::Spanner::V1::ChangeStreamRecord::PartitionEventRecord#commit_timestamp commit_timestamp}. + # @!attribute [rw] destination_partition_token + # @return [::String] + # An unique partition identifier describing the destination change + # stream partition that will record changes for the key range that is + # moving out of this partition. + class MoveOutEvent + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/spanner/v1/commit_response.rb b/owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/spanner/v1/commit_response.rb new file mode 100644 index 000000000000..2ffe052a2cbc --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/spanner/v1/commit_response.rb @@ -0,0 +1,65 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module Spanner + module V1 + # The response for {::Google::Cloud::Spanner::V1::Spanner::Client#commit Commit}. + # @!attribute [rw] commit_timestamp + # @return [::Google::Protobuf::Timestamp] + # The Cloud Spanner timestamp at which the transaction committed. + # @!attribute [rw] commit_stats + # @return [::Google::Cloud::Spanner::V1::CommitResponse::CommitStats] + # The statistics about this `Commit`. Not returned by default. + # For more information, see + # {::Google::Cloud::Spanner::V1::CommitRequest#return_commit_stats CommitRequest.return_commit_stats}. + # @!attribute [rw] precommit_token + # @return [::Google::Cloud::Spanner::V1::MultiplexedSessionPrecommitToken] + # If specified, transaction has not committed yet. + # You must retry the commit with the new precommit token. + # @!attribute [rw] snapshot_timestamp + # @return [::Google::Protobuf::Timestamp] + # If `TransactionOptions.isolation_level` is set to + # `IsolationLevel.REPEATABLE_READ`, then the snapshot timestamp is the + # timestamp at which all reads in the transaction ran. This timestamp is + # never returned. + class CommitResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Additional statistics about a commit. + # @!attribute [rw] mutation_count + # @return [::Integer] + # The total number of mutations for the transaction. Knowing the + # `mutation_count` value can help you maximize the number of mutations + # in a transaction and minimize the number of API round trips. You can + # also monitor this value to prevent transactions from exceeding the system + # [limit](https://cloud.google.com/spanner/quotas#limits_for_creating_reading_updating_and_deleting_data). + # If the number of mutations exceeds the limit, the server returns + # [INVALID_ARGUMENT](https://cloud.google.com/spanner/docs/reference/rest/v1/Code#ENUM_VALUES.INVALID_ARGUMENT). + class CommitStats + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/spanner/v1/keys.rb b/owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/spanner/v1/keys.rb new file mode 100644 index 000000000000..5faebc2232ef --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/spanner/v1/keys.rb @@ -0,0 +1,170 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module Spanner + module V1 + # KeyRange represents a range of rows in a table or index. + # + # A range has a start key and an end key. These keys can be open or + # closed, indicating if the range includes rows with that key. + # + # Keys are represented by lists, where the ith value in the list + # corresponds to the ith component of the table or index primary key. + # Individual values are encoded as described + # {::Google::Cloud::Spanner::V1::TypeCode here}. + # + # For example, consider the following table definition: + # + # CREATE TABLE UserEvents ( + # UserName STRING(MAX), + # EventDate STRING(10) + # ) PRIMARY KEY(UserName, EventDate); + # + # The following keys name rows in this table: + # + # ["Bob", "2014-09-23"] + # ["Alfred", "2015-06-12"] + # + # Since the `UserEvents` table's `PRIMARY KEY` clause names two + # columns, each `UserEvents` key has two elements; the first is the + # `UserName`, and the second is the `EventDate`. + # + # Key ranges with multiple components are interpreted + # lexicographically by component using the table or index key's declared + # sort order. For example, the following range returns all events for + # user `"Bob"` that occurred in the year 2015: + # + # "start_closed": ["Bob", "2015-01-01"] + # "end_closed": ["Bob", "2015-12-31"] + # + # Start and end keys can omit trailing key components. This affects the + # inclusion and exclusion of rows that exactly match the provided key + # components: if the key is closed, then rows that exactly match the + # provided components are included; if the key is open, then rows + # that exactly match are not included. + # + # For example, the following range includes all events for `"Bob"` that + # occurred during and after the year 2000: + # + # "start_closed": ["Bob", "2000-01-01"] + # "end_closed": ["Bob"] + # + # The next example retrieves all events for `"Bob"`: + # + # "start_closed": ["Bob"] + # "end_closed": ["Bob"] + # + # To retrieve events before the year 2000: + # + # "start_closed": ["Bob"] + # "end_open": ["Bob", "2000-01-01"] + # + # The following range includes all rows in the table: + # + # "start_closed": [] + # "end_closed": [] + # + # This range returns all users whose `UserName` begins with any + # character from A to C: + # + # "start_closed": ["A"] + # "end_open": ["D"] + # + # This range returns all users whose `UserName` begins with B: + # + # "start_closed": ["B"] + # "end_open": ["C"] + # + # Key ranges honor column sort order. For example, suppose a table is + # defined as follows: + # + # CREATE TABLE DescendingSortedTable { + # Key INT64, + # ... + # ) PRIMARY KEY(Key DESC); + # + # The following range retrieves all rows with key values between 1 + # and 100 inclusive: + # + # "start_closed": ["100"] + # "end_closed": ["1"] + # + # Note that 100 is passed as the start, and 1 is passed as the end, + # because `Key` is a descending column in the schema. + # @!attribute [rw] start_closed + # @return [::Google::Protobuf::ListValue] + # If the start is closed, then the range includes all rows whose + # first `len(start_closed)` key columns exactly match `start_closed`. + # + # Note: The following fields are mutually exclusive: `start_closed`, `start_open`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] start_open + # @return [::Google::Protobuf::ListValue] + # If the start is open, then the range excludes rows whose first + # `len(start_open)` key columns exactly match `start_open`. + # + # Note: The following fields are mutually exclusive: `start_open`, `start_closed`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] end_closed + # @return [::Google::Protobuf::ListValue] + # If the end is closed, then the range includes all rows whose + # first `len(end_closed)` key columns exactly match `end_closed`. + # + # Note: The following fields are mutually exclusive: `end_closed`, `end_open`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] end_open + # @return [::Google::Protobuf::ListValue] + # If the end is open, then the range excludes rows whose first + # `len(end_open)` key columns exactly match `end_open`. + # + # Note: The following fields are mutually exclusive: `end_open`, `end_closed`. If a field in that set is populated, all other fields in the set will automatically be cleared. + class KeyRange + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `KeySet` defines a collection of Cloud Spanner keys and/or key ranges. All + # the keys are expected to be in the same table or index. The keys need + # not be sorted in any particular way. + # + # If the same key is specified multiple times in the set (for example + # if two ranges, two keys, or a key and a range overlap), Cloud Spanner + # behaves as if the key were only specified once. + # @!attribute [rw] keys + # @return [::Array<::Google::Protobuf::ListValue>] + # A list of specific keys. Entries in `keys` should have exactly as + # many elements as there are columns in the primary or index key + # with which this `KeySet` is used. Individual key values are + # encoded as described {::Google::Cloud::Spanner::V1::TypeCode here}. + # @!attribute [rw] ranges + # @return [::Array<::Google::Cloud::Spanner::V1::KeyRange>] + # A list of key ranges. See {::Google::Cloud::Spanner::V1::KeyRange KeyRange} for more + # information about key range specifications. + # @!attribute [rw] all + # @return [::Boolean] + # For convenience `all` can be set to `true` to indicate that this + # `KeySet` matches all keys in the table or index. Note that any keys + # specified in `keys` or `ranges` are only yielded once. + class KeySet + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/spanner/v1/location.rb b/owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/spanner/v1/location.rb new file mode 100644 index 000000000000..d79971bad844 --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/spanner/v1/location.rb @@ -0,0 +1,417 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module Spanner + module V1 + # A `Range` represents a range of keys in a database. The keys themselves + # are encoded in "sortable string format", also known as ssformat. Consult + # Spanner's open source client libraries for details on the encoding. + # + # Each range represents a contiguous range of rows, possibly from multiple + # tables/indexes. Each range is associated with a single paxos group (known as + # a "group" throughout this API), a split (which names the exact range within + # the group), and a generation that can be used to determine whether a given + # `Range` represents a newer or older location for the key range. + # @!attribute [rw] start_key + # @return [::String] + # The start key of the range, inclusive. Encoded in "sortable string format" + # (ssformat). + # @!attribute [rw] limit_key + # @return [::String] + # The limit key of the range, exclusive. Encoded in "sortable string format" + # (ssformat). + # @!attribute [rw] group_uid + # @return [::Integer] + # The UID of the paxos group where this range is stored. UIDs are unique + # within the database. References `Group.group_uid`. + # @!attribute [rw] split_id + # @return [::Integer] + # A group can store multiple ranges of keys. Each key range is named by an + # ID (the split ID). Within a group, split IDs are unique. The `split_id` + # names the exact split in `group_uid` where this range is stored. + # @!attribute [rw] generation + # @return [::String] + # `generation` indicates the freshness of the range information contained + # in this proto. Generations can be compared lexicographically; if generation + # A is greater than generation B, then the `Range` corresponding to A is + # newer than the `Range` corresponding to B, and should be used + # preferentially. + class Range + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A `Tablet` represents a single replica of a `Group`. A tablet is served by a + # single server at a time, and can move between servers due to server death or + # simply load balancing. + # @!attribute [rw] tablet_uid + # @return [::Integer] + # The UID of the tablet, unique within the database. Matches the + # `tablet_uids` and `leader_tablet_uid` fields in `Group`. + # @!attribute [rw] server_address + # @return [::String] + # The address of the server that is serving this tablet -- either an IP + # address or DNS hostname and a port number. + # @!attribute [rw] location + # @return [::String] + # Where this tablet is located. This is the name of a Google Cloud region, + # such as "us-central1". + # @!attribute [rw] role + # @return [::Google::Cloud::Spanner::V1::Tablet::Role] + # The role of the tablet. + # @!attribute [rw] incarnation + # @return [::String] + # `incarnation` indicates the freshness of the tablet information contained + # in this proto. Incarnations can be compared lexicographically; if + # incarnation A is greater than incarnation B, then the `Tablet` + # corresponding to A is newer than the `Tablet` corresponding to B, and + # should be used preferentially. + # @!attribute [rw] distance + # @return [::Integer] + # Distances help the client pick the closest tablet out of the list of + # tablets for a given request. Tablets with lower distances should generally + # be preferred. Tablets with the same distance are approximately equally + # close; the client can choose arbitrarily. + # + # Distances do not correspond precisely to expected latency, geographical + # distance, or anything else. Distances should be compared only between + # tablets of the same group; they are not meaningful between different + # groups. + # + # A value of zero indicates that the tablet may be in the same zone as + # the client, and have minimum network latency. A value less than or equal to + # five indicates that the tablet is thought to be in the same region as the + # client, and may have a few milliseconds of network latency. Values greater + # than five are most likely in a different region, with non-trivial network + # latency. + # + # Clients should use the following algorithm: + # * If the request is using a directed read, eliminate any tablets that + # do not match the directed read's target zone and/or replica type. + # * (Read-write transactions only) Choose leader tablet if it has an + # distance <=5. + # * Group and sort tablets by distance. Choose a random + # tablet with the lowest distance. If the request + # is not a directed read, only consider replicas with distances <=5. + # * Send the request to the fallback endpoint. + # + # The tablet picked by this algorithm may be skipped, either because it is + # marked as `skip` by the server or because the corresponding server is + # unreachable, flow controlled, etc. Skipped tablets should be added to the + # `skipped_tablet_uid` field in `RoutingHint`; the algorithm above should + # then be re-run without including the skipped tablet(s) to pick the next + # best tablet. + # @!attribute [rw] skip + # @return [::Boolean] + # If true, the tablet should not be chosen by the client. Typically, this + # signals that the tablet is unhealthy in some way. Tablets with `skip` + # set to true should be reported back to the server in + # `RoutingHint.skipped_tablet_uid`; this cues the server to send updated + # information for this tablet should it become usable again. + class Tablet + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Indicates the role of the tablet. + module Role + # Not specified. + ROLE_UNSPECIFIED = 0 + + # The tablet can perform reads and (if elected leader) writes. + READ_WRITE = 1 + + # The tablet can only perform reads. + READ_ONLY = 2 + end + end + + # A `Group` represents a paxos group in a database. A group is a set of + # tablets that are replicated across multiple servers. Groups may have a leader + # tablet. Groups store one (or sometimes more) ranges of keys. + # @!attribute [rw] group_uid + # @return [::Integer] + # The UID of the paxos group, unique within the database. Matches the + # `group_uid` field in `Range`. + # @!attribute [rw] tablets + # @return [::Array<::Google::Cloud::Spanner::V1::Tablet>] + # A list of tablets that are part of the group. Note that this list may not + # be exhaustive; it will only include tablets the server considers useful + # to the client. The returned list is ordered ascending by distance. + # + # Tablet UIDs reference `Tablet.tablet_uid`. + # @!attribute [rw] leader_index + # @return [::Integer] + # The last known leader tablet of the group as an index into `tablets`. May + # be negative if the group has no known leader. + # @!attribute [rw] generation + # @return [::String] + # `generation` indicates the freshness of the group information (including + # leader information) contained in this proto. Generations can be compared + # lexicographically; if generation A is greater than generation B, then the + # `Group` corresponding to A is newer than the `Group` corresponding to B, + # and should be used preferentially. + class Group + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A `KeyRecipe` provides the metadata required to translate reads, mutations, + # and queries into a byte array in "sortable string format" (ssformat)that can + # be used with `Range`s to route requests. Note that the client *must* tolerate + # `KeyRecipe`s that appear to be invalid, since the `KeyRecipe` format may + # change over time. Requests with invalid `KeyRecipe`s should be routed to a + # default server. + # @!attribute [rw] table_name + # @return [::String] + # A table name, matching the name from the database schema. + # + # Note: The following fields are mutually exclusive: `table_name`, `index_name`, `operation_uid`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] index_name + # @return [::String] + # An index name, matching the name from the database schema. + # + # Note: The following fields are mutually exclusive: `index_name`, `table_name`, `operation_uid`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] operation_uid + # @return [::Integer] + # The UID of a query, matching the UID from `RoutingHint`. + # + # Note: The following fields are mutually exclusive: `operation_uid`, `table_name`, `index_name`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] part + # @return [::Array<::Google::Cloud::Spanner::V1::KeyRecipe::Part>] + # Parts are in the order they should appear in the encoded key. + class KeyRecipe + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # An ssformat key is composed of a sequence of tag numbers and key column + # values. `Part` represents a single tag or key column value. + # @!attribute [rw] tag + # @return [::Integer] + # If non-zero, `tag` is the only field present in this `Part`. The part + # is encoded by appending `tag` to the ssformat key. + # @!attribute [rw] order + # @return [::Google::Cloud::Spanner::V1::KeyRecipe::Part::Order] + # Whether the key column is sorted ascending or descending. Only present + # if `tag` is zero. + # @!attribute [rw] null_order + # @return [::Google::Cloud::Spanner::V1::KeyRecipe::Part::NullOrder] + # How NULLs are represented in the encoded key part. Only present if `tag` + # is zero. + # @!attribute [rw] type + # @return [::Google::Cloud::Spanner::V1::Type] + # The type of the key part. Only present if `tag` is zero. + # @!attribute [rw] identifier + # @return [::String] + # `identifier` is the name of the column or query parameter. + # + # Note: The following fields are mutually exclusive: `identifier`, `value`, `random`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] value + # @return [::Google::Protobuf::Value] + # The constant value of the key part. + # It is present when query uses a constant as a part of the key. + # + # Note: The following fields are mutually exclusive: `value`, `identifier`, `random`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] random + # @return [::Boolean] + # If true, the client is responsible to fill in the value randomly. + # It's relevant only for the INT64 type. + # + # Note: The following fields are mutually exclusive: `random`, `identifier`, `value`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] struct_identifiers + # @return [::Array<::Integer>] + # It is a repeated field to support fetching key columns from nested + # structs, such as `STRUCT` query parameters. + class Part + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The remaining fields encode column values. + module Order + # Default value, equivalent to `ASCENDING`. + ORDER_UNSPECIFIED = 0 + + # The key is ascending - corresponds to `ASC` in the schema definition. + ASCENDING = 1 + + # The key is descending - corresponds to `DESC` in the schema definition. + DESCENDING = 2 + end + + # The null order of the key column. This dictates where NULL values sort + # in the sorted order. Note that columns which are `NOT NULL` can have a + # special encoding. + module NullOrder + # Default value. This value is unused. + NULL_ORDER_UNSPECIFIED = 0 + + # NULL values sort before any non-NULL values. + NULLS_FIRST = 1 + + # NULL values sort after any non-NULL values. + NULLS_LAST = 2 + + # The column does not support NULL values. + NOT_NULL = 3 + end + end + end + + # A `RecipeList` contains a list of `KeyRecipe`s, which share the same + # schema generation. + # @!attribute [rw] schema_generation + # @return [::String] + # The schema generation of the recipes. To be sent to the server in + # `RoutingHint.schema_generation` whenever one of the recipes is used. + # `schema_generation` values are comparable with each other; if generation A + # compares greater than generation B, then A is a more recent schema than B. + # Clients should in general aim to cache only the latest schema generation, + # and discard more stale recipes. + # @!attribute [rw] recipe + # @return [::Array<::Google::Cloud::Spanner::V1::KeyRecipe>] + # A list of recipes to be cached. + class RecipeList + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A `CacheUpdate` expresses a set of changes the client should incorporate into + # its location cache. These changes may or may not be newer than what the + # client has in its cache, and should be discarded if necessary. `CacheUpdate`s + # can be obtained in response to requests that included a `RoutingHint` + # field, but may also be obtained by explicit location-fetching RPCs which may + # be added in the future. + # @!attribute [rw] database_id + # @return [::Integer] + # An internal ID for the database. Database names can be reused if a database + # is deleted and re-created. Each time the database is re-created, it will + # get a new database ID, which will never be re-used for any other database. + # @!attribute [rw] range + # @return [::Array<::Google::Cloud::Spanner::V1::Range>] + # A list of ranges to be cached. + # @!attribute [rw] group + # @return [::Array<::Google::Cloud::Spanner::V1::Group>] + # A list of groups to be cached. + # @!attribute [rw] key_recipes + # @return [::Google::Cloud::Spanner::V1::RecipeList] + # A list of recipes to be cached. + class CacheUpdate + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `RoutingHint` can be optionally added to location-aware Spanner + # requests. It gives the server hints that can be used to route the request to + # an appropriate server, potentially significantly decreasing latency and + # improving throughput. To achieve improved performance, most fields must be + # filled in with accurate values. + # + # The presence of a valid `RoutingHint` tells the server that the client + # is location-aware. + # + # `RoutingHint` does not change the semantics of the request; it is + # purely a performance hint; the request will perform the same actions on the + # database's data as if `RoutingHint` were not present. However, if + # the `RoutingHint` is incomplete or incorrect, the response may include + # a `CacheUpdate` the client can use to correct its location cache. + # @!attribute [rw] operation_uid + # @return [::Integer] + # A session-scoped unique ID for the operation, computed client-side. + # Requests with the same `operation_uid` should have a shared 'shape', + # meaning that some fields are expected to be the same, such as the SQL + # query, the target table/columns (for reads) etc. Requests with the same + # `operation_uid` are meant to differ only in fields like keys/key + # ranges/query parameters, transaction IDs, etc. + # + # `operation_uid` must be non-zero for `RoutingHint` to be valid. + # @!attribute [rw] database_id + # @return [::Integer] + # The database ID of the database being accessed, see + # `CacheUpdate.database_id`. Should match the cache entries that were used + # to generate the rest of the fields in this `RoutingHint`. + # @!attribute [rw] schema_generation + # @return [::String] + # The schema generation of the recipe that was used to generate `key` and + # `limit_key`. See also `RecipeList.schema_generation`. + # @!attribute [rw] key + # @return [::String] + # The key / key range that this request accesses. For operations that + # access a single key, `key` should be set and `limit_key` should be empty. + # For operations that access a key range, `key` and `limit_key` should both + # be set, to the inclusive start and exclusive end of the range respectively. + # + # The keys are encoded in "sortable string format" (ssformat), using a + # `KeyRecipe` that is appropriate for the request. See `KeyRecipe` for more + # details. + # @!attribute [rw] limit_key + # @return [::String] + # If this request targets a key range, this is the exclusive end of the + # range. See `key` for more details. + # @!attribute [rw] group_uid + # @return [::Integer] + # The group UID of the group that the client believes serves the range + # defined by `key` and `limit_key`. See `Range.group_uid` for more details. + # @!attribute [rw] split_id + # @return [::Integer] + # The split ID of the split that the client believes contains the range + # defined by `key` and `limit_key`. See `Range.split_id` for more details. + # @!attribute [rw] tablet_uid + # @return [::Integer] + # The tablet UID of the tablet from group `group_uid` that the client + # believes is best to serve this request. See `Group.local_tablet_uids` and + # `Group.leader_tablet_uid`. + # @!attribute [rw] skipped_tablet_uid + # @return [::Array<::Google::Cloud::Spanner::V1::RoutingHint::SkippedTablet>] + # If the client had multiple options for tablet selection, and some of its + # first choices were unhealthy (e.g., the server is unreachable, or + # `Tablet.skip` is true), this field will contain the tablet UIDs of those + # tablets, with their incarnations. The server may include a `CacheUpdate` + # with new locations for those tablets. + # @!attribute [rw] client_location + # @return [::String] + # If present, the client's current location. This should be the name of a + # Google Cloud zone or region, such as "us-central1". + # + # If absent, the client's location will be assumed to be the same as the + # location of the server the client ends up connected to. + # + # Locations are primarily valuable for clients that connect from regions + # other than the ones that contain the Spanner database. + class RoutingHint + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # A tablet that was skipped by the client. See `Tablet.tablet_uid` and + # `Tablet.incarnation`. + # @!attribute [rw] tablet_uid + # @return [::Integer] + # The tablet UID of the tablet that was skipped. See `Tablet.tablet_uid`. + # @!attribute [rw] incarnation + # @return [::String] + # The incarnation of the tablet that was skipped. See `Tablet.incarnation`. + class SkippedTablet + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/spanner/v1/mutation.rb b/owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/spanner/v1/mutation.rb new file mode 100644 index 000000000000..5c0d3caa5bb8 --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/spanner/v1/mutation.rb @@ -0,0 +1,178 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module Spanner + module V1 + # A modification to one or more Cloud Spanner rows. Mutations can be + # applied to a Cloud Spanner database by sending them in a + # {::Google::Cloud::Spanner::V1::Spanner::Client#commit Commit} call. + # @!attribute [rw] insert + # @return [::Google::Cloud::Spanner::V1::Mutation::Write] + # Insert new rows in a table. If any of the rows already exist, + # the write or transaction fails with error `ALREADY_EXISTS`. + # + # Note: The following fields are mutually exclusive: `insert`, `update`, `insert_or_update`, `replace`, `delete`, `send`, `ack`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] update + # @return [::Google::Cloud::Spanner::V1::Mutation::Write] + # Update existing rows in a table. If any of the rows does not + # already exist, the transaction fails with error `NOT_FOUND`. + # + # Note: The following fields are mutually exclusive: `update`, `insert`, `insert_or_update`, `replace`, `delete`, `send`, `ack`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] insert_or_update + # @return [::Google::Cloud::Spanner::V1::Mutation::Write] + # Like {::Google::Cloud::Spanner::V1::Mutation#insert insert}, except that if the row + # already exists, then its column values are overwritten with the ones + # provided. Any column values not explicitly written are preserved. + # + # When using + # {::Google::Cloud::Spanner::V1::Mutation#insert_or_update insert_or_update}, just as + # when using {::Google::Cloud::Spanner::V1::Mutation#insert insert}, all `NOT NULL` + # columns in the table must be given a value. This holds true even when the + # row already exists and will therefore actually be updated. + # + # Note: The following fields are mutually exclusive: `insert_or_update`, `insert`, `update`, `replace`, `delete`, `send`, `ack`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] replace + # @return [::Google::Cloud::Spanner::V1::Mutation::Write] + # Like {::Google::Cloud::Spanner::V1::Mutation#insert insert}, except that if the row + # already exists, it is deleted, and the column values provided are + # inserted instead. Unlike + # {::Google::Cloud::Spanner::V1::Mutation#insert_or_update insert_or_update}, this + # means any values not explicitly written become `NULL`. + # + # In an interleaved table, if you create the child table with the + # `ON DELETE CASCADE` annotation, then replacing a parent row + # also deletes the child rows. Otherwise, you must delete the + # child rows before you replace the parent row. + # + # Note: The following fields are mutually exclusive: `replace`, `insert`, `update`, `insert_or_update`, `delete`, `send`, `ack`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] delete + # @return [::Google::Cloud::Spanner::V1::Mutation::Delete] + # Delete rows from a table. Succeeds whether or not the named + # rows were present. + # + # Note: The following fields are mutually exclusive: `delete`, `insert`, `update`, `insert_or_update`, `replace`, `send`, `ack`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] send + # @return [::Google::Cloud::Spanner::V1::Mutation::Send] + # Send a message to a queue. + # + # Note: The following fields are mutually exclusive: `send`, `insert`, `update`, `insert_or_update`, `replace`, `delete`, `ack`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] ack + # @return [::Google::Cloud::Spanner::V1::Mutation::Ack] + # Ack a message from a queue. + # + # Note: The following fields are mutually exclusive: `ack`, `insert`, `update`, `insert_or_update`, `replace`, `delete`, `send`. If a field in that set is populated, all other fields in the set will automatically be cleared. + class Mutation + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Arguments to {::Google::Cloud::Spanner::V1::Mutation#insert insert}, + # {::Google::Cloud::Spanner::V1::Mutation#update update}, + # {::Google::Cloud::Spanner::V1::Mutation#insert_or_update insert_or_update}, and + # {::Google::Cloud::Spanner::V1::Mutation#replace replace} operations. + # @!attribute [rw] table + # @return [::String] + # Required. The table whose rows will be written. + # @!attribute [rw] columns + # @return [::Array<::String>] + # The names of the columns in + # {::Google::Cloud::Spanner::V1::Mutation::Write#table table} to be written. + # + # The list of columns must contain enough columns to allow + # Cloud Spanner to derive values for all primary key columns in the + # row(s) to be modified. + # @!attribute [rw] values + # @return [::Array<::Google::Protobuf::ListValue>] + # The values to be written. `values` can contain more than one + # list of values. If it does, then multiple rows are written, one + # for each entry in `values`. Each list in `values` must have + # exactly as many entries as there are entries in + # {::Google::Cloud::Spanner::V1::Mutation::Write#columns columns} above. Sending + # multiple lists is equivalent to sending multiple `Mutation`s, each + # containing one `values` entry and repeating + # {::Google::Cloud::Spanner::V1::Mutation::Write#table table} and + # {::Google::Cloud::Spanner::V1::Mutation::Write#columns columns}. Individual values in + # each list are encoded as described {::Google::Cloud::Spanner::V1::TypeCode here}. + class Write + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Arguments to {::Google::Cloud::Spanner::V1::Mutation#delete delete} operations. + # @!attribute [rw] table + # @return [::String] + # Required. The table whose rows will be deleted. + # @!attribute [rw] key_set + # @return [::Google::Cloud::Spanner::V1::KeySet] + # Required. The primary keys of the rows within + # {::Google::Cloud::Spanner::V1::Mutation::Delete#table table} to delete. The primary + # keys must be specified in the order in which they appear in the `PRIMARY + # KEY()` clause of the table's equivalent DDL statement (the DDL statement + # used to create the table). Delete is idempotent. The transaction will + # succeed even if some or all rows do not exist. + class Delete + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Arguments to {::Google::Cloud::Spanner::V1::Mutation#send send} operations. + # @!attribute [rw] queue + # @return [::String] + # Required. The queue to which the message will be sent. + # @!attribute [rw] key + # @return [::Google::Protobuf::ListValue] + # Required. The primary key of the message to be sent. + # @!attribute [rw] deliver_time + # @return [::Google::Protobuf::Timestamp] + # The time at which Spanner will begin attempting to deliver the message. + # If `deliver_time` is not set, Spanner will deliver the message + # immediately. If `deliver_time` is in the past, Spanner will replace it + # with a value closer to the current time. + # @!attribute [rw] payload + # @return [::Google::Protobuf::Value] + # The payload of the message. + class Send + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Arguments to {::Google::Cloud::Spanner::V1::Mutation#ack ack} operations. + # @!attribute [rw] queue + # @return [::String] + # Required. The queue where the message to be acked is stored. + # @!attribute [rw] key + # @return [::Google::Protobuf::ListValue] + # Required. The primary key of the message to be acked. + # @!attribute [rw] ignore_not_found + # @return [::Boolean] + # By default, an attempt to ack a message that does not exist will fail + # with a `NOT_FOUND` error. With `ignore_not_found` set to true, the ack + # will succeed even if the message does not exist. This is useful for + # unconditionally acking a message, even if it is missing or has already + # been acked. + class Ack + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/spanner/v1/query_plan.rb b/owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/spanner/v1/query_plan.rb new file mode 100644 index 000000000000..a213c6fbe1d4 --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/spanner/v1/query_plan.rb @@ -0,0 +1,180 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module Spanner + module V1 + # Node information for nodes appearing in a + # {::Google::Cloud::Spanner::V1::QueryPlan#plan_nodes QueryPlan.plan_nodes}. + # @!attribute [rw] index + # @return [::Integer] + # The `PlanNode`'s index in [node + # list][google.spanner.v1.QueryPlan.plan_nodes]. + # @!attribute [rw] kind + # @return [::Google::Cloud::Spanner::V1::PlanNode::Kind] + # Used to determine the type of node. May be needed for visualizing + # different kinds of nodes differently. For example, If the node is a + # {::Google::Cloud::Spanner::V1::PlanNode::Kind::SCALAR SCALAR} node, it will have a + # condensed representation which can be used to directly embed a description + # of the node in its parent. + # @!attribute [rw] display_name + # @return [::String] + # The display name for the node. + # @!attribute [rw] child_links + # @return [::Array<::Google::Cloud::Spanner::V1::PlanNode::ChildLink>] + # List of child node `index`es and their relationship to this parent. + # @!attribute [rw] short_representation + # @return [::Google::Cloud::Spanner::V1::PlanNode::ShortRepresentation] + # Condensed representation for + # {::Google::Cloud::Spanner::V1::PlanNode::Kind::SCALAR SCALAR} nodes. + # @!attribute [rw] metadata + # @return [::Google::Protobuf::Struct] + # Attributes relevant to the node contained in a group of key-value pairs. + # For example, a Parameter Reference node could have the following + # information in its metadata: + # + # { + # "parameter_reference": "param1", + # "parameter_type": "array" + # } + # @!attribute [rw] execution_stats + # @return [::Google::Protobuf::Struct] + # The execution statistics associated with the node, contained in a group of + # key-value pairs. Only present if the plan was returned as a result of a + # profile query. For example, number of executions, number of rows/time per + # execution etc. + class PlanNode + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Metadata associated with a parent-child relationship appearing in a + # {::Google::Cloud::Spanner::V1::PlanNode PlanNode}. + # @!attribute [rw] child_index + # @return [::Integer] + # The node to which the link points. + # @!attribute [rw] type + # @return [::String] + # The type of the link. For example, in Hash Joins this could be used to + # distinguish between the build child and the probe child, or in the case + # of the child being an output variable, to represent the tag associated + # with the output variable. + # @!attribute [rw] variable + # @return [::String] + # Only present if the child node is + # {::Google::Cloud::Spanner::V1::PlanNode::Kind::SCALAR SCALAR} and corresponds to an + # output variable of the parent node. The field carries the name of the + # output variable. For example, a `TableScan` operator that reads rows from + # a table will have child links to the `SCALAR` nodes representing the + # output variables created for each column that is read by the operator. + # The corresponding `variable` fields will be set to the variable names + # assigned to the columns. + class ChildLink + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Condensed representation of a node and its subtree. Only present for + # `SCALAR` [PlanNode(s)][google.spanner.v1.PlanNode]. + # @!attribute [rw] description + # @return [::String] + # A string representation of the expression subtree rooted at this node. + # @!attribute [rw] subqueries + # @return [::Google::Protobuf::Map{::String => ::Integer}] + # A mapping of (subquery variable name) -> (subquery node id) for cases + # where the `description` string of this node references a `SCALAR` + # subquery contained in the expression subtree rooted at this node. The + # referenced `SCALAR` subquery may not necessarily be a direct child of + # this node. + class ShortRepresentation + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::Integer] + class SubqueriesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The kind of {::Google::Cloud::Spanner::V1::PlanNode PlanNode}. Distinguishes between + # the two different kinds of nodes that can appear in a query plan. + module Kind + # Not specified. + KIND_UNSPECIFIED = 0 + + # Denotes a Relational operator node in the expression tree. Relational + # operators represent iterative processing of rows during query execution. + # For example, a `TableScan` operation that reads rows from a table. + RELATIONAL = 1 + + # Denotes a Scalar node in the expression tree. Scalar nodes represent + # non-iterable entities in the query plan. For example, constants or + # arithmetic operators appearing inside predicate expressions or references + # to column names. + SCALAR = 2 + end + end + + # Output of query advisor analysis. + # @!attribute [rw] index_advice + # @return [::Array<::Google::Cloud::Spanner::V1::QueryAdvisorResult::IndexAdvice>] + # Optional. Index Recommendation for a query. This is an optional field and + # the recommendation will only be available when the recommendation + # guarantees significant improvement in query performance. + class QueryAdvisorResult + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Recommendation to add new indexes to run queries more efficiently. + # @!attribute [rw] ddl + # @return [::Array<::String>] + # Optional. DDL statements to add new indexes that will improve the query. + # @!attribute [rw] improvement_factor + # @return [::Float] + # Optional. Estimated latency improvement factor. For example if the query + # currently takes 500 ms to run and the estimated latency with new indexes + # is 100 ms this field will be 5. + class IndexAdvice + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Contains an ordered list of nodes appearing in the query plan. + # @!attribute [rw] plan_nodes + # @return [::Array<::Google::Cloud::Spanner::V1::PlanNode>] + # The nodes in the query plan. Plan nodes are returned in pre-order starting + # with the plan root. Each {::Google::Cloud::Spanner::V1::PlanNode PlanNode}'s `id` + # corresponds to its index in `plan_nodes`. + # @!attribute [rw] query_advice + # @return [::Google::Cloud::Spanner::V1::QueryAdvisorResult] + # Optional. The advise/recommendations for a query. Currently this field will + # be serving index recommendations for a query. + class QueryPlan + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/spanner/v1/result_set.rb b/owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/spanner/v1/result_set.rb new file mode 100644 index 000000000000..965cab4685b9 --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/spanner/v1/result_set.rb @@ -0,0 +1,265 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module Spanner + module V1 + # Results from {::Google::Cloud::Spanner::V1::Spanner::Client#read Read} or + # {::Google::Cloud::Spanner::V1::Spanner::Client#execute_sql ExecuteSql}. + # @!attribute [rw] metadata + # @return [::Google::Cloud::Spanner::V1::ResultSetMetadata] + # Metadata about the result set, such as row type information. + # @!attribute [rw] rows + # @return [::Array<::Google::Protobuf::ListValue>] + # Each element in `rows` is a row whose format is defined by + # {::Google::Cloud::Spanner::V1::ResultSetMetadata#row_type metadata.row_type}. The ith + # element in each row matches the ith field in + # {::Google::Cloud::Spanner::V1::ResultSetMetadata#row_type metadata.row_type}. Elements + # are encoded based on type as described {::Google::Cloud::Spanner::V1::TypeCode here}. + # @!attribute [rw] stats + # @return [::Google::Cloud::Spanner::V1::ResultSetStats] + # Query plan and execution statistics for the SQL statement that + # produced this result set. These can be requested by setting + # {::Google::Cloud::Spanner::V1::ExecuteSqlRequest#query_mode ExecuteSqlRequest.query_mode}. + # DML statements always produce stats containing the number of rows + # modified, unless executed using the + # {::Google::Cloud::Spanner::V1::ExecuteSqlRequest::QueryMode::PLAN ExecuteSqlRequest.QueryMode.PLAN} + # {::Google::Cloud::Spanner::V1::ExecuteSqlRequest#query_mode ExecuteSqlRequest.query_mode}. + # Other fields might or might not be populated, based on the + # {::Google::Cloud::Spanner::V1::ExecuteSqlRequest#query_mode ExecuteSqlRequest.query_mode}. + # @!attribute [rw] precommit_token + # @return [::Google::Cloud::Spanner::V1::MultiplexedSessionPrecommitToken] + # Optional. A precommit token is included if the read-write transaction is on + # a multiplexed session. Pass the precommit token with the highest sequence + # number from this transaction attempt to the + # {::Google::Cloud::Spanner::V1::Spanner::Client#commit Commit} request for this transaction. + # @!attribute [rw] cache_update + # @return [::Google::Cloud::Spanner::V1::CacheUpdate] + # Optional. A cache update expresses a set of changes the client should + # incorporate into its location cache. The client should discard the changes + # if they are older than the data it already has. This data can be obtained + # in response to requests that included a `RoutingHint` field, but may also + # be obtained by explicit location-fetching RPCs which may be added in the + # future. + class ResultSet + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Partial results from a streaming read or SQL query. Streaming reads and + # SQL queries better tolerate large result sets, large rows, and large + # values, but are a little trickier to consume. + # @!attribute [rw] metadata + # @return [::Google::Cloud::Spanner::V1::ResultSetMetadata] + # Metadata about the result set, such as row type information. + # Only present in the first response. + # @!attribute [rw] values + # @return [::Array<::Google::Protobuf::Value>] + # A streamed result set consists of a stream of values, which might + # be split into many `PartialResultSet` messages to accommodate + # large rows and/or large values. Every N complete values defines a + # row, where N is equal to the number of entries in + # {::Google::Cloud::Spanner::V1::StructType#fields metadata.row_type.fields}. + # + # Most values are encoded based on type as described + # {::Google::Cloud::Spanner::V1::TypeCode here}. + # + # It's possible that the last value in values is "chunked", + # meaning that the rest of the value is sent in subsequent + # `PartialResultSet`(s). This is denoted by the + # {::Google::Cloud::Spanner::V1::PartialResultSet#chunked_value chunked_value} field. + # Two or more chunked values can be merged to form a complete value as + # follows: + # + # * `bool/number/null`: can't be chunked + # * `string`: concatenate the strings + # * `list`: concatenate the lists. If the last element in a list is a + # `string`, `list`, or `object`, merge it with the first element in + # the next list by applying these rules recursively. + # * `object`: concatenate the (field name, field value) pairs. If a + # field name is duplicated, then apply these rules recursively + # to merge the field values. + # + # Some examples of merging: + # + # Strings are concatenated. + # "foo", "bar" => "foobar" + # + # Lists of non-strings are concatenated. + # [2, 3], [4] => [2, 3, 4] + # + # Lists are concatenated, but the last and first elements are merged + # because they are strings. + # ["a", "b"], ["c", "d"] => ["a", "bc", "d"] + # + # Lists are concatenated, but the last and first elements are merged + # because they are lists. Recursively, the last and first elements + # of the inner lists are merged because they are strings. + # ["a", ["b", "c"]], [["d"], "e"] => ["a", ["b", "cd"], "e"] + # + # Non-overlapping object fields are combined. + # {"a": "1"}, {"b": "2"} => {"a": "1", "b": 2"} + # + # Overlapping object fields are merged. + # {"a": "1"}, {"a": "2"} => {"a": "12"} + # + # Examples of merging objects containing lists of strings. + # {"a": ["1"]}, {"a": ["2"]} => {"a": ["12"]} + # + # For a more complete example, suppose a streaming SQL query is + # yielding a result set whose rows contain a single string + # field. The following `PartialResultSet`s might be yielded: + # + # { + # "metadata": { ... } + # "values": ["Hello", "W"] + # "chunked_value": true + # "resume_token": "Af65..." + # } + # { + # "values": ["orl"] + # "chunked_value": true + # } + # { + # "values": ["d"] + # "resume_token": "Zx1B..." + # } + # + # This sequence of `PartialResultSet`s encodes two rows, one + # containing the field value `"Hello"`, and a second containing the + # field value `"World" = "W" + "orl" + "d"`. + # + # Not all `PartialResultSet`s contain a `resume_token`. Execution can only be + # resumed from a previously yielded `resume_token`. For the above sequence of + # `PartialResultSet`s, resuming the query with `"resume_token": "Af65..."` + # yields results from the `PartialResultSet` with value "orl". + # @!attribute [rw] chunked_value + # @return [::Boolean] + # If true, then the final value in + # {::Google::Cloud::Spanner::V1::PartialResultSet#values values} is chunked, and must be + # combined with more values from subsequent `PartialResultSet`s to obtain a + # complete field value. + # @!attribute [rw] resume_token + # @return [::String] + # Streaming calls might be interrupted for a variety of reasons, such + # as TCP connection loss. If this occurs, the stream of results can + # be resumed by re-sending the original request and including + # `resume_token`. Note that executing any other transaction in the + # same session invalidates the token. + # @!attribute [rw] stats + # @return [::Google::Cloud::Spanner::V1::ResultSetStats] + # Query plan and execution statistics for the statement that produced this + # streaming result set. These can be requested by setting + # {::Google::Cloud::Spanner::V1::ExecuteSqlRequest#query_mode ExecuteSqlRequest.query_mode} + # and are sent only once with the last response in the stream. This field is + # also present in the last response for DML statements. + # @!attribute [rw] precommit_token + # @return [::Google::Cloud::Spanner::V1::MultiplexedSessionPrecommitToken] + # Optional. A precommit token is included if the read-write transaction + # has multiplexed sessions enabled. Pass the precommit token with the highest + # sequence number from this transaction attempt to the + # {::Google::Cloud::Spanner::V1::Spanner::Client#commit Commit} request for this transaction. + # @!attribute [rw] last + # @return [::Boolean] + # Optional. Indicates whether this is the last `PartialResultSet` in the + # stream. The server might optionally set this field. Clients shouldn't rely + # on this field being set in all cases. + # @!attribute [rw] cache_update + # @return [::Google::Cloud::Spanner::V1::CacheUpdate] + # Optional. A cache update expresses a set of changes the client should + # incorporate into its location cache. The client should discard the changes + # if they are older than the data it already has. This data can be obtained + # in response to requests that included a `RoutingHint` field, but may also + # be obtained by explicit location-fetching RPCs which may be added in the + # future. + class PartialResultSet + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Metadata about a {::Google::Cloud::Spanner::V1::ResultSet ResultSet} or + # {::Google::Cloud::Spanner::V1::PartialResultSet PartialResultSet}. + # @!attribute [rw] row_type + # @return [::Google::Cloud::Spanner::V1::StructType] + # Indicates the field names and types for the rows in the result + # set. For example, a SQL query like `"SELECT UserId, UserName FROM + # Users"` could return a `row_type` value like: + # + # "fields": [ + # { "name": "UserId", "type": { "code": "INT64" } }, + # { "name": "UserName", "type": { "code": "STRING" } }, + # ] + # @!attribute [rw] transaction + # @return [::Google::Cloud::Spanner::V1::Transaction] + # If the read or SQL query began a transaction as a side-effect, the + # information about the new transaction is yielded here. + # @!attribute [rw] undeclared_parameters + # @return [::Google::Cloud::Spanner::V1::StructType] + # A SQL query can be parameterized. In PLAN mode, these parameters can be + # undeclared. This indicates the field names and types for those undeclared + # parameters in the SQL query. For example, a SQL query like `"SELECT * FROM + # Users where UserId = @userId and UserName = @userName "` could return a + # `undeclared_parameters` value like: + # + # "fields": [ + # { "name": "UserId", "type": { "code": "INT64" } }, + # { "name": "UserName", "type": { "code": "STRING" } }, + # ] + class ResultSetMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Additional statistics about a {::Google::Cloud::Spanner::V1::ResultSet ResultSet} or + # {::Google::Cloud::Spanner::V1::PartialResultSet PartialResultSet}. + # @!attribute [rw] query_plan + # @return [::Google::Cloud::Spanner::V1::QueryPlan] + # {::Google::Cloud::Spanner::V1::QueryPlan QueryPlan} for the query associated with this + # result. + # @!attribute [rw] query_stats + # @return [::Google::Protobuf::Struct] + # Aggregated statistics from the execution of the query. Only present when + # the query is profiled. For example, a query could return the statistics as + # follows: + # + # { + # "rows_returned": "3", + # "elapsed_time": "1.22 secs", + # "cpu_time": "1.19 secs" + # } + # @!attribute [rw] row_count_exact + # @return [::Integer] + # Standard DML returns an exact count of rows that were modified. + # + # Note: The following fields are mutually exclusive: `row_count_exact`, `row_count_lower_bound`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] row_count_lower_bound + # @return [::Integer] + # Partitioned DML doesn't offer exactly-once semantics, so it + # returns a lower bound of the rows modified. + # + # Note: The following fields are mutually exclusive: `row_count_lower_bound`, `row_count_exact`. If a field in that set is populated, all other fields in the set will automatically be cleared. + class ResultSetStats + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/spanner/v1/spanner.rb b/owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/spanner/v1/spanner.rb new file mode 100644 index 000000000000..1d34a7d5ebff --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/spanner/v1/spanner.rb @@ -0,0 +1,1187 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module Spanner + module V1 + # The request for {::Google::Cloud::Spanner::V1::Spanner::Client#create_session CreateSession}. + # @!attribute [rw] database + # @return [::String] + # Required. The database in which the new session is created. + # @!attribute [rw] session + # @return [::Google::Cloud::Spanner::V1::Session] + # Required. The session to create. + class CreateSessionRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request for + # {::Google::Cloud::Spanner::V1::Spanner::Client#batch_create_sessions BatchCreateSessions}. + # @!attribute [rw] database + # @return [::String] + # Required. The database in which the new sessions are created. + # @!attribute [rw] session_template + # @return [::Google::Cloud::Spanner::V1::Session] + # Parameters to apply to each created session. + # @!attribute [rw] session_count + # @return [::Integer] + # Required. The number of sessions to be created in this batch call. At least + # one session is created. The API can return fewer than the requested number + # of sessions. If a specific number of sessions are desired, the client can + # make additional calls to `BatchCreateSessions` (adjusting + # {::Google::Cloud::Spanner::V1::BatchCreateSessionsRequest#session_count session_count} + # as necessary). + class BatchCreateSessionsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The response for + # {::Google::Cloud::Spanner::V1::Spanner::Client#batch_create_sessions BatchCreateSessions}. + # @!attribute [rw] session + # @return [::Array<::Google::Cloud::Spanner::V1::Session>] + # The freshly created sessions. + class BatchCreateSessionsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A session in the Cloud Spanner API. + # @!attribute [r] name + # @return [::String] + # Output only. The name of the session. This is always system-assigned. + # @!attribute [rw] labels + # @return [::Google::Protobuf::Map{::String => ::String}] + # The labels for the session. + # + # * Label keys must be between 1 and 63 characters long and must conform to + # the following regular expression: `[a-z]([-a-z0-9]*[a-z0-9])?`. + # * Label values must be between 0 and 63 characters long and must conform + # to the regular expression `([a-z]([-a-z0-9]*[a-z0-9])?)?`. + # * No more than 64 labels can be associated with a given session. + # + # See https://goo.gl/xmQnxf for more information on and examples of labels. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The timestamp when the session is created. + # @!attribute [r] approximate_last_use_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The approximate timestamp when the session is last used. It's + # typically earlier than the actual last use time. + # @!attribute [rw] creator_role + # @return [::String] + # The database role which created this session. + # @!attribute [rw] multiplexed + # @return [::Boolean] + # Optional. If `true`, specifies a multiplexed session. Use a multiplexed + # session for multiple, concurrent operations including any combination of + # read-only and read-write transactions. Use + # {::Google::Cloud::Spanner::V1::Spanner::Client#create_session `sessions.create`} to create + # multiplexed sessions. Don't use + # {::Google::Cloud::Spanner::V1::Spanner::Client#batch_create_sessions BatchCreateSessions} to + # create a multiplexed session. You can't delete or list multiplexed + # sessions. + class Session + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class LabelsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The request for {::Google::Cloud::Spanner::V1::Spanner::Client#get_session GetSession}. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the session to retrieve. + class GetSessionRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request for {::Google::Cloud::Spanner::V1::Spanner::Client#list_sessions ListSessions}. + # @!attribute [rw] database + # @return [::String] + # Required. The database in which to list sessions. + # @!attribute [rw] page_size + # @return [::Integer] + # Number of sessions to be returned in the response. If 0 or less, defaults + # to the server's maximum allowed page size. + # @!attribute [rw] page_token + # @return [::String] + # If non-empty, `page_token` should contain a + # {::Google::Cloud::Spanner::V1::ListSessionsResponse#next_page_token next_page_token} + # from a previous + # {::Google::Cloud::Spanner::V1::ListSessionsResponse ListSessionsResponse}. + # @!attribute [rw] filter + # @return [::String] + # An expression for filtering the results of the request. Filter rules are + # case insensitive. The fields eligible for filtering are: + # + # * `labels.key` where key is the name of a label + # + # Some examples of using filters are: + # + # * `labels.env:*` --> The session has the label "env". + # * `labels.env:dev` --> The session has the label "env" and the value of + # the label contains the string "dev". + class ListSessionsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The response for {::Google::Cloud::Spanner::V1::Spanner::Client#list_sessions ListSessions}. + # @!attribute [rw] sessions + # @return [::Array<::Google::Cloud::Spanner::V1::Session>] + # The list of requested sessions. + # @!attribute [rw] next_page_token + # @return [::String] + # `next_page_token` can be sent in a subsequent + # {::Google::Cloud::Spanner::V1::Spanner::Client#list_sessions ListSessions} call to fetch more + # of the matching sessions. + class ListSessionsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request for {::Google::Cloud::Spanner::V1::Spanner::Client#delete_session DeleteSession}. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the session to delete. + class DeleteSessionRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Common request options for various APIs. + # @!attribute [rw] priority + # @return [::Google::Cloud::Spanner::V1::RequestOptions::Priority] + # Priority for the request. + # @!attribute [rw] request_tag + # @return [::String] + # A per-request tag which can be applied to queries or reads, used for + # statistics collection. + # Both `request_tag` and `transaction_tag` can be specified for a read or + # query that belongs to a transaction. + # This field is ignored for requests where it's not applicable (for example, + # `CommitRequest`). + # Legal characters for `request_tag` values are all printable characters + # (ASCII 32 - 126) and the length of a request_tag is limited to 50 + # characters. Values that exceed this limit are truncated. + # Any leading underscore (_) characters are removed from the string. + # @!attribute [rw] transaction_tag + # @return [::String] + # A tag used for statistics collection about this transaction. + # Both `request_tag` and `transaction_tag` can be specified for a read or + # query that belongs to a transaction. + # To enable tagging on a transaction, `transaction_tag` must be set to the + # same value for all requests belonging to the same transaction, including + # {::Google::Cloud::Spanner::V1::Spanner::Client#begin_transaction BeginTransaction}. + # If this request doesn't belong to any transaction, `transaction_tag` is + # ignored. + # Legal characters for `transaction_tag` values are all printable characters + # (ASCII 32 - 126) and the length of a `transaction_tag` is limited to 50 + # characters. Values that exceed this limit are truncated. + # Any leading underscore (_) characters are removed from the string. + # @!attribute [rw] client_context + # @return [::Google::Cloud::Spanner::V1::RequestOptions::ClientContext] + # Optional. Optional context that may be needed for some requests. + class RequestOptions + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Container for various pieces of client-owned context attached to a request. + # @!attribute [rw] secure_context + # @return [::Google::Protobuf::Map{::String => ::Google::Protobuf::Value}] + # Optional. Map of parameter name to value for this request. These values + # will be returned by any SECURE_CONTEXT() calls invoked by this request + # (e.g., by queries against Parameterized Secure Views). + class ClientContext + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::Google::Protobuf::Value] + class SecureContextEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The relative priority for requests. Note that priority isn't applicable + # for {::Google::Cloud::Spanner::V1::Spanner::Client#begin_transaction BeginTransaction}. + # + # The priority acts as a hint to the Cloud Spanner scheduler and doesn't + # guarantee priority or order of execution. For example: + # + # * Some parts of a write operation always execute at `PRIORITY_HIGH`, + # regardless of the specified priority. This can cause you to see an + # increase in high priority workload even when executing a low priority + # request. This can also potentially cause a priority inversion where a + # lower priority request is fulfilled ahead of a higher priority + # request. + # * If a transaction contains multiple operations with different priorities, + # Cloud Spanner doesn't guarantee to process the higher priority + # operations first. There might be other constraints to satisfy, such as + # the order of operations. + module Priority + # `PRIORITY_UNSPECIFIED` is equivalent to `PRIORITY_HIGH`. + PRIORITY_UNSPECIFIED = 0 + + # This specifies that the request is low priority. + PRIORITY_LOW = 1 + + # This specifies that the request is medium priority. + PRIORITY_MEDIUM = 2 + + # This specifies that the request is high priority. + PRIORITY_HIGH = 3 + end + end + + # The `DirectedReadOptions` can be used to indicate which replicas or regions + # should be used for non-transactional reads or queries. + # + # `DirectedReadOptions` can only be specified for a read-only transaction, + # otherwise the API returns an `INVALID_ARGUMENT` error. + # @!attribute [rw] include_replicas + # @return [::Google::Cloud::Spanner::V1::DirectedReadOptions::IncludeReplicas] + # `Include_replicas` indicates the order of replicas (as they appear in + # this list) to process the request. If `auto_failover_disabled` is set to + # `true` and all replicas are exhausted without finding a healthy replica, + # Spanner waits for a replica in the list to become available, requests + # might fail due to `DEADLINE_EXCEEDED` errors. + # + # Note: The following fields are mutually exclusive: `include_replicas`, `exclude_replicas`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] exclude_replicas + # @return [::Google::Cloud::Spanner::V1::DirectedReadOptions::ExcludeReplicas] + # `Exclude_replicas` indicates that specified replicas should be excluded + # from serving requests. Spanner doesn't route requests to the replicas + # in this list. + # + # Note: The following fields are mutually exclusive: `exclude_replicas`, `include_replicas`. If a field in that set is populated, all other fields in the set will automatically be cleared. + class DirectedReadOptions + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The directed read replica selector. + # Callers must provide one or more of the following fields for replica + # selection: + # + # * `location` - The location must be one of the regions within the + # multi-region configuration of your database. + # * `type` - The type of the replica. + # + # Some examples of using replica_selectors are: + # + # * `location:us-east1` --> The "us-east1" replica(s) of any available type + # is used to process the request. + # * `type:READ_ONLY` --> The "READ_ONLY" type replica(s) in the nearest + # available location are used to process the + # request. + # * `location:us-east1 type:READ_ONLY` --> The "READ_ONLY" type replica(s) + # in location "us-east1" is used to process + # the request. + # @!attribute [rw] location + # @return [::String] + # The location or region of the serving requests, for example, "us-east1". + # @!attribute [rw] type + # @return [::Google::Cloud::Spanner::V1::DirectedReadOptions::ReplicaSelection::Type] + # The type of replica. + class ReplicaSelection + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Indicates the type of replica. + module Type + # Not specified. + TYPE_UNSPECIFIED = 0 + + # Read-write replicas support both reads and writes. + READ_WRITE = 1 + + # Read-only replicas only support reads (not writes). + READ_ONLY = 2 + end + end + + # An `IncludeReplicas` contains a repeated set of `ReplicaSelection` which + # indicates the order in which replicas should be considered. + # @!attribute [rw] replica_selections + # @return [::Array<::Google::Cloud::Spanner::V1::DirectedReadOptions::ReplicaSelection>] + # The directed read replica selector. + # @!attribute [rw] auto_failover_disabled + # @return [::Boolean] + # If `true`, Spanner doesn't route requests to a replica outside the + # <`include_replicas` list when all of the specified replicas are + # unavailable or unhealthy. Default value is `false`. + class IncludeReplicas + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # An ExcludeReplicas contains a repeated set of ReplicaSelection that should + # be excluded from serving requests. + # @!attribute [rw] replica_selections + # @return [::Array<::Google::Cloud::Spanner::V1::DirectedReadOptions::ReplicaSelection>] + # The directed read replica selector. + class ExcludeReplicas + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The request for {::Google::Cloud::Spanner::V1::Spanner::Client#execute_sql ExecuteSql} and + # {::Google::Cloud::Spanner::V1::Spanner::Client#execute_streaming_sql ExecuteStreamingSql}. + # @!attribute [rw] session + # @return [::String] + # Required. The session in which the SQL query should be performed. + # @!attribute [rw] transaction + # @return [::Google::Cloud::Spanner::V1::TransactionSelector] + # The transaction to use. + # + # For queries, if none is provided, the default is a temporary read-only + # transaction with strong concurrency. + # + # Standard DML statements require a read-write transaction. To protect + # against replays, single-use transactions are not supported. The caller + # must either supply an existing transaction ID or begin a new transaction. + # + # Partitioned DML requires an existing Partitioned DML transaction ID. + # @!attribute [rw] sql + # @return [::String] + # Required. The SQL string. + # @!attribute [rw] params + # @return [::Google::Protobuf::Struct] + # Parameter names and values that bind to placeholders in the SQL string. + # + # A parameter placeholder consists of the `@` character followed by the + # parameter name (for example, `@firstName`). Parameter names must conform + # to the naming requirements of identifiers as specified at + # https://cloud.google.com/spanner/docs/lexical#identifiers. + # + # Parameters can appear anywhere that a literal value is expected. The same + # parameter name can be used more than once, for example: + # + # `"WHERE id > @msg_id AND id < @msg_id + 100"` + # + # It's an error to execute a SQL statement with unbound parameters. + # @!attribute [rw] param_types + # @return [::Google::Protobuf::Map{::String => ::Google::Cloud::Spanner::V1::Type}] + # It isn't always possible for Cloud Spanner to infer the right SQL type + # from a JSON value. For example, values of type `BYTES` and values + # of type `STRING` both appear in + # {::Google::Cloud::Spanner::V1::ExecuteSqlRequest#params params} as JSON strings. + # + # In these cases, you can use `param_types` to specify the exact + # SQL type for some or all of the SQL statement parameters. See the + # definition of {::Google::Cloud::Spanner::V1::Type Type} for more information + # about SQL types. + # @!attribute [rw] resume_token + # @return [::String] + # If this request is resuming a previously interrupted SQL statement + # execution, `resume_token` should be copied from the last + # {::Google::Cloud::Spanner::V1::PartialResultSet PartialResultSet} yielded before the + # interruption. Doing this enables the new SQL statement execution to resume + # where the last one left off. The rest of the request parameters must + # exactly match the request that yielded this token. + # @!attribute [rw] query_mode + # @return [::Google::Cloud::Spanner::V1::ExecuteSqlRequest::QueryMode] + # Used to control the amount of debugging information returned in + # {::Google::Cloud::Spanner::V1::ResultSetStats ResultSetStats}. If + # {::Google::Cloud::Spanner::V1::ExecuteSqlRequest#partition_token partition_token} is + # set, {::Google::Cloud::Spanner::V1::ExecuteSqlRequest#query_mode query_mode} can only + # be set to + # {::Google::Cloud::Spanner::V1::ExecuteSqlRequest::QueryMode::NORMAL QueryMode.NORMAL}. + # @!attribute [rw] partition_token + # @return [::String] + # If present, results are restricted to the specified partition + # previously created using `PartitionQuery`. There must be an exact + # match for the values of fields common to this message and the + # `PartitionQueryRequest` message used to create this `partition_token`. + # @!attribute [rw] seqno + # @return [::Integer] + # A per-transaction sequence number used to identify this request. This field + # makes each request idempotent such that if the request is received multiple + # times, at most one succeeds. + # + # The sequence number must be monotonically increasing within the + # transaction. If a request arrives for the first time with an out-of-order + # sequence number, the transaction can be aborted. Replays of previously + # handled requests yield the same response as the first execution. + # + # Required for DML statements. Ignored for queries. + # @!attribute [rw] query_options + # @return [::Google::Cloud::Spanner::V1::ExecuteSqlRequest::QueryOptions] + # Query optimizer configuration to use for the given query. + # @!attribute [rw] request_options + # @return [::Google::Cloud::Spanner::V1::RequestOptions] + # Common options for this request. + # @!attribute [rw] directed_read_options + # @return [::Google::Cloud::Spanner::V1::DirectedReadOptions] + # Directed read options for this request. + # @!attribute [rw] data_boost_enabled + # @return [::Boolean] + # If this is for a partitioned query and this field is set to `true`, the + # request is executed with Spanner Data Boost independent compute resources. + # + # If the field is set to `true` but the request doesn't set + # `partition_token`, the API returns an `INVALID_ARGUMENT` error. + # @!attribute [rw] last_statement + # @return [::Boolean] + # Optional. If set to `true`, this statement marks the end of the + # transaction. After this statement executes, you must commit or abort the + # transaction. Attempts to execute any other requests against this + # transaction (including reads and queries) are rejected. + # + # For DML statements, setting this option might cause some error reporting to + # be deferred until commit time (for example, validation of unique + # constraints). Given this, successful execution of a DML statement shouldn't + # be assumed until a subsequent `Commit` call completes successfully. + # @!attribute [rw] routing_hint + # @return [::Google::Cloud::Spanner::V1::RoutingHint] + # Optional. If present, it makes the Spanner requests location-aware. + # + # It gives the server hints that can be used to route the request + # to an appropriate server, potentially significantly decreasing latency and + # improving throughput. To achieve improved performance, most fields must be + # filled in with accurate values. + class ExecuteSqlRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Query optimizer configuration. + # @!attribute [rw] optimizer_version + # @return [::String] + # An option to control the selection of optimizer version. + # + # This parameter allows individual queries to pick different query + # optimizer versions. + # + # Specifying `latest` as a value instructs Cloud Spanner to use the + # latest supported query optimizer version. If not specified, Cloud Spanner + # uses the optimizer version set at the database level options. Any other + # positive integer (from the list of supported optimizer versions) + # overrides the default optimizer version for query execution. + # + # The list of supported optimizer versions can be queried from + # `SPANNER_SYS.SUPPORTED_OPTIMIZER_VERSIONS`. + # + # Executing a SQL statement with an invalid optimizer version fails with + # an `INVALID_ARGUMENT` error. + # + # See + # https://cloud.google.com/spanner/docs/query-optimizer/manage-query-optimizer + # for more information on managing the query optimizer. + # + # The `optimizer_version` statement hint has precedence over this setting. + # @!attribute [rw] optimizer_statistics_package + # @return [::String] + # An option to control the selection of optimizer statistics package. + # + # This parameter allows individual queries to use a different query + # optimizer statistics package. + # + # Specifying `latest` as a value instructs Cloud Spanner to use the latest + # generated statistics package. If not specified, Cloud Spanner uses + # the statistics package set at the database level options, or the latest + # package if the database option isn't set. + # + # The statistics package requested by the query has to be exempt from + # garbage collection. This can be achieved with the following DDL + # statement: + # + # ```sql + # ALTER STATISTICS SET OPTIONS (allow_gc=false) + # ``` + # + # The list of available statistics packages can be queried from + # `INFORMATION_SCHEMA.SPANNER_STATISTICS`. + # + # Executing a SQL statement with an invalid optimizer statistics package + # or with a statistics package that allows garbage collection fails with + # an `INVALID_ARGUMENT` error. + class QueryOptions + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::Google::Cloud::Spanner::V1::Type] + class ParamTypesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Mode in which the statement must be processed. + module QueryMode + # The default mode. Only the statement results are returned. + NORMAL = 0 + + # This mode returns only the query plan, without any results or + # execution statistics information. + PLAN = 1 + + # This mode returns the query plan, overall execution statistics, + # operator level execution statistics along with the results. This has a + # performance overhead compared to the other modes. It isn't recommended + # to use this mode for production traffic. + PROFILE = 2 + + # This mode returns the overall (but not operator-level) execution + # statistics along with the results. + WITH_STATS = 3 + + # This mode returns the query plan, overall (but not operator-level) + # execution statistics along with the results. + WITH_PLAN_AND_STATS = 4 + end + end + + # The request for {::Google::Cloud::Spanner::V1::Spanner::Client#execute_batch_dml ExecuteBatchDml}. + # @!attribute [rw] session + # @return [::String] + # Required. The session in which the DML statements should be performed. + # @!attribute [rw] transaction + # @return [::Google::Cloud::Spanner::V1::TransactionSelector] + # Required. The transaction to use. Must be a read-write transaction. + # + # To protect against replays, single-use transactions are not supported. The + # caller must either supply an existing transaction ID or begin a new + # transaction. + # @!attribute [rw] statements + # @return [::Array<::Google::Cloud::Spanner::V1::ExecuteBatchDmlRequest::Statement>] + # Required. The list of statements to execute in this batch. Statements are + # executed serially, such that the effects of statement `i` are visible to + # statement `i+1`. Each statement must be a DML statement. Execution stops at + # the first failed statement; the remaining statements are not executed. + # + # Callers must provide at least one statement. + # @!attribute [rw] seqno + # @return [::Integer] + # Required. A per-transaction sequence number used to identify this request. + # This field makes each request idempotent such that if the request is + # received multiple times, at most one succeeds. + # + # The sequence number must be monotonically increasing within the + # transaction. If a request arrives for the first time with an out-of-order + # sequence number, the transaction might be aborted. Replays of previously + # handled requests yield the same response as the first execution. + # @!attribute [rw] request_options + # @return [::Google::Cloud::Spanner::V1::RequestOptions] + # Common options for this request. + # @!attribute [rw] last_statements + # @return [::Boolean] + # Optional. If set to `true`, this request marks the end of the transaction. + # After these statements execute, you must commit or abort the transaction. + # Attempts to execute any other requests against this transaction + # (including reads and queries) are rejected. + # + # Setting this option might cause some error reporting to be deferred until + # commit time (for example, validation of unique constraints). Given this, + # successful execution of statements shouldn't be assumed until a subsequent + # `Commit` call completes successfully. + class ExecuteBatchDmlRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # A single DML statement. + # @!attribute [rw] sql + # @return [::String] + # Required. The DML string. + # @!attribute [rw] params + # @return [::Google::Protobuf::Struct] + # Parameter names and values that bind to placeholders in the DML string. + # + # A parameter placeholder consists of the `@` character followed by the + # parameter name (for example, `@firstName`). Parameter names can contain + # letters, numbers, and underscores. + # + # Parameters can appear anywhere that a literal value is expected. The + # same parameter name can be used more than once, for example: + # + # `"WHERE id > @msg_id AND id < @msg_id + 100"` + # + # It's an error to execute a SQL statement with unbound parameters. + # @!attribute [rw] param_types + # @return [::Google::Protobuf::Map{::String => ::Google::Cloud::Spanner::V1::Type}] + # It isn't always possible for Cloud Spanner to infer the right SQL type + # from a JSON value. For example, values of type `BYTES` and values + # of type `STRING` both appear in + # {::Google::Cloud::Spanner::V1::ExecuteBatchDmlRequest::Statement#params params} as + # JSON strings. + # + # In these cases, `param_types` can be used to specify the exact + # SQL type for some or all of the SQL statement parameters. See the + # definition of {::Google::Cloud::Spanner::V1::Type Type} for more information + # about SQL types. + class Statement + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::Google::Cloud::Spanner::V1::Type] + class ParamTypesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + + # The response for + # {::Google::Cloud::Spanner::V1::Spanner::Client#execute_batch_dml ExecuteBatchDml}. Contains a list + # of {::Google::Cloud::Spanner::V1::ResultSet ResultSet} messages, one for each DML + # statement that has successfully executed, in the same order as the statements + # in the request. If a statement fails, the status in the response body + # identifies the cause of the failure. + # + # To check for DML statements that failed, use the following approach: + # + # 1. Check the status in the response message. The + # [google.rpc.Code][google.rpc.Code] enum + # value `OK` indicates that all statements were executed successfully. + # 2. If the status was not `OK`, check the number of result sets in the + # response. If the response contains `N` + # {::Google::Cloud::Spanner::V1::ResultSet ResultSet} messages, then statement `N+1` in + # the request failed. + # + # Example 1: + # + # * Request: 5 DML statements, all executed successfully. + # * Response: 5 {::Google::Cloud::Spanner::V1::ResultSet ResultSet} messages, with the + # status `OK`. + # + # Example 2: + # + # * Request: 5 DML statements. The third statement has a syntax error. + # * Response: 2 {::Google::Cloud::Spanner::V1::ResultSet ResultSet} messages, and a syntax + # error (`INVALID_ARGUMENT`) + # status. The number of {::Google::Cloud::Spanner::V1::ResultSet ResultSet} messages + # indicates that the third statement failed, and the fourth and fifth + # statements were not executed. + # @!attribute [rw] result_sets + # @return [::Array<::Google::Cloud::Spanner::V1::ResultSet>] + # One {::Google::Cloud::Spanner::V1::ResultSet ResultSet} for each statement in the + # request that ran successfully, in the same order as the statements in the + # request. Each {::Google::Cloud::Spanner::V1::ResultSet ResultSet} does not contain any + # rows. The {::Google::Cloud::Spanner::V1::ResultSetStats ResultSetStats} in each + # {::Google::Cloud::Spanner::V1::ResultSet ResultSet} contain the number of rows + # modified by the statement. + # + # Only the first {::Google::Cloud::Spanner::V1::ResultSet ResultSet} in the response + # contains valid {::Google::Cloud::Spanner::V1::ResultSetMetadata ResultSetMetadata}. + # @!attribute [rw] status + # @return [::Google::Rpc::Status] + # If all DML statements are executed successfully, the status is `OK`. + # Otherwise, the error status of the first failed statement. + # @!attribute [rw] precommit_token + # @return [::Google::Cloud::Spanner::V1::MultiplexedSessionPrecommitToken] + # Optional. A precommit token is included if the read-write transaction + # is on a multiplexed session. Pass the precommit token with the highest + # sequence number from this transaction attempt should be passed to the + # {::Google::Cloud::Spanner::V1::Spanner::Client#commit Commit} request for this transaction. + class ExecuteBatchDmlResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Options for a `PartitionQueryRequest` and `PartitionReadRequest`. + # @!attribute [rw] partition_size_bytes + # @return [::Integer] + # **Note:** This hint is currently ignored by `PartitionQuery` and + # `PartitionRead` requests. + # + # The desired data size for each partition generated. The default for this + # option is currently 1 GiB. This is only a hint. The actual size of each + # partition can be smaller or larger than this size request. + # @!attribute [rw] max_partitions + # @return [::Integer] + # **Note:** This hint is currently ignored by `PartitionQuery` and + # `PartitionRead` requests. + # + # The desired maximum number of partitions to return. For example, this + # might be set to the number of workers available. The default for this + # option is currently 10,000. The maximum value is currently 200,000. This + # is only a hint. The actual number of partitions returned can be smaller or + # larger than this maximum count request. + class PartitionOptions + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request for {::Google::Cloud::Spanner::V1::Spanner::Client#partition_query PartitionQuery} + # @!attribute [rw] session + # @return [::String] + # Required. The session used to create the partitions. + # @!attribute [rw] transaction + # @return [::Google::Cloud::Spanner::V1::TransactionSelector] + # Read-only snapshot transactions are supported, read and write and + # single-use transactions are not. + # @!attribute [rw] sql + # @return [::String] + # Required. The query request to generate partitions for. The request fails + # if the query isn't root partitionable. For a query to be root + # partitionable, it needs to satisfy a few conditions. For example, if the + # query execution plan contains a distributed union operator, then it must be + # the first operator in the plan. For more information about other + # conditions, see [Read data in + # parallel](https://cloud.google.com/spanner/docs/reads#read_data_in_parallel). + # + # The query request must not contain DML commands, such as `INSERT`, + # `UPDATE`, or `DELETE`. Use + # {::Google::Cloud::Spanner::V1::Spanner::Client#execute_streaming_sql `ExecuteStreamingSql`} with + # a `PartitionedDml` transaction for large, partition-friendly DML + # operations. + # @!attribute [rw] params + # @return [::Google::Protobuf::Struct] + # Optional. Parameter names and values that bind to placeholders in the SQL + # string. + # + # A parameter placeholder consists of the `@` character followed by the + # parameter name (for example, `@firstName`). Parameter names can contain + # letters, numbers, and underscores. + # + # Parameters can appear anywhere that a literal value is expected. The same + # parameter name can be used more than once, for example: + # + # `"WHERE id > @msg_id AND id < @msg_id + 100"` + # + # It's an error to execute a SQL statement with unbound parameters. + # @!attribute [rw] param_types + # @return [::Google::Protobuf::Map{::String => ::Google::Cloud::Spanner::V1::Type}] + # Optional. It isn't always possible for Cloud Spanner to infer the right SQL + # type from a JSON value. For example, values of type `BYTES` and values of + # type `STRING` both appear in + # {::Google::Cloud::Spanner::V1::PartitionQueryRequest#params params} as JSON strings. + # + # In these cases, `param_types` can be used to specify the exact + # SQL type for some or all of the SQL query parameters. See the + # definition of {::Google::Cloud::Spanner::V1::Type Type} for more information + # about SQL types. + # @!attribute [rw] partition_options + # @return [::Google::Cloud::Spanner::V1::PartitionOptions] + # Additional options that affect how many partitions are created. + class PartitionQueryRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::Google::Cloud::Spanner::V1::Type] + class ParamTypesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The request for {::Google::Cloud::Spanner::V1::Spanner::Client#partition_read PartitionRead} + # @!attribute [rw] session + # @return [::String] + # Required. The session used to create the partitions. + # @!attribute [rw] transaction + # @return [::Google::Cloud::Spanner::V1::TransactionSelector] + # Read only snapshot transactions are supported, read/write and single use + # transactions are not. + # @!attribute [rw] table + # @return [::String] + # Required. The name of the table in the database to be read. + # @!attribute [rw] index + # @return [::String] + # If non-empty, the name of an index on + # {::Google::Cloud::Spanner::V1::PartitionReadRequest#table table}. This index is used + # instead of the table primary key when interpreting + # {::Google::Cloud::Spanner::V1::PartitionReadRequest#key_set key_set} and sorting + # result rows. See {::Google::Cloud::Spanner::V1::PartitionReadRequest#key_set key_set} + # for further information. + # @!attribute [rw] columns + # @return [::Array<::String>] + # The columns of {::Google::Cloud::Spanner::V1::PartitionReadRequest#table table} to be + # returned for each row matching this request. + # @!attribute [rw] key_set + # @return [::Google::Cloud::Spanner::V1::KeySet] + # Required. `key_set` identifies the rows to be yielded. `key_set` names the + # primary keys of the rows in + # {::Google::Cloud::Spanner::V1::PartitionReadRequest#table table} to be yielded, unless + # {::Google::Cloud::Spanner::V1::PartitionReadRequest#index index} is present. If + # {::Google::Cloud::Spanner::V1::PartitionReadRequest#index index} is present, then + # {::Google::Cloud::Spanner::V1::PartitionReadRequest#key_set key_set} instead names + # index keys in {::Google::Cloud::Spanner::V1::PartitionReadRequest#index index}. + # + # It isn't an error for the `key_set` to name rows that don't + # exist in the database. Read yields nothing for nonexistent rows. + # @!attribute [rw] partition_options + # @return [::Google::Cloud::Spanner::V1::PartitionOptions] + # Additional options that affect how many partitions are created. + class PartitionReadRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Information returned for each partition returned in a + # PartitionResponse. + # @!attribute [rw] partition_token + # @return [::String] + # This token can be passed to `Read`, `StreamingRead`, `ExecuteSql`, or + # `ExecuteStreamingSql` requests to restrict the results to those identified + # by this partition token. + class Partition + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The response for {::Google::Cloud::Spanner::V1::Spanner::Client#partition_query PartitionQuery} + # or {::Google::Cloud::Spanner::V1::Spanner::Client#partition_read PartitionRead} + # @!attribute [rw] partitions + # @return [::Array<::Google::Cloud::Spanner::V1::Partition>] + # Partitions created by this request. + # @!attribute [rw] transaction + # @return [::Google::Cloud::Spanner::V1::Transaction] + # Transaction created by this request. + class PartitionResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request for {::Google::Cloud::Spanner::V1::Spanner::Client#read Read} and + # {::Google::Cloud::Spanner::V1::Spanner::Client#streaming_read StreamingRead}. + # @!attribute [rw] session + # @return [::String] + # Required. The session in which the read should be performed. + # @!attribute [rw] transaction + # @return [::Google::Cloud::Spanner::V1::TransactionSelector] + # The transaction to use. If none is provided, the default is a + # temporary read-only transaction with strong concurrency. + # @!attribute [rw] table + # @return [::String] + # Required. The name of the table in the database to be read. + # @!attribute [rw] index + # @return [::String] + # If non-empty, the name of an index on + # {::Google::Cloud::Spanner::V1::ReadRequest#table table}. This index is used instead of + # the table primary key when interpreting + # {::Google::Cloud::Spanner::V1::ReadRequest#key_set key_set} and sorting result rows. + # See {::Google::Cloud::Spanner::V1::ReadRequest#key_set key_set} for further + # information. + # @!attribute [rw] columns + # @return [::Array<::String>] + # Required. The columns of {::Google::Cloud::Spanner::V1::ReadRequest#table table} to be + # returned for each row matching this request. + # @!attribute [rw] key_set + # @return [::Google::Cloud::Spanner::V1::KeySet] + # Required. `key_set` identifies the rows to be yielded. `key_set` names the + # primary keys of the rows in {::Google::Cloud::Spanner::V1::ReadRequest#table table} to + # be yielded, unless {::Google::Cloud::Spanner::V1::ReadRequest#index index} is present. + # If {::Google::Cloud::Spanner::V1::ReadRequest#index index} is present, then + # {::Google::Cloud::Spanner::V1::ReadRequest#key_set key_set} instead names index keys + # in {::Google::Cloud::Spanner::V1::ReadRequest#index index}. + # + # If the {::Google::Cloud::Spanner::V1::ReadRequest#partition_token partition_token} + # field is empty, rows are yielded in table primary key order (if + # {::Google::Cloud::Spanner::V1::ReadRequest#index index} is empty) or index key order + # (if {::Google::Cloud::Spanner::V1::ReadRequest#index index} is non-empty). If the + # {::Google::Cloud::Spanner::V1::ReadRequest#partition_token partition_token} field + # isn't empty, rows are yielded in an unspecified order. + # + # It isn't an error for the `key_set` to name rows that don't + # exist in the database. Read yields nothing for nonexistent rows. + # @!attribute [rw] limit + # @return [::Integer] + # If greater than zero, only the first `limit` rows are yielded. If `limit` + # is zero, the default is no limit. A limit can't be specified if + # `partition_token` is set. + # @!attribute [rw] resume_token + # @return [::String] + # If this request is resuming a previously interrupted read, + # `resume_token` should be copied from the last + # {::Google::Cloud::Spanner::V1::PartialResultSet PartialResultSet} yielded before the + # interruption. Doing this enables the new read to resume where the last read + # left off. The rest of the request parameters must exactly match the request + # that yielded this token. + # @!attribute [rw] partition_token + # @return [::String] + # If present, results are restricted to the specified partition + # previously created using `PartitionRead`. There must be an exact + # match for the values of fields common to this message and the + # PartitionReadRequest message used to create this partition_token. + # @!attribute [rw] request_options + # @return [::Google::Cloud::Spanner::V1::RequestOptions] + # Common options for this request. + # @!attribute [rw] directed_read_options + # @return [::Google::Cloud::Spanner::V1::DirectedReadOptions] + # Directed read options for this request. + # @!attribute [rw] data_boost_enabled + # @return [::Boolean] + # If this is for a partitioned read and this field is set to `true`, the + # request is executed with Spanner Data Boost independent compute resources. + # + # If the field is set to `true` but the request doesn't set + # `partition_token`, the API returns an `INVALID_ARGUMENT` error. + # @!attribute [rw] order_by + # @return [::Google::Cloud::Spanner::V1::ReadRequest::OrderBy] + # Optional. Order for the returned rows. + # + # By default, Spanner returns result rows in primary key order except for + # PartitionRead requests. For applications that don't require rows to be + # returned in primary key (`ORDER_BY_PRIMARY_KEY`) order, setting + # `ORDER_BY_NO_ORDER` option allows Spanner to optimize row retrieval, + # resulting in lower latencies in certain cases (for example, bulk point + # lookups). + # @!attribute [rw] lock_hint + # @return [::Google::Cloud::Spanner::V1::ReadRequest::LockHint] + # Optional. Lock Hint for the request, it can only be used with read-write + # transactions. + # @!attribute [rw] routing_hint + # @return [::Google::Cloud::Spanner::V1::RoutingHint] + # Optional. If present, it makes the Spanner requests location-aware. + # + # It gives the server hints that can be used to route the request + # to an appropriate server, potentially significantly decreasing latency and + # improving throughput. To achieve improved performance, most fields must be + # filled in with accurate values. + class ReadRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # An option to control the order in which rows are returned from a read. + module OrderBy + # Default value. + # + # `ORDER_BY_UNSPECIFIED` is equivalent to `ORDER_BY_PRIMARY_KEY`. + ORDER_BY_UNSPECIFIED = 0 + + # Read rows are returned in primary key order. + # + # In the event that this option is used in conjunction with the + # `partition_token` field, the API returns an `INVALID_ARGUMENT` error. + ORDER_BY_PRIMARY_KEY = 1 + + # Read rows are returned in any order. + ORDER_BY_NO_ORDER = 2 + end + + # A lock hint mechanism for reads done within a transaction. + module LockHint + # Default value. + # + # `LOCK_HINT_UNSPECIFIED` is equivalent to `LOCK_HINT_SHARED`. + LOCK_HINT_UNSPECIFIED = 0 + + # Acquire shared locks. + # + # By default when you perform a read as part of a read-write transaction, + # Spanner acquires shared read locks, which allows other reads to still + # access the data until your transaction is ready to commit. When your + # transaction is committing and writes are being applied, the transaction + # attempts to upgrade to an exclusive lock for any data you are writing. + # For more information about locks, see [Lock + # modes](https://cloud.google.com/spanner/docs/introspection/lock-statistics#explain-lock-modes). + LOCK_HINT_SHARED = 1 + + # Acquire exclusive locks. + # + # Requesting exclusive locks is beneficial if you observe high write + # contention, which means you notice that multiple transactions are + # concurrently trying to read and write to the same data, resulting in a + # large number of aborts. This problem occurs when two transactions + # initially acquire shared locks and then both try to upgrade to exclusive + # locks at the same time. In this situation both transactions are waiting + # for the other to give up their lock, resulting in a deadlocked situation. + # Spanner is able to detect this occurring and force one of the + # transactions to abort. However, this is a slow and expensive operation + # and results in lower performance. In this case it makes sense to acquire + # exclusive locks at the start of the transaction because then when + # multiple transactions try to act on the same data, they automatically get + # serialized. Each transaction waits its turn to acquire the lock and + # avoids getting into deadlock situations. + # + # Because the exclusive lock hint is just a hint, it shouldn't be + # considered equivalent to a mutex. In other words, you shouldn't use + # Spanner exclusive locks as a mutual exclusion mechanism for the execution + # of code outside of Spanner. + # + # **Note:** Request exclusive locks judiciously because they block others + # from reading that data for the entire transaction, rather than just when + # the writes are being performed. Unless you observe high write contention, + # you should use the default of shared read locks so you don't prematurely + # block other clients from reading the data that you're writing to. + LOCK_HINT_EXCLUSIVE = 2 + end + end + + # The request for + # {::Google::Cloud::Spanner::V1::Spanner::Client#begin_transaction BeginTransaction}. + # @!attribute [rw] session + # @return [::String] + # Required. The session in which the transaction runs. + # @!attribute [rw] options + # @return [::Google::Cloud::Spanner::V1::TransactionOptions] + # Required. Options for the new transaction. + # @!attribute [rw] request_options + # @return [::Google::Cloud::Spanner::V1::RequestOptions] + # Common options for this request. + # Priority is ignored for this request. Setting the priority in this + # `request_options` struct doesn't do anything. To set the priority for a + # transaction, set it on the reads and writes that are part of this + # transaction instead. + # @!attribute [rw] mutation_key + # @return [::Google::Cloud::Spanner::V1::Mutation] + # Optional. Required for read-write transactions on a multiplexed session + # that commit mutations but don't perform any reads or queries. You must + # randomly select one of the mutations from the mutation set and send it as a + # part of this request. + class BeginTransactionRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request for {::Google::Cloud::Spanner::V1::Spanner::Client#commit Commit}. + # @!attribute [rw] session + # @return [::String] + # Required. The session in which the transaction to be committed is running. + # @!attribute [rw] transaction_id + # @return [::String] + # Commit a previously-started transaction. + # + # Note: The following fields are mutually exclusive: `transaction_id`, `single_use_transaction`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] single_use_transaction + # @return [::Google::Cloud::Spanner::V1::TransactionOptions] + # Execute mutations in a temporary transaction. Note that unlike + # commit of a previously-started transaction, commit with a + # temporary transaction is non-idempotent. That is, if the + # `CommitRequest` is sent to Cloud Spanner more than once (for + # instance, due to retries in the application, or in the + # transport library), it's possible that the mutations are + # executed more than once. If this is undesirable, use + # {::Google::Cloud::Spanner::V1::Spanner::Client#begin_transaction BeginTransaction} and + # {::Google::Cloud::Spanner::V1::Spanner::Client#commit Commit} instead. + # + # Note: The following fields are mutually exclusive: `single_use_transaction`, `transaction_id`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] mutations + # @return [::Array<::Google::Cloud::Spanner::V1::Mutation>] + # The mutations to be executed when this transaction commits. All + # mutations are applied atomically, in the order they appear in + # this list. + # @!attribute [rw] return_commit_stats + # @return [::Boolean] + # If `true`, then statistics related to the transaction is included in + # the {::Google::Cloud::Spanner::V1::CommitResponse#commit_stats CommitResponse}. + # Default value is `false`. + # @!attribute [rw] max_commit_delay + # @return [::Google::Protobuf::Duration] + # Optional. The amount of latency this request is configured to incur in + # order to improve throughput. If this field isn't set, Spanner assumes + # requests are relatively latency sensitive and automatically determines an + # appropriate delay time. You can specify a commit delay value between 0 and + # 500 ms. + # @!attribute [rw] request_options + # @return [::Google::Cloud::Spanner::V1::RequestOptions] + # Common options for this request. + # @!attribute [rw] precommit_token + # @return [::Google::Cloud::Spanner::V1::MultiplexedSessionPrecommitToken] + # Optional. If the read-write transaction was executed on a multiplexed + # session, then you must include the precommit token with the highest + # sequence number received in this transaction attempt. Failing to do so + # results in a `FailedPrecondition` error. + class CommitRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request for {::Google::Cloud::Spanner::V1::Spanner::Client#rollback Rollback}. + # @!attribute [rw] session + # @return [::String] + # Required. The session in which the transaction to roll back is running. + # @!attribute [rw] transaction_id + # @return [::String] + # Required. The transaction to roll back. + class RollbackRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request for {::Google::Cloud::Spanner::V1::Spanner::Client#batch_write BatchWrite}. + # @!attribute [rw] session + # @return [::String] + # Required. The session in which the batch request is to be run. + # @!attribute [rw] request_options + # @return [::Google::Cloud::Spanner::V1::RequestOptions] + # Common options for this request. + # @!attribute [rw] mutation_groups + # @return [::Array<::Google::Cloud::Spanner::V1::BatchWriteRequest::MutationGroup>] + # Required. The groups of mutations to be applied. + # @!attribute [rw] exclude_txn_from_change_streams + # @return [::Boolean] + # Optional. If you don't set the `exclude_txn_from_change_streams` option or + # if it's set to `false`, then any change streams monitoring columns modified + # by transactions will capture the updates made within that transaction. + class BatchWriteRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # A group of mutations to be committed together. Related mutations should be + # placed in a group. For example, two mutations inserting rows with the same + # primary key prefix in both parent and child tables are related. + # @!attribute [rw] mutations + # @return [::Array<::Google::Cloud::Spanner::V1::Mutation>] + # Required. The mutations in this group. + class MutationGroup + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The result of applying a batch of mutations. + # @!attribute [rw] indexes + # @return [::Array<::Integer>] + # The mutation groups applied in this batch. The values index into the + # `mutation_groups` field in the corresponding `BatchWriteRequest`. + # @!attribute [rw] status + # @return [::Google::Rpc::Status] + # An `OK` status indicates success. Any other status indicates a failure. + # @!attribute [rw] commit_timestamp + # @return [::Google::Protobuf::Timestamp] + # The commit timestamp of the transaction that applied this batch. + # Present if status is OK and the mutation groups were applied, absent + # otherwise. + # + # For mutation groups with conditions, a status=OK and missing + # commit_timestamp means that the mutation groups were not applied due to the + # condition not being satisfied after evaluation. + class BatchWriteResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/spanner/v1/transaction.rb b/owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/spanner/v1/transaction.rb new file mode 100644 index 000000000000..85ccfc1d5b1e --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/spanner/v1/transaction.rb @@ -0,0 +1,338 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module Spanner + module V1 + # Options to use for transactions. + # @!attribute [rw] read_write + # @return [::Google::Cloud::Spanner::V1::TransactionOptions::ReadWrite] + # Transaction may write. + # + # Authorization to begin a read-write transaction requires + # `spanner.databases.beginOrRollbackReadWriteTransaction` permission + # on the `session` resource. + # + # Note: The following fields are mutually exclusive: `read_write`, `partitioned_dml`, `read_only`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] partitioned_dml + # @return [::Google::Cloud::Spanner::V1::TransactionOptions::PartitionedDml] + # Partitioned DML transaction. + # + # Authorization to begin a Partitioned DML transaction requires + # `spanner.databases.beginPartitionedDmlTransaction` permission + # on the `session` resource. + # + # Note: The following fields are mutually exclusive: `partitioned_dml`, `read_write`, `read_only`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] read_only + # @return [::Google::Cloud::Spanner::V1::TransactionOptions::ReadOnly] + # Transaction does not write. + # + # Authorization to begin a read-only transaction requires + # `spanner.databases.beginReadOnlyTransaction` permission + # on the `session` resource. + # + # Note: The following fields are mutually exclusive: `read_only`, `read_write`, `partitioned_dml`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] exclude_txn_from_change_streams + # @return [::Boolean] + # When `exclude_txn_from_change_streams` is set to `true`, it prevents read + # or write transactions from being tracked in change streams. + # + # * If the DDL option `allow_txn_exclusion` is set to `true`, then the + # updates + # made within this transaction aren't recorded in the change stream. + # + # * If you don't set the DDL option `allow_txn_exclusion` or if it's + # set to `false`, then the updates made within this transaction are + # recorded in the change stream. + # + # When `exclude_txn_from_change_streams` is set to `false` or not set, + # modifications from this transaction are recorded in all change streams + # that are tracking columns modified by these transactions. + # + # The `exclude_txn_from_change_streams` option can only be specified + # for read-write or partitioned DML transactions, otherwise the API returns + # an `INVALID_ARGUMENT` error. + # @!attribute [rw] isolation_level + # @return [::Google::Cloud::Spanner::V1::TransactionOptions::IsolationLevel] + # Isolation level for the transaction. + class TransactionOptions + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Message type to initiate a read-write transaction. Currently this + # transaction type has no options. + # @!attribute [rw] read_lock_mode + # @return [::Google::Cloud::Spanner::V1::TransactionOptions::ReadWrite::ReadLockMode] + # Read lock mode for the transaction. + # @!attribute [rw] multiplexed_session_previous_transaction_id + # @return [::String] + # Optional. Clients should pass the transaction ID of the previous + # transaction attempt that was aborted if this transaction is being + # executed on a multiplexed session. + class ReadWrite + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # `ReadLockMode` is used to set the read lock mode for read-write + # transactions. + module ReadLockMode + # Default value. + # + # * If isolation level is + # {::Google::Cloud::Spanner::V1::TransactionOptions::IsolationLevel::REPEATABLE_READ REPEATABLE_READ}, + # then it is an error to specify `read_lock_mode`. Locking semantics + # default to `OPTIMISTIC`. No validation checks are done for reads, + # except to validate that the data that was served at the snapshot time + # is unchanged at commit time in the following cases: + # 1. reads done as part of queries that use `SELECT FOR UPDATE` + # 2. reads done as part of statements with a `LOCK_SCANNED_RANGES` + # hint + # 3. reads done as part of DML statements + # * At all other isolation levels, if `read_lock_mode` is the default + # value, then pessimistic read locks are used. + READ_LOCK_MODE_UNSPECIFIED = 0 + + # Pessimistic lock mode. + # + # Read locks are acquired immediately on read. + # Semantics described only applies to + # {::Google::Cloud::Spanner::V1::TransactionOptions::IsolationLevel::SERIALIZABLE SERIALIZABLE} + # isolation. + PESSIMISTIC = 1 + + # Optimistic lock mode. + # + # Locks for reads within the transaction are not acquired on read. + # Instead the locks are acquired on a commit to validate that + # read/queried data has not changed since the transaction started. + # Semantics described only applies to + # {::Google::Cloud::Spanner::V1::TransactionOptions::IsolationLevel::SERIALIZABLE SERIALIZABLE} + # isolation. + OPTIMISTIC = 2 + end + end + + # Message type to initiate a Partitioned DML transaction. + class PartitionedDml + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message type to initiate a read-only transaction. + # @!attribute [rw] strong + # @return [::Boolean] + # Read at a timestamp where all previously committed transactions + # are visible. + # + # Note: The following fields are mutually exclusive: `strong`, `min_read_timestamp`, `max_staleness`, `read_timestamp`, `exact_staleness`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] min_read_timestamp + # @return [::Google::Protobuf::Timestamp] + # Executes all reads at a timestamp >= `min_read_timestamp`. + # + # This is useful for requesting fresher data than some previous + # read, or data that is fresh enough to observe the effects of some + # previously committed transaction whose timestamp is known. + # + # Note that this option can only be used in single-use transactions. + # + # A timestamp in RFC3339 UTC \"Zulu\" format, accurate to nanoseconds. + # Example: `"2014-10-02T15:01:23.045123456Z"`. + # + # Note: The following fields are mutually exclusive: `min_read_timestamp`, `strong`, `max_staleness`, `read_timestamp`, `exact_staleness`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] max_staleness + # @return [::Google::Protobuf::Duration] + # Read data at a timestamp >= `NOW - max_staleness` + # seconds. Guarantees that all writes that have committed more + # than the specified number of seconds ago are visible. Because + # Cloud Spanner chooses the exact timestamp, this mode works even if + # the client's local clock is substantially skewed from Cloud Spanner + # commit timestamps. + # + # Useful for reading the freshest data available at a nearby + # replica, while bounding the possible staleness if the local + # replica has fallen behind. + # + # Note that this option can only be used in single-use + # transactions. + # + # Note: The following fields are mutually exclusive: `max_staleness`, `strong`, `min_read_timestamp`, `read_timestamp`, `exact_staleness`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] read_timestamp + # @return [::Google::Protobuf::Timestamp] + # Executes all reads at the given timestamp. Unlike other modes, + # reads at a specific timestamp are repeatable; the same read at + # the same timestamp always returns the same data. If the + # timestamp is in the future, the read is blocked until the + # specified timestamp, modulo the read's deadline. + # + # Useful for large scale consistent reads such as mapreduces, or + # for coordinating many reads against a consistent snapshot of the + # data. + # + # A timestamp in RFC3339 UTC \"Zulu\" format, accurate to nanoseconds. + # Example: `"2014-10-02T15:01:23.045123456Z"`. + # + # Note: The following fields are mutually exclusive: `read_timestamp`, `strong`, `min_read_timestamp`, `max_staleness`, `exact_staleness`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] exact_staleness + # @return [::Google::Protobuf::Duration] + # Executes all reads at a timestamp that is `exact_staleness` + # old. The timestamp is chosen soon after the read is started. + # + # Guarantees that all writes that have committed more than the + # specified number of seconds ago are visible. Because Cloud Spanner + # chooses the exact timestamp, this mode works even if the client's + # local clock is substantially skewed from Cloud Spanner commit + # timestamps. + # + # Useful for reading at nearby replicas without the distributed + # timestamp negotiation overhead of `max_staleness`. + # + # Note: The following fields are mutually exclusive: `exact_staleness`, `strong`, `min_read_timestamp`, `max_staleness`, `read_timestamp`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] return_read_timestamp + # @return [::Boolean] + # If true, the Cloud Spanner-selected read timestamp is included in + # the {::Google::Cloud::Spanner::V1::Transaction Transaction} message that describes + # the transaction. + class ReadOnly + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `IsolationLevel` is used when setting the [isolation + # level](https://cloud.google.com/spanner/docs/isolation-levels) for a + # transaction. + module IsolationLevel + # Default value. + # + # If the value is not specified, the `SERIALIZABLE` isolation level is + # used. + ISOLATION_LEVEL_UNSPECIFIED = 0 + + # All transactions appear as if they executed in a serial order, even if + # some of the reads, writes, and other operations of distinct transactions + # actually occurred in parallel. Spanner assigns commit timestamps that + # reflect the order of committed transactions to implement this property. + # Spanner offers a stronger guarantee than serializability called external + # consistency. For more information, see + # [TrueTime and external + # consistency](https://cloud.google.com/spanner/docs/true-time-external-consistency#serializability). + SERIALIZABLE = 1 + + # All reads performed during the transaction observe a consistent snapshot + # of the database, and the transaction is only successfully committed in + # the absence of conflicts between its updates and any concurrent updates + # that have occurred since that snapshot. Consequently, in contrast to + # `SERIALIZABLE` transactions, only write-write conflicts are detected in + # snapshot transactions. + # + # This isolation level does not support read-only and partitioned DML + # transactions. + # + # When `REPEATABLE_READ` is specified on a read-write transaction, the + # locking semantics default to `OPTIMISTIC`. + REPEATABLE_READ = 2 + end + end + + # A transaction. + # @!attribute [rw] id + # @return [::String] + # `id` may be used to identify the transaction in subsequent + # {::Google::Cloud::Spanner::V1::Spanner::Client#read Read}, + # {::Google::Cloud::Spanner::V1::Spanner::Client#execute_sql ExecuteSql}, + # {::Google::Cloud::Spanner::V1::Spanner::Client#commit Commit}, or + # {::Google::Cloud::Spanner::V1::Spanner::Client#rollback Rollback} calls. + # + # Single-use read-only transactions do not have IDs, because + # single-use transactions do not support multiple requests. + # @!attribute [rw] read_timestamp + # @return [::Google::Protobuf::Timestamp] + # For snapshot read-only transactions, the read timestamp chosen + # for the transaction. Not returned by default: see + # {::Google::Cloud::Spanner::V1::TransactionOptions::ReadOnly#return_read_timestamp TransactionOptions.ReadOnly.return_read_timestamp}. + # + # A timestamp in RFC3339 UTC \"Zulu\" format, accurate to nanoseconds. + # Example: `"2014-10-02T15:01:23.045123456Z"`. + # @!attribute [rw] precommit_token + # @return [::Google::Cloud::Spanner::V1::MultiplexedSessionPrecommitToken] + # A precommit token is included in the response of a BeginTransaction + # request if the read-write transaction is on a multiplexed session and + # a mutation_key was specified in the + # {::Google::Cloud::Spanner::V1::BeginTransactionRequest BeginTransaction}. + # The precommit token with the highest sequence number from this transaction + # attempt should be passed to the {::Google::Cloud::Spanner::V1::Spanner::Client#commit Commit} + # request for this transaction. + class Transaction + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message is used to select the transaction in which a + # {::Google::Cloud::Spanner::V1::Spanner::Client#read Read} or + # {::Google::Cloud::Spanner::V1::Spanner::Client#execute_sql ExecuteSql} call runs. + # + # See {::Google::Cloud::Spanner::V1::TransactionOptions TransactionOptions} for more + # information about transactions. + # @!attribute [rw] single_use + # @return [::Google::Cloud::Spanner::V1::TransactionOptions] + # Execute the read or SQL query in a temporary transaction. + # This is the most efficient way to execute a transaction that + # consists of a single SQL query. + # + # Note: The following fields are mutually exclusive: `single_use`, `id`, `begin`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] id + # @return [::String] + # Execute the read or SQL query in a previously-started transaction. + # + # Note: The following fields are mutually exclusive: `id`, `single_use`, `begin`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] begin + # @return [::Google::Cloud::Spanner::V1::TransactionOptions] + # Begin a new transaction and execute this read or SQL query in + # it. The transaction ID of the new transaction is returned in + # {::Google::Cloud::Spanner::V1::ResultSetMetadata#transaction ResultSetMetadata.transaction}, + # which is a {::Google::Cloud::Spanner::V1::Transaction Transaction}. + # + # Note: The following fields are mutually exclusive: `begin`, `single_use`, `id`. If a field in that set is populated, all other fields in the set will automatically be cleared. + class TransactionSelector + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # When a read-write transaction is executed on a multiplexed session, + # this precommit token is sent back to the client + # as a part of the {::Google::Cloud::Spanner::V1::Transaction Transaction} message in the + # {::Google::Cloud::Spanner::V1::BeginTransactionRequest BeginTransaction} response and + # also as a part of the {::Google::Cloud::Spanner::V1::ResultSet ResultSet} and + # {::Google::Cloud::Spanner::V1::PartialResultSet PartialResultSet} responses. + # @!attribute [rw] precommit_token + # @return [::String] + # Opaque precommit token. + # @!attribute [rw] seq_num + # @return [::Integer] + # An incrementing seq number is generated on every precommit token + # that is returned. Clients should remember the precommit token with the + # highest sequence number from the current transaction attempt. + class MultiplexedSessionPrecommitToken + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/spanner/v1/type.rb b/owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/spanner/v1/type.rb new file mode 100644 index 000000000000..693060eddddf --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/spanner/v1/type.rb @@ -0,0 +1,222 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module Spanner + module V1 + # `Type` indicates the type of a Cloud Spanner value, as might be stored in a + # table cell or returned from an SQL query. + # @!attribute [rw] code + # @return [::Google::Cloud::Spanner::V1::TypeCode] + # Required. The {::Google::Cloud::Spanner::V1::TypeCode TypeCode} for this type. + # @!attribute [rw] array_element_type + # @return [::Google::Cloud::Spanner::V1::Type] + # If {::Google::Cloud::Spanner::V1::Type#code code} == + # {::Google::Cloud::Spanner::V1::TypeCode::ARRAY ARRAY}, then `array_element_type` is the + # type of the array elements. + # @!attribute [rw] struct_type + # @return [::Google::Cloud::Spanner::V1::StructType] + # If {::Google::Cloud::Spanner::V1::Type#code code} == + # {::Google::Cloud::Spanner::V1::TypeCode::STRUCT STRUCT}, then `struct_type` provides + # type information for the struct's fields. + # @!attribute [rw] type_annotation + # @return [::Google::Cloud::Spanner::V1::TypeAnnotationCode] + # The {::Google::Cloud::Spanner::V1::TypeAnnotationCode TypeAnnotationCode} that + # disambiguates SQL type that Spanner will use to represent values of this + # type during query processing. This is necessary for some type codes because + # a single {::Google::Cloud::Spanner::V1::TypeCode TypeCode} can be mapped to different + # SQL types depending on the SQL dialect. + # {::Google::Cloud::Spanner::V1::Type#type_annotation type_annotation} typically is not + # needed to process the content of a value (it doesn't affect serialization) + # and clients can ignore it on the read path. + # @!attribute [rw] proto_type_fqn + # @return [::String] + # If {::Google::Cloud::Spanner::V1::Type#code code} == + # {::Google::Cloud::Spanner::V1::TypeCode::PROTO PROTO} or + # {::Google::Cloud::Spanner::V1::Type#code code} == + # {::Google::Cloud::Spanner::V1::TypeCode::ENUM ENUM}, then `proto_type_fqn` is the fully + # qualified name of the proto type representing the proto/enum definition. + class Type + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `StructType` defines the fields of a + # {::Google::Cloud::Spanner::V1::TypeCode::STRUCT STRUCT} type. + # @!attribute [rw] fields + # @return [::Array<::Google::Cloud::Spanner::V1::StructType::Field>] + # The list of fields that make up this struct. Order is + # significant, because values of this struct type are represented as + # lists, where the order of field values matches the order of + # fields in the {::Google::Cloud::Spanner::V1::StructType StructType}. In turn, the + # order of fields matches the order of columns in a read request, or the + # order of fields in the `SELECT` clause of a query. + class StructType + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Message representing a single field of a struct. + # @!attribute [rw] name + # @return [::String] + # The name of the field. For reads, this is the column name. For + # SQL queries, it is the column alias (e.g., `"Word"` in the + # query `"SELECT 'hello' AS Word"`), or the column name (e.g., + # `"ColName"` in the query `"SELECT ColName FROM Table"`). Some + # columns might have an empty name (e.g., `"SELECT + # UPPER(ColName)"`). Note that a query result can contain + # multiple fields with the same name. + # @!attribute [rw] type + # @return [::Google::Cloud::Spanner::V1::Type] + # The type of the field. + class Field + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # `TypeCode` is used as part of {::Google::Cloud::Spanner::V1::Type Type} to + # indicate the type of a Cloud Spanner value. + # + # Each legal value of a type can be encoded to or decoded from a JSON + # value, using the encodings described below. All Cloud Spanner values can + # be `null`, regardless of type; `null`s are always encoded as a JSON + # `null`. + module TypeCode + # Not specified. + TYPE_CODE_UNSPECIFIED = 0 + + # Encoded as JSON `true` or `false`. + BOOL = 1 + + # Encoded as `string`, in decimal format. + INT64 = 2 + + # Encoded as `number`, or the strings `"NaN"`, `"Infinity"`, or + # `"-Infinity"`. + FLOAT64 = 3 + + # Encoded as `number`, or the strings `"NaN"`, `"Infinity"`, or + # `"-Infinity"`. + FLOAT32 = 15 + + # Encoded as `string` in RFC 3339 timestamp format. The time zone + # must be present, and must be `"Z"`. + # + # If the schema has the column option + # `allow_commit_timestamp=true`, the placeholder string + # `"spanner.commit_timestamp()"` can be used to instruct the system + # to insert the commit timestamp associated with the transaction + # commit. + TIMESTAMP = 4 + + # Encoded as `string` in RFC 3339 date format. + DATE = 5 + + # Encoded as `string`. + STRING = 6 + + # Encoded as a base64-encoded `string`, as described in RFC 4648, + # section 4. + BYTES = 7 + + # Encoded as `list`, where the list elements are represented + # according to + # {::Google::Cloud::Spanner::V1::Type#array_element_type array_element_type}. + ARRAY = 8 + + # Encoded as `list`, where list element `i` is represented according + # to [struct_type.fields[i]][google.spanner.v1.StructType.fields]. + STRUCT = 9 + + # Encoded as `string`, in decimal format or scientific notation format. + # Decimal format: + # `[+-]Digits[.[Digits]]` or + # `[+-][Digits].Digits` + # + # Scientific notation: + # `[+-]Digits[.[Digits]][ExponentIndicator[+-]Digits]` or + # `[+-][Digits].Digits[ExponentIndicator[+-]Digits]` + # (ExponentIndicator is `"e"` or `"E"`) + NUMERIC = 10 + + # Encoded as a JSON-formatted `string` as described in RFC 7159. The + # following rules are applied when parsing JSON input: + # + # - Whitespace characters are not preserved. + # - If a JSON object has duplicate keys, only the first key is preserved. + # - Members of a JSON object are not guaranteed to have their order + # preserved. + # - JSON array elements will have their order preserved. + JSON = 11 + + # Encoded as a base64-encoded `string`, as described in RFC 4648, + # section 4. + PROTO = 13 + + # Encoded as `string`, in decimal format. + ENUM = 14 + + # Encoded as `string`, in `ISO8601` duration format - + # `P[n]Y[n]M[n]DT[n]H[n]M[n[.fraction]]S` + # where `n` is an integer. + # For example, `P1Y2M3DT4H5M6.5S` represents time duration of 1 year, 2 + # months, 3 days, 4 hours, 5 minutes, and 6.5 seconds. + INTERVAL = 16 + + # Encoded as `string`, in lower-case hexa-decimal format, as described + # in RFC 9562, section 4. + UUID = 17 + end + + # `TypeAnnotationCode` is used as a part of {::Google::Cloud::Spanner::V1::Type Type} to + # disambiguate SQL types that should be used for a given Cloud Spanner value. + # Disambiguation is needed because the same Cloud Spanner type can be mapped to + # different SQL types depending on SQL dialect. TypeAnnotationCode doesn't + # affect the way value is serialized. + module TypeAnnotationCode + # Not specified. + TYPE_ANNOTATION_CODE_UNSPECIFIED = 0 + + # PostgreSQL compatible NUMERIC type. This annotation needs to be applied to + # {::Google::Cloud::Spanner::V1::Type Type} instances having + # {::Google::Cloud::Spanner::V1::TypeCode::NUMERIC NUMERIC} type code to specify that + # values of this type should be treated as PostgreSQL NUMERIC values. + # Currently this annotation is always needed for + # {::Google::Cloud::Spanner::V1::TypeCode::NUMERIC NUMERIC} when a client interacts with + # PostgreSQL-enabled Spanner databases. + PG_NUMERIC = 2 + + # PostgreSQL compatible JSONB type. This annotation needs to be applied to + # {::Google::Cloud::Spanner::V1::Type Type} instances having + # {::Google::Cloud::Spanner::V1::TypeCode::JSON JSON} type code to specify that values of + # this type should be treated as PostgreSQL JSONB values. Currently this + # annotation is always needed for {::Google::Cloud::Spanner::V1::TypeCode::JSON JSON} + # when a client interacts with PostgreSQL-enabled Spanner databases. + PG_JSONB = 3 + + # PostgreSQL compatible OID type. This annotation can be used by a client + # interacting with PostgreSQL-enabled Spanner database to specify that a + # value should be treated using the semantics of the OID type. + PG_OID = 4 + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-spanner-v1/snippets/Gemfile b/owl-bot-staging/google-cloud-spanner-v1/snippets/Gemfile new file mode 100644 index 000000000000..77b0e1097706 --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-v1/snippets/Gemfile @@ -0,0 +1,32 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +source "https://rubygems.org" + +if ENV["GOOGLE_CLOUD_SAMPLES_TEST"] == "master" + gem "google-cloud-spanner-v1", path: "../" +else + gem "google-cloud-spanner-v1" +end + +group :test do + gem "google-style", "~> 1.26.1" + gem "minitest", "~> 5.16" + gem "minitest-focus", "~> 1.1" + gem "minitest-hooks", "~> 1.5" +end diff --git a/owl-bot-staging/google-cloud-spanner-v1/snippets/snippet_metadata_google.spanner.v1.json b/owl-bot-staging/google-cloud-spanner-v1/snippets/snippet_metadata_google.spanner.v1.json new file mode 100644 index 000000000000..7aed2197752d --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-v1/snippets/snippet_metadata_google.spanner.v1.json @@ -0,0 +1,655 @@ +{ + "client_library": { + "name": "google-cloud-spanner-v1", + "version": "", + "language": "RUBY", + "apis": [ + { + "id": "google.spanner.v1", + "version": "v1" + } + ] + }, + "snippets": [ + { + "region_tag": "spanner_v1_generated_Spanner_CreateSession_sync", + "title": "Snippet for the create_session call in the Spanner service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Spanner::V1::Spanner::Client#create_session.", + "file": "spanner/create_session.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_session", + "full_name": "::Google::Cloud::Spanner::V1::Spanner::Client#create_session", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Spanner::V1::CreateSessionRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Spanner::V1::Session", + "client": { + "short_name": "Spanner::Client", + "full_name": "::Google::Cloud::Spanner::V1::Spanner::Client" + }, + "method": { + "short_name": "CreateSession", + "full_name": "google.spanner.v1.Spanner.CreateSession", + "service": { + "short_name": "Spanner", + "full_name": "google.spanner.v1.Spanner" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "spanner_v1_generated_Spanner_BatchCreateSessions_sync", + "title": "Snippet for the batch_create_sessions call in the Spanner service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Spanner::V1::Spanner::Client#batch_create_sessions.", + "file": "spanner/batch_create_sessions.rb", + "language": "RUBY", + "client_method": { + "short_name": "batch_create_sessions", + "full_name": "::Google::Cloud::Spanner::V1::Spanner::Client#batch_create_sessions", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Spanner::V1::BatchCreateSessionsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Spanner::V1::BatchCreateSessionsResponse", + "client": { + "short_name": "Spanner::Client", + "full_name": "::Google::Cloud::Spanner::V1::Spanner::Client" + }, + "method": { + "short_name": "BatchCreateSessions", + "full_name": "google.spanner.v1.Spanner.BatchCreateSessions", + "service": { + "short_name": "Spanner", + "full_name": "google.spanner.v1.Spanner" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "spanner_v1_generated_Spanner_GetSession_sync", + "title": "Snippet for the get_session call in the Spanner service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Spanner::V1::Spanner::Client#get_session.", + "file": "spanner/get_session.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_session", + "full_name": "::Google::Cloud::Spanner::V1::Spanner::Client#get_session", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Spanner::V1::GetSessionRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Spanner::V1::Session", + "client": { + "short_name": "Spanner::Client", + "full_name": "::Google::Cloud::Spanner::V1::Spanner::Client" + }, + "method": { + "short_name": "GetSession", + "full_name": "google.spanner.v1.Spanner.GetSession", + "service": { + "short_name": "Spanner", + "full_name": "google.spanner.v1.Spanner" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "spanner_v1_generated_Spanner_ListSessions_sync", + "title": "Snippet for the list_sessions call in the Spanner service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Spanner::V1::Spanner::Client#list_sessions.", + "file": "spanner/list_sessions.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_sessions", + "full_name": "::Google::Cloud::Spanner::V1::Spanner::Client#list_sessions", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Spanner::V1::ListSessionsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Spanner::V1::ListSessionsResponse", + "client": { + "short_name": "Spanner::Client", + "full_name": "::Google::Cloud::Spanner::V1::Spanner::Client" + }, + "method": { + "short_name": "ListSessions", + "full_name": "google.spanner.v1.Spanner.ListSessions", + "service": { + "short_name": "Spanner", + "full_name": "google.spanner.v1.Spanner" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "spanner_v1_generated_Spanner_DeleteSession_sync", + "title": "Snippet for the delete_session call in the Spanner service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Spanner::V1::Spanner::Client#delete_session.", + "file": "spanner/delete_session.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_session", + "full_name": "::Google::Cloud::Spanner::V1::Spanner::Client#delete_session", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Spanner::V1::DeleteSessionRequest", + "name": "request" + } + ], + "result_type": "::Google::Protobuf::Empty", + "client": { + "short_name": "Spanner::Client", + "full_name": "::Google::Cloud::Spanner::V1::Spanner::Client" + }, + "method": { + "short_name": "DeleteSession", + "full_name": "google.spanner.v1.Spanner.DeleteSession", + "service": { + "short_name": "Spanner", + "full_name": "google.spanner.v1.Spanner" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "spanner_v1_generated_Spanner_ExecuteSql_sync", + "title": "Snippet for the execute_sql call in the Spanner service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Spanner::V1::Spanner::Client#execute_sql.", + "file": "spanner/execute_sql.rb", + "language": "RUBY", + "client_method": { + "short_name": "execute_sql", + "full_name": "::Google::Cloud::Spanner::V1::Spanner::Client#execute_sql", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Spanner::V1::ExecuteSqlRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Spanner::V1::ResultSet", + "client": { + "short_name": "Spanner::Client", + "full_name": "::Google::Cloud::Spanner::V1::Spanner::Client" + }, + "method": { + "short_name": "ExecuteSql", + "full_name": "google.spanner.v1.Spanner.ExecuteSql", + "service": { + "short_name": "Spanner", + "full_name": "google.spanner.v1.Spanner" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "spanner_v1_generated_Spanner_ExecuteStreamingSql_sync", + "title": "Snippet for the execute_streaming_sql call in the Spanner service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Spanner::V1::Spanner::Client#execute_streaming_sql.", + "file": "spanner/execute_streaming_sql.rb", + "language": "RUBY", + "client_method": { + "short_name": "execute_streaming_sql", + "full_name": "::Google::Cloud::Spanner::V1::Spanner::Client#execute_streaming_sql", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Spanner::V1::ExecuteSqlRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Spanner::V1::PartialResultSet", + "client": { + "short_name": "Spanner::Client", + "full_name": "::Google::Cloud::Spanner::V1::Spanner::Client" + }, + "method": { + "short_name": "ExecuteStreamingSql", + "full_name": "google.spanner.v1.Spanner.ExecuteStreamingSql", + "service": { + "short_name": "Spanner", + "full_name": "google.spanner.v1.Spanner" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 49, + "type": "FULL" + } + ] + }, + { + "region_tag": "spanner_v1_generated_Spanner_ExecuteBatchDml_sync", + "title": "Snippet for the execute_batch_dml call in the Spanner service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Spanner::V1::Spanner::Client#execute_batch_dml.", + "file": "spanner/execute_batch_dml.rb", + "language": "RUBY", + "client_method": { + "short_name": "execute_batch_dml", + "full_name": "::Google::Cloud::Spanner::V1::Spanner::Client#execute_batch_dml", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Spanner::V1::ExecuteBatchDmlRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Spanner::V1::ExecuteBatchDmlResponse", + "client": { + "short_name": "Spanner::Client", + "full_name": "::Google::Cloud::Spanner::V1::Spanner::Client" + }, + "method": { + "short_name": "ExecuteBatchDml", + "full_name": "google.spanner.v1.Spanner.ExecuteBatchDml", + "service": { + "short_name": "Spanner", + "full_name": "google.spanner.v1.Spanner" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "spanner_v1_generated_Spanner_Read_sync", + "title": "Snippet for the read call in the Spanner service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Spanner::V1::Spanner::Client#read.", + "file": "spanner/read.rb", + "language": "RUBY", + "client_method": { + "short_name": "read", + "full_name": "::Google::Cloud::Spanner::V1::Spanner::Client#read", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Spanner::V1::ReadRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Spanner::V1::ResultSet", + "client": { + "short_name": "Spanner::Client", + "full_name": "::Google::Cloud::Spanner::V1::Spanner::Client" + }, + "method": { + "short_name": "Read", + "full_name": "google.spanner.v1.Spanner.Read", + "service": { + "short_name": "Spanner", + "full_name": "google.spanner.v1.Spanner" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "spanner_v1_generated_Spanner_StreamingRead_sync", + "title": "Snippet for the streaming_read call in the Spanner service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Spanner::V1::Spanner::Client#streaming_read.", + "file": "spanner/streaming_read.rb", + "language": "RUBY", + "client_method": { + "short_name": "streaming_read", + "full_name": "::Google::Cloud::Spanner::V1::Spanner::Client#streaming_read", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Spanner::V1::ReadRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Spanner::V1::PartialResultSet", + "client": { + "short_name": "Spanner::Client", + "full_name": "::Google::Cloud::Spanner::V1::Spanner::Client" + }, + "method": { + "short_name": "StreamingRead", + "full_name": "google.spanner.v1.Spanner.StreamingRead", + "service": { + "short_name": "Spanner", + "full_name": "google.spanner.v1.Spanner" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 49, + "type": "FULL" + } + ] + }, + { + "region_tag": "spanner_v1_generated_Spanner_BeginTransaction_sync", + "title": "Snippet for the begin_transaction call in the Spanner service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Spanner::V1::Spanner::Client#begin_transaction.", + "file": "spanner/begin_transaction.rb", + "language": "RUBY", + "client_method": { + "short_name": "begin_transaction", + "full_name": "::Google::Cloud::Spanner::V1::Spanner::Client#begin_transaction", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Spanner::V1::BeginTransactionRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Spanner::V1::Transaction", + "client": { + "short_name": "Spanner::Client", + "full_name": "::Google::Cloud::Spanner::V1::Spanner::Client" + }, + "method": { + "short_name": "BeginTransaction", + "full_name": "google.spanner.v1.Spanner.BeginTransaction", + "service": { + "short_name": "Spanner", + "full_name": "google.spanner.v1.Spanner" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "spanner_v1_generated_Spanner_Commit_sync", + "title": "Snippet for the commit call in the Spanner service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Spanner::V1::Spanner::Client#commit.", + "file": "spanner/commit.rb", + "language": "RUBY", + "client_method": { + "short_name": "commit", + "full_name": "::Google::Cloud::Spanner::V1::Spanner::Client#commit", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Spanner::V1::CommitRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Spanner::V1::CommitResponse", + "client": { + "short_name": "Spanner::Client", + "full_name": "::Google::Cloud::Spanner::V1::Spanner::Client" + }, + "method": { + "short_name": "Commit", + "full_name": "google.spanner.v1.Spanner.Commit", + "service": { + "short_name": "Spanner", + "full_name": "google.spanner.v1.Spanner" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "spanner_v1_generated_Spanner_Rollback_sync", + "title": "Snippet for the rollback call in the Spanner service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Spanner::V1::Spanner::Client#rollback.", + "file": "spanner/rollback.rb", + "language": "RUBY", + "client_method": { + "short_name": "rollback", + "full_name": "::Google::Cloud::Spanner::V1::Spanner::Client#rollback", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Spanner::V1::RollbackRequest", + "name": "request" + } + ], + "result_type": "::Google::Protobuf::Empty", + "client": { + "short_name": "Spanner::Client", + "full_name": "::Google::Cloud::Spanner::V1::Spanner::Client" + }, + "method": { + "short_name": "Rollback", + "full_name": "google.spanner.v1.Spanner.Rollback", + "service": { + "short_name": "Spanner", + "full_name": "google.spanner.v1.Spanner" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "spanner_v1_generated_Spanner_PartitionQuery_sync", + "title": "Snippet for the partition_query call in the Spanner service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Spanner::V1::Spanner::Client#partition_query.", + "file": "spanner/partition_query.rb", + "language": "RUBY", + "client_method": { + "short_name": "partition_query", + "full_name": "::Google::Cloud::Spanner::V1::Spanner::Client#partition_query", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Spanner::V1::PartitionQueryRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Spanner::V1::PartitionResponse", + "client": { + "short_name": "Spanner::Client", + "full_name": "::Google::Cloud::Spanner::V1::Spanner::Client" + }, + "method": { + "short_name": "PartitionQuery", + "full_name": "google.spanner.v1.Spanner.PartitionQuery", + "service": { + "short_name": "Spanner", + "full_name": "google.spanner.v1.Spanner" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "spanner_v1_generated_Spanner_PartitionRead_sync", + "title": "Snippet for the partition_read call in the Spanner service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Spanner::V1::Spanner::Client#partition_read.", + "file": "spanner/partition_read.rb", + "language": "RUBY", + "client_method": { + "short_name": "partition_read", + "full_name": "::Google::Cloud::Spanner::V1::Spanner::Client#partition_read", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Spanner::V1::PartitionReadRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Spanner::V1::PartitionResponse", + "client": { + "short_name": "Spanner::Client", + "full_name": "::Google::Cloud::Spanner::V1::Spanner::Client" + }, + "method": { + "short_name": "PartitionRead", + "full_name": "google.spanner.v1.Spanner.PartitionRead", + "service": { + "short_name": "Spanner", + "full_name": "google.spanner.v1.Spanner" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "spanner_v1_generated_Spanner_BatchWrite_sync", + "title": "Snippet for the batch_write call in the Spanner service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Spanner::V1::Spanner::Client#batch_write.", + "file": "spanner/batch_write.rb", + "language": "RUBY", + "client_method": { + "short_name": "batch_write", + "full_name": "::Google::Cloud::Spanner::V1::Spanner::Client#batch_write", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Spanner::V1::BatchWriteRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Spanner::V1::BatchWriteResponse", + "client": { + "short_name": "Spanner::Client", + "full_name": "::Google::Cloud::Spanner::V1::Spanner::Client" + }, + "method": { + "short_name": "BatchWrite", + "full_name": "google.spanner.v1.Spanner.BatchWrite", + "service": { + "short_name": "Spanner", + "full_name": "google.spanner.v1.Spanner" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 49, + "type": "FULL" + } + ] + } + ] +} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/batch_create_sessions.rb b/owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/batch_create_sessions.rb new file mode 100644 index 000000000000..0586ea617219 --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/batch_create_sessions.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START spanner_v1_generated_Spanner_BatchCreateSessions_sync] +require "google/cloud/spanner/v1" + +## +# Snippet for the batch_create_sessions call in the Spanner service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Spanner::V1::Spanner::Client#batch_create_sessions. +# +def batch_create_sessions + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Spanner::V1::Spanner::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Spanner::V1::BatchCreateSessionsRequest.new + + # Call the batch_create_sessions method. + result = client.batch_create_sessions request + + # The returned object is of type Google::Cloud::Spanner::V1::BatchCreateSessionsResponse. + p result +end +# [END spanner_v1_generated_Spanner_BatchCreateSessions_sync] diff --git a/owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/batch_write.rb b/owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/batch_write.rb new file mode 100644 index 000000000000..b95914412706 --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/batch_write.rb @@ -0,0 +1,50 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START spanner_v1_generated_Spanner_BatchWrite_sync] +require "google/cloud/spanner/v1" + +## +# Snippet for the batch_write call in the Spanner service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Spanner::V1::Spanner::Client#batch_write. +# +def batch_write + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Spanner::V1::Spanner::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Spanner::V1::BatchWriteRequest.new + + # Call the batch_write method to start streaming. + output = client.batch_write request + + # The returned object is a streamed enumerable yielding elements of type + # ::Google::Cloud::Spanner::V1::BatchWriteResponse + output.each do |current_response| + p current_response + end +end +# [END spanner_v1_generated_Spanner_BatchWrite_sync] diff --git a/owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/begin_transaction.rb b/owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/begin_transaction.rb new file mode 100644 index 000000000000..491b1932c86d --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/begin_transaction.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START spanner_v1_generated_Spanner_BeginTransaction_sync] +require "google/cloud/spanner/v1" + +## +# Snippet for the begin_transaction call in the Spanner service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Spanner::V1::Spanner::Client#begin_transaction. +# +def begin_transaction + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Spanner::V1::Spanner::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Spanner::V1::BeginTransactionRequest.new + + # Call the begin_transaction method. + result = client.begin_transaction request + + # The returned object is of type Google::Cloud::Spanner::V1::Transaction. + p result +end +# [END spanner_v1_generated_Spanner_BeginTransaction_sync] diff --git a/owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/commit.rb b/owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/commit.rb new file mode 100644 index 000000000000..bdef590c536b --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/commit.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START spanner_v1_generated_Spanner_Commit_sync] +require "google/cloud/spanner/v1" + +## +# Snippet for the commit call in the Spanner service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Spanner::V1::Spanner::Client#commit. +# +def commit + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Spanner::V1::Spanner::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Spanner::V1::CommitRequest.new + + # Call the commit method. + result = client.commit request + + # The returned object is of type Google::Cloud::Spanner::V1::CommitResponse. + p result +end +# [END spanner_v1_generated_Spanner_Commit_sync] diff --git a/owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/create_session.rb b/owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/create_session.rb new file mode 100644 index 000000000000..2978e20b708d --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/create_session.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START spanner_v1_generated_Spanner_CreateSession_sync] +require "google/cloud/spanner/v1" + +## +# Snippet for the create_session call in the Spanner service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Spanner::V1::Spanner::Client#create_session. +# +def create_session + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Spanner::V1::Spanner::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Spanner::V1::CreateSessionRequest.new + + # Call the create_session method. + result = client.create_session request + + # The returned object is of type Google::Cloud::Spanner::V1::Session. + p result +end +# [END spanner_v1_generated_Spanner_CreateSession_sync] diff --git a/owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/delete_session.rb b/owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/delete_session.rb new file mode 100644 index 000000000000..0fe6714eefc1 --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/delete_session.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START spanner_v1_generated_Spanner_DeleteSession_sync] +require "google/cloud/spanner/v1" + +## +# Snippet for the delete_session call in the Spanner service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Spanner::V1::Spanner::Client#delete_session. +# +def delete_session + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Spanner::V1::Spanner::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Spanner::V1::DeleteSessionRequest.new + + # Call the delete_session method. + result = client.delete_session request + + # The returned object is of type Google::Protobuf::Empty. + p result +end +# [END spanner_v1_generated_Spanner_DeleteSession_sync] diff --git a/owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/execute_batch_dml.rb b/owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/execute_batch_dml.rb new file mode 100644 index 000000000000..0dfff556a81d --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/execute_batch_dml.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START spanner_v1_generated_Spanner_ExecuteBatchDml_sync] +require "google/cloud/spanner/v1" + +## +# Snippet for the execute_batch_dml call in the Spanner service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Spanner::V1::Spanner::Client#execute_batch_dml. +# +def execute_batch_dml + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Spanner::V1::Spanner::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Spanner::V1::ExecuteBatchDmlRequest.new + + # Call the execute_batch_dml method. + result = client.execute_batch_dml request + + # The returned object is of type Google::Cloud::Spanner::V1::ExecuteBatchDmlResponse. + p result +end +# [END spanner_v1_generated_Spanner_ExecuteBatchDml_sync] diff --git a/owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/execute_sql.rb b/owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/execute_sql.rb new file mode 100644 index 000000000000..25fda1b8ff3f --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/execute_sql.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START spanner_v1_generated_Spanner_ExecuteSql_sync] +require "google/cloud/spanner/v1" + +## +# Snippet for the execute_sql call in the Spanner service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Spanner::V1::Spanner::Client#execute_sql. +# +def execute_sql + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Spanner::V1::Spanner::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Spanner::V1::ExecuteSqlRequest.new + + # Call the execute_sql method. + result = client.execute_sql request + + # The returned object is of type Google::Cloud::Spanner::V1::ResultSet. + p result +end +# [END spanner_v1_generated_Spanner_ExecuteSql_sync] diff --git a/owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/execute_streaming_sql.rb b/owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/execute_streaming_sql.rb new file mode 100644 index 000000000000..e96077064cca --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/execute_streaming_sql.rb @@ -0,0 +1,50 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START spanner_v1_generated_Spanner_ExecuteStreamingSql_sync] +require "google/cloud/spanner/v1" + +## +# Snippet for the execute_streaming_sql call in the Spanner service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Spanner::V1::Spanner::Client#execute_streaming_sql. +# +def execute_streaming_sql + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Spanner::V1::Spanner::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Spanner::V1::ExecuteSqlRequest.new + + # Call the execute_streaming_sql method to start streaming. + output = client.execute_streaming_sql request + + # The returned object is a streamed enumerable yielding elements of type + # ::Google::Cloud::Spanner::V1::PartialResultSet + output.each do |current_response| + p current_response + end +end +# [END spanner_v1_generated_Spanner_ExecuteStreamingSql_sync] diff --git a/owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/get_session.rb b/owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/get_session.rb new file mode 100644 index 000000000000..57e3f09069af --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/get_session.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START spanner_v1_generated_Spanner_GetSession_sync] +require "google/cloud/spanner/v1" + +## +# Snippet for the get_session call in the Spanner service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Spanner::V1::Spanner::Client#get_session. +# +def get_session + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Spanner::V1::Spanner::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Spanner::V1::GetSessionRequest.new + + # Call the get_session method. + result = client.get_session request + + # The returned object is of type Google::Cloud::Spanner::V1::Session. + p result +end +# [END spanner_v1_generated_Spanner_GetSession_sync] diff --git a/owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/list_sessions.rb b/owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/list_sessions.rb new file mode 100644 index 000000000000..ad2e46e5db36 --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/list_sessions.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START spanner_v1_generated_Spanner_ListSessions_sync] +require "google/cloud/spanner/v1" + +## +# Snippet for the list_sessions call in the Spanner service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Spanner::V1::Spanner::Client#list_sessions. +# +def list_sessions + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Spanner::V1::Spanner::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Spanner::V1::ListSessionsRequest.new + + # Call the list_sessions method. + result = client.list_sessions request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::Spanner::V1::Session. + p item + end +end +# [END spanner_v1_generated_Spanner_ListSessions_sync] diff --git a/owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/partition_query.rb b/owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/partition_query.rb new file mode 100644 index 000000000000..fe7511916bee --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/partition_query.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START spanner_v1_generated_Spanner_PartitionQuery_sync] +require "google/cloud/spanner/v1" + +## +# Snippet for the partition_query call in the Spanner service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Spanner::V1::Spanner::Client#partition_query. +# +def partition_query + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Spanner::V1::Spanner::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Spanner::V1::PartitionQueryRequest.new + + # Call the partition_query method. + result = client.partition_query request + + # The returned object is of type Google::Cloud::Spanner::V1::PartitionResponse. + p result +end +# [END spanner_v1_generated_Spanner_PartitionQuery_sync] diff --git a/owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/partition_read.rb b/owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/partition_read.rb new file mode 100644 index 000000000000..548247d9a655 --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/partition_read.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START spanner_v1_generated_Spanner_PartitionRead_sync] +require "google/cloud/spanner/v1" + +## +# Snippet for the partition_read call in the Spanner service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Spanner::V1::Spanner::Client#partition_read. +# +def partition_read + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Spanner::V1::Spanner::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Spanner::V1::PartitionReadRequest.new + + # Call the partition_read method. + result = client.partition_read request + + # The returned object is of type Google::Cloud::Spanner::V1::PartitionResponse. + p result +end +# [END spanner_v1_generated_Spanner_PartitionRead_sync] diff --git a/owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/read.rb b/owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/read.rb new file mode 100644 index 000000000000..e0ae8f6a89bd --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/read.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START spanner_v1_generated_Spanner_Read_sync] +require "google/cloud/spanner/v1" + +## +# Snippet for the read call in the Spanner service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Spanner::V1::Spanner::Client#read. +# +def read + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Spanner::V1::Spanner::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Spanner::V1::ReadRequest.new + + # Call the read method. + result = client.read request + + # The returned object is of type Google::Cloud::Spanner::V1::ResultSet. + p result +end +# [END spanner_v1_generated_Spanner_Read_sync] diff --git a/owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/rollback.rb b/owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/rollback.rb new file mode 100644 index 000000000000..aa46e63322b9 --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/rollback.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START spanner_v1_generated_Spanner_Rollback_sync] +require "google/cloud/spanner/v1" + +## +# Snippet for the rollback call in the Spanner service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Spanner::V1::Spanner::Client#rollback. +# +def rollback + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Spanner::V1::Spanner::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Spanner::V1::RollbackRequest.new + + # Call the rollback method. + result = client.rollback request + + # The returned object is of type Google::Protobuf::Empty. + p result +end +# [END spanner_v1_generated_Spanner_Rollback_sync] diff --git a/owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/streaming_read.rb b/owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/streaming_read.rb new file mode 100644 index 000000000000..858dafcebeb7 --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/streaming_read.rb @@ -0,0 +1,50 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START spanner_v1_generated_Spanner_StreamingRead_sync] +require "google/cloud/spanner/v1" + +## +# Snippet for the streaming_read call in the Spanner service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Spanner::V1::Spanner::Client#streaming_read. +# +def streaming_read + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Spanner::V1::Spanner::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Spanner::V1::ReadRequest.new + + # Call the streaming_read method to start streaming. + output = client.streaming_read request + + # The returned object is a streamed enumerable yielding elements of type + # ::Google::Cloud::Spanner::V1::PartialResultSet + output.each do |current_response| + p current_response + end +end +# [END spanner_v1_generated_Spanner_StreamingRead_sync] diff --git a/owl-bot-staging/google-cloud-spanner-v1/test/google/cloud/spanner/v1/spanner_paths_test.rb b/owl-bot-staging/google-cloud-spanner-v1/test/google/cloud/spanner/v1/spanner_paths_test.rb new file mode 100644 index 000000000000..f1898edbaf00 --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-v1/test/google/cloud/spanner/v1/spanner_paths_test.rb @@ -0,0 +1,67 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/spanner/v1/spanner" + +class ::Google::Cloud::Spanner::V1::Spanner::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_database_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Spanner::V1::Spanner::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.database_path project: "value0", instance: "value1", database: "value2" + assert_equal "projects/value0/instances/value1/databases/value2", path + end + end + + def test_session_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Spanner::V1::Spanner::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.session_path project: "value0", instance: "value1", database: "value2", session: "value3" + assert_equal "projects/value0/instances/value1/databases/value2/sessions/value3", path + end + end +end diff --git a/owl-bot-staging/google-cloud-spanner-v1/test/google/cloud/spanner/v1/spanner_test.rb b/owl-bot-staging/google-cloud-spanner-v1/test/google/cloud/spanner/v1/spanner_test.rb new file mode 100644 index 000000000000..262fd4461e4f --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-v1/test/google/cloud/spanner/v1/spanner_test.rb @@ -0,0 +1,1265 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/spanner/v1/spanner_pb" +require "google/cloud/spanner/v1/spanner" + +class ::Google::Cloud::Spanner::V1::Spanner::ClientTest < Minitest::Test + class ClientStub + attr_accessor :call_rpc_count, :requests + + def initialize response, operation, &block + @response = response + @operation = operation + @block = block + @call_rpc_count = 0 + @requests = [] + end + + def call_rpc *args, **kwargs + @call_rpc_count += 1 + + @requests << @block&.call(*args, **kwargs) + + catch :response do + yield @response, @operation if block_given? + @response + end + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_create_session + # Create GRPC objects. + grpc_response = ::Google::Cloud::Spanner::V1::Session.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + database = "hello world" + session = {} + + create_session_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_session, name + assert_kind_of ::Google::Cloud::Spanner::V1::CreateSessionRequest, request + assert_equal "hello world", request["database"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Spanner::V1::Session), request["session"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_session_client_stub do + # Create client + client = ::Google::Cloud::Spanner::V1::Spanner::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_session({ database: database, session: session }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.create_session database: database, session: session do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.create_session ::Google::Cloud::Spanner::V1::CreateSessionRequest.new(database: database, session: session) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.create_session({ database: database, session: session }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.create_session(::Google::Cloud::Spanner::V1::CreateSessionRequest.new(database: database, session: session), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, create_session_client_stub.call_rpc_count + end + end + + def test_batch_create_sessions + # Create GRPC objects. + grpc_response = ::Google::Cloud::Spanner::V1::BatchCreateSessionsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + database = "hello world" + session_template = {} + session_count = 42 + + batch_create_sessions_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :batch_create_sessions, name + assert_kind_of ::Google::Cloud::Spanner::V1::BatchCreateSessionsRequest, request + assert_equal "hello world", request["database"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Spanner::V1::Session), request["session_template"] + assert_equal 42, request["session_count"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, batch_create_sessions_client_stub do + # Create client + client = ::Google::Cloud::Spanner::V1::Spanner::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.batch_create_sessions({ database: database, session_template: session_template, session_count: session_count }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.batch_create_sessions database: database, session_template: session_template, session_count: session_count do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.batch_create_sessions ::Google::Cloud::Spanner::V1::BatchCreateSessionsRequest.new(database: database, session_template: session_template, session_count: session_count) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.batch_create_sessions({ database: database, session_template: session_template, session_count: session_count }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.batch_create_sessions(::Google::Cloud::Spanner::V1::BatchCreateSessionsRequest.new(database: database, session_template: session_template, session_count: session_count), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, batch_create_sessions_client_stub.call_rpc_count + end + end + + def test_get_session + # Create GRPC objects. + grpc_response = ::Google::Cloud::Spanner::V1::Session.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_session_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_session, name + assert_kind_of ::Google::Cloud::Spanner::V1::GetSessionRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_session_client_stub do + # Create client + client = ::Google::Cloud::Spanner::V1::Spanner::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_session({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_session name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_session ::Google::Cloud::Spanner::V1::GetSessionRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_session({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_session(::Google::Cloud::Spanner::V1::GetSessionRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_session_client_stub.call_rpc_count + end + end + + def test_list_sessions + # Create GRPC objects. + grpc_response = ::Google::Cloud::Spanner::V1::ListSessionsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + database = "hello world" + page_size = 42 + page_token = "hello world" + filter = "hello world" + + list_sessions_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_sessions, name + assert_kind_of ::Google::Cloud::Spanner::V1::ListSessionsRequest, request + assert_equal "hello world", request["database"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + assert_equal "hello world", request["filter"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_sessions_client_stub do + # Create client + client = ::Google::Cloud::Spanner::V1::Spanner::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_sessions({ database: database, page_size: page_size, page_token: page_token, filter: filter }) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.list_sessions database: database, page_size: page_size, page_token: page_token, filter: filter do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.list_sessions ::Google::Cloud::Spanner::V1::ListSessionsRequest.new(database: database, page_size: page_size, page_token: page_token, filter: filter) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.list_sessions({ database: database, page_size: page_size, page_token: page_token, filter: filter }, grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.list_sessions(::Google::Cloud::Spanner::V1::ListSessionsRequest.new(database: database, page_size: page_size, page_token: page_token, filter: filter), grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, list_sessions_client_stub.call_rpc_count + end + end + + def test_delete_session + # Create GRPC objects. + grpc_response = ::Google::Protobuf::Empty.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + delete_session_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_session, name + assert_kind_of ::Google::Cloud::Spanner::V1::DeleteSessionRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_session_client_stub do + # Create client + client = ::Google::Cloud::Spanner::V1::Spanner::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_session({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_session name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_session ::Google::Cloud::Spanner::V1::DeleteSessionRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_session({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.delete_session(::Google::Cloud::Spanner::V1::DeleteSessionRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, delete_session_client_stub.call_rpc_count + end + end + + def test_execute_sql + # Create GRPC objects. + grpc_response = ::Google::Cloud::Spanner::V1::ResultSet.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + session = "hello world" + transaction = {} + sql = "hello world" + params = {} + param_types = {} + resume_token = "hello world" + query_mode = :NORMAL + partition_token = "hello world" + seqno = 42 + query_options = {} + request_options = {} + directed_read_options = {} + data_boost_enabled = true + last_statement = true + routing_hint = {} + + execute_sql_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :execute_sql, name + assert_kind_of ::Google::Cloud::Spanner::V1::ExecuteSqlRequest, request + assert_equal "hello world", request["session"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Spanner::V1::TransactionSelector), request["transaction"] + assert_equal "hello world", request["sql"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Struct), request["params"] + assert_equal({}, request["param_types"].to_h) + assert_equal "hello world", request["resume_token"] + assert_equal :NORMAL, request["query_mode"] + assert_equal "hello world", request["partition_token"] + assert_equal 42, request["seqno"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Spanner::V1::ExecuteSqlRequest::QueryOptions), request["query_options"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Spanner::V1::RequestOptions), request["request_options"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Spanner::V1::DirectedReadOptions), request["directed_read_options"] + assert_equal true, request["data_boost_enabled"] + assert_equal true, request["last_statement"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Spanner::V1::RoutingHint), request["routing_hint"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, execute_sql_client_stub do + # Create client + client = ::Google::Cloud::Spanner::V1::Spanner::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.execute_sql({ session: session, transaction: transaction, sql: sql, params: params, param_types: param_types, resume_token: resume_token, query_mode: query_mode, partition_token: partition_token, seqno: seqno, query_options: query_options, request_options: request_options, directed_read_options: directed_read_options, data_boost_enabled: data_boost_enabled, last_statement: last_statement, routing_hint: routing_hint }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.execute_sql session: session, transaction: transaction, sql: sql, params: params, param_types: param_types, resume_token: resume_token, query_mode: query_mode, partition_token: partition_token, seqno: seqno, query_options: query_options, request_options: request_options, directed_read_options: directed_read_options, data_boost_enabled: data_boost_enabled, last_statement: last_statement, routing_hint: routing_hint do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.execute_sql ::Google::Cloud::Spanner::V1::ExecuteSqlRequest.new(session: session, transaction: transaction, sql: sql, params: params, param_types: param_types, resume_token: resume_token, query_mode: query_mode, partition_token: partition_token, seqno: seqno, query_options: query_options, request_options: request_options, directed_read_options: directed_read_options, data_boost_enabled: data_boost_enabled, last_statement: last_statement, routing_hint: routing_hint) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.execute_sql({ session: session, transaction: transaction, sql: sql, params: params, param_types: param_types, resume_token: resume_token, query_mode: query_mode, partition_token: partition_token, seqno: seqno, query_options: query_options, request_options: request_options, directed_read_options: directed_read_options, data_boost_enabled: data_boost_enabled, last_statement: last_statement, routing_hint: routing_hint }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.execute_sql(::Google::Cloud::Spanner::V1::ExecuteSqlRequest.new(session: session, transaction: transaction, sql: sql, params: params, param_types: param_types, resume_token: resume_token, query_mode: query_mode, partition_token: partition_token, seqno: seqno, query_options: query_options, request_options: request_options, directed_read_options: directed_read_options, data_boost_enabled: data_boost_enabled, last_statement: last_statement, routing_hint: routing_hint), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, execute_sql_client_stub.call_rpc_count + end + end + + def test_execute_streaming_sql + # Create GRPC objects. + grpc_response = ::Google::Cloud::Spanner::V1::PartialResultSet.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a server streaming method. + session = "hello world" + transaction = {} + sql = "hello world" + params = {} + param_types = {} + resume_token = "hello world" + query_mode = :NORMAL + partition_token = "hello world" + seqno = 42 + query_options = {} + request_options = {} + directed_read_options = {} + data_boost_enabled = true + last_statement = true + routing_hint = {} + + execute_streaming_sql_client_stub = ClientStub.new [grpc_response].to_enum, grpc_operation do |name, request, options:| + assert_equal :execute_streaming_sql, name + assert_kind_of ::Google::Cloud::Spanner::V1::ExecuteSqlRequest, request + assert_equal "hello world", request["session"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Spanner::V1::TransactionSelector), request["transaction"] + assert_equal "hello world", request["sql"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Struct), request["params"] + assert_equal({}, request["param_types"].to_h) + assert_equal "hello world", request["resume_token"] + assert_equal :NORMAL, request["query_mode"] + assert_equal "hello world", request["partition_token"] + assert_equal 42, request["seqno"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Spanner::V1::ExecuteSqlRequest::QueryOptions), request["query_options"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Spanner::V1::RequestOptions), request["request_options"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Spanner::V1::DirectedReadOptions), request["directed_read_options"] + assert_equal true, request["data_boost_enabled"] + assert_equal true, request["last_statement"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Spanner::V1::RoutingHint), request["routing_hint"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, execute_streaming_sql_client_stub do + # Create client + client = ::Google::Cloud::Spanner::V1::Spanner::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.execute_streaming_sql({ session: session, transaction: transaction, sql: sql, params: params, param_types: param_types, resume_token: resume_token, query_mode: query_mode, partition_token: partition_token, seqno: seqno, query_options: query_options, request_options: request_options, directed_read_options: directed_read_options, data_boost_enabled: data_boost_enabled, last_statement: last_statement, routing_hint: routing_hint }) do |response, operation| + assert_kind_of Enumerable, response + response.to_a.each do |r| + assert_kind_of ::Google::Cloud::Spanner::V1::PartialResultSet, r + end + assert_equal grpc_operation, operation + end + + # Use named arguments + client.execute_streaming_sql session: session, transaction: transaction, sql: sql, params: params, param_types: param_types, resume_token: resume_token, query_mode: query_mode, partition_token: partition_token, seqno: seqno, query_options: query_options, request_options: request_options, directed_read_options: directed_read_options, data_boost_enabled: data_boost_enabled, last_statement: last_statement, routing_hint: routing_hint do |response, operation| + assert_kind_of Enumerable, response + response.to_a.each do |r| + assert_kind_of ::Google::Cloud::Spanner::V1::PartialResultSet, r + end + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.execute_streaming_sql ::Google::Cloud::Spanner::V1::ExecuteSqlRequest.new(session: session, transaction: transaction, sql: sql, params: params, param_types: param_types, resume_token: resume_token, query_mode: query_mode, partition_token: partition_token, seqno: seqno, query_options: query_options, request_options: request_options, directed_read_options: directed_read_options, data_boost_enabled: data_boost_enabled, last_statement: last_statement, routing_hint: routing_hint) do |response, operation| + assert_kind_of Enumerable, response + response.to_a.each do |r| + assert_kind_of ::Google::Cloud::Spanner::V1::PartialResultSet, r + end + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.execute_streaming_sql({ session: session, transaction: transaction, sql: sql, params: params, param_types: param_types, resume_token: resume_token, query_mode: query_mode, partition_token: partition_token, seqno: seqno, query_options: query_options, request_options: request_options, directed_read_options: directed_read_options, data_boost_enabled: data_boost_enabled, last_statement: last_statement, routing_hint: routing_hint }, grpc_options) do |response, operation| + assert_kind_of Enumerable, response + response.to_a.each do |r| + assert_kind_of ::Google::Cloud::Spanner::V1::PartialResultSet, r + end + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.execute_streaming_sql(::Google::Cloud::Spanner::V1::ExecuteSqlRequest.new(session: session, transaction: transaction, sql: sql, params: params, param_types: param_types, resume_token: resume_token, query_mode: query_mode, partition_token: partition_token, seqno: seqno, query_options: query_options, request_options: request_options, directed_read_options: directed_read_options, data_boost_enabled: data_boost_enabled, last_statement: last_statement, routing_hint: routing_hint), grpc_options) do |response, operation| + assert_kind_of Enumerable, response + response.to_a.each do |r| + assert_kind_of ::Google::Cloud::Spanner::V1::PartialResultSet, r + end + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, execute_streaming_sql_client_stub.call_rpc_count + end + end + + def test_execute_batch_dml + # Create GRPC objects. + grpc_response = ::Google::Cloud::Spanner::V1::ExecuteBatchDmlResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + session = "hello world" + transaction = {} + statements = [{}] + seqno = 42 + request_options = {} + last_statements = true + + execute_batch_dml_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :execute_batch_dml, name + assert_kind_of ::Google::Cloud::Spanner::V1::ExecuteBatchDmlRequest, request + assert_equal "hello world", request["session"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Spanner::V1::TransactionSelector), request["transaction"] + assert_kind_of ::Google::Cloud::Spanner::V1::ExecuteBatchDmlRequest::Statement, request["statements"].first + assert_equal 42, request["seqno"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Spanner::V1::RequestOptions), request["request_options"] + assert_equal true, request["last_statements"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, execute_batch_dml_client_stub do + # Create client + client = ::Google::Cloud::Spanner::V1::Spanner::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.execute_batch_dml({ session: session, transaction: transaction, statements: statements, seqno: seqno, request_options: request_options, last_statements: last_statements }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.execute_batch_dml session: session, transaction: transaction, statements: statements, seqno: seqno, request_options: request_options, last_statements: last_statements do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.execute_batch_dml ::Google::Cloud::Spanner::V1::ExecuteBatchDmlRequest.new(session: session, transaction: transaction, statements: statements, seqno: seqno, request_options: request_options, last_statements: last_statements) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.execute_batch_dml({ session: session, transaction: transaction, statements: statements, seqno: seqno, request_options: request_options, last_statements: last_statements }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.execute_batch_dml(::Google::Cloud::Spanner::V1::ExecuteBatchDmlRequest.new(session: session, transaction: transaction, statements: statements, seqno: seqno, request_options: request_options, last_statements: last_statements), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, execute_batch_dml_client_stub.call_rpc_count + end + end + + def test_read + # Create GRPC objects. + grpc_response = ::Google::Cloud::Spanner::V1::ResultSet.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + session = "hello world" + transaction = {} + table = "hello world" + index = "hello world" + columns = ["hello world"] + key_set = {} + limit = 42 + resume_token = "hello world" + partition_token = "hello world" + request_options = {} + directed_read_options = {} + data_boost_enabled = true + order_by = :ORDER_BY_UNSPECIFIED + lock_hint = :LOCK_HINT_UNSPECIFIED + routing_hint = {} + + read_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :read, name + assert_kind_of ::Google::Cloud::Spanner::V1::ReadRequest, request + assert_equal "hello world", request["session"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Spanner::V1::TransactionSelector), request["transaction"] + assert_equal "hello world", request["table"] + assert_equal "hello world", request["index"] + assert_equal ["hello world"], request["columns"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Spanner::V1::KeySet), request["key_set"] + assert_equal 42, request["limit"] + assert_equal "hello world", request["resume_token"] + assert_equal "hello world", request["partition_token"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Spanner::V1::RequestOptions), request["request_options"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Spanner::V1::DirectedReadOptions), request["directed_read_options"] + assert_equal true, request["data_boost_enabled"] + assert_equal :ORDER_BY_UNSPECIFIED, request["order_by"] + assert_equal :LOCK_HINT_UNSPECIFIED, request["lock_hint"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Spanner::V1::RoutingHint), request["routing_hint"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, read_client_stub do + # Create client + client = ::Google::Cloud::Spanner::V1::Spanner::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.read({ session: session, transaction: transaction, table: table, index: index, columns: columns, key_set: key_set, limit: limit, resume_token: resume_token, partition_token: partition_token, request_options: request_options, directed_read_options: directed_read_options, data_boost_enabled: data_boost_enabled, order_by: order_by, lock_hint: lock_hint, routing_hint: routing_hint }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.read session: session, transaction: transaction, table: table, index: index, columns: columns, key_set: key_set, limit: limit, resume_token: resume_token, partition_token: partition_token, request_options: request_options, directed_read_options: directed_read_options, data_boost_enabled: data_boost_enabled, order_by: order_by, lock_hint: lock_hint, routing_hint: routing_hint do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.read ::Google::Cloud::Spanner::V1::ReadRequest.new(session: session, transaction: transaction, table: table, index: index, columns: columns, key_set: key_set, limit: limit, resume_token: resume_token, partition_token: partition_token, request_options: request_options, directed_read_options: directed_read_options, data_boost_enabled: data_boost_enabled, order_by: order_by, lock_hint: lock_hint, routing_hint: routing_hint) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.read({ session: session, transaction: transaction, table: table, index: index, columns: columns, key_set: key_set, limit: limit, resume_token: resume_token, partition_token: partition_token, request_options: request_options, directed_read_options: directed_read_options, data_boost_enabled: data_boost_enabled, order_by: order_by, lock_hint: lock_hint, routing_hint: routing_hint }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.read(::Google::Cloud::Spanner::V1::ReadRequest.new(session: session, transaction: transaction, table: table, index: index, columns: columns, key_set: key_set, limit: limit, resume_token: resume_token, partition_token: partition_token, request_options: request_options, directed_read_options: directed_read_options, data_boost_enabled: data_boost_enabled, order_by: order_by, lock_hint: lock_hint, routing_hint: routing_hint), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, read_client_stub.call_rpc_count + end + end + + def test_streaming_read + # Create GRPC objects. + grpc_response = ::Google::Cloud::Spanner::V1::PartialResultSet.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a server streaming method. + session = "hello world" + transaction = {} + table = "hello world" + index = "hello world" + columns = ["hello world"] + key_set = {} + limit = 42 + resume_token = "hello world" + partition_token = "hello world" + request_options = {} + directed_read_options = {} + data_boost_enabled = true + order_by = :ORDER_BY_UNSPECIFIED + lock_hint = :LOCK_HINT_UNSPECIFIED + routing_hint = {} + + streaming_read_client_stub = ClientStub.new [grpc_response].to_enum, grpc_operation do |name, request, options:| + assert_equal :streaming_read, name + assert_kind_of ::Google::Cloud::Spanner::V1::ReadRequest, request + assert_equal "hello world", request["session"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Spanner::V1::TransactionSelector), request["transaction"] + assert_equal "hello world", request["table"] + assert_equal "hello world", request["index"] + assert_equal ["hello world"], request["columns"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Spanner::V1::KeySet), request["key_set"] + assert_equal 42, request["limit"] + assert_equal "hello world", request["resume_token"] + assert_equal "hello world", request["partition_token"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Spanner::V1::RequestOptions), request["request_options"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Spanner::V1::DirectedReadOptions), request["directed_read_options"] + assert_equal true, request["data_boost_enabled"] + assert_equal :ORDER_BY_UNSPECIFIED, request["order_by"] + assert_equal :LOCK_HINT_UNSPECIFIED, request["lock_hint"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Spanner::V1::RoutingHint), request["routing_hint"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, streaming_read_client_stub do + # Create client + client = ::Google::Cloud::Spanner::V1::Spanner::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.streaming_read({ session: session, transaction: transaction, table: table, index: index, columns: columns, key_set: key_set, limit: limit, resume_token: resume_token, partition_token: partition_token, request_options: request_options, directed_read_options: directed_read_options, data_boost_enabled: data_boost_enabled, order_by: order_by, lock_hint: lock_hint, routing_hint: routing_hint }) do |response, operation| + assert_kind_of Enumerable, response + response.to_a.each do |r| + assert_kind_of ::Google::Cloud::Spanner::V1::PartialResultSet, r + end + assert_equal grpc_operation, operation + end + + # Use named arguments + client.streaming_read session: session, transaction: transaction, table: table, index: index, columns: columns, key_set: key_set, limit: limit, resume_token: resume_token, partition_token: partition_token, request_options: request_options, directed_read_options: directed_read_options, data_boost_enabled: data_boost_enabled, order_by: order_by, lock_hint: lock_hint, routing_hint: routing_hint do |response, operation| + assert_kind_of Enumerable, response + response.to_a.each do |r| + assert_kind_of ::Google::Cloud::Spanner::V1::PartialResultSet, r + end + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.streaming_read ::Google::Cloud::Spanner::V1::ReadRequest.new(session: session, transaction: transaction, table: table, index: index, columns: columns, key_set: key_set, limit: limit, resume_token: resume_token, partition_token: partition_token, request_options: request_options, directed_read_options: directed_read_options, data_boost_enabled: data_boost_enabled, order_by: order_by, lock_hint: lock_hint, routing_hint: routing_hint) do |response, operation| + assert_kind_of Enumerable, response + response.to_a.each do |r| + assert_kind_of ::Google::Cloud::Spanner::V1::PartialResultSet, r + end + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.streaming_read({ session: session, transaction: transaction, table: table, index: index, columns: columns, key_set: key_set, limit: limit, resume_token: resume_token, partition_token: partition_token, request_options: request_options, directed_read_options: directed_read_options, data_boost_enabled: data_boost_enabled, order_by: order_by, lock_hint: lock_hint, routing_hint: routing_hint }, grpc_options) do |response, operation| + assert_kind_of Enumerable, response + response.to_a.each do |r| + assert_kind_of ::Google::Cloud::Spanner::V1::PartialResultSet, r + end + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.streaming_read(::Google::Cloud::Spanner::V1::ReadRequest.new(session: session, transaction: transaction, table: table, index: index, columns: columns, key_set: key_set, limit: limit, resume_token: resume_token, partition_token: partition_token, request_options: request_options, directed_read_options: directed_read_options, data_boost_enabled: data_boost_enabled, order_by: order_by, lock_hint: lock_hint, routing_hint: routing_hint), grpc_options) do |response, operation| + assert_kind_of Enumerable, response + response.to_a.each do |r| + assert_kind_of ::Google::Cloud::Spanner::V1::PartialResultSet, r + end + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, streaming_read_client_stub.call_rpc_count + end + end + + def test_begin_transaction + # Create GRPC objects. + grpc_response = ::Google::Cloud::Spanner::V1::Transaction.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + session = "hello world" + options = {} + request_options = {} + mutation_key = {} + + begin_transaction_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :begin_transaction, name + assert_kind_of ::Google::Cloud::Spanner::V1::BeginTransactionRequest, request + assert_equal "hello world", request["session"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Spanner::V1::TransactionOptions), request["options"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Spanner::V1::RequestOptions), request["request_options"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Spanner::V1::Mutation), request["mutation_key"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, begin_transaction_client_stub do + # Create client + client = ::Google::Cloud::Spanner::V1::Spanner::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.begin_transaction({ session: session, options: options, request_options: request_options, mutation_key: mutation_key }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.begin_transaction session: session, options: options, request_options: request_options, mutation_key: mutation_key do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.begin_transaction ::Google::Cloud::Spanner::V1::BeginTransactionRequest.new(session: session, options: options, request_options: request_options, mutation_key: mutation_key) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.begin_transaction({ session: session, options: options, request_options: request_options, mutation_key: mutation_key }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.begin_transaction(::Google::Cloud::Spanner::V1::BeginTransactionRequest.new(session: session, options: options, request_options: request_options, mutation_key: mutation_key), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, begin_transaction_client_stub.call_rpc_count + end + end + + def test_commit + # Create GRPC objects. + grpc_response = ::Google::Cloud::Spanner::V1::CommitResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + session = "hello world" + transaction_id = "hello world" + mutations = [{}] + return_commit_stats = true + max_commit_delay = {} + request_options = {} + precommit_token = {} + + commit_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :commit, name + assert_kind_of ::Google::Cloud::Spanner::V1::CommitRequest, request + assert_equal "hello world", request["session"] + assert_equal "hello world", request["transaction_id"] + assert_equal :transaction_id, request.transaction + assert_kind_of ::Google::Cloud::Spanner::V1::Mutation, request["mutations"].first + assert_equal true, request["return_commit_stats"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Duration), request["max_commit_delay"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Spanner::V1::RequestOptions), request["request_options"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Spanner::V1::MultiplexedSessionPrecommitToken), request["precommit_token"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, commit_client_stub do + # Create client + client = ::Google::Cloud::Spanner::V1::Spanner::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.commit({ session: session, transaction_id: transaction_id, mutations: mutations, return_commit_stats: return_commit_stats, max_commit_delay: max_commit_delay, request_options: request_options, precommit_token: precommit_token }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.commit session: session, transaction_id: transaction_id, mutations: mutations, return_commit_stats: return_commit_stats, max_commit_delay: max_commit_delay, request_options: request_options, precommit_token: precommit_token do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.commit ::Google::Cloud::Spanner::V1::CommitRequest.new(session: session, transaction_id: transaction_id, mutations: mutations, return_commit_stats: return_commit_stats, max_commit_delay: max_commit_delay, request_options: request_options, precommit_token: precommit_token) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.commit({ session: session, transaction_id: transaction_id, mutations: mutations, return_commit_stats: return_commit_stats, max_commit_delay: max_commit_delay, request_options: request_options, precommit_token: precommit_token }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.commit(::Google::Cloud::Spanner::V1::CommitRequest.new(session: session, transaction_id: transaction_id, mutations: mutations, return_commit_stats: return_commit_stats, max_commit_delay: max_commit_delay, request_options: request_options, precommit_token: precommit_token), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, commit_client_stub.call_rpc_count + end + end + + def test_rollback + # Create GRPC objects. + grpc_response = ::Google::Protobuf::Empty.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + session = "hello world" + transaction_id = "hello world" + + rollback_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :rollback, name + assert_kind_of ::Google::Cloud::Spanner::V1::RollbackRequest, request + assert_equal "hello world", request["session"] + assert_equal "hello world", request["transaction_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, rollback_client_stub do + # Create client + client = ::Google::Cloud::Spanner::V1::Spanner::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.rollback({ session: session, transaction_id: transaction_id }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.rollback session: session, transaction_id: transaction_id do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.rollback ::Google::Cloud::Spanner::V1::RollbackRequest.new(session: session, transaction_id: transaction_id) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.rollback({ session: session, transaction_id: transaction_id }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.rollback(::Google::Cloud::Spanner::V1::RollbackRequest.new(session: session, transaction_id: transaction_id), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, rollback_client_stub.call_rpc_count + end + end + + def test_partition_query + # Create GRPC objects. + grpc_response = ::Google::Cloud::Spanner::V1::PartitionResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + session = "hello world" + transaction = {} + sql = "hello world" + params = {} + param_types = {} + partition_options = {} + + partition_query_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :partition_query, name + assert_kind_of ::Google::Cloud::Spanner::V1::PartitionQueryRequest, request + assert_equal "hello world", request["session"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Spanner::V1::TransactionSelector), request["transaction"] + assert_equal "hello world", request["sql"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Struct), request["params"] + assert_equal({}, request["param_types"].to_h) + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Spanner::V1::PartitionOptions), request["partition_options"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, partition_query_client_stub do + # Create client + client = ::Google::Cloud::Spanner::V1::Spanner::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.partition_query({ session: session, transaction: transaction, sql: sql, params: params, param_types: param_types, partition_options: partition_options }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.partition_query session: session, transaction: transaction, sql: sql, params: params, param_types: param_types, partition_options: partition_options do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.partition_query ::Google::Cloud::Spanner::V1::PartitionQueryRequest.new(session: session, transaction: transaction, sql: sql, params: params, param_types: param_types, partition_options: partition_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.partition_query({ session: session, transaction: transaction, sql: sql, params: params, param_types: param_types, partition_options: partition_options }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.partition_query(::Google::Cloud::Spanner::V1::PartitionQueryRequest.new(session: session, transaction: transaction, sql: sql, params: params, param_types: param_types, partition_options: partition_options), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, partition_query_client_stub.call_rpc_count + end + end + + def test_partition_read + # Create GRPC objects. + grpc_response = ::Google::Cloud::Spanner::V1::PartitionResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + session = "hello world" + transaction = {} + table = "hello world" + index = "hello world" + columns = ["hello world"] + key_set = {} + partition_options = {} + + partition_read_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :partition_read, name + assert_kind_of ::Google::Cloud::Spanner::V1::PartitionReadRequest, request + assert_equal "hello world", request["session"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Spanner::V1::TransactionSelector), request["transaction"] + assert_equal "hello world", request["table"] + assert_equal "hello world", request["index"] + assert_equal ["hello world"], request["columns"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Spanner::V1::KeySet), request["key_set"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Spanner::V1::PartitionOptions), request["partition_options"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, partition_read_client_stub do + # Create client + client = ::Google::Cloud::Spanner::V1::Spanner::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.partition_read({ session: session, transaction: transaction, table: table, index: index, columns: columns, key_set: key_set, partition_options: partition_options }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.partition_read session: session, transaction: transaction, table: table, index: index, columns: columns, key_set: key_set, partition_options: partition_options do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.partition_read ::Google::Cloud::Spanner::V1::PartitionReadRequest.new(session: session, transaction: transaction, table: table, index: index, columns: columns, key_set: key_set, partition_options: partition_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.partition_read({ session: session, transaction: transaction, table: table, index: index, columns: columns, key_set: key_set, partition_options: partition_options }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.partition_read(::Google::Cloud::Spanner::V1::PartitionReadRequest.new(session: session, transaction: transaction, table: table, index: index, columns: columns, key_set: key_set, partition_options: partition_options), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, partition_read_client_stub.call_rpc_count + end + end + + def test_batch_write + # Create GRPC objects. + grpc_response = ::Google::Cloud::Spanner::V1::BatchWriteResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a server streaming method. + session = "hello world" + request_options = {} + mutation_groups = [{}] + exclude_txn_from_change_streams = true + + batch_write_client_stub = ClientStub.new [grpc_response].to_enum, grpc_operation do |name, request, options:| + assert_equal :batch_write, name + assert_kind_of ::Google::Cloud::Spanner::V1::BatchWriteRequest, request + assert_equal "hello world", request["session"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Spanner::V1::RequestOptions), request["request_options"] + assert_kind_of ::Google::Cloud::Spanner::V1::BatchWriteRequest::MutationGroup, request["mutation_groups"].first + assert_equal true, request["exclude_txn_from_change_streams"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, batch_write_client_stub do + # Create client + client = ::Google::Cloud::Spanner::V1::Spanner::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.batch_write({ session: session, request_options: request_options, mutation_groups: mutation_groups, exclude_txn_from_change_streams: exclude_txn_from_change_streams }) do |response, operation| + assert_kind_of Enumerable, response + response.to_a.each do |r| + assert_kind_of ::Google::Cloud::Spanner::V1::BatchWriteResponse, r + end + assert_equal grpc_operation, operation + end + + # Use named arguments + client.batch_write session: session, request_options: request_options, mutation_groups: mutation_groups, exclude_txn_from_change_streams: exclude_txn_from_change_streams do |response, operation| + assert_kind_of Enumerable, response + response.to_a.each do |r| + assert_kind_of ::Google::Cloud::Spanner::V1::BatchWriteResponse, r + end + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.batch_write ::Google::Cloud::Spanner::V1::BatchWriteRequest.new(session: session, request_options: request_options, mutation_groups: mutation_groups, exclude_txn_from_change_streams: exclude_txn_from_change_streams) do |response, operation| + assert_kind_of Enumerable, response + response.to_a.each do |r| + assert_kind_of ::Google::Cloud::Spanner::V1::BatchWriteResponse, r + end + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.batch_write({ session: session, request_options: request_options, mutation_groups: mutation_groups, exclude_txn_from_change_streams: exclude_txn_from_change_streams }, grpc_options) do |response, operation| + assert_kind_of Enumerable, response + response.to_a.each do |r| + assert_kind_of ::Google::Cloud::Spanner::V1::BatchWriteResponse, r + end + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.batch_write(::Google::Cloud::Spanner::V1::BatchWriteRequest.new(session: session, request_options: request_options, mutation_groups: mutation_groups, exclude_txn_from_change_streams: exclude_txn_from_change_streams), grpc_options) do |response, operation| + assert_kind_of Enumerable, response + response.to_a.each do |r| + assert_kind_of ::Google::Cloud::Spanner::V1::BatchWriteResponse, r + end + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, batch_write_client_stub.call_rpc_count + end + end + + def test_configure + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = block_config = config = nil + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::Spanner::V1::Spanner::Client.new do |config| + config.credentials = grpc_channel + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Cloud::Spanner::V1::Spanner::Client::Configuration, config + end + + def test_credentials + key = OpenSSL::PKey::RSA.new 2048 + cred_json = { + "private_key" => key.to_pem, + "client_email" => "app@developer.gserviceaccount.com", + "type" => "service_account" + } + key_file = StringIO.new cred_json.to_json + creds = Google::Auth::ServiceAccountCredentials.make_creds({ json_key_io: key_file }) + + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::Spanner::V1::Spanner::Client.new do |config| + config.credentials = creds + end + assert_kind_of ::Google::Cloud::Spanner::V1::Spanner::Client, client + assert_equal creds, client.configure.credentials + end + end +end diff --git a/owl-bot-staging/google-cloud-spanner-v1/test/helper.rb b/owl-bot-staging/google-cloud-spanner-v1/test/helper.rb new file mode 100644 index 000000000000..f0e715458fa2 --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-v1/test/helper.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "minitest/autorun" +require "minitest/focus" +require "minitest/rg" + +require "grpc" + +require "ostruct" From b0690b6d3d0f795fa459dc69b96a7bfee8258047 Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Wed, 4 Feb 2026 23:09:36 +0000 Subject: [PATCH 2/2] =?UTF-8?q?=F0=9F=A6=89=20Updates=20from=20OwlBot=20po?= =?UTF-8?q?st-processor?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --- .../google/cloud/spanner/v1/spanner/client.rb | 9 +- .../lib/google/spanner/v1/result_set_pb.rb | 2 +- .../lib/google/spanner/v1/spanner_pb.rb | 2 +- .../google/spanner/v1/result_set.rb | 8 + .../proto_docs/google/spanner/v1/spanner.rb | 21 +- .../google-cloud-spanner-v1/.gitignore | 22 - .../.repo-metadata.json | 18 - .../google-cloud-spanner-v1/.rubocop.yml | 33 - .../google-cloud-spanner-v1/.toys.rb | 28 - .../google-cloud-spanner-v1/.yardopts | 12 - .../google-cloud-spanner-v1/AUTHENTICATION.md | 122 - .../google-cloud-spanner-v1/CHANGELOG.md | 2 - .../google-cloud-spanner-v1/Gemfile | 11 - .../google-cloud-spanner-v1/LICENSE.md | 201 -- .../google-cloud-spanner-v1/README.md | 153 - .../google-cloud-spanner-v1/Rakefile | 169 -- .../gapic_metadata.json | 98 - .../google-cloud-spanner-v1.gemspec | 28 - .../lib/google-cloud-spanner-v1.rb | 21 - .../lib/google/cloud/spanner/v1.rb | 40 - .../lib/google/cloud/spanner/v1/spanner.rb | 52 - .../google/cloud/spanner/v1/spanner/client.rb | 2622 ----------------- .../cloud/spanner/v1/spanner/credentials.rb | 52 - .../google/cloud/spanner/v1/spanner/paths.rb | 73 - .../lib/google/cloud/spanner/v1/version.rb | 28 - .../lib/google/spanner/v1/change_stream_pb.rb | 61 - .../google/spanner/v1/commit_response_pb.rb | 48 - .../lib/google/spanner/v1/keys_pb.rb | 46 - .../lib/google/spanner/v1/location_pb.rb | 58 - .../lib/google/spanner/v1/mutation_pb.rb | 54 - .../lib/google/spanner/v1/query_plan_pb.rb | 52 - .../lib/google/spanner/v1/result_set_pb.rb | 57 - .../lib/google/spanner/v1/spanner_pb.rb | 104 - .../google/spanner/v1/spanner_services_pb.rb | 216 -- .../lib/google/spanner/v1/transaction_pb.rb | 56 - .../lib/google/spanner/v1/type_pb.rb | 48 - .../proto_docs/README.md | 4 - .../proto_docs/google/api/client.rb | 473 --- .../proto_docs/google/api/field_behavior.rb | 85 - .../proto_docs/google/api/launch_stage.rb | 71 - .../proto_docs/google/api/resource.rb | 227 -- .../proto_docs/google/protobuf/any.rb | 145 - .../proto_docs/google/protobuf/duration.rb | 98 - .../proto_docs/google/protobuf/empty.rb | 34 - .../proto_docs/google/protobuf/struct.rb | 108 - .../proto_docs/google/protobuf/timestamp.rb | 127 - .../proto_docs/google/rpc/status.rb | 48 - .../google/spanner/v1/change_stream.rb | 488 --- .../google/spanner/v1/commit_response.rb | 65 - .../proto_docs/google/spanner/v1/keys.rb | 170 -- .../proto_docs/google/spanner/v1/location.rb | 417 --- .../proto_docs/google/spanner/v1/mutation.rb | 178 -- .../google/spanner/v1/query_plan.rb | 180 -- .../google/spanner/v1/result_set.rb | 265 -- .../proto_docs/google/spanner/v1/spanner.rb | 1187 -------- .../google/spanner/v1/transaction.rb | 338 --- .../proto_docs/google/spanner/v1/type.rb | 222 -- .../google-cloud-spanner-v1/snippets/Gemfile | 32 - .../snippet_metadata_google.spanner.v1.json | 655 ---- .../snippets/spanner/batch_create_sessions.rb | 47 - .../snippets/spanner/batch_write.rb | 50 - .../snippets/spanner/begin_transaction.rb | 47 - .../snippets/spanner/commit.rb | 47 - .../snippets/spanner/create_session.rb | 47 - .../snippets/spanner/delete_session.rb | 47 - .../snippets/spanner/execute_batch_dml.rb | 47 - .../snippets/spanner/execute_sql.rb | 47 - .../snippets/spanner/execute_streaming_sql.rb | 50 - .../snippets/spanner/get_session.rb | 47 - .../snippets/spanner/list_sessions.rb | 51 - .../snippets/spanner/partition_query.rb | 47 - .../snippets/spanner/partition_read.rb | 47 - .../snippets/spanner/read.rb | 47 - .../snippets/spanner/rollback.rb | 47 - .../snippets/spanner/streaming_read.rb | 50 - .../cloud/spanner/v1/spanner_paths_test.rb | 67 - .../google/cloud/spanner/v1/spanner_test.rb | 1265 -------- .../google-cloud-spanner-v1/test/helper.rb | 25 - 78 files changed, 29 insertions(+), 12337 deletions(-) delete mode 100644 owl-bot-staging/google-cloud-spanner-v1/.gitignore delete mode 100644 owl-bot-staging/google-cloud-spanner-v1/.repo-metadata.json delete mode 100644 owl-bot-staging/google-cloud-spanner-v1/.rubocop.yml delete mode 100644 owl-bot-staging/google-cloud-spanner-v1/.toys.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-v1/.yardopts delete mode 100644 owl-bot-staging/google-cloud-spanner-v1/AUTHENTICATION.md delete mode 100644 owl-bot-staging/google-cloud-spanner-v1/CHANGELOG.md delete mode 100644 owl-bot-staging/google-cloud-spanner-v1/Gemfile delete mode 100644 owl-bot-staging/google-cloud-spanner-v1/LICENSE.md delete mode 100644 owl-bot-staging/google-cloud-spanner-v1/README.md delete mode 100644 owl-bot-staging/google-cloud-spanner-v1/Rakefile delete mode 100644 owl-bot-staging/google-cloud-spanner-v1/gapic_metadata.json delete mode 100644 owl-bot-staging/google-cloud-spanner-v1/google-cloud-spanner-v1.gemspec delete mode 100644 owl-bot-staging/google-cloud-spanner-v1/lib/google-cloud-spanner-v1.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-v1/lib/google/cloud/spanner/v1.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-v1/lib/google/cloud/spanner/v1/spanner.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-v1/lib/google/cloud/spanner/v1/spanner/client.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-v1/lib/google/cloud/spanner/v1/spanner/credentials.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-v1/lib/google/cloud/spanner/v1/spanner/paths.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-v1/lib/google/cloud/spanner/v1/version.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-v1/lib/google/spanner/v1/change_stream_pb.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-v1/lib/google/spanner/v1/commit_response_pb.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-v1/lib/google/spanner/v1/keys_pb.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-v1/lib/google/spanner/v1/location_pb.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-v1/lib/google/spanner/v1/mutation_pb.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-v1/lib/google/spanner/v1/query_plan_pb.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-v1/lib/google/spanner/v1/result_set_pb.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-v1/lib/google/spanner/v1/spanner_pb.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-v1/lib/google/spanner/v1/spanner_services_pb.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-v1/lib/google/spanner/v1/transaction_pb.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-v1/lib/google/spanner/v1/type_pb.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-v1/proto_docs/README.md delete mode 100644 owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/api/client.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/api/field_behavior.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/api/launch_stage.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/api/resource.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/protobuf/any.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/protobuf/duration.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/protobuf/empty.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/protobuf/struct.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/protobuf/timestamp.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/rpc/status.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/spanner/v1/change_stream.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/spanner/v1/commit_response.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/spanner/v1/keys.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/spanner/v1/location.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/spanner/v1/mutation.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/spanner/v1/query_plan.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/spanner/v1/result_set.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/spanner/v1/spanner.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/spanner/v1/transaction.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/spanner/v1/type.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-v1/snippets/Gemfile delete mode 100644 owl-bot-staging/google-cloud-spanner-v1/snippets/snippet_metadata_google.spanner.v1.json delete mode 100644 owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/batch_create_sessions.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/batch_write.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/begin_transaction.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/commit.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/create_session.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/delete_session.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/execute_batch_dml.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/execute_sql.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/execute_streaming_sql.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/get_session.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/list_sessions.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/partition_query.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/partition_read.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/read.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/rollback.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/streaming_read.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-v1/test/google/cloud/spanner/v1/spanner_paths_test.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-v1/test/google/cloud/spanner/v1/spanner_test.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-v1/test/helper.rb diff --git a/google-cloud-spanner-v1/lib/google/cloud/spanner/v1/spanner/client.rb b/google-cloud-spanner-v1/lib/google/cloud/spanner/v1/spanner/client.rb index 95e28619ce1d..1fc4fbd66dd9 100644 --- a/google-cloud-spanner-v1/lib/google/cloud/spanner/v1/spanner/client.rb +++ b/google-cloud-spanner-v1/lib/google/cloud/spanner/v1/spanner/client.rb @@ -1985,7 +1985,8 @@ def rollback request, options = nil # a `PartitionedDml` transaction for large, partition-friendly DML # operations. # @param params [::Google::Protobuf::Struct, ::Hash] - # Parameter names and values that bind to placeholders in the SQL string. + # Optional. Parameter names and values that bind to placeholders in the SQL + # string. # # A parameter placeholder consists of the `@` character followed by the # parameter name (for example, `@firstName`). Parameter names can contain @@ -1998,9 +1999,9 @@ def rollback request, options = nil # # It's an error to execute a SQL statement with unbound parameters. # @param param_types [::Hash{::String => ::Google::Cloud::Spanner::V1::Type, ::Hash}] - # It isn't always possible for Cloud Spanner to infer the right SQL type - # from a JSON value. For example, values of type `BYTES` and values - # of type `STRING` both appear in + # Optional. It isn't always possible for Cloud Spanner to infer the right SQL + # type from a JSON value. For example, values of type `BYTES` and values of + # type `STRING` both appear in # {::Google::Cloud::Spanner::V1::PartitionQueryRequest#params params} as JSON strings. # # In these cases, `param_types` can be used to specify the exact diff --git a/google-cloud-spanner-v1/lib/google/spanner/v1/result_set_pb.rb b/google-cloud-spanner-v1/lib/google/spanner/v1/result_set_pb.rb index 3fb0ec87e098..dbd8ff5a6221 100644 --- a/google-cloud-spanner-v1/lib/google/spanner/v1/result_set_pb.rb +++ b/google-cloud-spanner-v1/lib/google/spanner/v1/result_set_pb.rb @@ -12,7 +12,7 @@ require 'google/spanner/v1/type_pb' -descriptor_data = "\n\"google/spanner/v1/result_set.proto\x12\x11google.spanner.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x1cgoogle/protobuf/struct.proto\x1a google/spanner/v1/location.proto\x1a\"google/spanner/v1/query_plan.proto\x1a#google/spanner/v1/transaction.proto\x1a\x1cgoogle/spanner/v1/type.proto\"\xf2\x01\n\tResultSet\x12\x36\n\x08metadata\x18\x01 \x01(\x0b\x32$.google.spanner.v1.ResultSetMetadata\x12(\n\x04rows\x18\x02 \x03(\x0b\x32\x1a.google.protobuf.ListValue\x12\x30\n\x05stats\x18\x03 \x01(\x0b\x32!.google.spanner.v1.ResultSetStats\x12Q\n\x0fprecommit_token\x18\x05 \x01(\x0b\x32\x33.google.spanner.v1.MultiplexedSessionPrecommitTokenB\x03\xe0\x41\x01\"\xf2\x02\n\x10PartialResultSet\x12\x36\n\x08metadata\x18\x01 \x01(\x0b\x32$.google.spanner.v1.ResultSetMetadata\x12&\n\x06values\x18\x02 \x03(\x0b\x32\x16.google.protobuf.Value\x12\x15\n\rchunked_value\x18\x03 \x01(\x08\x12\x14\n\x0cresume_token\x18\x04 \x01(\x0c\x12\x30\n\x05stats\x18\x05 \x01(\x0b\x32!.google.spanner.v1.ResultSetStats\x12Q\n\x0fprecommit_token\x18\x08 \x01(\x0b\x32\x33.google.spanner.v1.MultiplexedSessionPrecommitTokenB\x03\xe0\x41\x01\x12\x11\n\x04last\x18\t \x01(\x08\x42\x03\xe0\x41\x01\x12\x39\n\x0c\x63\x61\x63he_update\x18\n \x01(\x0b\x32\x1e.google.spanner.v1.CacheUpdateB\x03\xe0\x41\x01\"\xb7\x01\n\x11ResultSetMetadata\x12/\n\x08row_type\x18\x01 \x01(\x0b\x32\x1d.google.spanner.v1.StructType\x12\x33\n\x0btransaction\x18\x02 \x01(\x0b\x32\x1e.google.spanner.v1.Transaction\x12<\n\x15undeclared_parameters\x18\x03 \x01(\x0b\x32\x1d.google.spanner.v1.StructType\"\xb9\x01\n\x0eResultSetStats\x12\x30\n\nquery_plan\x18\x01 \x01(\x0b\x32\x1c.google.spanner.v1.QueryPlan\x12,\n\x0bquery_stats\x18\x02 \x01(\x0b\x32\x17.google.protobuf.Struct\x12\x19\n\x0frow_count_exact\x18\x03 \x01(\x03H\x00\x12\x1f\n\x15row_count_lower_bound\x18\x04 \x01(\x03H\x00\x42\x0b\n\trow_countB\xb1\x01\n\x15\x63om.google.spanner.v1B\x0eResultSetProtoP\x01Z5cloud.google.com/go/spanner/apiv1/spannerpb;spannerpb\xaa\x02\x17Google.Cloud.Spanner.V1\xca\x02\x17Google\\Cloud\\Spanner\\V1\xea\x02\x1aGoogle::Cloud::Spanner::V1b\x06proto3" +descriptor_data = "\n\"google/spanner/v1/result_set.proto\x12\x11google.spanner.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x1cgoogle/protobuf/struct.proto\x1a google/spanner/v1/location.proto\x1a\"google/spanner/v1/query_plan.proto\x1a#google/spanner/v1/transaction.proto\x1a\x1cgoogle/spanner/v1/type.proto\"\xad\x02\n\tResultSet\x12\x36\n\x08metadata\x18\x01 \x01(\x0b\x32$.google.spanner.v1.ResultSetMetadata\x12(\n\x04rows\x18\x02 \x03(\x0b\x32\x1a.google.protobuf.ListValue\x12\x30\n\x05stats\x18\x03 \x01(\x0b\x32!.google.spanner.v1.ResultSetStats\x12Q\n\x0fprecommit_token\x18\x05 \x01(\x0b\x32\x33.google.spanner.v1.MultiplexedSessionPrecommitTokenB\x03\xe0\x41\x01\x12\x39\n\x0c\x63\x61\x63he_update\x18\x06 \x01(\x0b\x32\x1e.google.spanner.v1.CacheUpdateB\x03\xe0\x41\x01\"\xf2\x02\n\x10PartialResultSet\x12\x36\n\x08metadata\x18\x01 \x01(\x0b\x32$.google.spanner.v1.ResultSetMetadata\x12&\n\x06values\x18\x02 \x03(\x0b\x32\x16.google.protobuf.Value\x12\x15\n\rchunked_value\x18\x03 \x01(\x08\x12\x14\n\x0cresume_token\x18\x04 \x01(\x0c\x12\x30\n\x05stats\x18\x05 \x01(\x0b\x32!.google.spanner.v1.ResultSetStats\x12Q\n\x0fprecommit_token\x18\x08 \x01(\x0b\x32\x33.google.spanner.v1.MultiplexedSessionPrecommitTokenB\x03\xe0\x41\x01\x12\x11\n\x04last\x18\t \x01(\x08\x42\x03\xe0\x41\x01\x12\x39\n\x0c\x63\x61\x63he_update\x18\n \x01(\x0b\x32\x1e.google.spanner.v1.CacheUpdateB\x03\xe0\x41\x01\"\xb7\x01\n\x11ResultSetMetadata\x12/\n\x08row_type\x18\x01 \x01(\x0b\x32\x1d.google.spanner.v1.StructType\x12\x33\n\x0btransaction\x18\x02 \x01(\x0b\x32\x1e.google.spanner.v1.Transaction\x12<\n\x15undeclared_parameters\x18\x03 \x01(\x0b\x32\x1d.google.spanner.v1.StructType\"\xb9\x01\n\x0eResultSetStats\x12\x30\n\nquery_plan\x18\x01 \x01(\x0b\x32\x1c.google.spanner.v1.QueryPlan\x12,\n\x0bquery_stats\x18\x02 \x01(\x0b\x32\x17.google.protobuf.Struct\x12\x19\n\x0frow_count_exact\x18\x03 \x01(\x03H\x00\x12\x1f\n\x15row_count_lower_bound\x18\x04 \x01(\x03H\x00\x42\x0b\n\trow_countB\xb1\x01\n\x15\x63om.google.spanner.v1B\x0eResultSetProtoP\x01Z5cloud.google.com/go/spanner/apiv1/spannerpb;spannerpb\xaa\x02\x17Google.Cloud.Spanner.V1\xca\x02\x17Google\\Cloud\\Spanner\\V1\xea\x02\x1aGoogle::Cloud::Spanner::V1b\x06proto3" pool = Google::Protobuf::DescriptorPool.generated_pool diff --git a/google-cloud-spanner-v1/lib/google/spanner/v1/spanner_pb.rb b/google-cloud-spanner-v1/lib/google/spanner/v1/spanner_pb.rb index b00e296e5000..106d38e306e9 100644 --- a/google-cloud-spanner-v1/lib/google/spanner/v1/spanner_pb.rb +++ b/google-cloud-spanner-v1/lib/google/spanner/v1/spanner_pb.rb @@ -22,7 +22,7 @@ require 'google/spanner/v1/type_pb' -descriptor_data = "\n\x1fgoogle/spanner/v1/spanner.proto\x12\x11google.spanner.v1\x1a\'google/spanner/v1/commit_response.proto\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a\x1cgoogle/protobuf/struct.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x17google/rpc/status.proto\x1a\x1cgoogle/spanner/v1/keys.proto\x1a google/spanner/v1/location.proto\x1a google/spanner/v1/mutation.proto\x1a\"google/spanner/v1/result_set.proto\x1a#google/spanner/v1/transaction.proto\x1a\x1cgoogle/spanner/v1/type.proto\"\x83\x01\n\x14\x43reateSessionRequest\x12\x39\n\x08\x64\x61tabase\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1fspanner.googleapis.com/Database\x12\x30\n\x07session\x18\x02 \x01(\x0b\x32\x1a.google.spanner.v1.SessionB\x03\xe0\x41\x02\"\xa9\x01\n\x1a\x42\x61tchCreateSessionsRequest\x12\x39\n\x08\x64\x61tabase\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1fspanner.googleapis.com/Database\x12\x34\n\x10session_template\x18\x02 \x01(\x0b\x32\x1a.google.spanner.v1.Session\x12\x1a\n\rsession_count\x18\x03 \x01(\x05\x42\x03\xe0\x41\x02\"J\n\x1b\x42\x61tchCreateSessionsResponse\x12+\n\x07session\x18\x01 \x03(\x0b\x32\x1a.google.spanner.v1.Session\"\xb8\x03\n\x07Session\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x36\n\x06labels\x18\x02 \x03(\x0b\x32&.google.spanner.v1.Session.LabelsEntry\x12\x34\n\x0b\x63reate_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x42\n\x19\x61pproximate_last_use_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x14\n\x0c\x63reator_role\x18\x05 \x01(\t\x12\x18\n\x0bmultiplexed\x18\x06 \x01(\x08\x42\x03\xe0\x41\x01\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01:\x88\x01\xea\x41\x84\x01\n\x1espanner.googleapis.com/Session\x12Oprojects/{project}/instances/{instance}/databases/{database}/sessions/{session}*\x08sessions2\x07session\"I\n\x11GetSessionRequest\x12\x34\n\x04name\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1espanner.googleapis.com/Session\"\x87\x01\n\x13ListSessionsRequest\x12\x39\n\x08\x64\x61tabase\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1fspanner.googleapis.com/Database\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\x12\x0e\n\x06\x66ilter\x18\x04 \x01(\t\"]\n\x14ListSessionsResponse\x12,\n\x08sessions\x18\x01 \x03(\x0b\x32\x1a.google.spanner.v1.Session\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"L\n\x14\x44\x65leteSessionRequest\x12\x34\n\x04name\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1espanner.googleapis.com/Session\"\xeb\x03\n\x0eRequestOptions\x12<\n\x08priority\x18\x01 \x01(\x0e\x32*.google.spanner.v1.RequestOptions.Priority\x12\x13\n\x0brequest_tag\x18\x02 \x01(\t\x12\x17\n\x0ftransaction_tag\x18\x03 \x01(\t\x12L\n\x0e\x63lient_context\x18\x04 \x01(\x0b\x32/.google.spanner.v1.RequestOptions.ClientContextB\x03\xe0\x41\x01\x1a\xbe\x01\n\rClientContext\x12_\n\x0esecure_context\x18\x01 \x03(\x0b\x32\x42.google.spanner.v1.RequestOptions.ClientContext.SecureContextEntryB\x03\xe0\x41\x01\x1aL\n\x12SecureContextEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12%\n\x05value\x18\x02 \x01(\x0b\x32\x16.google.protobuf.Value:\x02\x38\x01\"^\n\x08Priority\x12\x18\n\x14PRIORITY_UNSPECIFIED\x10\x00\x12\x10\n\x0cPRIORITY_LOW\x10\x01\x12\x13\n\x0fPRIORITY_MEDIUM\x10\x02\x12\x11\n\rPRIORITY_HIGH\x10\x03\"\xea\x04\n\x13\x44irectedReadOptions\x12R\n\x10include_replicas\x18\x01 \x01(\x0b\x32\x36.google.spanner.v1.DirectedReadOptions.IncludeReplicasH\x00\x12R\n\x10\x65xclude_replicas\x18\x02 \x01(\x0b\x32\x36.google.spanner.v1.DirectedReadOptions.ExcludeReplicasH\x00\x1a\xad\x01\n\x10ReplicaSelection\x12\x10\n\x08location\x18\x01 \x01(\t\x12J\n\x04type\x18\x02 \x01(\x0e\x32<.google.spanner.v1.DirectedReadOptions.ReplicaSelection.Type\";\n\x04Type\x12\x14\n\x10TYPE_UNSPECIFIED\x10\x00\x12\x0e\n\nREAD_WRITE\x10\x01\x12\r\n\tREAD_ONLY\x10\x02\x1a\x86\x01\n\x0fIncludeReplicas\x12S\n\x12replica_selections\x18\x01 \x03(\x0b\x32\x37.google.spanner.v1.DirectedReadOptions.ReplicaSelection\x12\x1e\n\x16\x61uto_failover_disabled\x18\x02 \x01(\x08\x1a\x66\n\x0f\x45xcludeReplicas\x12S\n\x12replica_selections\x18\x01 \x03(\x0b\x32\x37.google.spanner.v1.DirectedReadOptions.ReplicaSelectionB\n\n\x08replicas\"\xc8\x07\n\x11\x45xecuteSqlRequest\x12\x37\n\x07session\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1espanner.googleapis.com/Session\x12;\n\x0btransaction\x18\x02 \x01(\x0b\x32&.google.spanner.v1.TransactionSelector\x12\x10\n\x03sql\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12\'\n\x06params\x18\x04 \x01(\x0b\x32\x17.google.protobuf.Struct\x12I\n\x0bparam_types\x18\x05 \x03(\x0b\x32\x34.google.spanner.v1.ExecuteSqlRequest.ParamTypesEntry\x12\x14\n\x0cresume_token\x18\x06 \x01(\x0c\x12\x42\n\nquery_mode\x18\x07 \x01(\x0e\x32..google.spanner.v1.ExecuteSqlRequest.QueryMode\x12\x17\n\x0fpartition_token\x18\x08 \x01(\x0c\x12\r\n\x05seqno\x18\t \x01(\x03\x12H\n\rquery_options\x18\n \x01(\x0b\x32\x31.google.spanner.v1.ExecuteSqlRequest.QueryOptions\x12:\n\x0frequest_options\x18\x0b \x01(\x0b\x32!.google.spanner.v1.RequestOptions\x12\x45\n\x15\x64irected_read_options\x18\x0f \x01(\x0b\x32&.google.spanner.v1.DirectedReadOptions\x12\x1a\n\x12\x64\x61ta_boost_enabled\x18\x10 \x01(\x08\x12\x1b\n\x0elast_statement\x18\x11 \x01(\x08\x42\x03\xe0\x41\x01\x12\x39\n\x0crouting_hint\x18\x12 \x01(\x0b\x32\x1e.google.spanner.v1.RoutingHintB\x03\xe0\x41\x01\x1aO\n\x0cQueryOptions\x12\x19\n\x11optimizer_version\x18\x01 \x01(\t\x12$\n\x1coptimizer_statistics_package\x18\x02 \x01(\t\x1aJ\n\x0fParamTypesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12&\n\x05value\x18\x02 \x01(\x0b\x32\x17.google.spanner.v1.Type:\x02\x38\x01\"W\n\tQueryMode\x12\n\n\x06NORMAL\x10\x00\x12\x08\n\x04PLAN\x10\x01\x12\x0b\n\x07PROFILE\x10\x02\x12\x0e\n\nWITH_STATS\x10\x03\x12\x17\n\x13WITH_PLAN_AND_STATS\x10\x04\"\xbe\x04\n\x16\x45xecuteBatchDmlRequest\x12\x37\n\x07session\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1espanner.googleapis.com/Session\x12@\n\x0btransaction\x18\x02 \x01(\x0b\x32&.google.spanner.v1.TransactionSelectorB\x03\xe0\x41\x02\x12L\n\nstatements\x18\x03 \x03(\x0b\x32\x33.google.spanner.v1.ExecuteBatchDmlRequest.StatementB\x03\xe0\x41\x02\x12\x12\n\x05seqno\x18\x04 \x01(\x03\x42\x03\xe0\x41\x02\x12:\n\x0frequest_options\x18\x05 \x01(\x0b\x32!.google.spanner.v1.RequestOptions\x12\x1c\n\x0flast_statements\x18\x06 \x01(\x08\x42\x03\xe0\x41\x01\x1a\xec\x01\n\tStatement\x12\x10\n\x03sql\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\'\n\x06params\x18\x02 \x01(\x0b\x32\x17.google.protobuf.Struct\x12X\n\x0bparam_types\x18\x03 \x03(\x0b\x32\x43.google.spanner.v1.ExecuteBatchDmlRequest.Statement.ParamTypesEntry\x1aJ\n\x0fParamTypesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12&\n\x05value\x18\x02 \x01(\x0b\x32\x17.google.spanner.v1.Type:\x02\x38\x01\"\xc3\x01\n\x17\x45xecuteBatchDmlResponse\x12\x31\n\x0bresult_sets\x18\x01 \x03(\x0b\x32\x1c.google.spanner.v1.ResultSet\x12\"\n\x06status\x18\x02 \x01(\x0b\x32\x12.google.rpc.Status\x12Q\n\x0fprecommit_token\x18\x03 \x01(\x0b\x32\x33.google.spanner.v1.MultiplexedSessionPrecommitTokenB\x03\xe0\x41\x01\"H\n\x10PartitionOptions\x12\x1c\n\x14partition_size_bytes\x18\x01 \x01(\x03\x12\x16\n\x0emax_partitions\x18\x02 \x01(\x03\"\xa3\x03\n\x15PartitionQueryRequest\x12\x37\n\x07session\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1espanner.googleapis.com/Session\x12;\n\x0btransaction\x18\x02 \x01(\x0b\x32&.google.spanner.v1.TransactionSelector\x12\x10\n\x03sql\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12\'\n\x06params\x18\x04 \x01(\x0b\x32\x17.google.protobuf.Struct\x12M\n\x0bparam_types\x18\x05 \x03(\x0b\x32\x38.google.spanner.v1.PartitionQueryRequest.ParamTypesEntry\x12>\n\x11partition_options\x18\x06 \x01(\x0b\x32#.google.spanner.v1.PartitionOptions\x1aJ\n\x0fParamTypesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12&\n\x05value\x18\x02 \x01(\x0b\x32\x17.google.spanner.v1.Type:\x02\x38\x01\"\xb1\x02\n\x14PartitionReadRequest\x12\x37\n\x07session\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1espanner.googleapis.com/Session\x12;\n\x0btransaction\x18\x02 \x01(\x0b\x32&.google.spanner.v1.TransactionSelector\x12\x12\n\x05table\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12\r\n\x05index\x18\x04 \x01(\t\x12\x0f\n\x07\x63olumns\x18\x05 \x03(\t\x12/\n\x07key_set\x18\x06 \x01(\x0b\x32\x19.google.spanner.v1.KeySetB\x03\xe0\x41\x02\x12>\n\x11partition_options\x18\t \x01(\x0b\x32#.google.spanner.v1.PartitionOptions\"$\n\tPartition\x12\x17\n\x0fpartition_token\x18\x01 \x01(\x0c\"z\n\x11PartitionResponse\x12\x30\n\npartitions\x18\x01 \x03(\x0b\x32\x1c.google.spanner.v1.Partition\x12\x33\n\x0btransaction\x18\x02 \x01(\x0b\x32\x1e.google.spanner.v1.Transaction\"\xb1\x06\n\x0bReadRequest\x12\x37\n\x07session\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1espanner.googleapis.com/Session\x12;\n\x0btransaction\x18\x02 \x01(\x0b\x32&.google.spanner.v1.TransactionSelector\x12\x12\n\x05table\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12\r\n\x05index\x18\x04 \x01(\t\x12\x14\n\x07\x63olumns\x18\x05 \x03(\tB\x03\xe0\x41\x02\x12/\n\x07key_set\x18\x06 \x01(\x0b\x32\x19.google.spanner.v1.KeySetB\x03\xe0\x41\x02\x12\r\n\x05limit\x18\x08 \x01(\x03\x12\x14\n\x0cresume_token\x18\t \x01(\x0c\x12\x17\n\x0fpartition_token\x18\n \x01(\x0c\x12:\n\x0frequest_options\x18\x0b \x01(\x0b\x32!.google.spanner.v1.RequestOptions\x12\x45\n\x15\x64irected_read_options\x18\x0e \x01(\x0b\x32&.google.spanner.v1.DirectedReadOptions\x12\x1a\n\x12\x64\x61ta_boost_enabled\x18\x0f \x01(\x08\x12=\n\x08order_by\x18\x10 \x01(\x0e\x32&.google.spanner.v1.ReadRequest.OrderByB\x03\xe0\x41\x01\x12?\n\tlock_hint\x18\x11 \x01(\x0e\x32\'.google.spanner.v1.ReadRequest.LockHintB\x03\xe0\x41\x01\x12\x39\n\x0crouting_hint\x18\x12 \x01(\x0b\x32\x1e.google.spanner.v1.RoutingHintB\x03\xe0\x41\x01\"T\n\x07OrderBy\x12\x18\n\x14ORDER_BY_UNSPECIFIED\x10\x00\x12\x18\n\x14ORDER_BY_PRIMARY_KEY\x10\x01\x12\x15\n\x11ORDER_BY_NO_ORDER\x10\x02\"T\n\x08LockHint\x12\x19\n\x15LOCK_HINT_UNSPECIFIED\x10\x00\x12\x14\n\x10LOCK_HINT_SHARED\x10\x01\x12\x17\n\x13LOCK_HINT_EXCLUSIVE\x10\x02\"\x83\x02\n\x17\x42\x65ginTransactionRequest\x12\x37\n\x07session\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1espanner.googleapis.com/Session\x12;\n\x07options\x18\x02 \x01(\x0b\x32%.google.spanner.v1.TransactionOptionsB\x03\xe0\x41\x02\x12:\n\x0frequest_options\x18\x03 \x01(\x0b\x32!.google.spanner.v1.RequestOptions\x12\x36\n\x0cmutation_key\x18\x04 \x01(\x0b\x32\x1b.google.spanner.v1.MutationB\x03\xe0\x41\x01\"\xd0\x03\n\rCommitRequest\x12\x37\n\x07session\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1espanner.googleapis.com/Session\x12\x18\n\x0etransaction_id\x18\x02 \x01(\x0cH\x00\x12G\n\x16single_use_transaction\x18\x03 \x01(\x0b\x32%.google.spanner.v1.TransactionOptionsH\x00\x12.\n\tmutations\x18\x04 \x03(\x0b\x32\x1b.google.spanner.v1.Mutation\x12\x1b\n\x13return_commit_stats\x18\x05 \x01(\x08\x12\x38\n\x10max_commit_delay\x18\x08 \x01(\x0b\x32\x19.google.protobuf.DurationB\x03\xe0\x41\x01\x12:\n\x0frequest_options\x18\x06 \x01(\x0b\x32!.google.spanner.v1.RequestOptions\x12Q\n\x0fprecommit_token\x18\t \x01(\x0b\x32\x33.google.spanner.v1.MultiplexedSessionPrecommitTokenB\x03\xe0\x41\x01\x42\r\n\x0btransaction\"g\n\x0fRollbackRequest\x12\x37\n\x07session\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1espanner.googleapis.com/Session\x12\x1b\n\x0etransaction_id\x18\x02 \x01(\x0c\x42\x03\xe0\x41\x02\"\xce\x02\n\x11\x42\x61tchWriteRequest\x12\x37\n\x07session\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1espanner.googleapis.com/Session\x12:\n\x0frequest_options\x18\x03 \x01(\x0b\x32!.google.spanner.v1.RequestOptions\x12P\n\x0fmutation_groups\x18\x04 \x03(\x0b\x32\x32.google.spanner.v1.BatchWriteRequest.MutationGroupB\x03\xe0\x41\x02\x12,\n\x1f\x65xclude_txn_from_change_streams\x18\x05 \x01(\x08\x42\x03\xe0\x41\x01\x1a\x44\n\rMutationGroup\x12\x33\n\tmutations\x18\x01 \x03(\x0b\x32\x1b.google.spanner.v1.MutationB\x03\xe0\x41\x02\"\x7f\n\x12\x42\x61tchWriteResponse\x12\x0f\n\x07indexes\x18\x01 \x03(\x05\x12\"\n\x06status\x18\x02 \x01(\x0b\x32\x12.google.rpc.Status\x12\x34\n\x10\x63ommit_timestamp\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp2\x8b\x18\n\x07Spanner\x12\xa6\x01\n\rCreateSession\x12\'.google.spanner.v1.CreateSessionRequest\x1a\x1a.google.spanner.v1.Session\"P\xda\x41\x08\x64\x61tabase\x82\xd3\xe4\x93\x02?\":/v1/{database=projects/*/instances/*/databases/*}/sessions:\x01*\x12\xe0\x01\n\x13\x42\x61tchCreateSessions\x12-.google.spanner.v1.BatchCreateSessionsRequest\x1a..google.spanner.v1.BatchCreateSessionsResponse\"j\xda\x41\x16\x64\x61tabase,session_count\x82\xd3\xe4\x93\x02K\"F/v1/{database=projects/*/instances/*/databases/*}/sessions:batchCreate:\x01*\x12\x97\x01\n\nGetSession\x12$.google.spanner.v1.GetSessionRequest\x1a\x1a.google.spanner.v1.Session\"G\xda\x41\x04name\x82\xd3\xe4\x93\x02:\x12\x38/v1/{name=projects/*/instances/*/databases/*/sessions/*}\x12\xae\x01\n\x0cListSessions\x12&.google.spanner.v1.ListSessionsRequest\x1a\'.google.spanner.v1.ListSessionsResponse\"M\xda\x41\x08\x64\x61tabase\x82\xd3\xe4\x93\x02<\x12:/v1/{database=projects/*/instances/*/databases/*}/sessions\x12\x99\x01\n\rDeleteSession\x12\'.google.spanner.v1.DeleteSessionRequest\x1a\x16.google.protobuf.Empty\"G\xda\x41\x04name\x82\xd3\xe4\x93\x02:*8/v1/{name=projects/*/instances/*/databases/*/sessions/*}\x12\xa3\x01\n\nExecuteSql\x12$.google.spanner.v1.ExecuteSqlRequest\x1a\x1c.google.spanner.v1.ResultSet\"Q\x82\xd3\xe4\x93\x02K\"F/v1/{session=projects/*/instances/*/databases/*/sessions/*}:executeSql:\x01*\x12\xbe\x01\n\x13\x45xecuteStreamingSql\x12$.google.spanner.v1.ExecuteSqlRequest\x1a#.google.spanner.v1.PartialResultSet\"Z\x82\xd3\xe4\x93\x02T\"O/v1/{session=projects/*/instances/*/databases/*/sessions/*}:executeStreamingSql:\x01*0\x01\x12\xc0\x01\n\x0f\x45xecuteBatchDml\x12).google.spanner.v1.ExecuteBatchDmlRequest\x1a*.google.spanner.v1.ExecuteBatchDmlResponse\"V\x82\xd3\xe4\x93\x02P\"K/v1/{session=projects/*/instances/*/databases/*/sessions/*}:executeBatchDml:\x01*\x12\x91\x01\n\x04Read\x12\x1e.google.spanner.v1.ReadRequest\x1a\x1c.google.spanner.v1.ResultSet\"K\x82\xd3\xe4\x93\x02\x45\"@/v1/{session=projects/*/instances/*/databases/*/sessions/*}:read:\x01*\x12\xac\x01\n\rStreamingRead\x12\x1e.google.spanner.v1.ReadRequest\x1a#.google.spanner.v1.PartialResultSet\"T\x82\xd3\xe4\x93\x02N\"I/v1/{session=projects/*/instances/*/databases/*/sessions/*}:streamingRead:\x01*0\x01\x12\xc9\x01\n\x10\x42\x65ginTransaction\x12*.google.spanner.v1.BeginTransactionRequest\x1a\x1e.google.spanner.v1.Transaction\"i\xda\x41\x0fsession,options\x82\xd3\xe4\x93\x02Q\"L/v1/{session=projects/*/instances/*/databases/*/sessions/*}:beginTransaction:\x01*\x12\xeb\x01\n\x06\x43ommit\x12 .google.spanner.v1.CommitRequest\x1a!.google.spanner.v1.CommitResponse\"\x9b\x01\xda\x41 session,transaction_id,mutations\xda\x41(session,single_use_transaction,mutations\x82\xd3\xe4\x93\x02G\"B/v1/{session=projects/*/instances/*/databases/*/sessions/*}:commit:\x01*\x12\xb0\x01\n\x08Rollback\x12\".google.spanner.v1.RollbackRequest\x1a\x16.google.protobuf.Empty\"h\xda\x41\x16session,transaction_id\x82\xd3\xe4\x93\x02I\"D/v1/{session=projects/*/instances/*/databases/*/sessions/*}:rollback:\x01*\x12\xb7\x01\n\x0ePartitionQuery\x12(.google.spanner.v1.PartitionQueryRequest\x1a$.google.spanner.v1.PartitionResponse\"U\x82\xd3\xe4\x93\x02O\"J/v1/{session=projects/*/instances/*/databases/*/sessions/*}:partitionQuery:\x01*\x12\xb4\x01\n\rPartitionRead\x12\'.google.spanner.v1.PartitionReadRequest\x1a$.google.spanner.v1.PartitionResponse\"T\x82\xd3\xe4\x93\x02N\"I/v1/{session=projects/*/instances/*/databases/*/sessions/*}:partitionRead:\x01*\x12\xc8\x01\n\nBatchWrite\x12$.google.spanner.v1.BatchWriteRequest\x1a%.google.spanner.v1.BatchWriteResponse\"k\xda\x41\x17session,mutation_groups\x82\xd3\xe4\x93\x02K\"F/v1/{session=projects/*/instances/*/databases/*/sessions/*}:batchWrite:\x01*0\x01\x1aw\xca\x41\x16spanner.googleapis.com\xd2\x41[https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/spanner.dataB\x91\x02\n\x15\x63om.google.spanner.v1B\x0cSpannerProtoP\x01Z5cloud.google.com/go/spanner/apiv1/spannerpb;spannerpb\xaa\x02\x17Google.Cloud.Spanner.V1\xca\x02\x17Google\\Cloud\\Spanner\\V1\xea\x02\x1aGoogle::Cloud::Spanner::V1\xea\x41_\n\x1fspanner.googleapis.com/Database\x12\n\x11partition_options\x18\x06 \x01(\x0b\x32#.google.spanner.v1.PartitionOptions\x1aJ\n\x0fParamTypesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12&\n\x05value\x18\x02 \x01(\x0b\x32\x17.google.spanner.v1.Type:\x02\x38\x01\"\xb1\x02\n\x14PartitionReadRequest\x12\x37\n\x07session\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1espanner.googleapis.com/Session\x12;\n\x0btransaction\x18\x02 \x01(\x0b\x32&.google.spanner.v1.TransactionSelector\x12\x12\n\x05table\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12\r\n\x05index\x18\x04 \x01(\t\x12\x0f\n\x07\x63olumns\x18\x05 \x03(\t\x12/\n\x07key_set\x18\x06 \x01(\x0b\x32\x19.google.spanner.v1.KeySetB\x03\xe0\x41\x02\x12>\n\x11partition_options\x18\t \x01(\x0b\x32#.google.spanner.v1.PartitionOptions\"$\n\tPartition\x12\x17\n\x0fpartition_token\x18\x01 \x01(\x0c\"z\n\x11PartitionResponse\x12\x30\n\npartitions\x18\x01 \x03(\x0b\x32\x1c.google.spanner.v1.Partition\x12\x33\n\x0btransaction\x18\x02 \x01(\x0b\x32\x1e.google.spanner.v1.Transaction\"\xb1\x06\n\x0bReadRequest\x12\x37\n\x07session\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1espanner.googleapis.com/Session\x12;\n\x0btransaction\x18\x02 \x01(\x0b\x32&.google.spanner.v1.TransactionSelector\x12\x12\n\x05table\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12\r\n\x05index\x18\x04 \x01(\t\x12\x14\n\x07\x63olumns\x18\x05 \x03(\tB\x03\xe0\x41\x02\x12/\n\x07key_set\x18\x06 \x01(\x0b\x32\x19.google.spanner.v1.KeySetB\x03\xe0\x41\x02\x12\r\n\x05limit\x18\x08 \x01(\x03\x12\x14\n\x0cresume_token\x18\t \x01(\x0c\x12\x17\n\x0fpartition_token\x18\n \x01(\x0c\x12:\n\x0frequest_options\x18\x0b \x01(\x0b\x32!.google.spanner.v1.RequestOptions\x12\x45\n\x15\x64irected_read_options\x18\x0e \x01(\x0b\x32&.google.spanner.v1.DirectedReadOptions\x12\x1a\n\x12\x64\x61ta_boost_enabled\x18\x0f \x01(\x08\x12=\n\x08order_by\x18\x10 \x01(\x0e\x32&.google.spanner.v1.ReadRequest.OrderByB\x03\xe0\x41\x01\x12?\n\tlock_hint\x18\x11 \x01(\x0e\x32\'.google.spanner.v1.ReadRequest.LockHintB\x03\xe0\x41\x01\x12\x39\n\x0crouting_hint\x18\x12 \x01(\x0b\x32\x1e.google.spanner.v1.RoutingHintB\x03\xe0\x41\x01\"T\n\x07OrderBy\x12\x18\n\x14ORDER_BY_UNSPECIFIED\x10\x00\x12\x18\n\x14ORDER_BY_PRIMARY_KEY\x10\x01\x12\x15\n\x11ORDER_BY_NO_ORDER\x10\x02\"T\n\x08LockHint\x12\x19\n\x15LOCK_HINT_UNSPECIFIED\x10\x00\x12\x14\n\x10LOCK_HINT_SHARED\x10\x01\x12\x17\n\x13LOCK_HINT_EXCLUSIVE\x10\x02\"\x83\x02\n\x17\x42\x65ginTransactionRequest\x12\x37\n\x07session\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1espanner.googleapis.com/Session\x12;\n\x07options\x18\x02 \x01(\x0b\x32%.google.spanner.v1.TransactionOptionsB\x03\xe0\x41\x02\x12:\n\x0frequest_options\x18\x03 \x01(\x0b\x32!.google.spanner.v1.RequestOptions\x12\x36\n\x0cmutation_key\x18\x04 \x01(\x0b\x32\x1b.google.spanner.v1.MutationB\x03\xe0\x41\x01\"\xd0\x03\n\rCommitRequest\x12\x37\n\x07session\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1espanner.googleapis.com/Session\x12\x18\n\x0etransaction_id\x18\x02 \x01(\x0cH\x00\x12G\n\x16single_use_transaction\x18\x03 \x01(\x0b\x32%.google.spanner.v1.TransactionOptionsH\x00\x12.\n\tmutations\x18\x04 \x03(\x0b\x32\x1b.google.spanner.v1.Mutation\x12\x1b\n\x13return_commit_stats\x18\x05 \x01(\x08\x12\x38\n\x10max_commit_delay\x18\x08 \x01(\x0b\x32\x19.google.protobuf.DurationB\x03\xe0\x41\x01\x12:\n\x0frequest_options\x18\x06 \x01(\x0b\x32!.google.spanner.v1.RequestOptions\x12Q\n\x0fprecommit_token\x18\t \x01(\x0b\x32\x33.google.spanner.v1.MultiplexedSessionPrecommitTokenB\x03\xe0\x41\x01\x42\r\n\x0btransaction\"g\n\x0fRollbackRequest\x12\x37\n\x07session\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1espanner.googleapis.com/Session\x12\x1b\n\x0etransaction_id\x18\x02 \x01(\x0c\x42\x03\xe0\x41\x02\"\xce\x02\n\x11\x42\x61tchWriteRequest\x12\x37\n\x07session\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1espanner.googleapis.com/Session\x12:\n\x0frequest_options\x18\x03 \x01(\x0b\x32!.google.spanner.v1.RequestOptions\x12P\n\x0fmutation_groups\x18\x04 \x03(\x0b\x32\x32.google.spanner.v1.BatchWriteRequest.MutationGroupB\x03\xe0\x41\x02\x12,\n\x1f\x65xclude_txn_from_change_streams\x18\x05 \x01(\x08\x42\x03\xe0\x41\x01\x1a\x44\n\rMutationGroup\x12\x33\n\tmutations\x18\x01 \x03(\x0b\x32\x1b.google.spanner.v1.MutationB\x03\xe0\x41\x02\"\x7f\n\x12\x42\x61tchWriteResponse\x12\x0f\n\x07indexes\x18\x01 \x03(\x05\x12\"\n\x06status\x18\x02 \x01(\x0b\x32\x12.google.rpc.Status\x12\x34\n\x10\x63ommit_timestamp\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp2\x8b\x18\n\x07Spanner\x12\xa6\x01\n\rCreateSession\x12\'.google.spanner.v1.CreateSessionRequest\x1a\x1a.google.spanner.v1.Session\"P\xda\x41\x08\x64\x61tabase\x82\xd3\xe4\x93\x02?\":/v1/{database=projects/*/instances/*/databases/*}/sessions:\x01*\x12\xe0\x01\n\x13\x42\x61tchCreateSessions\x12-.google.spanner.v1.BatchCreateSessionsRequest\x1a..google.spanner.v1.BatchCreateSessionsResponse\"j\xda\x41\x16\x64\x61tabase,session_count\x82\xd3\xe4\x93\x02K\"F/v1/{database=projects/*/instances/*/databases/*}/sessions:batchCreate:\x01*\x12\x97\x01\n\nGetSession\x12$.google.spanner.v1.GetSessionRequest\x1a\x1a.google.spanner.v1.Session\"G\xda\x41\x04name\x82\xd3\xe4\x93\x02:\x12\x38/v1/{name=projects/*/instances/*/databases/*/sessions/*}\x12\xae\x01\n\x0cListSessions\x12&.google.spanner.v1.ListSessionsRequest\x1a\'.google.spanner.v1.ListSessionsResponse\"M\xda\x41\x08\x64\x61tabase\x82\xd3\xe4\x93\x02<\x12:/v1/{database=projects/*/instances/*/databases/*}/sessions\x12\x99\x01\n\rDeleteSession\x12\'.google.spanner.v1.DeleteSessionRequest\x1a\x16.google.protobuf.Empty\"G\xda\x41\x04name\x82\xd3\xe4\x93\x02:*8/v1/{name=projects/*/instances/*/databases/*/sessions/*}\x12\xa3\x01\n\nExecuteSql\x12$.google.spanner.v1.ExecuteSqlRequest\x1a\x1c.google.spanner.v1.ResultSet\"Q\x82\xd3\xe4\x93\x02K\"F/v1/{session=projects/*/instances/*/databases/*/sessions/*}:executeSql:\x01*\x12\xbe\x01\n\x13\x45xecuteStreamingSql\x12$.google.spanner.v1.ExecuteSqlRequest\x1a#.google.spanner.v1.PartialResultSet\"Z\x82\xd3\xe4\x93\x02T\"O/v1/{session=projects/*/instances/*/databases/*/sessions/*}:executeStreamingSql:\x01*0\x01\x12\xc0\x01\n\x0f\x45xecuteBatchDml\x12).google.spanner.v1.ExecuteBatchDmlRequest\x1a*.google.spanner.v1.ExecuteBatchDmlResponse\"V\x82\xd3\xe4\x93\x02P\"K/v1/{session=projects/*/instances/*/databases/*/sessions/*}:executeBatchDml:\x01*\x12\x91\x01\n\x04Read\x12\x1e.google.spanner.v1.ReadRequest\x1a\x1c.google.spanner.v1.ResultSet\"K\x82\xd3\xe4\x93\x02\x45\"@/v1/{session=projects/*/instances/*/databases/*/sessions/*}:read:\x01*\x12\xac\x01\n\rStreamingRead\x12\x1e.google.spanner.v1.ReadRequest\x1a#.google.spanner.v1.PartialResultSet\"T\x82\xd3\xe4\x93\x02N\"I/v1/{session=projects/*/instances/*/databases/*/sessions/*}:streamingRead:\x01*0\x01\x12\xc9\x01\n\x10\x42\x65ginTransaction\x12*.google.spanner.v1.BeginTransactionRequest\x1a\x1e.google.spanner.v1.Transaction\"i\xda\x41\x0fsession,options\x82\xd3\xe4\x93\x02Q\"L/v1/{session=projects/*/instances/*/databases/*/sessions/*}:beginTransaction:\x01*\x12\xeb\x01\n\x06\x43ommit\x12 .google.spanner.v1.CommitRequest\x1a!.google.spanner.v1.CommitResponse\"\x9b\x01\xda\x41 session,transaction_id,mutations\xda\x41(session,single_use_transaction,mutations\x82\xd3\xe4\x93\x02G\"B/v1/{session=projects/*/instances/*/databases/*/sessions/*}:commit:\x01*\x12\xb0\x01\n\x08Rollback\x12\".google.spanner.v1.RollbackRequest\x1a\x16.google.protobuf.Empty\"h\xda\x41\x16session,transaction_id\x82\xd3\xe4\x93\x02I\"D/v1/{session=projects/*/instances/*/databases/*/sessions/*}:rollback:\x01*\x12\xb7\x01\n\x0ePartitionQuery\x12(.google.spanner.v1.PartitionQueryRequest\x1a$.google.spanner.v1.PartitionResponse\"U\x82\xd3\xe4\x93\x02O\"J/v1/{session=projects/*/instances/*/databases/*/sessions/*}:partitionQuery:\x01*\x12\xb4\x01\n\rPartitionRead\x12\'.google.spanner.v1.PartitionReadRequest\x1a$.google.spanner.v1.PartitionResponse\"T\x82\xd3\xe4\x93\x02N\"I/v1/{session=projects/*/instances/*/databases/*/sessions/*}:partitionRead:\x01*\x12\xc8\x01\n\nBatchWrite\x12$.google.spanner.v1.BatchWriteRequest\x1a%.google.spanner.v1.BatchWriteResponse\"k\xda\x41\x17session,mutation_groups\x82\xd3\xe4\x93\x02K\"F/v1/{session=projects/*/instances/*/databases/*/sessions/*}:batchWrite:\x01*0\x01\x1aw\xca\x41\x16spanner.googleapis.com\xd2\x41[https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/spanner.dataB\x91\x02\n\x15\x63om.google.spanner.v1B\x0cSpannerProtoP\x01Z5cloud.google.com/go/spanner/apiv1/spannerpb;spannerpb\xaa\x02\x17Google.Cloud.Spanner.V1\xca\x02\x17Google\\Cloud\\Spanner\\V1\xea\x02\x1aGoogle::Cloud::Spanner::V1\xea\x41_\n\x1fspanner.googleapis.com/Database\x12 ::Google::Cloud::Spanner::V1::Type}] - # It isn't always possible for Cloud Spanner to infer the right SQL type - # from a JSON value. For example, values of type `BYTES` and values - # of type `STRING` both appear in + # Optional. It isn't always possible for Cloud Spanner to infer the right SQL + # type from a JSON value. For example, values of type `BYTES` and values of + # type `STRING` both appear in # {::Google::Cloud::Spanner::V1::PartitionQueryRequest#params params} as JSON strings. # # In these cases, `param_types` can be used to specify the exact @@ -1169,7 +1171,12 @@ class MutationGroup # @!attribute [rw] commit_timestamp # @return [::Google::Protobuf::Timestamp] # The commit timestamp of the transaction that applied this batch. - # Present if `status` is `OK`, absent otherwise. + # Present if status is OK and the mutation groups were applied, absent + # otherwise. + # + # For mutation groups with conditions, a status=OK and missing + # commit_timestamp means that the mutation groups were not applied due to the + # condition not being satisfied after evaluation. class BatchWriteResponse include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods diff --git a/owl-bot-staging/google-cloud-spanner-v1/.gitignore b/owl-bot-staging/google-cloud-spanner-v1/.gitignore deleted file mode 100644 index 0135b6bc6cfc..000000000000 --- a/owl-bot-staging/google-cloud-spanner-v1/.gitignore +++ /dev/null @@ -1,22 +0,0 @@ -# Ignore bundler lockfiles -Gemfile.lock -gems.locked - -# Ignore documentation output -doc/* -.yardoc/* - -# Ignore test output -coverage/* - -# Ignore build artifacts -pkg/* - -# Ignore files commonly present in certain dev environments -.vagrant -.DS_STORE -.idea -*.iml - -# Ignore synth output -__pycache__ diff --git a/owl-bot-staging/google-cloud-spanner-v1/.repo-metadata.json b/owl-bot-staging/google-cloud-spanner-v1/.repo-metadata.json deleted file mode 100644 index 97ae30d48f35..000000000000 --- a/owl-bot-staging/google-cloud-spanner-v1/.repo-metadata.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "api_id": "spanner.googleapis.com", - "api_shortname": "spanner", - "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-spanner-v1/latest", - "distribution_name": "google-cloud-spanner-v1", - "is_cloud": true, - "language": "ruby", - "name": "spanner", - "name_pretty": "Cloud Spanner V1 API", - "product_documentation": "https://cloud.google.com/spanner", - "release_level": "unreleased", - "repo": "googleapis/google-cloud-ruby", - "requires_billing": true, - "ruby-cloud-description": "Cloud Spanner is a managed, mission-critical, globally consistent and scalable relational database service. Note that google-cloud-spanner-v1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-spanner instead. See the readme for more details.", - "ruby-cloud-env-prefix": "SPANNER", - "ruby-cloud-product-url": "https://cloud.google.com/spanner", - "library_type": "GAPIC_AUTO" -} diff --git a/owl-bot-staging/google-cloud-spanner-v1/.rubocop.yml b/owl-bot-staging/google-cloud-spanner-v1/.rubocop.yml deleted file mode 100644 index c29064123444..000000000000 --- a/owl-bot-staging/google-cloud-spanner-v1/.rubocop.yml +++ /dev/null @@ -1,33 +0,0 @@ -inherit_gem: - google-style: google-style.yml - -AllCops: - Exclude: - - "google-cloud-spanner-v1.gemspec" - - "lib/**/*_pb.rb" - - "proto_docs/**/*" - - "test/**/*" - - "acceptance/**/*" - - "samples/acceptance/**/*" - - "Rakefile" - -Layout/LineLength: - Enabled: false -Metrics/AbcSize: - Enabled: false -Metrics/ClassLength: - Enabled: false -Metrics/CyclomaticComplexity: - Enabled: false -Metrics/MethodLength: - Enabled: false -Metrics/ModuleLength: - Enabled: false -Metrics/PerceivedComplexity: - Enabled: false -Naming/AccessorMethodName: - Exclude: - - "snippets/**/*.rb" -Naming/FileName: - Exclude: - - "lib/google-cloud-spanner-v1.rb" diff --git a/owl-bot-staging/google-cloud-spanner-v1/.toys.rb b/owl-bot-staging/google-cloud-spanner-v1/.toys.rb deleted file mode 100644 index 177e22456e8a..000000000000 --- a/owl-bot-staging/google-cloud-spanner-v1/.toys.rb +++ /dev/null @@ -1,28 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -toys_version! ">= 0.15.3" - -if ENV["RUBY_COMMON_TOOLS"] - common_tools_dir = File.expand_path ENV["RUBY_COMMON_TOOLS"] - load File.join(common_tools_dir, "toys", "gapic") -else - load_git remote: "https://github.com/googleapis/ruby-common-tools.git", - path: "toys/gapic", - update: true -end diff --git a/owl-bot-staging/google-cloud-spanner-v1/.yardopts b/owl-bot-staging/google-cloud-spanner-v1/.yardopts deleted file mode 100644 index 62c084b2c082..000000000000 --- a/owl-bot-staging/google-cloud-spanner-v1/.yardopts +++ /dev/null @@ -1,12 +0,0 @@ ---no-private ---title="Cloud Spanner V1 API" ---exclude _pb\.rb$ ---markup markdown ---markup-provider redcarpet - -./lib/**/*.rb -./proto_docs/**/*.rb -- -README.md -LICENSE.md -AUTHENTICATION.md diff --git a/owl-bot-staging/google-cloud-spanner-v1/AUTHENTICATION.md b/owl-bot-staging/google-cloud-spanner-v1/AUTHENTICATION.md deleted file mode 100644 index a4d7b47836ad..000000000000 --- a/owl-bot-staging/google-cloud-spanner-v1/AUTHENTICATION.md +++ /dev/null @@ -1,122 +0,0 @@ -# Authentication - -The recommended way to authenticate to the google-cloud-spanner-v1 library is to use -[Application Default Credentials (ADC)](https://cloud.google.com/docs/authentication/application-default-credentials). -To review all of your authentication options, see [Credentials lookup](#credential-lookup). - -## Quickstart - -The following example shows how to set up authentication for a local development -environment with your user credentials. - -**NOTE:** This method is _not_ recommended for running in production. User credentials -should be used only during development. - -1. [Download and install the Google Cloud CLI](https://cloud.google.com/sdk). -2. Set up a local ADC file with your user credentials: - -```sh -gcloud auth application-default login -``` - -3. Write code as if already authenticated. - -For more information about setting up authentication for a local development environment, see -[Set up Application Default Credentials](https://cloud.google.com/docs/authentication/provide-credentials-adc#local-dev). - -## Credential Lookup - -The google-cloud-spanner-v1 library provides several mechanisms to configure your system. -Generally, using Application Default Credentials to facilitate automatic -credentials discovery is the easist method. But if you need to explicitly specify -credentials, there are several methods available to you. - -Credentials are accepted in the following ways, in the following order or precedence: - -1. Credentials specified in method arguments -2. Credentials specified in configuration -3. Credentials pointed to or included in environment variables -4. Credentials found in local ADC file -5. Credentials returned by the metadata server for the attached service account (GCP) - -### Configuration - -You can configure a path to a JSON credentials file, either for an individual client object or -globally, for all client objects. The JSON file can contain credentials created for -[workload identity federation](https://cloud.google.com/iam/docs/workload-identity-federation), -[workforce identity federation](https://cloud.google.com/iam/docs/workforce-identity-federation), or a -[service account key](https://cloud.google.com/docs/authentication/provide-credentials-adc#local-key). - -Note: Service account keys are a security risk if not managed correctly. You should -[choose a more secure alternative to service account keys](https://cloud.google.com/docs/authentication#auth-decision-tree) -whenever possible. - -To configure a credentials file for an individual client initialization: - -```ruby -require "google/cloud/spanner/v1" - -client = ::Google::Cloud::Spanner::V1::Spanner::Client.new do |config| - config.credentials = "path/to/credentialfile.json" -end -``` - -To configure a credentials file globally for all clients: - -```ruby -require "google/cloud/spanner/v1" - -::Google::Cloud::Spanner::V1::Spanner::Client.configure do |config| - config.credentials = "path/to/credentialfile.json" -end - -client = ::Google::Cloud::Spanner::V1::Spanner::Client.new -``` - -### Environment Variables - -You can also use an environment variable to provide a JSON credentials file. -The environment variable can contain a path to the credentials file or, for -environments such as Docker containers where writing files is not encouraged, -you can include the credentials file itself. - -The JSON file can contain credentials created for -[workload identity federation](https://cloud.google.com/iam/docs/workload-identity-federation), -[workforce identity federation](https://cloud.google.com/iam/docs/workforce-identity-federation), or a -[service account key](https://cloud.google.com/docs/authentication/provide-credentials-adc#local-key). - -Note: Service account keys are a security risk if not managed correctly. You should -[choose a more secure alternative to service account keys](https://cloud.google.com/docs/authentication#auth-decision-tree) -whenever possible. - -The environment variables that google-cloud-spanner-v1 -checks for credentials are: - -* `GOOGLE_CLOUD_CREDENTIALS` - Path to JSON file, or JSON contents -* `GOOGLE_APPLICATION_CREDENTIALS` - Path to JSON file - -```ruby -require "google/cloud/spanner/v1" - -ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" - -client = ::Google::Cloud::Spanner::V1::Spanner::Client.new -``` - -### Local ADC file - -You can set up a local ADC file with your user credentials for authentication during -development. If credentials are not provided in code or in environment variables, -then the local ADC credentials are discovered. - -Follow the steps in [Quickstart](#quickstart) to set up a local ADC file. - -### Google Cloud Platform environments - -When running on Google Cloud Platform (GCP), including Google Compute Engine -(GCE), Google Kubernetes Engine (GKE), Google App Engine (GAE), Google Cloud -Functions (GCF) and Cloud Run, credentials are retrieved from the attached -service account automatically. Code should be written as if already authenticated. - -For more information, see -[Set up ADC for Google Cloud services](https://cloud.google.com/docs/authentication/provide-credentials-adc#attached-sa). diff --git a/owl-bot-staging/google-cloud-spanner-v1/CHANGELOG.md b/owl-bot-staging/google-cloud-spanner-v1/CHANGELOG.md deleted file mode 100644 index f88957a62ba2..000000000000 --- a/owl-bot-staging/google-cloud-spanner-v1/CHANGELOG.md +++ /dev/null @@ -1,2 +0,0 @@ -# Release History - diff --git a/owl-bot-staging/google-cloud-spanner-v1/Gemfile b/owl-bot-staging/google-cloud-spanner-v1/Gemfile deleted file mode 100644 index 6442df18fa2f..000000000000 --- a/owl-bot-staging/google-cloud-spanner-v1/Gemfile +++ /dev/null @@ -1,11 +0,0 @@ -source "https://rubygems.org" - -gemspec - -gem "google-style", "~> 1.31.1" -gem "minitest", "~> 5.22" -gem "minitest-focus", "~> 1.4" -gem "minitest-rg", "~> 5.3" -gem "rake", ">= 13.0" -gem "redcarpet", "~> 3.6" -gem "yard", "~> 0.9" diff --git a/owl-bot-staging/google-cloud-spanner-v1/LICENSE.md b/owl-bot-staging/google-cloud-spanner-v1/LICENSE.md deleted file mode 100644 index c261857ba6ad..000000000000 --- a/owl-bot-staging/google-cloud-spanner-v1/LICENSE.md +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/owl-bot-staging/google-cloud-spanner-v1/README.md b/owl-bot-staging/google-cloud-spanner-v1/README.md deleted file mode 100644 index 1ff29659d58a..000000000000 --- a/owl-bot-staging/google-cloud-spanner-v1/README.md +++ /dev/null @@ -1,153 +0,0 @@ -# Ruby Client for the Cloud Spanner V1 API - -Cloud Spanner is a managed, mission-critical, globally consistent and scalable relational database service. - - -https://github.com/googleapis/google-cloud-ruby - -This gem is a _versioned_ client. It provides basic client classes for a -specific version of the Cloud Spanner V1 API. Most users should consider using -the main client gem, -[google-cloud-spanner](https://rubygems.org/gems/google-cloud-spanner). -See the section below titled *Which client should I use?* for more information. - -## Installation - -``` -$ gem install google-cloud-spanner-v1 -``` - -## Before You Begin - -In order to use this library, you first need to go through the following steps: - -1. [Select or create a Cloud Platform project.](https://console.cloud.google.com/project) -1. [Enable billing for your project.](https://cloud.google.com/billing/docs/how-to/modify-project#enable_billing_for_a_project) -1. [Enable the API.](https://console.cloud.google.com/apis/library/spanner.googleapis.com) -1. [Set up authentication.](AUTHENTICATION.md) - -## Quick Start - -```ruby -require "google/cloud/spanner/v1" - -client = ::Google::Cloud::Spanner::V1::Spanner::Client.new -request = ::Google::Cloud::Spanner::V1::CreateSessionRequest.new # (request fields as keyword arguments...) -response = client.create_session request -``` - -View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-spanner-v1/latest) -for class and method documentation. - -See also the [Product Documentation](https://cloud.google.com/spanner) -for general usage information. - -## Debug Logging - -This library comes with opt-in Debug Logging that can help you troubleshoot -your application's integration with the API. When logging is activated, key -events such as requests and responses, along with data payloads and metadata -such as headers and client configuration, are logged to the standard error -stream. - -**WARNING:** Client Library Debug Logging includes your data payloads in -plaintext, which could include sensitive data such as PII for yourself or your -customers, private keys, or other security data that could be compromising if -leaked. Always practice good data hygiene with your application logs, and follow -the principle of least access. Google also recommends that Client Library Debug -Logging be enabled only temporarily during active debugging, and not used -permanently in production. - -To enable logging, set the environment variable `GOOGLE_SDK_RUBY_LOGGING_GEMS` -to the value `all`. Alternatively, you can set the value to a comma-delimited -list of client library gem names. This will select the default logging behavior, -which writes logs to the standard error stream. On a local workstation, this may -result in logs appearing on the console. When running on a Google Cloud hosting -service such as [Google Cloud Run](https://cloud.google.com/run), this generally -results in logs appearing alongside your application logs in the -[Google Cloud Logging](https://cloud.google.com/logging/) service. - -You can customize logging by modifying the `logger` configuration when -constructing a client object. For example: - -```ruby -require "google/cloud/spanner/v1" -require "logger" - -client = ::Google::Cloud::Spanner::V1::Spanner::Client.new do |config| - config.logger = Logger.new "my-app.log" -end -``` - -## Google Cloud Samples - -To browse ready to use code samples check [Google Cloud Samples](https://cloud.google.com/docs/samples). - -## Supported Ruby Versions - -This library is supported on Ruby 3.0+. - -Google provides official support for Ruby versions that are actively supported -by Ruby Core—that is, Ruby versions that are either in normal maintenance or -in security maintenance, and not end of life. Older versions of Ruby _may_ -still work, but are unsupported and not recommended. See -https://www.ruby-lang.org/en/downloads/branches/ for details about the Ruby -support schedule. - -## Which client should I use? - -Most modern Ruby client libraries for Google APIs come in two flavors: the main -client library with a name such as `google-cloud-spanner`, -and lower-level _versioned_ client libraries with names such as -`google-cloud-spanner-v1`. -_In most cases, you should install the main client._ - -### What's the difference between the main client and a versioned client? - -A _versioned client_ provides a basic set of data types and client classes for -a _single version_ of a specific service. (That is, for a service with multiple -versions, there might be a separate versioned client for each service version.) -Most versioned clients are written and maintained by a code generator. - -The _main client_ is designed to provide you with the _recommended_ client -interfaces for the service. There will be only one main client for any given -service, even a service with multiple versions. The main client includes -factory methods for constructing the client objects we recommend for most -users. In some cases, those will be classes provided by an underlying versioned -client; in other cases, they will be handwritten higher-level client objects -with additional capabilities, convenience methods, or best practices built in. -Generally, the main client will default to a recommended service version, -although in some cases you can override this if you need to talk to a specific -service version. - -### Why would I want to use the main client? - -We recommend that most users install the main client gem for a service. You can -identify this gem as the one _without_ a version in its name, e.g. -`google-cloud-spanner`. -The main client is recommended because it will embody the best practices for -accessing the service, and may also provide more convenient interfaces or -tighter integration into frameworks and third-party libraries. In addition, the -documentation and samples published by Google will generally demonstrate use of -the main client. - -### Why would I want to use a versioned client? - -You can use a versioned client if you are content with a possibly lower-level -class interface, you explicitly want to avoid features provided by the main -client, or you want to access a specific service version not be covered by the -main client. You can identify versioned client gems because the service version -is part of the name, e.g. `google-cloud-spanner-v1`. - -### What about the google-apis- clients? - -Client library gems with names that begin with `google-apis-` are based on an -older code generation technology. They talk to a REST/JSON backend (whereas -most modern clients talk to a [gRPC](https://grpc.io/) backend) and they may -not offer the same performance, features, and ease of use provided by more -modern clients. - -The `google-apis-` clients have wide coverage across Google services, so you -might need to use one if there is no modern client available for the service. -However, if a modern client is available, we generally recommend it over the -older `google-apis-` clients. diff --git a/owl-bot-staging/google-cloud-spanner-v1/Rakefile b/owl-bot-staging/google-cloud-spanner-v1/Rakefile deleted file mode 100644 index b18de45c0a03..000000000000 --- a/owl-bot-staging/google-cloud-spanner-v1/Rakefile +++ /dev/null @@ -1,169 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "bundler/setup" -require "bundler/gem_tasks" - -require "rubocop/rake_task" -RuboCop::RakeTask.new - -require "rake/testtask" -desc "Run tests." -Rake::TestTask.new do |t| - t.libs << "test" - t.test_files = FileList["test/**/*_test.rb"] - t.warning = false -end - -desc "Runs the smoke tests." -Rake::TestTask.new :smoke_test do |t| - t.test_files = FileList["acceptance/**/*smoke_test.rb"] - t.warning = false -end - -# Acceptance tests -desc "Run the google-cloud-spanner-v1 acceptance tests." -task :acceptance, :project, :keyfile do |t, args| - project = args[:project] - project ||= - ENV["SPANNER_TEST_PROJECT"] || - ENV["GCLOUD_TEST_PROJECT"] - keyfile = args[:keyfile] - keyfile ||= - ENV["SPANNER_TEST_KEYFILE"] || - ENV["GCLOUD_TEST_KEYFILE"] - if keyfile - keyfile = File.read keyfile - else - keyfile ||= - ENV["SPANNER_TEST_KEYFILE_JSON"] || - ENV["GCLOUD_TEST_KEYFILE_JSON"] - end - if project.nil? || keyfile.nil? - fail "You must provide a project and keyfile. e.g. rake acceptance[test123, /path/to/keyfile.json] or SPANNER_TEST_PROJECT=test123 SPANNER_TEST_KEYFILE=/path/to/keyfile.json rake acceptance" - end - require "google/cloud/spanner/v1/spanner/credentials" - ::Google::Cloud::Spanner::V1::Spanner::Credentials.env_vars.each do |path| - ENV[path] = nil - end - ENV["SPANNER_PROJECT"] = project - ENV["SPANNER_TEST_PROJECT"] = project - ENV["SPANNER_KEYFILE_JSON"] = keyfile - - Rake::Task["acceptance:run"].invoke -end - -namespace :acceptance do - task :run do - if File.directory? "acceptance" - Rake::Task[:smoke_test].invoke - else - puts "The google-cloud-spanner-v1 gem has no acceptance tests." - end - end - - desc "Run acceptance cleanup." - task :cleanup do - end -end - -task :samples do - Rake::Task["samples:latest"].invoke -end - -namespace :samples do - task :latest do - if File.directory? "samples" - Dir.chdir "samples" do - Bundler.with_clean_env do - ENV["GOOGLE_CLOUD_SAMPLES_TEST"] = "not_master" - sh "bundle update" - sh "bundle exec rake test" - end - end - else - puts "The google-cloud-spanner-v1 gem has no samples to test." - end - end - - task :master do - if File.directory? "samples" - Dir.chdir "samples" do - Bundler.with_clean_env do - ENV["GOOGLE_CLOUD_SAMPLES_TEST"] = "master" - sh "bundle update" - sh "bundle exec rake test" - end - end - else - puts "The google-cloud-spanner-v1 gem has no samples to test." - end - end -end - -require "yard" -require "yard/rake/yardoc_task" -YARD::Rake::YardocTask.new do |y| - y.options << "--fail-on-warning" -end - -desc "Run yard-doctest example tests." -task :doctest do - puts "The google-cloud-spanner-v1 gem does not have doctest tests." -end - -desc "Run the CI build" -task :ci do - header "BUILDING google-cloud-spanner-v1" - header "google-cloud-spanner-v1 rubocop", "*" - Rake::Task[:rubocop].invoke - header "google-cloud-spanner-v1 yard", "*" - Rake::Task[:yard].invoke - header "google-cloud-spanner-v1 test", "*" - Rake::Task[:test].invoke -end - -namespace :ci do - desc "Run the CI build, with smoke tests." - task :smoke_test do - Rake::Task[:ci].invoke - header "google-cloud-spanner-v1 smoke_test", "*" - Rake::Task[:smoke_test].invoke - end - desc "Run the CI build, with acceptance tests." - task :acceptance do - Rake::Task[:ci].invoke - header "google-cloud-spanner-v1 acceptance", "*" - Rake::Task[:acceptance].invoke - end - task :a do - # This is a handy shortcut to save typing - Rake::Task["ci:acceptance"].invoke - end -end - -task default: :test - -def header str, token = "#" - line_length = str.length + 8 - puts "" - puts token * line_length - puts "#{token * 3} #{str} #{token * 3}" - puts token * line_length - puts "" -end diff --git a/owl-bot-staging/google-cloud-spanner-v1/gapic_metadata.json b/owl-bot-staging/google-cloud-spanner-v1/gapic_metadata.json deleted file mode 100644 index 5d46cd55f5fb..000000000000 --- a/owl-bot-staging/google-cloud-spanner-v1/gapic_metadata.json +++ /dev/null @@ -1,98 +0,0 @@ -{ - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", - "language": "ruby", - "protoPackage": "google.spanner.v1", - "libraryPackage": "::Google::Cloud::Spanner::V1", - "services": { - "Spanner": { - "clients": { - "grpc": { - "libraryClient": "::Google::Cloud::Spanner::V1::Spanner::Client", - "rpcs": { - "CreateSession": { - "methods": [ - "create_session" - ] - }, - "BatchCreateSessions": { - "methods": [ - "batch_create_sessions" - ] - }, - "GetSession": { - "methods": [ - "get_session" - ] - }, - "ListSessions": { - "methods": [ - "list_sessions" - ] - }, - "DeleteSession": { - "methods": [ - "delete_session" - ] - }, - "ExecuteSql": { - "methods": [ - "execute_sql" - ] - }, - "ExecuteStreamingSql": { - "methods": [ - "execute_streaming_sql" - ] - }, - "ExecuteBatchDml": { - "methods": [ - "execute_batch_dml" - ] - }, - "Read": { - "methods": [ - "read" - ] - }, - "StreamingRead": { - "methods": [ - "streaming_read" - ] - }, - "BeginTransaction": { - "methods": [ - "begin_transaction" - ] - }, - "Commit": { - "methods": [ - "commit" - ] - }, - "Rollback": { - "methods": [ - "rollback" - ] - }, - "PartitionQuery": { - "methods": [ - "partition_query" - ] - }, - "PartitionRead": { - "methods": [ - "partition_read" - ] - }, - "BatchWrite": { - "methods": [ - "batch_write" - ] - } - } - } - } - } - } -} diff --git a/owl-bot-staging/google-cloud-spanner-v1/google-cloud-spanner-v1.gemspec b/owl-bot-staging/google-cloud-spanner-v1/google-cloud-spanner-v1.gemspec deleted file mode 100644 index aa059c10b7aa..000000000000 --- a/owl-bot-staging/google-cloud-spanner-v1/google-cloud-spanner-v1.gemspec +++ /dev/null @@ -1,28 +0,0 @@ -# -*- ruby -*- -# encoding: utf-8 - -require File.expand_path("lib/google/cloud/spanner/v1/version", __dir__) - -Gem::Specification.new do |gem| - gem.name = "google-cloud-spanner-v1" - gem.version = Google::Cloud::Spanner::V1::VERSION - - gem.authors = ["Google LLC"] - gem.email = "googleapis-packages@google.com" - gem.description = "Cloud Spanner is a managed, mission-critical, globally consistent and scalable relational database service. Note that google-cloud-spanner-v1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-spanner instead. See the readme for more details." - gem.summary = "Cloud Spanner is a managed, mission-critical, globally consistent and scalable relational database service." - gem.homepage = "https://github.com/googleapis/google-cloud-ruby" - gem.license = "Apache-2.0" - - gem.platform = Gem::Platform::RUBY - - gem.files = `git ls-files -- lib/*`.split("\n") + - `git ls-files -- proto_docs/*`.split("\n") + - ["README.md", "LICENSE.md", "AUTHENTICATION.md", ".yardopts"] - gem.require_paths = ["lib"] - - gem.required_ruby_version = ">= 3.1" - - gem.add_dependency "gapic-common", "~> 1.2" - gem.add_dependency "google-cloud-errors", "~> 1.0" -end diff --git a/owl-bot-staging/google-cloud-spanner-v1/lib/google-cloud-spanner-v1.rb b/owl-bot-staging/google-cloud-spanner-v1/lib/google-cloud-spanner-v1.rb deleted file mode 100644 index 2f3a79fec01f..000000000000 --- a/owl-bot-staging/google-cloud-spanner-v1/lib/google-cloud-spanner-v1.rb +++ /dev/null @@ -1,21 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# This gem does not autoload during Bundler.require. To load this gem, -# issue explicit require statements for the packages desired, e.g.: -# require "google/cloud/spanner/v1" diff --git a/owl-bot-staging/google-cloud-spanner-v1/lib/google/cloud/spanner/v1.rb b/owl-bot-staging/google-cloud-spanner-v1/lib/google/cloud/spanner/v1.rb deleted file mode 100644 index 031d8a0b49f6..000000000000 --- a/owl-bot-staging/google-cloud-spanner-v1/lib/google/cloud/spanner/v1.rb +++ /dev/null @@ -1,40 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/spanner/v1/spanner" -require "google/cloud/spanner/v1/version" - -module Google - module Cloud - module Spanner - ## - # API client module. - # - # @example Load this package, including all its services, and instantiate a gRPC client - # - # require "google/cloud/spanner/v1" - # client = ::Google::Cloud::Spanner::V1::Spanner::Client.new - # - module V1 - end - end - end -end - -helper_path = ::File.join __dir__, "v1", "_helpers.rb" -require "google/cloud/spanner/v1/_helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-spanner-v1/lib/google/cloud/spanner/v1/spanner.rb b/owl-bot-staging/google-cloud-spanner-v1/lib/google/cloud/spanner/v1/spanner.rb deleted file mode 100644 index 50df58fbcc65..000000000000 --- a/owl-bot-staging/google-cloud-spanner-v1/lib/google/cloud/spanner/v1/spanner.rb +++ /dev/null @@ -1,52 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/common" -require "gapic/config" -require "gapic/config/method" - -require "google/cloud/spanner/v1/version" - -require "google/cloud/spanner/v1/spanner/credentials" -require "google/cloud/spanner/v1/spanner/paths" -require "google/cloud/spanner/v1/spanner/client" - -module Google - module Cloud - module Spanner - module V1 - ## - # Cloud Spanner API - # - # The Cloud Spanner API can be used to manage sessions and execute - # transactions on data stored in Cloud Spanner databases. - # - # @example Load this service and instantiate a gRPC client - # - # require "google/cloud/spanner/v1/spanner" - # client = ::Google::Cloud::Spanner::V1::Spanner::Client.new - # - module Spanner - end - end - end - end -end - -helper_path = ::File.join __dir__, "spanner", "helpers.rb" -require "google/cloud/spanner/v1/spanner/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-spanner-v1/lib/google/cloud/spanner/v1/spanner/client.rb b/owl-bot-staging/google-cloud-spanner-v1/lib/google/cloud/spanner/v1/spanner/client.rb deleted file mode 100644 index ccd5101e705a..000000000000 --- a/owl-bot-staging/google-cloud-spanner-v1/lib/google/cloud/spanner/v1/spanner/client.rb +++ /dev/null @@ -1,2622 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/spanner/v1/spanner_pb" - -module Google - module Cloud - module Spanner - module V1 - module Spanner - ## - # Client for the Spanner service. - # - # Cloud Spanner API - # - # The Cloud Spanner API can be used to manage sessions and execute - # transactions on data stored in Cloud Spanner databases. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "spanner.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :spanner_stub - - ## - # Configure the Spanner Client class. - # - # See {::Google::Cloud::Spanner::V1::Spanner::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all Spanner clients - # ::Google::Cloud::Spanner::V1::Spanner::Client.configure do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "Spanner", "V1"] - parent_config = while namespace.any? - parent_name = namespace.join "::" - parent_const = const_get parent_name - break parent_const.configure if parent_const.respond_to? :configure - namespace.pop - end - default_config = Client::Configuration.new parent_config - - default_config.rpcs.create_session.timeout = 30.0 - default_config.rpcs.create_session.retry_policy = { - initial_delay: 0.25, max_delay: 32.0, multiplier: 1.3, retry_codes: [14, 8] - } - - default_config.rpcs.batch_create_sessions.timeout = 60.0 - default_config.rpcs.batch_create_sessions.retry_policy = { - initial_delay: 0.25, max_delay: 32.0, multiplier: 1.3, retry_codes: [14, 8] - } - - default_config.rpcs.get_session.timeout = 30.0 - default_config.rpcs.get_session.retry_policy = { - initial_delay: 0.25, max_delay: 32.0, multiplier: 1.3, retry_codes: [14, 8] - } - - default_config.rpcs.list_sessions.timeout = 3600.0 - default_config.rpcs.list_sessions.retry_policy = { - initial_delay: 0.25, max_delay: 32.0, multiplier: 1.3, retry_codes: [14, 8] - } - - default_config.rpcs.delete_session.timeout = 30.0 - default_config.rpcs.delete_session.retry_policy = { - initial_delay: 0.25, max_delay: 32.0, multiplier: 1.3, retry_codes: [14, 8] - } - - default_config.rpcs.execute_sql.timeout = 30.0 - default_config.rpcs.execute_sql.retry_policy = { - initial_delay: 0.25, max_delay: 32.0, multiplier: 1.3, retry_codes: [14, 8] - } - - default_config.rpcs.execute_streaming_sql.timeout = 3600.0 - - default_config.rpcs.execute_batch_dml.timeout = 30.0 - default_config.rpcs.execute_batch_dml.retry_policy = { - initial_delay: 0.25, max_delay: 32.0, multiplier: 1.3, retry_codes: [14, 8] - } - - default_config.rpcs.read.timeout = 30.0 - default_config.rpcs.read.retry_policy = { - initial_delay: 0.25, max_delay: 32.0, multiplier: 1.3, retry_codes: [14, 8] - } - - default_config.rpcs.streaming_read.timeout = 3600.0 - - default_config.rpcs.begin_transaction.timeout = 30.0 - default_config.rpcs.begin_transaction.retry_policy = { - initial_delay: 0.25, max_delay: 32.0, multiplier: 1.3, retry_codes: [14, 8] - } - - default_config.rpcs.commit.timeout = 3600.0 - default_config.rpcs.commit.retry_policy = { - initial_delay: 0.25, max_delay: 32.0, multiplier: 1.3, retry_codes: [14, 8] - } - - default_config.rpcs.rollback.timeout = 30.0 - default_config.rpcs.rollback.retry_policy = { - initial_delay: 0.25, max_delay: 32.0, multiplier: 1.3, retry_codes: [14, 8] - } - - default_config.rpcs.partition_query.timeout = 30.0 - default_config.rpcs.partition_query.retry_policy = { - initial_delay: 0.25, max_delay: 32.0, multiplier: 1.3, retry_codes: [14, 8] - } - - default_config.rpcs.partition_read.timeout = 30.0 - default_config.rpcs.partition_read.retry_policy = { - initial_delay: 0.25, max_delay: 32.0, multiplier: 1.3, retry_codes: [14, 8] - } - - default_config.rpcs.batch_write.timeout = 3600.0 - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the Spanner Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Cloud::Spanner::V1::Spanner::Client::Configuration} - # for a description of the configuration fields. - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def configure - yield @config if block_given? - @config - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @spanner_stub.universe_domain - end - - ## - # Create a new Spanner client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Spanner::V1::Spanner::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Spanner::V1::Spanner::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Spanner client. - # @yieldparam config [Client::Configuration] - # - def initialize - # These require statements are intentionally placed here to initialize - # the gRPC module only when it's required. - # See https://github.com/googleapis/toolkit/issues/446 - require "gapic/grpc" - require "google/spanner/v1/spanner_services_pb" - - # Create the configuration object - @config = Configuration.new Client.configure - - # Yield the configuration if needed - yield @config if block_given? - - # Create credentials - credentials = @config.credentials - # Use self-signed JWT if the endpoint is unchanged from default, - # but only if the default endpoint does not have a region prefix. - enable_self_signed_jwt = @config.endpoint.nil? || - (@config.endpoint == Configuration::DEFAULT_ENDPOINT && - !@config.endpoint.split(".").first.include?("-")) - credentials ||= Credentials.default scope: @config.scope, - enable_self_signed_jwt: enable_self_signed_jwt - if credentials.is_a?(::String) || credentials.is_a?(::Hash) - credentials = Credentials.new credentials, scope: @config.scope - end - @quota_project_id = @config.quota_project - @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - - @spanner_stub = ::Gapic::ServiceStub.new( - ::Google::Cloud::Spanner::V1::Spanner::Stub, - credentials: credentials, - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - channel_args: @config.channel_args, - interceptors: @config.interceptors, - channel_pool_config: @config.channel_pool, - logger: @config.logger - ) - - @spanner_stub.stub_logger&.info do |entry| - entry.set_system_name - entry.set_service - entry.message = "Created client for #{entry.service}" - entry.set_credentials_fields credentials - entry.set "customEndpoint", @config.endpoint if @config.endpoint - entry.set "defaultTimeout", @config.timeout if @config.timeout - entry.set "quotaProject", @quota_project_id if @quota_project_id - end - end - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @spanner_stub.logger - end - - # Service calls - - ## - # 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 meant to be reused for many consecutive - # transactions. - # - # Sessions can only execute one transaction at a time. To execute - # multiple concurrent read-write/write-only transactions, create - # multiple sessions. Note that standalone reads and queries use a - # transaction internally, and count toward the one transaction - # limit. - # - # Active sessions use additional server resources, so it's a good idea to - # delete idle and unneeded sessions. - # Aside from explicit deletes, Cloud Spanner can delete sessions when no - # operations are sent for more than an hour. If a session is deleted, - # requests to it return `NOT_FOUND`. - # - # Idle sessions can be kept alive by sending a trivial SQL query - # periodically, for example, `"SELECT 1"`. - # - # @overload create_session(request, options = nil) - # Pass arguments to `create_session` via a request object, either of type - # {::Google::Cloud::Spanner::V1::CreateSessionRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Spanner::V1::CreateSessionRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload create_session(database: nil, session: nil) - # Pass arguments to `create_session` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param database [::String] - # Required. The database in which the new session is created. - # @param session [::Google::Cloud::Spanner::V1::Session, ::Hash] - # Required. The session to create. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Spanner::V1::Session] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Spanner::V1::Session] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/spanner/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Spanner::V1::Spanner::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Spanner::V1::CreateSessionRequest.new - # - # # Call the create_session method. - # result = client.create_session request - # - # # The returned object is of type Google::Cloud::Spanner::V1::Session. - # p result - # - def create_session request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::V1::CreateSessionRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.create_session.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Spanner::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.database - header_params["database"] = request.database - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.create_session.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_session.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @spanner_stub.call_rpc :create_session, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Creates multiple new sessions. - # - # This API can be used to initialize a session cache on the clients. - # See https://goo.gl/TgSFN2 for best practices on session cache management. - # - # @overload batch_create_sessions(request, options = nil) - # Pass arguments to `batch_create_sessions` via a request object, either of type - # {::Google::Cloud::Spanner::V1::BatchCreateSessionsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Spanner::V1::BatchCreateSessionsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload batch_create_sessions(database: nil, session_template: nil, session_count: nil) - # Pass arguments to `batch_create_sessions` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param database [::String] - # Required. The database in which the new sessions are created. - # @param session_template [::Google::Cloud::Spanner::V1::Session, ::Hash] - # Parameters to apply to each created session. - # @param session_count [::Integer] - # Required. The number of sessions to be created in this batch call. At least - # one session is created. The API can return fewer than the requested number - # of sessions. If a specific number of sessions are desired, the client can - # make additional calls to `BatchCreateSessions` (adjusting - # {::Google::Cloud::Spanner::V1::BatchCreateSessionsRequest#session_count session_count} - # as necessary). - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Spanner::V1::BatchCreateSessionsResponse] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Spanner::V1::BatchCreateSessionsResponse] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/spanner/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Spanner::V1::Spanner::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Spanner::V1::BatchCreateSessionsRequest.new - # - # # Call the batch_create_sessions method. - # result = client.batch_create_sessions request - # - # # The returned object is of type Google::Cloud::Spanner::V1::BatchCreateSessionsResponse. - # p result - # - def batch_create_sessions request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::V1::BatchCreateSessionsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.batch_create_sessions.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Spanner::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.database - header_params["database"] = request.database - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.batch_create_sessions.timeout, - metadata: metadata, - retry_policy: @config.rpcs.batch_create_sessions.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @spanner_stub.call_rpc :batch_create_sessions, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets a session. Returns `NOT_FOUND` if the session doesn't exist. - # This is mainly useful for determining whether a session is still - # alive. - # - # @overload get_session(request, options = nil) - # Pass arguments to `get_session` via a request object, either of type - # {::Google::Cloud::Spanner::V1::GetSessionRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Spanner::V1::GetSessionRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload get_session(name: nil) - # Pass arguments to `get_session` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The name of the session to retrieve. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Spanner::V1::Session] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Spanner::V1::Session] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/spanner/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Spanner::V1::Spanner::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Spanner::V1::GetSessionRequest.new - # - # # Call the get_session method. - # result = client.get_session request - # - # # The returned object is of type Google::Cloud::Spanner::V1::Session. - # p result - # - def get_session request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::V1::GetSessionRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.get_session.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Spanner::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_session.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_session.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @spanner_stub.call_rpc :get_session, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Lists all sessions in a given database. - # - # @overload list_sessions(request, options = nil) - # Pass arguments to `list_sessions` via a request object, either of type - # {::Google::Cloud::Spanner::V1::ListSessionsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Spanner::V1::ListSessionsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload list_sessions(database: nil, page_size: nil, page_token: nil, filter: nil) - # Pass arguments to `list_sessions` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param database [::String] - # Required. The database in which to list sessions. - # @param page_size [::Integer] - # Number of sessions to be returned in the response. If 0 or less, defaults - # to the server's maximum allowed page size. - # @param page_token [::String] - # If non-empty, `page_token` should contain a - # {::Google::Cloud::Spanner::V1::ListSessionsResponse#next_page_token next_page_token} - # from a previous - # {::Google::Cloud::Spanner::V1::ListSessionsResponse ListSessionsResponse}. - # @param filter [::String] - # An expression for filtering the results of the request. Filter rules are - # case insensitive. The fields eligible for filtering are: - # - # * `labels.key` where key is the name of a label - # - # Some examples of using filters are: - # - # * `labels.env:*` --> The session has the label "env". - # * `labels.env:dev` --> The session has the label "env" and the value of - # the label contains the string "dev". - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Spanner::V1::Session>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::Spanner::V1::Session>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/spanner/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Spanner::V1::Spanner::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Spanner::V1::ListSessionsRequest.new - # - # # Call the list_sessions method. - # result = client.list_sessions request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::Spanner::V1::Session. - # p item - # end - # - def list_sessions request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::V1::ListSessionsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.list_sessions.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Spanner::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.database - header_params["database"] = request.database - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.list_sessions.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_sessions.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @spanner_stub.call_rpc :list_sessions, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @spanner_stub, :list_sessions, request, response, operation, options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Ends a session, releasing server resources associated with it. This - # asynchronously triggers the cancellation of any operations that are running - # with this session. - # - # @overload delete_session(request, options = nil) - # Pass arguments to `delete_session` via a request object, either of type - # {::Google::Cloud::Spanner::V1::DeleteSessionRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Spanner::V1::DeleteSessionRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload delete_session(name: nil) - # Pass arguments to `delete_session` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The name of the session to delete. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Protobuf::Empty] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/spanner/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Spanner::V1::Spanner::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Spanner::V1::DeleteSessionRequest.new - # - # # Call the delete_session method. - # result = client.delete_session request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_session request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::V1::DeleteSessionRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.delete_session.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Spanner::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.delete_session.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_session.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @spanner_stub.call_rpc :delete_session, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Executes an SQL statement, returning all results in a single reply. This - # method can't be used to return a result set larger than 10 MiB; - # if the query yields more data than that, the query fails with - # a `FAILED_PRECONDITION` error. - # - # Operations inside read-write transactions might return `ABORTED`. If - # this occurs, the application should restart the transaction from - # the beginning. See {::Google::Cloud::Spanner::V1::Transaction Transaction} for more - # details. - # - # Larger result sets can be fetched in streaming fashion by calling - # {::Google::Cloud::Spanner::V1::Spanner::Client#execute_streaming_sql ExecuteStreamingSql} - # instead. - # - # The query string can be SQL or [Graph Query Language - # (GQL)](https://cloud.google.com/spanner/docs/reference/standard-sql/graph-intro). - # - # @overload execute_sql(request, options = nil) - # Pass arguments to `execute_sql` via a request object, either of type - # {::Google::Cloud::Spanner::V1::ExecuteSqlRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Spanner::V1::ExecuteSqlRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload execute_sql(session: nil, transaction: nil, sql: nil, params: nil, param_types: nil, resume_token: nil, query_mode: nil, partition_token: nil, seqno: nil, query_options: nil, request_options: nil, directed_read_options: nil, data_boost_enabled: nil, last_statement: nil, routing_hint: nil) - # Pass arguments to `execute_sql` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param session [::String] - # Required. The session in which the SQL query should be performed. - # @param transaction [::Google::Cloud::Spanner::V1::TransactionSelector, ::Hash] - # The transaction to use. - # - # For queries, if none is provided, the default is a temporary read-only - # transaction with strong concurrency. - # - # Standard DML statements require a read-write transaction. To protect - # against replays, single-use transactions are not supported. The caller - # must either supply an existing transaction ID or begin a new transaction. - # - # Partitioned DML requires an existing Partitioned DML transaction ID. - # @param sql [::String] - # Required. The SQL string. - # @param params [::Google::Protobuf::Struct, ::Hash] - # Parameter names and values that bind to placeholders in the SQL string. - # - # A parameter placeholder consists of the `@` character followed by the - # parameter name (for example, `@firstName`). Parameter names must conform - # to the naming requirements of identifiers as specified at - # https://cloud.google.com/spanner/docs/lexical#identifiers. - # - # Parameters can appear anywhere that a literal value is expected. The same - # parameter name can be used more than once, for example: - # - # `"WHERE id > @msg_id AND id < @msg_id + 100"` - # - # It's an error to execute a SQL statement with unbound parameters. - # @param param_types [::Hash{::String => ::Google::Cloud::Spanner::V1::Type, ::Hash}] - # It isn't always possible for Cloud Spanner to infer the right SQL type - # from a JSON value. For example, values of type `BYTES` and values - # of type `STRING` both appear in - # {::Google::Cloud::Spanner::V1::ExecuteSqlRequest#params params} as JSON strings. - # - # In these cases, you can use `param_types` to specify the exact - # SQL type for some or all of the SQL statement parameters. See the - # definition of {::Google::Cloud::Spanner::V1::Type Type} for more information - # about SQL types. - # @param resume_token [::String] - # If this request is resuming a previously interrupted SQL statement - # execution, `resume_token` should be copied from the last - # {::Google::Cloud::Spanner::V1::PartialResultSet PartialResultSet} yielded before the - # interruption. Doing this enables the new SQL statement execution to resume - # where the last one left off. The rest of the request parameters must - # exactly match the request that yielded this token. - # @param query_mode [::Google::Cloud::Spanner::V1::ExecuteSqlRequest::QueryMode] - # Used to control the amount of debugging information returned in - # {::Google::Cloud::Spanner::V1::ResultSetStats ResultSetStats}. If - # {::Google::Cloud::Spanner::V1::ExecuteSqlRequest#partition_token partition_token} is - # set, {::Google::Cloud::Spanner::V1::ExecuteSqlRequest#query_mode query_mode} can only - # be set to - # {::Google::Cloud::Spanner::V1::ExecuteSqlRequest::QueryMode::NORMAL QueryMode.NORMAL}. - # @param partition_token [::String] - # If present, results are restricted to the specified partition - # previously created using `PartitionQuery`. There must be an exact - # match for the values of fields common to this message and the - # `PartitionQueryRequest` message used to create this `partition_token`. - # @param seqno [::Integer] - # A per-transaction sequence number used to identify this request. This field - # makes each request idempotent such that if the request is received multiple - # times, at most one succeeds. - # - # The sequence number must be monotonically increasing within the - # transaction. If a request arrives for the first time with an out-of-order - # sequence number, the transaction can be aborted. Replays of previously - # handled requests yield the same response as the first execution. - # - # Required for DML statements. Ignored for queries. - # @param query_options [::Google::Cloud::Spanner::V1::ExecuteSqlRequest::QueryOptions, ::Hash] - # Query optimizer configuration to use for the given query. - # @param request_options [::Google::Cloud::Spanner::V1::RequestOptions, ::Hash] - # Common options for this request. - # @param directed_read_options [::Google::Cloud::Spanner::V1::DirectedReadOptions, ::Hash] - # Directed read options for this request. - # @param data_boost_enabled [::Boolean] - # If this is for a partitioned query and this field is set to `true`, the - # request is executed with Spanner Data Boost independent compute resources. - # - # If the field is set to `true` but the request doesn't set - # `partition_token`, the API returns an `INVALID_ARGUMENT` error. - # @param last_statement [::Boolean] - # Optional. If set to `true`, this statement marks the end of the - # transaction. After this statement executes, you must commit or abort the - # transaction. Attempts to execute any other requests against this - # transaction (including reads and queries) are rejected. - # - # For DML statements, setting this option might cause some error reporting to - # be deferred until commit time (for example, validation of unique - # constraints). Given this, successful execution of a DML statement shouldn't - # be assumed until a subsequent `Commit` call completes successfully. - # @param routing_hint [::Google::Cloud::Spanner::V1::RoutingHint, ::Hash] - # Optional. If present, it makes the Spanner requests location-aware. - # - # It gives the server hints that can be used to route the request - # to an appropriate server, potentially significantly decreasing latency and - # improving throughput. To achieve improved performance, most fields must be - # filled in with accurate values. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Spanner::V1::ResultSet] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Spanner::V1::ResultSet] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/spanner/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Spanner::V1::Spanner::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Spanner::V1::ExecuteSqlRequest.new - # - # # Call the execute_sql method. - # result = client.execute_sql request - # - # # The returned object is of type Google::Cloud::Spanner::V1::ResultSet. - # p result - # - def execute_sql request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::V1::ExecuteSqlRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.execute_sql.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Spanner::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.session - header_params["session"] = request.session - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.execute_sql.timeout, - metadata: metadata, - retry_policy: @config.rpcs.execute_sql.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @spanner_stub.call_rpc :execute_sql, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Like {::Google::Cloud::Spanner::V1::Spanner::Client#execute_sql ExecuteSql}, except returns the - # result set as a stream. Unlike - # {::Google::Cloud::Spanner::V1::Spanner::Client#execute_sql ExecuteSql}, there is no limit on - # the size of the returned result set. However, no individual row in the - # result set can exceed 100 MiB, and no column value can exceed 10 MiB. - # - # The query string can be SQL or [Graph Query Language - # (GQL)](https://cloud.google.com/spanner/docs/reference/standard-sql/graph-intro). - # - # @overload execute_streaming_sql(request, options = nil) - # Pass arguments to `execute_streaming_sql` via a request object, either of type - # {::Google::Cloud::Spanner::V1::ExecuteSqlRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Spanner::V1::ExecuteSqlRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload execute_streaming_sql(session: nil, transaction: nil, sql: nil, params: nil, param_types: nil, resume_token: nil, query_mode: nil, partition_token: nil, seqno: nil, query_options: nil, request_options: nil, directed_read_options: nil, data_boost_enabled: nil, last_statement: nil, routing_hint: nil) - # Pass arguments to `execute_streaming_sql` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param session [::String] - # Required. The session in which the SQL query should be performed. - # @param transaction [::Google::Cloud::Spanner::V1::TransactionSelector, ::Hash] - # The transaction to use. - # - # For queries, if none is provided, the default is a temporary read-only - # transaction with strong concurrency. - # - # Standard DML statements require a read-write transaction. To protect - # against replays, single-use transactions are not supported. The caller - # must either supply an existing transaction ID or begin a new transaction. - # - # Partitioned DML requires an existing Partitioned DML transaction ID. - # @param sql [::String] - # Required. The SQL string. - # @param params [::Google::Protobuf::Struct, ::Hash] - # Parameter names and values that bind to placeholders in the SQL string. - # - # A parameter placeholder consists of the `@` character followed by the - # parameter name (for example, `@firstName`). Parameter names must conform - # to the naming requirements of identifiers as specified at - # https://cloud.google.com/spanner/docs/lexical#identifiers. - # - # Parameters can appear anywhere that a literal value is expected. The same - # parameter name can be used more than once, for example: - # - # `"WHERE id > @msg_id AND id < @msg_id + 100"` - # - # It's an error to execute a SQL statement with unbound parameters. - # @param param_types [::Hash{::String => ::Google::Cloud::Spanner::V1::Type, ::Hash}] - # It isn't always possible for Cloud Spanner to infer the right SQL type - # from a JSON value. For example, values of type `BYTES` and values - # of type `STRING` both appear in - # {::Google::Cloud::Spanner::V1::ExecuteSqlRequest#params params} as JSON strings. - # - # In these cases, you can use `param_types` to specify the exact - # SQL type for some or all of the SQL statement parameters. See the - # definition of {::Google::Cloud::Spanner::V1::Type Type} for more information - # about SQL types. - # @param resume_token [::String] - # If this request is resuming a previously interrupted SQL statement - # execution, `resume_token` should be copied from the last - # {::Google::Cloud::Spanner::V1::PartialResultSet PartialResultSet} yielded before the - # interruption. Doing this enables the new SQL statement execution to resume - # where the last one left off. The rest of the request parameters must - # exactly match the request that yielded this token. - # @param query_mode [::Google::Cloud::Spanner::V1::ExecuteSqlRequest::QueryMode] - # Used to control the amount of debugging information returned in - # {::Google::Cloud::Spanner::V1::ResultSetStats ResultSetStats}. If - # {::Google::Cloud::Spanner::V1::ExecuteSqlRequest#partition_token partition_token} is - # set, {::Google::Cloud::Spanner::V1::ExecuteSqlRequest#query_mode query_mode} can only - # be set to - # {::Google::Cloud::Spanner::V1::ExecuteSqlRequest::QueryMode::NORMAL QueryMode.NORMAL}. - # @param partition_token [::String] - # If present, results are restricted to the specified partition - # previously created using `PartitionQuery`. There must be an exact - # match for the values of fields common to this message and the - # `PartitionQueryRequest` message used to create this `partition_token`. - # @param seqno [::Integer] - # A per-transaction sequence number used to identify this request. This field - # makes each request idempotent such that if the request is received multiple - # times, at most one succeeds. - # - # The sequence number must be monotonically increasing within the - # transaction. If a request arrives for the first time with an out-of-order - # sequence number, the transaction can be aborted. Replays of previously - # handled requests yield the same response as the first execution. - # - # Required for DML statements. Ignored for queries. - # @param query_options [::Google::Cloud::Spanner::V1::ExecuteSqlRequest::QueryOptions, ::Hash] - # Query optimizer configuration to use for the given query. - # @param request_options [::Google::Cloud::Spanner::V1::RequestOptions, ::Hash] - # Common options for this request. - # @param directed_read_options [::Google::Cloud::Spanner::V1::DirectedReadOptions, ::Hash] - # Directed read options for this request. - # @param data_boost_enabled [::Boolean] - # If this is for a partitioned query and this field is set to `true`, the - # request is executed with Spanner Data Boost independent compute resources. - # - # If the field is set to `true` but the request doesn't set - # `partition_token`, the API returns an `INVALID_ARGUMENT` error. - # @param last_statement [::Boolean] - # Optional. If set to `true`, this statement marks the end of the - # transaction. After this statement executes, you must commit or abort the - # transaction. Attempts to execute any other requests against this - # transaction (including reads and queries) are rejected. - # - # For DML statements, setting this option might cause some error reporting to - # be deferred until commit time (for example, validation of unique - # constraints). Given this, successful execution of a DML statement shouldn't - # be assumed until a subsequent `Commit` call completes successfully. - # @param routing_hint [::Google::Cloud::Spanner::V1::RoutingHint, ::Hash] - # Optional. If present, it makes the Spanner requests location-aware. - # - # It gives the server hints that can be used to route the request - # to an appropriate server, potentially significantly decreasing latency and - # improving throughput. To achieve improved performance, most fields must be - # filled in with accurate values. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Enumerable<::Google::Cloud::Spanner::V1::PartialResultSet>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Enumerable<::Google::Cloud::Spanner::V1::PartialResultSet>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/spanner/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Spanner::V1::Spanner::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Spanner::V1::ExecuteSqlRequest.new - # - # # Call the execute_streaming_sql method to start streaming. - # output = client.execute_streaming_sql request - # - # # The returned object is a streamed enumerable yielding elements of type - # # ::Google::Cloud::Spanner::V1::PartialResultSet - # output.each do |current_response| - # p current_response - # end - # - def execute_streaming_sql request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::V1::ExecuteSqlRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.execute_streaming_sql.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Spanner::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.session - header_params["session"] = request.session - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.execute_streaming_sql.timeout, - metadata: metadata, - retry_policy: @config.rpcs.execute_streaming_sql.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @spanner_stub.call_rpc :execute_streaming_sql, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Executes a batch of SQL DML statements. This method allows many statements - # to be run with lower latency than submitting them sequentially with - # {::Google::Cloud::Spanner::V1::Spanner::Client#execute_sql ExecuteSql}. - # - # Statements are executed in sequential order. A request can succeed even if - # a statement fails. The - # {::Google::Cloud::Spanner::V1::ExecuteBatchDmlResponse#status ExecuteBatchDmlResponse.status} - # field in the response provides information about the statement that failed. - # Clients must inspect this field to determine whether an error occurred. - # - # Execution stops after the first failed statement; the remaining statements - # are not executed. - # - # @overload execute_batch_dml(request, options = nil) - # Pass arguments to `execute_batch_dml` via a request object, either of type - # {::Google::Cloud::Spanner::V1::ExecuteBatchDmlRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Spanner::V1::ExecuteBatchDmlRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload execute_batch_dml(session: nil, transaction: nil, statements: nil, seqno: nil, request_options: nil, last_statements: nil) - # Pass arguments to `execute_batch_dml` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param session [::String] - # Required. The session in which the DML statements should be performed. - # @param transaction [::Google::Cloud::Spanner::V1::TransactionSelector, ::Hash] - # Required. The transaction to use. Must be a read-write transaction. - # - # To protect against replays, single-use transactions are not supported. The - # caller must either supply an existing transaction ID or begin a new - # transaction. - # @param statements [::Array<::Google::Cloud::Spanner::V1::ExecuteBatchDmlRequest::Statement, ::Hash>] - # Required. The list of statements to execute in this batch. Statements are - # executed serially, such that the effects of statement `i` are visible to - # statement `i+1`. Each statement must be a DML statement. Execution stops at - # the first failed statement; the remaining statements are not executed. - # - # Callers must provide at least one statement. - # @param seqno [::Integer] - # Required. A per-transaction sequence number used to identify this request. - # This field makes each request idempotent such that if the request is - # received multiple times, at most one succeeds. - # - # The sequence number must be monotonically increasing within the - # transaction. If a request arrives for the first time with an out-of-order - # sequence number, the transaction might be aborted. Replays of previously - # handled requests yield the same response as the first execution. - # @param request_options [::Google::Cloud::Spanner::V1::RequestOptions, ::Hash] - # Common options for this request. - # @param last_statements [::Boolean] - # Optional. If set to `true`, this request marks the end of the transaction. - # After these statements execute, you must commit or abort the transaction. - # Attempts to execute any other requests against this transaction - # (including reads and queries) are rejected. - # - # Setting this option might cause some error reporting to be deferred until - # commit time (for example, validation of unique constraints). Given this, - # successful execution of statements shouldn't be assumed until a subsequent - # `Commit` call completes successfully. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Spanner::V1::ExecuteBatchDmlResponse] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Spanner::V1::ExecuteBatchDmlResponse] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/spanner/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Spanner::V1::Spanner::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Spanner::V1::ExecuteBatchDmlRequest.new - # - # # Call the execute_batch_dml method. - # result = client.execute_batch_dml request - # - # # The returned object is of type Google::Cloud::Spanner::V1::ExecuteBatchDmlResponse. - # p result - # - def execute_batch_dml request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::V1::ExecuteBatchDmlRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.execute_batch_dml.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Spanner::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.session - header_params["session"] = request.session - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.execute_batch_dml.timeout, - metadata: metadata, - retry_policy: @config.rpcs.execute_batch_dml.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @spanner_stub.call_rpc :execute_batch_dml, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Reads rows from the database using key lookups and scans, as a - # simple key/value style alternative to - # {::Google::Cloud::Spanner::V1::Spanner::Client#execute_sql ExecuteSql}. This method can't be - # used to return a result set larger than 10 MiB; if the read matches more - # data than that, the read fails with a `FAILED_PRECONDITION` - # error. - # - # Reads inside read-write transactions might return `ABORTED`. If - # this occurs, the application should restart the transaction from - # the beginning. See {::Google::Cloud::Spanner::V1::Transaction Transaction} for more - # details. - # - # Larger result sets can be yielded in streaming fashion by calling - # {::Google::Cloud::Spanner::V1::Spanner::Client#streaming_read StreamingRead} instead. - # - # @overload read(request, options = nil) - # Pass arguments to `read` via a request object, either of type - # {::Google::Cloud::Spanner::V1::ReadRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Spanner::V1::ReadRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload read(session: nil, transaction: nil, table: nil, index: nil, columns: nil, key_set: nil, limit: nil, resume_token: nil, partition_token: nil, request_options: nil, directed_read_options: nil, data_boost_enabled: nil, order_by: nil, lock_hint: nil, routing_hint: nil) - # Pass arguments to `read` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param session [::String] - # Required. The session in which the read should be performed. - # @param transaction [::Google::Cloud::Spanner::V1::TransactionSelector, ::Hash] - # The transaction to use. If none is provided, the default is a - # temporary read-only transaction with strong concurrency. - # @param table [::String] - # Required. The name of the table in the database to be read. - # @param index [::String] - # If non-empty, the name of an index on - # {::Google::Cloud::Spanner::V1::ReadRequest#table table}. This index is used instead of - # the table primary key when interpreting - # {::Google::Cloud::Spanner::V1::ReadRequest#key_set key_set} and sorting result rows. - # See {::Google::Cloud::Spanner::V1::ReadRequest#key_set key_set} for further - # information. - # @param columns [::Array<::String>] - # Required. The columns of {::Google::Cloud::Spanner::V1::ReadRequest#table table} to be - # returned for each row matching this request. - # @param key_set [::Google::Cloud::Spanner::V1::KeySet, ::Hash] - # Required. `key_set` identifies the rows to be yielded. `key_set` names the - # primary keys of the rows in {::Google::Cloud::Spanner::V1::ReadRequest#table table} to - # be yielded, unless {::Google::Cloud::Spanner::V1::ReadRequest#index index} is present. - # If {::Google::Cloud::Spanner::V1::ReadRequest#index index} is present, then - # {::Google::Cloud::Spanner::V1::ReadRequest#key_set key_set} instead names index keys - # in {::Google::Cloud::Spanner::V1::ReadRequest#index index}. - # - # If the {::Google::Cloud::Spanner::V1::ReadRequest#partition_token partition_token} - # field is empty, rows are yielded in table primary key order (if - # {::Google::Cloud::Spanner::V1::ReadRequest#index index} is empty) or index key order - # (if {::Google::Cloud::Spanner::V1::ReadRequest#index index} is non-empty). If the - # {::Google::Cloud::Spanner::V1::ReadRequest#partition_token partition_token} field - # isn't empty, rows are yielded in an unspecified order. - # - # It isn't an error for the `key_set` to name rows that don't - # exist in the database. Read yields nothing for nonexistent rows. - # @param limit [::Integer] - # If greater than zero, only the first `limit` rows are yielded. If `limit` - # is zero, the default is no limit. A limit can't be specified if - # `partition_token` is set. - # @param resume_token [::String] - # If this request is resuming a previously interrupted read, - # `resume_token` should be copied from the last - # {::Google::Cloud::Spanner::V1::PartialResultSet PartialResultSet} yielded before the - # interruption. Doing this enables the new read to resume where the last read - # left off. The rest of the request parameters must exactly match the request - # that yielded this token. - # @param partition_token [::String] - # If present, results are restricted to the specified partition - # previously created using `PartitionRead`. There must be an exact - # match for the values of fields common to this message and the - # PartitionReadRequest message used to create this partition_token. - # @param request_options [::Google::Cloud::Spanner::V1::RequestOptions, ::Hash] - # Common options for this request. - # @param directed_read_options [::Google::Cloud::Spanner::V1::DirectedReadOptions, ::Hash] - # Directed read options for this request. - # @param data_boost_enabled [::Boolean] - # If this is for a partitioned read and this field is set to `true`, the - # request is executed with Spanner Data Boost independent compute resources. - # - # If the field is set to `true` but the request doesn't set - # `partition_token`, the API returns an `INVALID_ARGUMENT` error. - # @param order_by [::Google::Cloud::Spanner::V1::ReadRequest::OrderBy] - # Optional. Order for the returned rows. - # - # By default, Spanner returns result rows in primary key order except for - # PartitionRead requests. For applications that don't require rows to be - # returned in primary key (`ORDER_BY_PRIMARY_KEY`) order, setting - # `ORDER_BY_NO_ORDER` option allows Spanner to optimize row retrieval, - # resulting in lower latencies in certain cases (for example, bulk point - # lookups). - # @param lock_hint [::Google::Cloud::Spanner::V1::ReadRequest::LockHint] - # Optional. Lock Hint for the request, it can only be used with read-write - # transactions. - # @param routing_hint [::Google::Cloud::Spanner::V1::RoutingHint, ::Hash] - # Optional. If present, it makes the Spanner requests location-aware. - # - # It gives the server hints that can be used to route the request - # to an appropriate server, potentially significantly decreasing latency and - # improving throughput. To achieve improved performance, most fields must be - # filled in with accurate values. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Spanner::V1::ResultSet] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Spanner::V1::ResultSet] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/spanner/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Spanner::V1::Spanner::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Spanner::V1::ReadRequest.new - # - # # Call the read method. - # result = client.read request - # - # # The returned object is of type Google::Cloud::Spanner::V1::ResultSet. - # p result - # - def read request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::V1::ReadRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.read.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Spanner::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.session - header_params["session"] = request.session - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.read.timeout, - metadata: metadata, - retry_policy: @config.rpcs.read.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @spanner_stub.call_rpc :read, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Like {::Google::Cloud::Spanner::V1::Spanner::Client#read Read}, except returns the result set - # as a stream. Unlike {::Google::Cloud::Spanner::V1::Spanner::Client#read Read}, there is no - # limit on the size of the returned result set. However, no individual row in - # the result set can exceed 100 MiB, and no column value can exceed - # 10 MiB. - # - # @overload streaming_read(request, options = nil) - # Pass arguments to `streaming_read` via a request object, either of type - # {::Google::Cloud::Spanner::V1::ReadRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Spanner::V1::ReadRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload streaming_read(session: nil, transaction: nil, table: nil, index: nil, columns: nil, key_set: nil, limit: nil, resume_token: nil, partition_token: nil, request_options: nil, directed_read_options: nil, data_boost_enabled: nil, order_by: nil, lock_hint: nil, routing_hint: nil) - # Pass arguments to `streaming_read` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param session [::String] - # Required. The session in which the read should be performed. - # @param transaction [::Google::Cloud::Spanner::V1::TransactionSelector, ::Hash] - # The transaction to use. If none is provided, the default is a - # temporary read-only transaction with strong concurrency. - # @param table [::String] - # Required. The name of the table in the database to be read. - # @param index [::String] - # If non-empty, the name of an index on - # {::Google::Cloud::Spanner::V1::ReadRequest#table table}. This index is used instead of - # the table primary key when interpreting - # {::Google::Cloud::Spanner::V1::ReadRequest#key_set key_set} and sorting result rows. - # See {::Google::Cloud::Spanner::V1::ReadRequest#key_set key_set} for further - # information. - # @param columns [::Array<::String>] - # Required. The columns of {::Google::Cloud::Spanner::V1::ReadRequest#table table} to be - # returned for each row matching this request. - # @param key_set [::Google::Cloud::Spanner::V1::KeySet, ::Hash] - # Required. `key_set` identifies the rows to be yielded. `key_set` names the - # primary keys of the rows in {::Google::Cloud::Spanner::V1::ReadRequest#table table} to - # be yielded, unless {::Google::Cloud::Spanner::V1::ReadRequest#index index} is present. - # If {::Google::Cloud::Spanner::V1::ReadRequest#index index} is present, then - # {::Google::Cloud::Spanner::V1::ReadRequest#key_set key_set} instead names index keys - # in {::Google::Cloud::Spanner::V1::ReadRequest#index index}. - # - # If the {::Google::Cloud::Spanner::V1::ReadRequest#partition_token partition_token} - # field is empty, rows are yielded in table primary key order (if - # {::Google::Cloud::Spanner::V1::ReadRequest#index index} is empty) or index key order - # (if {::Google::Cloud::Spanner::V1::ReadRequest#index index} is non-empty). If the - # {::Google::Cloud::Spanner::V1::ReadRequest#partition_token partition_token} field - # isn't empty, rows are yielded in an unspecified order. - # - # It isn't an error for the `key_set` to name rows that don't - # exist in the database. Read yields nothing for nonexistent rows. - # @param limit [::Integer] - # If greater than zero, only the first `limit` rows are yielded. If `limit` - # is zero, the default is no limit. A limit can't be specified if - # `partition_token` is set. - # @param resume_token [::String] - # If this request is resuming a previously interrupted read, - # `resume_token` should be copied from the last - # {::Google::Cloud::Spanner::V1::PartialResultSet PartialResultSet} yielded before the - # interruption. Doing this enables the new read to resume where the last read - # left off. The rest of the request parameters must exactly match the request - # that yielded this token. - # @param partition_token [::String] - # If present, results are restricted to the specified partition - # previously created using `PartitionRead`. There must be an exact - # match for the values of fields common to this message and the - # PartitionReadRequest message used to create this partition_token. - # @param request_options [::Google::Cloud::Spanner::V1::RequestOptions, ::Hash] - # Common options for this request. - # @param directed_read_options [::Google::Cloud::Spanner::V1::DirectedReadOptions, ::Hash] - # Directed read options for this request. - # @param data_boost_enabled [::Boolean] - # If this is for a partitioned read and this field is set to `true`, the - # request is executed with Spanner Data Boost independent compute resources. - # - # If the field is set to `true` but the request doesn't set - # `partition_token`, the API returns an `INVALID_ARGUMENT` error. - # @param order_by [::Google::Cloud::Spanner::V1::ReadRequest::OrderBy] - # Optional. Order for the returned rows. - # - # By default, Spanner returns result rows in primary key order except for - # PartitionRead requests. For applications that don't require rows to be - # returned in primary key (`ORDER_BY_PRIMARY_KEY`) order, setting - # `ORDER_BY_NO_ORDER` option allows Spanner to optimize row retrieval, - # resulting in lower latencies in certain cases (for example, bulk point - # lookups). - # @param lock_hint [::Google::Cloud::Spanner::V1::ReadRequest::LockHint] - # Optional. Lock Hint for the request, it can only be used with read-write - # transactions. - # @param routing_hint [::Google::Cloud::Spanner::V1::RoutingHint, ::Hash] - # Optional. If present, it makes the Spanner requests location-aware. - # - # It gives the server hints that can be used to route the request - # to an appropriate server, potentially significantly decreasing latency and - # improving throughput. To achieve improved performance, most fields must be - # filled in with accurate values. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Enumerable<::Google::Cloud::Spanner::V1::PartialResultSet>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Enumerable<::Google::Cloud::Spanner::V1::PartialResultSet>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/spanner/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Spanner::V1::Spanner::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Spanner::V1::ReadRequest.new - # - # # Call the streaming_read method to start streaming. - # output = client.streaming_read request - # - # # The returned object is a streamed enumerable yielding elements of type - # # ::Google::Cloud::Spanner::V1::PartialResultSet - # output.each do |current_response| - # p current_response - # end - # - def streaming_read request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::V1::ReadRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.streaming_read.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Spanner::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.session - header_params["session"] = request.session - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.streaming_read.timeout, - metadata: metadata, - retry_policy: @config.rpcs.streaming_read.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @spanner_stub.call_rpc :streaming_read, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Begins a new transaction. This step can often be skipped: - # {::Google::Cloud::Spanner::V1::Spanner::Client#read Read}, - # {::Google::Cloud::Spanner::V1::Spanner::Client#execute_sql ExecuteSql} and - # {::Google::Cloud::Spanner::V1::Spanner::Client#commit Commit} can begin a new transaction as a - # side-effect. - # - # @overload begin_transaction(request, options = nil) - # Pass arguments to `begin_transaction` via a request object, either of type - # {::Google::Cloud::Spanner::V1::BeginTransactionRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Spanner::V1::BeginTransactionRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload begin_transaction(session: nil, options: nil, request_options: nil, mutation_key: nil) - # Pass arguments to `begin_transaction` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param session [::String] - # Required. The session in which the transaction runs. - # @param options [::Google::Cloud::Spanner::V1::TransactionOptions, ::Hash] - # Required. Options for the new transaction. - # @param request_options [::Google::Cloud::Spanner::V1::RequestOptions, ::Hash] - # Common options for this request. - # Priority is ignored for this request. Setting the priority in this - # `request_options` struct doesn't do anything. To set the priority for a - # transaction, set it on the reads and writes that are part of this - # transaction instead. - # @param mutation_key [::Google::Cloud::Spanner::V1::Mutation, ::Hash] - # Optional. Required for read-write transactions on a multiplexed session - # that commit mutations but don't perform any reads or queries. You must - # randomly select one of the mutations from the mutation set and send it as a - # part of this request. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Spanner::V1::Transaction] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Spanner::V1::Transaction] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/spanner/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Spanner::V1::Spanner::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Spanner::V1::BeginTransactionRequest.new - # - # # Call the begin_transaction method. - # result = client.begin_transaction request - # - # # The returned object is of type Google::Cloud::Spanner::V1::Transaction. - # p result - # - def begin_transaction request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::V1::BeginTransactionRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.begin_transaction.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Spanner::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.session - header_params["session"] = request.session - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.begin_transaction.timeout, - metadata: metadata, - retry_policy: @config.rpcs.begin_transaction.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @spanner_stub.call_rpc :begin_transaction, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Commits a transaction. The request includes the mutations to be - # applied to rows in the database. - # - # `Commit` might return an `ABORTED` error. This can occur at any time; - # commonly, the cause is conflicts with concurrent - # transactions. However, it can also happen for a variety of other - # reasons. If `Commit` returns `ABORTED`, the caller should retry - # the transaction from the beginning, reusing the same session. - # - # On very rare occasions, `Commit` might return `UNKNOWN`. This can happen, - # for example, if the client job experiences a 1+ hour networking failure. - # At that point, Cloud Spanner has lost track of the transaction outcome and - # we recommend that you perform another read from the database to see the - # state of things as they are now. - # - # @overload commit(request, options = nil) - # Pass arguments to `commit` via a request object, either of type - # {::Google::Cloud::Spanner::V1::CommitRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Spanner::V1::CommitRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload commit(session: nil, transaction_id: nil, single_use_transaction: nil, mutations: nil, return_commit_stats: nil, max_commit_delay: nil, request_options: nil, precommit_token: nil) - # Pass arguments to `commit` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param session [::String] - # Required. The session in which the transaction to be committed is running. - # @param transaction_id [::String] - # Commit a previously-started transaction. - # - # Note: The following parameters are mutually exclusive: `transaction_id`, `single_use_transaction`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one. - # @param single_use_transaction [::Google::Cloud::Spanner::V1::TransactionOptions, ::Hash] - # Execute mutations in a temporary transaction. Note that unlike - # commit of a previously-started transaction, commit with a - # temporary transaction is non-idempotent. That is, if the - # `CommitRequest` is sent to Cloud Spanner more than once (for - # instance, due to retries in the application, or in the - # transport library), it's possible that the mutations are - # executed more than once. If this is undesirable, use - # {::Google::Cloud::Spanner::V1::Spanner::Client#begin_transaction BeginTransaction} and - # {::Google::Cloud::Spanner::V1::Spanner::Client#commit Commit} instead. - # - # Note: The following parameters are mutually exclusive: `single_use_transaction`, `transaction_id`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one. - # @param mutations [::Array<::Google::Cloud::Spanner::V1::Mutation, ::Hash>] - # The mutations to be executed when this transaction commits. All - # mutations are applied atomically, in the order they appear in - # this list. - # @param return_commit_stats [::Boolean] - # If `true`, then statistics related to the transaction is included in - # the {::Google::Cloud::Spanner::V1::CommitResponse#commit_stats CommitResponse}. - # Default value is `false`. - # @param max_commit_delay [::Google::Protobuf::Duration, ::Hash] - # Optional. The amount of latency this request is configured to incur in - # order to improve throughput. If this field isn't set, Spanner assumes - # requests are relatively latency sensitive and automatically determines an - # appropriate delay time. You can specify a commit delay value between 0 and - # 500 ms. - # @param request_options [::Google::Cloud::Spanner::V1::RequestOptions, ::Hash] - # Common options for this request. - # @param precommit_token [::Google::Cloud::Spanner::V1::MultiplexedSessionPrecommitToken, ::Hash] - # Optional. If the read-write transaction was executed on a multiplexed - # session, then you must include the precommit token with the highest - # sequence number received in this transaction attempt. Failing to do so - # results in a `FailedPrecondition` error. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Spanner::V1::CommitResponse] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Spanner::V1::CommitResponse] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/spanner/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Spanner::V1::Spanner::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Spanner::V1::CommitRequest.new - # - # # Call the commit method. - # result = client.commit request - # - # # The returned object is of type Google::Cloud::Spanner::V1::CommitResponse. - # p result - # - def commit request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::V1::CommitRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.commit.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Spanner::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.session - header_params["session"] = request.session - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.commit.timeout, - metadata: metadata, - retry_policy: @config.rpcs.commit.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @spanner_stub.call_rpc :commit, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Rolls back a transaction, releasing any locks it holds. It's a good - # idea to call this for any transaction that includes one or more - # {::Google::Cloud::Spanner::V1::Spanner::Client#read Read} or - # {::Google::Cloud::Spanner::V1::Spanner::Client#execute_sql ExecuteSql} requests and ultimately - # decides not to commit. - # - # `Rollback` returns `OK` if it successfully aborts the transaction, the - # transaction was already aborted, or the transaction isn't - # found. `Rollback` never returns `ABORTED`. - # - # @overload rollback(request, options = nil) - # Pass arguments to `rollback` via a request object, either of type - # {::Google::Cloud::Spanner::V1::RollbackRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Spanner::V1::RollbackRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload rollback(session: nil, transaction_id: nil) - # Pass arguments to `rollback` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param session [::String] - # Required. The session in which the transaction to roll back is running. - # @param transaction_id [::String] - # Required. The transaction to roll back. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Protobuf::Empty] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/spanner/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Spanner::V1::Spanner::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Spanner::V1::RollbackRequest.new - # - # # Call the rollback method. - # result = client.rollback request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def rollback request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::V1::RollbackRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.rollback.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Spanner::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.session - header_params["session"] = request.session - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.rollback.timeout, - metadata: metadata, - retry_policy: @config.rpcs.rollback.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @spanner_stub.call_rpc :rollback, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # 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 - # by {::Google::Cloud::Spanner::V1::Spanner::Client#execute_streaming_sql ExecuteStreamingSql} to - # specify a subset of the query result to read. The same session and - # read-only transaction must be used by the `PartitionQueryRequest` used to - # create the partition tokens and the `ExecuteSqlRequests` that use the - # partition tokens. - # - # Partition tokens become invalid when the session used to create them - # is deleted, is idle for too long, begins a new transaction, or becomes too - # old. When any of these happen, it isn't possible to resume the query, and - # the whole operation must be restarted from the beginning. - # - # @overload partition_query(request, options = nil) - # Pass arguments to `partition_query` via a request object, either of type - # {::Google::Cloud::Spanner::V1::PartitionQueryRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Spanner::V1::PartitionQueryRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload partition_query(session: nil, transaction: nil, sql: nil, params: nil, param_types: nil, partition_options: nil) - # Pass arguments to `partition_query` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param session [::String] - # Required. The session used to create the partitions. - # @param transaction [::Google::Cloud::Spanner::V1::TransactionSelector, ::Hash] - # Read-only snapshot transactions are supported, read and write and - # single-use transactions are not. - # @param sql [::String] - # Required. The query request to generate partitions for. The request fails - # if the query isn't root partitionable. For a query to be root - # partitionable, it needs to satisfy a few conditions. For example, if the - # query execution plan contains a distributed union operator, then it must be - # the first operator in the plan. For more information about other - # conditions, see [Read data in - # parallel](https://cloud.google.com/spanner/docs/reads#read_data_in_parallel). - # - # The query request must not contain DML commands, such as `INSERT`, - # `UPDATE`, or `DELETE`. Use - # {::Google::Cloud::Spanner::V1::Spanner::Client#execute_streaming_sql `ExecuteStreamingSql`} with - # a `PartitionedDml` transaction for large, partition-friendly DML - # operations. - # @param params [::Google::Protobuf::Struct, ::Hash] - # Optional. Parameter names and values that bind to placeholders in the SQL - # string. - # - # A parameter placeholder consists of the `@` character followed by the - # parameter name (for example, `@firstName`). Parameter names can contain - # letters, numbers, and underscores. - # - # Parameters can appear anywhere that a literal value is expected. The same - # parameter name can be used more than once, for example: - # - # `"WHERE id > @msg_id AND id < @msg_id + 100"` - # - # It's an error to execute a SQL statement with unbound parameters. - # @param param_types [::Hash{::String => ::Google::Cloud::Spanner::V1::Type, ::Hash}] - # Optional. It isn't always possible for Cloud Spanner to infer the right SQL - # type from a JSON value. For example, values of type `BYTES` and values of - # type `STRING` both appear in - # {::Google::Cloud::Spanner::V1::PartitionQueryRequest#params params} as JSON strings. - # - # In these cases, `param_types` can be used to specify the exact - # SQL type for some or all of the SQL query parameters. See the - # definition of {::Google::Cloud::Spanner::V1::Type Type} for more information - # about SQL types. - # @param partition_options [::Google::Cloud::Spanner::V1::PartitionOptions, ::Hash] - # Additional options that affect how many partitions are created. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Spanner::V1::PartitionResponse] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Spanner::V1::PartitionResponse] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/spanner/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Spanner::V1::Spanner::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Spanner::V1::PartitionQueryRequest.new - # - # # Call the partition_query method. - # result = client.partition_query request - # - # # The returned object is of type Google::Cloud::Spanner::V1::PartitionResponse. - # p result - # - def partition_query request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::V1::PartitionQueryRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.partition_query.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Spanner::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.session - header_params["session"] = request.session - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.partition_query.timeout, - metadata: metadata, - retry_policy: @config.rpcs.partition_query.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @spanner_stub.call_rpc :partition_query, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # 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 - # by {::Google::Cloud::Spanner::V1::Spanner::Client#streaming_read StreamingRead} to specify a - # subset of the read result to read. The same session and read-only - # transaction must be used by the `PartitionReadRequest` used to create the - # partition tokens and the `ReadRequests` that use the partition tokens. - # There are no ordering guarantees on rows returned among the returned - # partition tokens, or even within each individual `StreamingRead` call - # issued with a `partition_token`. - # - # Partition tokens become invalid when the session used to create them - # is deleted, is idle for too long, begins a new transaction, or becomes too - # old. When any of these happen, it isn't possible to resume the read, and - # the whole operation must be restarted from the beginning. - # - # @overload partition_read(request, options = nil) - # Pass arguments to `partition_read` via a request object, either of type - # {::Google::Cloud::Spanner::V1::PartitionReadRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Spanner::V1::PartitionReadRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload partition_read(session: nil, transaction: nil, table: nil, index: nil, columns: nil, key_set: nil, partition_options: nil) - # Pass arguments to `partition_read` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param session [::String] - # Required. The session used to create the partitions. - # @param transaction [::Google::Cloud::Spanner::V1::TransactionSelector, ::Hash] - # Read only snapshot transactions are supported, read/write and single use - # transactions are not. - # @param table [::String] - # Required. The name of the table in the database to be read. - # @param index [::String] - # If non-empty, the name of an index on - # {::Google::Cloud::Spanner::V1::PartitionReadRequest#table table}. This index is used - # instead of the table primary key when interpreting - # {::Google::Cloud::Spanner::V1::PartitionReadRequest#key_set key_set} and sorting - # result rows. See {::Google::Cloud::Spanner::V1::PartitionReadRequest#key_set key_set} - # for further information. - # @param columns [::Array<::String>] - # The columns of {::Google::Cloud::Spanner::V1::PartitionReadRequest#table table} to be - # returned for each row matching this request. - # @param key_set [::Google::Cloud::Spanner::V1::KeySet, ::Hash] - # Required. `key_set` identifies the rows to be yielded. `key_set` names the - # primary keys of the rows in - # {::Google::Cloud::Spanner::V1::PartitionReadRequest#table table} to be yielded, unless - # {::Google::Cloud::Spanner::V1::PartitionReadRequest#index index} is present. If - # {::Google::Cloud::Spanner::V1::PartitionReadRequest#index index} is present, then - # {::Google::Cloud::Spanner::V1::PartitionReadRequest#key_set key_set} instead names - # index keys in {::Google::Cloud::Spanner::V1::PartitionReadRequest#index index}. - # - # It isn't an error for the `key_set` to name rows that don't - # exist in the database. Read yields nothing for nonexistent rows. - # @param partition_options [::Google::Cloud::Spanner::V1::PartitionOptions, ::Hash] - # Additional options that affect how many partitions are created. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Spanner::V1::PartitionResponse] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Spanner::V1::PartitionResponse] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/spanner/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Spanner::V1::Spanner::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Spanner::V1::PartitionReadRequest.new - # - # # Call the partition_read method. - # result = client.partition_read request - # - # # The returned object is of type Google::Cloud::Spanner::V1::PartitionResponse. - # p result - # - def partition_read request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::V1::PartitionReadRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.partition_read.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Spanner::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.session - header_params["session"] = request.session - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.partition_read.timeout, - metadata: metadata, - retry_policy: @config.rpcs.partition_read.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @spanner_stub.call_rpc :partition_read, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Batches the supplied mutation groups in a collection of efficient - # transactions. All mutations in a group are committed atomically. However, - # mutations across groups can be committed non-atomically in an unspecified - # order and thus, they must be independent of each other. Partial failure is - # possible, that is, some groups might have been committed successfully, - # while some might have failed. The results of individual batches are - # streamed into the response as the batches are applied. - # - # `BatchWrite` requests are not replay protected, meaning that each mutation - # group can be applied more than once. Replays of non-idempotent mutations - # can have undesirable effects. For example, replays of an insert mutation - # can produce an already exists error or if you use generated or commit - # timestamp-based keys, it can result in additional rows being added to the - # mutation's table. We recommend structuring your mutation groups to be - # idempotent to avoid this issue. - # - # @overload batch_write(request, options = nil) - # Pass arguments to `batch_write` via a request object, either of type - # {::Google::Cloud::Spanner::V1::BatchWriteRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Spanner::V1::BatchWriteRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload batch_write(session: nil, request_options: nil, mutation_groups: nil, exclude_txn_from_change_streams: nil) - # Pass arguments to `batch_write` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param session [::String] - # Required. The session in which the batch request is to be run. - # @param request_options [::Google::Cloud::Spanner::V1::RequestOptions, ::Hash] - # Common options for this request. - # @param mutation_groups [::Array<::Google::Cloud::Spanner::V1::BatchWriteRequest::MutationGroup, ::Hash>] - # Required. The groups of mutations to be applied. - # @param exclude_txn_from_change_streams [::Boolean] - # Optional. If you don't set the `exclude_txn_from_change_streams` option or - # if it's set to `false`, then any change streams monitoring columns modified - # by transactions will capture the updates made within that transaction. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Enumerable<::Google::Cloud::Spanner::V1::BatchWriteResponse>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Enumerable<::Google::Cloud::Spanner::V1::BatchWriteResponse>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/spanner/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Spanner::V1::Spanner::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Spanner::V1::BatchWriteRequest.new - # - # # Call the batch_write method to start streaming. - # output = client.batch_write request - # - # # The returned object is a streamed enumerable yielding elements of type - # # ::Google::Cloud::Spanner::V1::BatchWriteResponse - # output.each do |current_response| - # p current_response - # end - # - def batch_write request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::V1::BatchWriteRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.batch_write.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Spanner::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.session - header_params["session"] = request.session - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.batch_write.timeout, - metadata: metadata, - retry_policy: @config.rpcs.batch_write.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @spanner_stub.call_rpc :batch_write, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the Spanner API. - # - # This class represents the configuration for Spanner, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Cloud::Spanner::V1::Spanner::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # create_session to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Spanner::V1::Spanner::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.create_session.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Spanner::V1::Spanner::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.create_session.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`GRPC::Core::Channel`) a gRPC channel with included credentials - # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object - # * (`nil`) indicating no credentials - # - # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials - # is deprecated. Providing an unvalidated credential configuration to - # Google APIs can compromise the security of your systems and data. - # - # @example - # - # # The recommended way to provide credentials is to use the `make_creds` method - # # on the appropriate credentials class for your environment. - # - # require "googleauth" - # - # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( - # json_key_io: ::File.open("/path/to/keyfile.json") - # ) - # - # client = ::Google::Cloud::Spanner::V1::Spanner::Client.new do |config| - # config.credentials = credentials - # end - # - # @note Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] channel_args - # Extra parameters passed to the gRPC channel. Note: this is ignored if a - # `GRPC::Core::Channel` object is provided as the credential. - # @return [::Hash] - # @!attribute [rw] interceptors - # An array of interceptors that are run before calls are executed. - # @return [::Array<::GRPC::ClientInterceptor>] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional gRPC headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "spanner.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) - config_attr :interceptors, nil, ::Array, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - config_attr :logger, :default, ::Logger, nil, :default - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration for the channel pool - # @return [::Gapic::ServiceStub::ChannelPool::Configuration] - # - def channel_pool - @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new - end - - ## - # Configuration RPC class for the Spanner API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `create_session` - # @return [::Gapic::Config::Method] - # - attr_reader :create_session - ## - # RPC-specific configuration for `batch_create_sessions` - # @return [::Gapic::Config::Method] - # - attr_reader :batch_create_sessions - ## - # RPC-specific configuration for `get_session` - # @return [::Gapic::Config::Method] - # - attr_reader :get_session - ## - # RPC-specific configuration for `list_sessions` - # @return [::Gapic::Config::Method] - # - attr_reader :list_sessions - ## - # RPC-specific configuration for `delete_session` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_session - ## - # RPC-specific configuration for `execute_sql` - # @return [::Gapic::Config::Method] - # - attr_reader :execute_sql - ## - # RPC-specific configuration for `execute_streaming_sql` - # @return [::Gapic::Config::Method] - # - attr_reader :execute_streaming_sql - ## - # RPC-specific configuration for `execute_batch_dml` - # @return [::Gapic::Config::Method] - # - attr_reader :execute_batch_dml - ## - # RPC-specific configuration for `read` - # @return [::Gapic::Config::Method] - # - attr_reader :read - ## - # RPC-specific configuration for `streaming_read` - # @return [::Gapic::Config::Method] - # - attr_reader :streaming_read - ## - # RPC-specific configuration for `begin_transaction` - # @return [::Gapic::Config::Method] - # - attr_reader :begin_transaction - ## - # RPC-specific configuration for `commit` - # @return [::Gapic::Config::Method] - # - attr_reader :commit - ## - # RPC-specific configuration for `rollback` - # @return [::Gapic::Config::Method] - # - attr_reader :rollback - ## - # RPC-specific configuration for `partition_query` - # @return [::Gapic::Config::Method] - # - attr_reader :partition_query - ## - # RPC-specific configuration for `partition_read` - # @return [::Gapic::Config::Method] - # - attr_reader :partition_read - ## - # RPC-specific configuration for `batch_write` - # @return [::Gapic::Config::Method] - # - attr_reader :batch_write - - # @private - def initialize parent_rpcs = nil - create_session_config = parent_rpcs.create_session if parent_rpcs.respond_to? :create_session - @create_session = ::Gapic::Config::Method.new create_session_config - batch_create_sessions_config = parent_rpcs.batch_create_sessions if parent_rpcs.respond_to? :batch_create_sessions - @batch_create_sessions = ::Gapic::Config::Method.new batch_create_sessions_config - get_session_config = parent_rpcs.get_session if parent_rpcs.respond_to? :get_session - @get_session = ::Gapic::Config::Method.new get_session_config - list_sessions_config = parent_rpcs.list_sessions if parent_rpcs.respond_to? :list_sessions - @list_sessions = ::Gapic::Config::Method.new list_sessions_config - delete_session_config = parent_rpcs.delete_session if parent_rpcs.respond_to? :delete_session - @delete_session = ::Gapic::Config::Method.new delete_session_config - execute_sql_config = parent_rpcs.execute_sql if parent_rpcs.respond_to? :execute_sql - @execute_sql = ::Gapic::Config::Method.new execute_sql_config - execute_streaming_sql_config = parent_rpcs.execute_streaming_sql if parent_rpcs.respond_to? :execute_streaming_sql - @execute_streaming_sql = ::Gapic::Config::Method.new execute_streaming_sql_config - execute_batch_dml_config = parent_rpcs.execute_batch_dml if parent_rpcs.respond_to? :execute_batch_dml - @execute_batch_dml = ::Gapic::Config::Method.new execute_batch_dml_config - read_config = parent_rpcs.read if parent_rpcs.respond_to? :read - @read = ::Gapic::Config::Method.new read_config - streaming_read_config = parent_rpcs.streaming_read if parent_rpcs.respond_to? :streaming_read - @streaming_read = ::Gapic::Config::Method.new streaming_read_config - begin_transaction_config = parent_rpcs.begin_transaction if parent_rpcs.respond_to? :begin_transaction - @begin_transaction = ::Gapic::Config::Method.new begin_transaction_config - commit_config = parent_rpcs.commit if parent_rpcs.respond_to? :commit - @commit = ::Gapic::Config::Method.new commit_config - rollback_config = parent_rpcs.rollback if parent_rpcs.respond_to? :rollback - @rollback = ::Gapic::Config::Method.new rollback_config - partition_query_config = parent_rpcs.partition_query if parent_rpcs.respond_to? :partition_query - @partition_query = ::Gapic::Config::Method.new partition_query_config - partition_read_config = parent_rpcs.partition_read if parent_rpcs.respond_to? :partition_read - @partition_read = ::Gapic::Config::Method.new partition_read_config - batch_write_config = parent_rpcs.batch_write if parent_rpcs.respond_to? :batch_write - @batch_write = ::Gapic::Config::Method.new batch_write_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-spanner-v1/lib/google/cloud/spanner/v1/spanner/credentials.rb b/owl-bot-staging/google-cloud-spanner-v1/lib/google/cloud/spanner/v1/spanner/credentials.rb deleted file mode 100644 index 1970ece8b929..000000000000 --- a/owl-bot-staging/google-cloud-spanner-v1/lib/google/cloud/spanner/v1/spanner/credentials.rb +++ /dev/null @@ -1,52 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "googleauth" - -module Google - module Cloud - module Spanner - module V1 - module Spanner - # Credentials for the Spanner API. - class Credentials < ::Google::Auth::Credentials - self.scope = [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/spanner.data" - ] - self.env_vars = [ - "SPANNER_CREDENTIALS", - "SPANNER_KEYFILE", - "GOOGLE_CLOUD_CREDENTIALS", - "GOOGLE_CLOUD_KEYFILE", - "GCLOUD_KEYFILE", - "SPANNER_CREDENTIALS_JSON", - "SPANNER_KEYFILE_JSON", - "GOOGLE_CLOUD_CREDENTIALS_JSON", - "GOOGLE_CLOUD_KEYFILE_JSON", - "GCLOUD_KEYFILE_JSON" - ] - self.paths = [ - "~/.config/google_cloud/application_default_credentials.json" - ] - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-spanner-v1/lib/google/cloud/spanner/v1/spanner/paths.rb b/owl-bot-staging/google-cloud-spanner-v1/lib/google/cloud/spanner/v1/spanner/paths.rb deleted file mode 100644 index ef5cfd6c6bab..000000000000 --- a/owl-bot-staging/google-cloud-spanner-v1/lib/google/cloud/spanner/v1/spanner/paths.rb +++ /dev/null @@ -1,73 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module Spanner - module V1 - module Spanner - # Path helper methods for the Spanner API. - module Paths - ## - # Create a fully-qualified Database resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/instances/{instance}/databases/{database}` - # - # @param project [String] - # @param instance [String] - # @param database [String] - # - # @return [::String] - def database_path project:, instance:, database: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "instance cannot contain /" if instance.to_s.include? "/" - - "projects/#{project}/instances/#{instance}/databases/#{database}" - end - - ## - # Create a fully-qualified Session resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/instances/{instance}/databases/{database}/sessions/{session}` - # - # @param project [String] - # @param instance [String] - # @param database [String] - # @param session [String] - # - # @return [::String] - def session_path project:, instance:, database:, session: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "instance cannot contain /" if instance.to_s.include? "/" - raise ::ArgumentError, "database cannot contain /" if database.to_s.include? "/" - - "projects/#{project}/instances/#{instance}/databases/#{database}/sessions/#{session}" - end - - extend self - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-spanner-v1/lib/google/cloud/spanner/v1/version.rb b/owl-bot-staging/google-cloud-spanner-v1/lib/google/cloud/spanner/v1/version.rb deleted file mode 100644 index d42f1a645d00..000000000000 --- a/owl-bot-staging/google-cloud-spanner-v1/lib/google/cloud/spanner/v1/version.rb +++ /dev/null @@ -1,28 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module Spanner - module V1 - VERSION = "0.0.1" - end - end - end -end diff --git a/owl-bot-staging/google-cloud-spanner-v1/lib/google/spanner/v1/change_stream_pb.rb b/owl-bot-staging/google-cloud-spanner-v1/lib/google/spanner/v1/change_stream_pb.rb deleted file mode 100644 index 7aadb137310b..000000000000 --- a/owl-bot-staging/google-cloud-spanner-v1/lib/google/spanner/v1/change_stream_pb.rb +++ /dev/null @@ -1,61 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/spanner/v1/change_stream.proto - -require 'google/protobuf' - -require 'google/protobuf/struct_pb' -require 'google/protobuf/timestamp_pb' -require 'google/spanner/v1/type_pb' - - -descriptor_data = "\n%google/spanner/v1/change_stream.proto\x12\x11google.spanner.v1\x1a\x1cgoogle/protobuf/struct.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x1cgoogle/spanner/v1/type.proto\"\x96\x14\n\x12\x43hangeStreamRecord\x12T\n\x12\x64\x61ta_change_record\x18\x01 \x01(\x0b\x32\x36.google.spanner.v1.ChangeStreamRecord.DataChangeRecordH\x00\x12Q\n\x10heartbeat_record\x18\x02 \x01(\x0b\x32\x35.google.spanner.v1.ChangeStreamRecord.HeartbeatRecordH\x00\x12\\\n\x16partition_start_record\x18\x03 \x01(\x0b\x32:.google.spanner.v1.ChangeStreamRecord.PartitionStartRecordH\x00\x12X\n\x14partition_end_record\x18\x04 \x01(\x0b\x32\x38.google.spanner.v1.ChangeStreamRecord.PartitionEndRecordH\x00\x12\\\n\x16partition_event_record\x18\x05 \x01(\x0b\x32:.google.spanner.v1.ChangeStreamRecord.PartitionEventRecordH\x00\x1a\xd2\n\n\x10\x44\x61taChangeRecord\x12\x34\n\x10\x63ommit_timestamp\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x17\n\x0frecord_sequence\x18\x02 \x01(\t\x12\x1d\n\x15server_transaction_id\x18\x03 \x01(\t\x12\x32\n*is_last_record_in_transaction_in_partition\x18\x04 \x01(\x08\x12\r\n\x05table\x18\x05 \x01(\t\x12^\n\x0f\x63olumn_metadata\x18\x06 \x03(\x0b\x32\x45.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ColumnMetadata\x12H\n\x04mods\x18\x07 \x03(\x0b\x32:.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.Mod\x12P\n\x08mod_type\x18\x08 \x01(\x0e\x32>.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModType\x12\x63\n\x12value_capture_type\x18\t \x01(\x0e\x32G.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ValueCaptureType\x12(\n number_of_records_in_transaction\x18\n \x01(\x05\x12+\n#number_of_partitions_in_transaction\x18\x0b \x01(\x05\x12\x17\n\x0ftransaction_tag\x18\x0c \x01(\t\x12\x1d\n\x15is_system_transaction\x18\r \x01(\x08\x1aw\n\x0e\x43olumnMetadata\x12\x0c\n\x04name\x18\x01 \x01(\t\x12%\n\x04type\x18\x02 \x01(\x0b\x32\x17.google.spanner.v1.Type\x12\x16\n\x0eis_primary_key\x18\x03 \x01(\x08\x12\x18\n\x10ordinal_position\x18\x04 \x01(\x03\x1aP\n\x08ModValue\x12\x1d\n\x15\x63olumn_metadata_index\x18\x01 \x01(\x05\x12%\n\x05value\x18\x02 \x01(\x0b\x32\x16.google.protobuf.Value\x1a\xfe\x01\n\x03Mod\x12M\n\x04keys\x18\x01 \x03(\x0b\x32?.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue\x12S\n\nold_values\x18\x02 \x03(\x0b\x32?.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue\x12S\n\nnew_values\x18\x03 \x03(\x0b\x32?.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue\"G\n\x07ModType\x12\x18\n\x14MOD_TYPE_UNSPECIFIED\x10\x00\x12\n\n\x06INSERT\x10\n\x12\n\n\x06UPDATE\x10\x14\x12\n\n\x06\x44\x45LETE\x10\x1e\"\x87\x01\n\x10ValueCaptureType\x12\"\n\x1eVALUE_CAPTURE_TYPE_UNSPECIFIED\x10\x00\x12\x16\n\x12OLD_AND_NEW_VALUES\x10\n\x12\x0e\n\nNEW_VALUES\x10\x14\x12\x0b\n\x07NEW_ROW\x10\x1e\x12\x1a\n\x16NEW_ROW_AND_OLD_VALUES\x10(\x1a@\n\x0fHeartbeatRecord\x12-\n\ttimestamp\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x1a~\n\x14PartitionStartRecord\x12\x33\n\x0fstart_timestamp\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x17\n\x0frecord_sequence\x18\x02 \x01(\t\x12\x18\n\x10partition_tokens\x18\x03 \x03(\t\x1ay\n\x12PartitionEndRecord\x12\x31\n\rend_timestamp\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x17\n\x0frecord_sequence\x18\x02 \x01(\t\x12\x17\n\x0fpartition_token\x18\x03 \x01(\t\x1a\xa4\x03\n\x14PartitionEventRecord\x12\x34\n\x10\x63ommit_timestamp\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x17\n\x0frecord_sequence\x18\x02 \x01(\t\x12\x17\n\x0fpartition_token\x18\x03 \x01(\t\x12^\n\x0emove_in_events\x18\x04 \x03(\x0b\x32\x46.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveInEvent\x12`\n\x0fmove_out_events\x18\x05 \x03(\x0b\x32G.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveOutEvent\x1a-\n\x0bMoveInEvent\x12\x1e\n\x16source_partition_token\x18\x01 \x01(\t\x1a\x33\n\x0cMoveOutEvent\x12#\n\x1b\x64\x65stination_partition_token\x18\x01 \x01(\tB\x08\n\x06recordB\xb4\x01\n\x15\x63om.google.spanner.v1B\x11\x43hangeStreamProtoP\x01Z5cloud.google.com/go/spanner/apiv1/spannerpb;spannerpb\xaa\x02\x17Google.Cloud.Spanner.V1\xca\x02\x17Google\\Cloud\\Spanner\\V1\xea\x02\x1aGoogle::Cloud::Spanner::V1b\x06proto3" - -pool = Google::Protobuf::DescriptorPool.generated_pool - -begin - pool.add_serialized_file(descriptor_data) -rescue TypeError - # Compatibility code: will be removed in the next major version. - require 'google/protobuf/descriptor_pb' - parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) - parsed.clear_dependency - serialized = parsed.class.encode(parsed) - file = pool.add_serialized_file(serialized) - warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" - imports = [ - ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], - ["google.spanner.v1.Type", "google/spanner/v1/type.proto"], - ["google.protobuf.Value", "google/protobuf/struct.proto"], - ] - imports.each do |type_name, expected_filename| - import_file = pool.lookup(type_name).file_descriptor - if import_file.name != expected_filename - warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" - end - end - warn "Each proto file must use a consistent fully-qualified name." - warn "This will become an error in the next major version." -end - -module Google - module Cloud - module Spanner - module V1 - ChangeStreamRecord = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.ChangeStreamRecord").msgclass - ChangeStreamRecord::DataChangeRecord = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.ChangeStreamRecord.DataChangeRecord").msgclass - ChangeStreamRecord::DataChangeRecord::ColumnMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ColumnMetadata").msgclass - ChangeStreamRecord::DataChangeRecord::ModValue = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue").msgclass - ChangeStreamRecord::DataChangeRecord::Mod = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.ChangeStreamRecord.DataChangeRecord.Mod").msgclass - ChangeStreamRecord::DataChangeRecord::ModType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModType").enummodule - ChangeStreamRecord::DataChangeRecord::ValueCaptureType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ValueCaptureType").enummodule - ChangeStreamRecord::HeartbeatRecord = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.ChangeStreamRecord.HeartbeatRecord").msgclass - ChangeStreamRecord::PartitionStartRecord = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.ChangeStreamRecord.PartitionStartRecord").msgclass - ChangeStreamRecord::PartitionEndRecord = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.ChangeStreamRecord.PartitionEndRecord").msgclass - ChangeStreamRecord::PartitionEventRecord = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.ChangeStreamRecord.PartitionEventRecord").msgclass - ChangeStreamRecord::PartitionEventRecord::MoveInEvent = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveInEvent").msgclass - ChangeStreamRecord::PartitionEventRecord::MoveOutEvent = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveOutEvent").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-spanner-v1/lib/google/spanner/v1/commit_response_pb.rb b/owl-bot-staging/google-cloud-spanner-v1/lib/google/spanner/v1/commit_response_pb.rb deleted file mode 100644 index 42faa7a00e43..000000000000 --- a/owl-bot-staging/google-cloud-spanner-v1/lib/google/spanner/v1/commit_response_pb.rb +++ /dev/null @@ -1,48 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/spanner/v1/commit_response.proto - -require 'google/protobuf' - -require 'google/protobuf/timestamp_pb' -require 'google/spanner/v1/transaction_pb' - - -descriptor_data = "\n\'google/spanner/v1/commit_response.proto\x12\x11google.spanner.v1\x1a\x1fgoogle/protobuf/timestamp.proto\x1a#google/spanner/v1/transaction.proto\"\xd5\x02\n\x0e\x43ommitResponse\x12\x34\n\x10\x63ommit_timestamp\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x43\n\x0c\x63ommit_stats\x18\x02 \x01(\x0b\x32-.google.spanner.v1.CommitResponse.CommitStats\x12N\n\x0fprecommit_token\x18\x04 \x01(\x0b\x32\x33.google.spanner.v1.MultiplexedSessionPrecommitTokenH\x00\x12\x36\n\x12snapshot_timestamp\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x1a%\n\x0b\x43ommitStats\x12\x16\n\x0emutation_count\x18\x01 \x01(\x03\x42\x19\n\x17MultiplexedSessionRetryB\xb6\x01\n\x15\x63om.google.spanner.v1B\x13\x43ommitResponseProtoP\x01Z5cloud.google.com/go/spanner/apiv1/spannerpb;spannerpb\xaa\x02\x17Google.Cloud.Spanner.V1\xca\x02\x17Google\\Cloud\\Spanner\\V1\xea\x02\x1aGoogle::Cloud::Spanner::V1b\x06proto3" - -pool = Google::Protobuf::DescriptorPool.generated_pool - -begin - pool.add_serialized_file(descriptor_data) -rescue TypeError - # Compatibility code: will be removed in the next major version. - require 'google/protobuf/descriptor_pb' - parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) - parsed.clear_dependency - serialized = parsed.class.encode(parsed) - file = pool.add_serialized_file(serialized) - warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" - imports = [ - ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], - ["google.spanner.v1.MultiplexedSessionPrecommitToken", "google/spanner/v1/transaction.proto"], - ] - imports.each do |type_name, expected_filename| - import_file = pool.lookup(type_name).file_descriptor - if import_file.name != expected_filename - warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" - end - end - warn "Each proto file must use a consistent fully-qualified name." - warn "This will become an error in the next major version." -end - -module Google - module Cloud - module Spanner - module V1 - CommitResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.CommitResponse").msgclass - CommitResponse::CommitStats = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.CommitResponse.CommitStats").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-spanner-v1/lib/google/spanner/v1/keys_pb.rb b/owl-bot-staging/google-cloud-spanner-v1/lib/google/spanner/v1/keys_pb.rb deleted file mode 100644 index d7789eca500e..000000000000 --- a/owl-bot-staging/google-cloud-spanner-v1/lib/google/spanner/v1/keys_pb.rb +++ /dev/null @@ -1,46 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/spanner/v1/keys.proto - -require 'google/protobuf' - -require 'google/protobuf/struct_pb' - - -descriptor_data = "\n\x1cgoogle/spanner/v1/keys.proto\x12\x11google.spanner.v1\x1a\x1cgoogle/protobuf/struct.proto\"\xf4\x01\n\x08KeyRange\x12\x32\n\x0cstart_closed\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.ListValueH\x00\x12\x30\n\nstart_open\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.ListValueH\x00\x12\x30\n\nend_closed\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.ListValueH\x01\x12.\n\x08\x65nd_open\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.ListValueH\x01\x42\x10\n\x0estart_key_typeB\x0e\n\x0c\x65nd_key_type\"l\n\x06KeySet\x12(\n\x04keys\x18\x01 \x03(\x0b\x32\x1a.google.protobuf.ListValue\x12+\n\x06ranges\x18\x02 \x03(\x0b\x32\x1b.google.spanner.v1.KeyRange\x12\x0b\n\x03\x61ll\x18\x03 \x01(\x08\x42\xac\x01\n\x15\x63om.google.spanner.v1B\tKeysProtoP\x01Z5cloud.google.com/go/spanner/apiv1/spannerpb;spannerpb\xaa\x02\x17Google.Cloud.Spanner.V1\xca\x02\x17Google\\Cloud\\Spanner\\V1\xea\x02\x1aGoogle::Cloud::Spanner::V1b\x06proto3" - -pool = Google::Protobuf::DescriptorPool.generated_pool - -begin - pool.add_serialized_file(descriptor_data) -rescue TypeError - # Compatibility code: will be removed in the next major version. - require 'google/protobuf/descriptor_pb' - parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) - parsed.clear_dependency - serialized = parsed.class.encode(parsed) - file = pool.add_serialized_file(serialized) - warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" - imports = [ - ["google.protobuf.ListValue", "google/protobuf/struct.proto"], - ] - imports.each do |type_name, expected_filename| - import_file = pool.lookup(type_name).file_descriptor - if import_file.name != expected_filename - warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" - end - end - warn "Each proto file must use a consistent fully-qualified name." - warn "This will become an error in the next major version." -end - -module Google - module Cloud - module Spanner - module V1 - KeyRange = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.KeyRange").msgclass - KeySet = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.KeySet").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-spanner-v1/lib/google/spanner/v1/location_pb.rb b/owl-bot-staging/google-cloud-spanner-v1/lib/google/spanner/v1/location_pb.rb deleted file mode 100644 index 05b9569cbd13..000000000000 --- a/owl-bot-staging/google-cloud-spanner-v1/lib/google/spanner/v1/location_pb.rb +++ /dev/null @@ -1,58 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/spanner/v1/location.proto - -require 'google/protobuf' - -require 'google/protobuf/struct_pb' -require 'google/spanner/v1/type_pb' - - -descriptor_data = "\n google/spanner/v1/location.proto\x12\x11google.spanner.v1\x1a\x1cgoogle/protobuf/struct.proto\x1a\x1cgoogle/spanner/v1/type.proto\"f\n\x05Range\x12\x11\n\tstart_key\x18\x01 \x01(\x0c\x12\x11\n\tlimit_key\x18\x02 \x01(\x0c\x12\x11\n\tgroup_uid\x18\x03 \x01(\x04\x12\x10\n\x08split_id\x18\x04 \x01(\x04\x12\x12\n\ngeneration\x18\x05 \x01(\x0c\"\xe6\x01\n\x06Tablet\x12\x12\n\ntablet_uid\x18\x01 \x01(\x04\x12\x16\n\x0eserver_address\x18\x02 \x01(\t\x12\x10\n\x08location\x18\x03 \x01(\t\x12,\n\x04role\x18\x04 \x01(\x0e\x32\x1e.google.spanner.v1.Tablet.Role\x12\x13\n\x0bincarnation\x18\x05 \x01(\x0c\x12\x10\n\x08\x64istance\x18\x06 \x01(\r\x12\x0c\n\x04skip\x18\x07 \x01(\x08\";\n\x04Role\x12\x14\n\x10ROLE_UNSPECIFIED\x10\x00\x12\x0e\n\nREAD_WRITE\x10\x01\x12\r\n\tREAD_ONLY\x10\x02\"p\n\x05Group\x12\x11\n\tgroup_uid\x18\x01 \x01(\x04\x12*\n\x07tablets\x18\x02 \x03(\x0b\x32\x19.google.spanner.v1.Tablet\x12\x14\n\x0cleader_index\x18\x03 \x01(\x05\x12\x12\n\ngeneration\x18\x04 \x01(\x0c\"\xd3\x04\n\tKeyRecipe\x12\x14\n\ntable_name\x18\x01 \x01(\tH\x00\x12\x14\n\nindex_name\x18\x02 \x01(\tH\x00\x12\x17\n\roperation_uid\x18\x03 \x01(\x04H\x00\x12/\n\x04part\x18\x04 \x03(\x0b\x32!.google.spanner.v1.KeyRecipe.Part\x1a\xc5\x03\n\x04Part\x12\x0b\n\x03tag\x18\x01 \x01(\r\x12\x36\n\x05order\x18\x02 \x01(\x0e\x32\'.google.spanner.v1.KeyRecipe.Part.Order\x12?\n\nnull_order\x18\x03 \x01(\x0e\x32+.google.spanner.v1.KeyRecipe.Part.NullOrder\x12%\n\x04type\x18\x04 \x01(\x0b\x32\x17.google.spanner.v1.Type\x12\x14\n\nidentifier\x18\x05 \x01(\tH\x00\x12\'\n\x05value\x18\x06 \x01(\x0b\x32\x16.google.protobuf.ValueH\x00\x12\x10\n\x06random\x18\x08 \x01(\x08H\x00\x12\x1a\n\x12struct_identifiers\x18\x07 \x03(\x05\"=\n\x05Order\x12\x15\n\x11ORDER_UNSPECIFIED\x10\x00\x12\r\n\tASCENDING\x10\x01\x12\x0e\n\nDESCENDING\x10\x02\"V\n\tNullOrder\x12\x1a\n\x16NULL_ORDER_UNSPECIFIED\x10\x00\x12\x0f\n\x0bNULLS_FIRST\x10\x01\x12\x0e\n\nNULLS_LAST\x10\x02\x12\x0c\n\x08NOT_NULL\x10\x03\x42\x0c\n\nvalue_typeB\x08\n\x06target\"U\n\nRecipeList\x12\x19\n\x11schema_generation\x18\x01 \x01(\x0c\x12,\n\x06recipe\x18\x03 \x03(\x0b\x32\x1c.google.spanner.v1.KeyRecipe\"\xa8\x01\n\x0b\x43\x61\x63heUpdate\x12\x13\n\x0b\x64\x61tabase_id\x18\x01 \x01(\x04\x12\'\n\x05range\x18\x02 \x03(\x0b\x32\x18.google.spanner.v1.Range\x12\'\n\x05group\x18\x03 \x03(\x0b\x32\x18.google.spanner.v1.Group\x12\x32\n\x0bkey_recipes\x18\x05 \x01(\x0b\x32\x1d.google.spanner.v1.RecipeList\"\xca\x02\n\x0bRoutingHint\x12\x15\n\roperation_uid\x18\x01 \x01(\x04\x12\x13\n\x0b\x64\x61tabase_id\x18\x02 \x01(\x04\x12\x19\n\x11schema_generation\x18\x03 \x01(\x0c\x12\x0b\n\x03key\x18\x04 \x01(\x0c\x12\x11\n\tlimit_key\x18\x05 \x01(\x0c\x12\x11\n\tgroup_uid\x18\x06 \x01(\x04\x12\x10\n\x08split_id\x18\x07 \x01(\x04\x12\x12\n\ntablet_uid\x18\x08 \x01(\x04\x12H\n\x12skipped_tablet_uid\x18\t \x03(\x0b\x32,.google.spanner.v1.RoutingHint.SkippedTablet\x12\x17\n\x0f\x63lient_location\x18\n \x01(\t\x1a\x38\n\rSkippedTablet\x12\x12\n\ntablet_uid\x18\x01 \x01(\x04\x12\x13\n\x0bincarnation\x18\x02 \x01(\x0c\x42\xb0\x01\n\x15\x63om.google.spanner.v1B\rLocationProtoP\x01Z5cloud.google.com/go/spanner/apiv1/spannerpb;spannerpb\xaa\x02\x17Google.Cloud.Spanner.V1\xca\x02\x17Google\\Cloud\\Spanner\\V1\xea\x02\x1aGoogle::Cloud::Spanner::V1b\x06proto3" - -pool = Google::Protobuf::DescriptorPool.generated_pool - -begin - pool.add_serialized_file(descriptor_data) -rescue TypeError - # Compatibility code: will be removed in the next major version. - require 'google/protobuf/descriptor_pb' - parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) - parsed.clear_dependency - serialized = parsed.class.encode(parsed) - file = pool.add_serialized_file(serialized) - warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" - imports = [ - ["google.spanner.v1.Type", "google/spanner/v1/type.proto"], - ["google.protobuf.Value", "google/protobuf/struct.proto"], - ] - imports.each do |type_name, expected_filename| - import_file = pool.lookup(type_name).file_descriptor - if import_file.name != expected_filename - warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" - end - end - warn "Each proto file must use a consistent fully-qualified name." - warn "This will become an error in the next major version." -end - -module Google - module Cloud - module Spanner - module V1 - Range = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.Range").msgclass - Tablet = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.Tablet").msgclass - Tablet::Role = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.Tablet.Role").enummodule - Group = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.Group").msgclass - KeyRecipe = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.KeyRecipe").msgclass - KeyRecipe::Part = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.KeyRecipe.Part").msgclass - KeyRecipe::Part::Order = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.KeyRecipe.Part.Order").enummodule - KeyRecipe::Part::NullOrder = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.KeyRecipe.Part.NullOrder").enummodule - RecipeList = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.RecipeList").msgclass - CacheUpdate = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.CacheUpdate").msgclass - RoutingHint = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.RoutingHint").msgclass - RoutingHint::SkippedTablet = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.RoutingHint.SkippedTablet").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-spanner-v1/lib/google/spanner/v1/mutation_pb.rb b/owl-bot-staging/google-cloud-spanner-v1/lib/google/spanner/v1/mutation_pb.rb deleted file mode 100644 index 49b325292161..000000000000 --- a/owl-bot-staging/google-cloud-spanner-v1/lib/google/spanner/v1/mutation_pb.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/spanner/v1/mutation.proto - -require 'google/protobuf' - -require 'google/api/field_behavior_pb' -require 'google/protobuf/struct_pb' -require 'google/protobuf/timestamp_pb' -require 'google/spanner/v1/keys_pb' - - -descriptor_data = "\n google/spanner/v1/mutation.proto\x12\x11google.spanner.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x1cgoogle/protobuf/struct.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x1cgoogle/spanner/v1/keys.proto\"\xc0\x06\n\x08Mutation\x12\x33\n\x06insert\x18\x01 \x01(\x0b\x32!.google.spanner.v1.Mutation.WriteH\x00\x12\x33\n\x06update\x18\x02 \x01(\x0b\x32!.google.spanner.v1.Mutation.WriteH\x00\x12=\n\x10insert_or_update\x18\x03 \x01(\x0b\x32!.google.spanner.v1.Mutation.WriteH\x00\x12\x34\n\x07replace\x18\x04 \x01(\x0b\x32!.google.spanner.v1.Mutation.WriteH\x00\x12\x34\n\x06\x64\x65lete\x18\x05 \x01(\x0b\x32\".google.spanner.v1.Mutation.DeleteH\x00\x12\x30\n\x04send\x18\x06 \x01(\x0b\x32 .google.spanner.v1.Mutation.SendH\x00\x12.\n\x03\x61\x63k\x18\x07 \x01(\x0b\x32\x1f.google.spanner.v1.Mutation.AckH\x00\x1aX\n\x05Write\x12\x12\n\x05table\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x0f\n\x07\x63olumns\x18\x02 \x03(\t\x12*\n\x06values\x18\x03 \x03(\x0b\x32\x1a.google.protobuf.ListValue\x1aM\n\x06\x44\x65lete\x12\x12\n\x05table\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12/\n\x07key_set\x18\x02 \x01(\x0b\x32\x19.google.spanner.v1.KeySetB\x03\xe0\x41\x02\x1a\xa3\x01\n\x04Send\x12\x12\n\x05queue\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12,\n\x03key\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.ListValueB\x03\xe0\x41\x02\x12\x30\n\x0c\x64\x65liver_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\'\n\x07payload\x18\x04 \x01(\x0b\x32\x16.google.protobuf.Value\x1a\x61\n\x03\x41\x63k\x12\x12\n\x05queue\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12,\n\x03key\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.ListValueB\x03\xe0\x41\x02\x12\x18\n\x10ignore_not_found\x18\x03 \x01(\x08\x42\x0b\n\toperationB\xb0\x01\n\x15\x63om.google.spanner.v1B\rMutationProtoP\x01Z5cloud.google.com/go/spanner/apiv1/spannerpb;spannerpb\xaa\x02\x17Google.Cloud.Spanner.V1\xca\x02\x17Google\\Cloud\\Spanner\\V1\xea\x02\x1aGoogle::Cloud::Spanner::V1b\x06proto3" - -pool = Google::Protobuf::DescriptorPool.generated_pool - -begin - pool.add_serialized_file(descriptor_data) -rescue TypeError - # Compatibility code: will be removed in the next major version. - require 'google/protobuf/descriptor_pb' - parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) - parsed.clear_dependency - serialized = parsed.class.encode(parsed) - file = pool.add_serialized_file(serialized) - warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" - imports = [ - ["google.protobuf.ListValue", "google/protobuf/struct.proto"], - ["google.spanner.v1.KeySet", "google/spanner/v1/keys.proto"], - ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], - ] - imports.each do |type_name, expected_filename| - import_file = pool.lookup(type_name).file_descriptor - if import_file.name != expected_filename - warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" - end - end - warn "Each proto file must use a consistent fully-qualified name." - warn "This will become an error in the next major version." -end - -module Google - module Cloud - module Spanner - module V1 - Mutation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.Mutation").msgclass - Mutation::Write = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.Mutation.Write").msgclass - Mutation::Delete = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.Mutation.Delete").msgclass - Mutation::Send = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.Mutation.Send").msgclass - Mutation::Ack = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.Mutation.Ack").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-spanner-v1/lib/google/spanner/v1/query_plan_pb.rb b/owl-bot-staging/google-cloud-spanner-v1/lib/google/spanner/v1/query_plan_pb.rb deleted file mode 100644 index f7da0f94ab59..000000000000 --- a/owl-bot-staging/google-cloud-spanner-v1/lib/google/spanner/v1/query_plan_pb.rb +++ /dev/null @@ -1,52 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/spanner/v1/query_plan.proto - -require 'google/protobuf' - -require 'google/api/field_behavior_pb' -require 'google/protobuf/struct_pb' - - -descriptor_data = "\n\"google/spanner/v1/query_plan.proto\x12\x11google.spanner.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x1cgoogle/protobuf/struct.proto\"\xf8\x04\n\x08PlanNode\x12\r\n\x05index\x18\x01 \x01(\x05\x12.\n\x04kind\x18\x02 \x01(\x0e\x32 .google.spanner.v1.PlanNode.Kind\x12\x14\n\x0c\x64isplay_name\x18\x03 \x01(\t\x12:\n\x0b\x63hild_links\x18\x04 \x03(\x0b\x32%.google.spanner.v1.PlanNode.ChildLink\x12M\n\x14short_representation\x18\x05 \x01(\x0b\x32/.google.spanner.v1.PlanNode.ShortRepresentation\x12)\n\x08metadata\x18\x06 \x01(\x0b\x32\x17.google.protobuf.Struct\x12\x30\n\x0f\x65xecution_stats\x18\x07 \x01(\x0b\x32\x17.google.protobuf.Struct\x1a@\n\tChildLink\x12\x13\n\x0b\x63hild_index\x18\x01 \x01(\x05\x12\x0c\n\x04type\x18\x02 \x01(\t\x12\x10\n\x08variable\x18\x03 \x01(\t\x1a\xb2\x01\n\x13ShortRepresentation\x12\x13\n\x0b\x64\x65scription\x18\x01 \x01(\t\x12S\n\nsubqueries\x18\x02 \x03(\x0b\x32?.google.spanner.v1.PlanNode.ShortRepresentation.SubqueriesEntry\x1a\x31\n\x0fSubqueriesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\x05:\x02\x38\x01\"8\n\x04Kind\x12\x14\n\x10KIND_UNSPECIFIED\x10\x00\x12\x0e\n\nRELATIONAL\x10\x01\x12\n\n\x06SCALAR\x10\x02\"\xa4\x01\n\x12QueryAdvisorResult\x12L\n\x0cindex_advice\x18\x01 \x03(\x0b\x32\x31.google.spanner.v1.QueryAdvisorResult.IndexAdviceB\x03\xe0\x41\x01\x1a@\n\x0bIndexAdvice\x12\x10\n\x03\x64\x64l\x18\x01 \x03(\tB\x03\xe0\x41\x01\x12\x1f\n\x12improvement_factor\x18\x02 \x01(\x01\x42\x03\xe0\x41\x01\"~\n\tQueryPlan\x12/\n\nplan_nodes\x18\x01 \x03(\x0b\x32\x1b.google.spanner.v1.PlanNode\x12@\n\x0cquery_advice\x18\x02 \x01(\x0b\x32%.google.spanner.v1.QueryAdvisorResultB\x03\xe0\x41\x01\x42\xb1\x01\n\x15\x63om.google.spanner.v1B\x0eQueryPlanProtoP\x01Z5cloud.google.com/go/spanner/apiv1/spannerpb;spannerpb\xaa\x02\x17Google.Cloud.Spanner.V1\xca\x02\x17Google\\Cloud\\Spanner\\V1\xea\x02\x1aGoogle::Cloud::Spanner::V1b\x06proto3" - -pool = Google::Protobuf::DescriptorPool.generated_pool - -begin - pool.add_serialized_file(descriptor_data) -rescue TypeError - # Compatibility code: will be removed in the next major version. - require 'google/protobuf/descriptor_pb' - parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) - parsed.clear_dependency - serialized = parsed.class.encode(parsed) - file = pool.add_serialized_file(serialized) - warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" - imports = [ - ["google.protobuf.Struct", "google/protobuf/struct.proto"], - ] - imports.each do |type_name, expected_filename| - import_file = pool.lookup(type_name).file_descriptor - if import_file.name != expected_filename - warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" - end - end - warn "Each proto file must use a consistent fully-qualified name." - warn "This will become an error in the next major version." -end - -module Google - module Cloud - module Spanner - module V1 - PlanNode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.PlanNode").msgclass - PlanNode::ChildLink = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.PlanNode.ChildLink").msgclass - PlanNode::ShortRepresentation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.PlanNode.ShortRepresentation").msgclass - PlanNode::Kind = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.PlanNode.Kind").enummodule - QueryAdvisorResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.QueryAdvisorResult").msgclass - QueryAdvisorResult::IndexAdvice = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.QueryAdvisorResult.IndexAdvice").msgclass - QueryPlan = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.QueryPlan").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-spanner-v1/lib/google/spanner/v1/result_set_pb.rb b/owl-bot-staging/google-cloud-spanner-v1/lib/google/spanner/v1/result_set_pb.rb deleted file mode 100644 index dbd8ff5a6221..000000000000 --- a/owl-bot-staging/google-cloud-spanner-v1/lib/google/spanner/v1/result_set_pb.rb +++ /dev/null @@ -1,57 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/spanner/v1/result_set.proto - -require 'google/protobuf' - -require 'google/api/field_behavior_pb' -require 'google/protobuf/struct_pb' -require 'google/spanner/v1/location_pb' -require 'google/spanner/v1/query_plan_pb' -require 'google/spanner/v1/transaction_pb' -require 'google/spanner/v1/type_pb' - - -descriptor_data = "\n\"google/spanner/v1/result_set.proto\x12\x11google.spanner.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x1cgoogle/protobuf/struct.proto\x1a google/spanner/v1/location.proto\x1a\"google/spanner/v1/query_plan.proto\x1a#google/spanner/v1/transaction.proto\x1a\x1cgoogle/spanner/v1/type.proto\"\xad\x02\n\tResultSet\x12\x36\n\x08metadata\x18\x01 \x01(\x0b\x32$.google.spanner.v1.ResultSetMetadata\x12(\n\x04rows\x18\x02 \x03(\x0b\x32\x1a.google.protobuf.ListValue\x12\x30\n\x05stats\x18\x03 \x01(\x0b\x32!.google.spanner.v1.ResultSetStats\x12Q\n\x0fprecommit_token\x18\x05 \x01(\x0b\x32\x33.google.spanner.v1.MultiplexedSessionPrecommitTokenB\x03\xe0\x41\x01\x12\x39\n\x0c\x63\x61\x63he_update\x18\x06 \x01(\x0b\x32\x1e.google.spanner.v1.CacheUpdateB\x03\xe0\x41\x01\"\xf2\x02\n\x10PartialResultSet\x12\x36\n\x08metadata\x18\x01 \x01(\x0b\x32$.google.spanner.v1.ResultSetMetadata\x12&\n\x06values\x18\x02 \x03(\x0b\x32\x16.google.protobuf.Value\x12\x15\n\rchunked_value\x18\x03 \x01(\x08\x12\x14\n\x0cresume_token\x18\x04 \x01(\x0c\x12\x30\n\x05stats\x18\x05 \x01(\x0b\x32!.google.spanner.v1.ResultSetStats\x12Q\n\x0fprecommit_token\x18\x08 \x01(\x0b\x32\x33.google.spanner.v1.MultiplexedSessionPrecommitTokenB\x03\xe0\x41\x01\x12\x11\n\x04last\x18\t \x01(\x08\x42\x03\xe0\x41\x01\x12\x39\n\x0c\x63\x61\x63he_update\x18\n \x01(\x0b\x32\x1e.google.spanner.v1.CacheUpdateB\x03\xe0\x41\x01\"\xb7\x01\n\x11ResultSetMetadata\x12/\n\x08row_type\x18\x01 \x01(\x0b\x32\x1d.google.spanner.v1.StructType\x12\x33\n\x0btransaction\x18\x02 \x01(\x0b\x32\x1e.google.spanner.v1.Transaction\x12<\n\x15undeclared_parameters\x18\x03 \x01(\x0b\x32\x1d.google.spanner.v1.StructType\"\xb9\x01\n\x0eResultSetStats\x12\x30\n\nquery_plan\x18\x01 \x01(\x0b\x32\x1c.google.spanner.v1.QueryPlan\x12,\n\x0bquery_stats\x18\x02 \x01(\x0b\x32\x17.google.protobuf.Struct\x12\x19\n\x0frow_count_exact\x18\x03 \x01(\x03H\x00\x12\x1f\n\x15row_count_lower_bound\x18\x04 \x01(\x03H\x00\x42\x0b\n\trow_countB\xb1\x01\n\x15\x63om.google.spanner.v1B\x0eResultSetProtoP\x01Z5cloud.google.com/go/spanner/apiv1/spannerpb;spannerpb\xaa\x02\x17Google.Cloud.Spanner.V1\xca\x02\x17Google\\Cloud\\Spanner\\V1\xea\x02\x1aGoogle::Cloud::Spanner::V1b\x06proto3" - -pool = Google::Protobuf::DescriptorPool.generated_pool - -begin - pool.add_serialized_file(descriptor_data) -rescue TypeError - # Compatibility code: will be removed in the next major version. - require 'google/protobuf/descriptor_pb' - parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) - parsed.clear_dependency - serialized = parsed.class.encode(parsed) - file = pool.add_serialized_file(serialized) - warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" - imports = [ - ["google.protobuf.ListValue", "google/protobuf/struct.proto"], - ["google.spanner.v1.MultiplexedSessionPrecommitToken", "google/spanner/v1/transaction.proto"], - ["google.spanner.v1.CacheUpdate", "google/spanner/v1/location.proto"], - ["google.spanner.v1.StructType", "google/spanner/v1/type.proto"], - ["google.spanner.v1.QueryPlan", "google/spanner/v1/query_plan.proto"], - ] - imports.each do |type_name, expected_filename| - import_file = pool.lookup(type_name).file_descriptor - if import_file.name != expected_filename - warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" - end - end - warn "Each proto file must use a consistent fully-qualified name." - warn "This will become an error in the next major version." -end - -module Google - module Cloud - module Spanner - module V1 - ResultSet = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.ResultSet").msgclass - PartialResultSet = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.PartialResultSet").msgclass - ResultSetMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.ResultSetMetadata").msgclass - ResultSetStats = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.ResultSetStats").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-spanner-v1/lib/google/spanner/v1/spanner_pb.rb b/owl-bot-staging/google-cloud-spanner-v1/lib/google/spanner/v1/spanner_pb.rb deleted file mode 100644 index 106d38e306e9..000000000000 --- a/owl-bot-staging/google-cloud-spanner-v1/lib/google/spanner/v1/spanner_pb.rb +++ /dev/null @@ -1,104 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/spanner/v1/spanner.proto - -require 'google/protobuf' - -require 'google/spanner/v1/commit_response_pb' -require 'google/api/annotations_pb' -require 'google/api/client_pb' -require 'google/api/field_behavior_pb' -require 'google/api/resource_pb' -require 'google/protobuf/duration_pb' -require 'google/protobuf/empty_pb' -require 'google/protobuf/struct_pb' -require 'google/protobuf/timestamp_pb' -require 'google/rpc/status_pb' -require 'google/spanner/v1/keys_pb' -require 'google/spanner/v1/location_pb' -require 'google/spanner/v1/mutation_pb' -require 'google/spanner/v1/result_set_pb' -require 'google/spanner/v1/transaction_pb' -require 'google/spanner/v1/type_pb' - - -descriptor_data = "\n\x1fgoogle/spanner/v1/spanner.proto\x12\x11google.spanner.v1\x1a\'google/spanner/v1/commit_response.proto\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a\x1cgoogle/protobuf/struct.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x17google/rpc/status.proto\x1a\x1cgoogle/spanner/v1/keys.proto\x1a google/spanner/v1/location.proto\x1a google/spanner/v1/mutation.proto\x1a\"google/spanner/v1/result_set.proto\x1a#google/spanner/v1/transaction.proto\x1a\x1cgoogle/spanner/v1/type.proto\"\x83\x01\n\x14\x43reateSessionRequest\x12\x39\n\x08\x64\x61tabase\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1fspanner.googleapis.com/Database\x12\x30\n\x07session\x18\x02 \x01(\x0b\x32\x1a.google.spanner.v1.SessionB\x03\xe0\x41\x02\"\xa9\x01\n\x1a\x42\x61tchCreateSessionsRequest\x12\x39\n\x08\x64\x61tabase\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1fspanner.googleapis.com/Database\x12\x34\n\x10session_template\x18\x02 \x01(\x0b\x32\x1a.google.spanner.v1.Session\x12\x1a\n\rsession_count\x18\x03 \x01(\x05\x42\x03\xe0\x41\x02\"J\n\x1b\x42\x61tchCreateSessionsResponse\x12+\n\x07session\x18\x01 \x03(\x0b\x32\x1a.google.spanner.v1.Session\"\xb8\x03\n\x07Session\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x36\n\x06labels\x18\x02 \x03(\x0b\x32&.google.spanner.v1.Session.LabelsEntry\x12\x34\n\x0b\x63reate_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x42\n\x19\x61pproximate_last_use_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x14\n\x0c\x63reator_role\x18\x05 \x01(\t\x12\x18\n\x0bmultiplexed\x18\x06 \x01(\x08\x42\x03\xe0\x41\x01\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01:\x88\x01\xea\x41\x84\x01\n\x1espanner.googleapis.com/Session\x12Oprojects/{project}/instances/{instance}/databases/{database}/sessions/{session}*\x08sessions2\x07session\"I\n\x11GetSessionRequest\x12\x34\n\x04name\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1espanner.googleapis.com/Session\"\x87\x01\n\x13ListSessionsRequest\x12\x39\n\x08\x64\x61tabase\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1fspanner.googleapis.com/Database\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\x12\x0e\n\x06\x66ilter\x18\x04 \x01(\t\"]\n\x14ListSessionsResponse\x12,\n\x08sessions\x18\x01 \x03(\x0b\x32\x1a.google.spanner.v1.Session\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"L\n\x14\x44\x65leteSessionRequest\x12\x34\n\x04name\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1espanner.googleapis.com/Session\"\xeb\x03\n\x0eRequestOptions\x12<\n\x08priority\x18\x01 \x01(\x0e\x32*.google.spanner.v1.RequestOptions.Priority\x12\x13\n\x0brequest_tag\x18\x02 \x01(\t\x12\x17\n\x0ftransaction_tag\x18\x03 \x01(\t\x12L\n\x0e\x63lient_context\x18\x04 \x01(\x0b\x32/.google.spanner.v1.RequestOptions.ClientContextB\x03\xe0\x41\x01\x1a\xbe\x01\n\rClientContext\x12_\n\x0esecure_context\x18\x01 \x03(\x0b\x32\x42.google.spanner.v1.RequestOptions.ClientContext.SecureContextEntryB\x03\xe0\x41\x01\x1aL\n\x12SecureContextEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12%\n\x05value\x18\x02 \x01(\x0b\x32\x16.google.protobuf.Value:\x02\x38\x01\"^\n\x08Priority\x12\x18\n\x14PRIORITY_UNSPECIFIED\x10\x00\x12\x10\n\x0cPRIORITY_LOW\x10\x01\x12\x13\n\x0fPRIORITY_MEDIUM\x10\x02\x12\x11\n\rPRIORITY_HIGH\x10\x03\"\xea\x04\n\x13\x44irectedReadOptions\x12R\n\x10include_replicas\x18\x01 \x01(\x0b\x32\x36.google.spanner.v1.DirectedReadOptions.IncludeReplicasH\x00\x12R\n\x10\x65xclude_replicas\x18\x02 \x01(\x0b\x32\x36.google.spanner.v1.DirectedReadOptions.ExcludeReplicasH\x00\x1a\xad\x01\n\x10ReplicaSelection\x12\x10\n\x08location\x18\x01 \x01(\t\x12J\n\x04type\x18\x02 \x01(\x0e\x32<.google.spanner.v1.DirectedReadOptions.ReplicaSelection.Type\";\n\x04Type\x12\x14\n\x10TYPE_UNSPECIFIED\x10\x00\x12\x0e\n\nREAD_WRITE\x10\x01\x12\r\n\tREAD_ONLY\x10\x02\x1a\x86\x01\n\x0fIncludeReplicas\x12S\n\x12replica_selections\x18\x01 \x03(\x0b\x32\x37.google.spanner.v1.DirectedReadOptions.ReplicaSelection\x12\x1e\n\x16\x61uto_failover_disabled\x18\x02 \x01(\x08\x1a\x66\n\x0f\x45xcludeReplicas\x12S\n\x12replica_selections\x18\x01 \x03(\x0b\x32\x37.google.spanner.v1.DirectedReadOptions.ReplicaSelectionB\n\n\x08replicas\"\xc8\x07\n\x11\x45xecuteSqlRequest\x12\x37\n\x07session\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1espanner.googleapis.com/Session\x12;\n\x0btransaction\x18\x02 \x01(\x0b\x32&.google.spanner.v1.TransactionSelector\x12\x10\n\x03sql\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12\'\n\x06params\x18\x04 \x01(\x0b\x32\x17.google.protobuf.Struct\x12I\n\x0bparam_types\x18\x05 \x03(\x0b\x32\x34.google.spanner.v1.ExecuteSqlRequest.ParamTypesEntry\x12\x14\n\x0cresume_token\x18\x06 \x01(\x0c\x12\x42\n\nquery_mode\x18\x07 \x01(\x0e\x32..google.spanner.v1.ExecuteSqlRequest.QueryMode\x12\x17\n\x0fpartition_token\x18\x08 \x01(\x0c\x12\r\n\x05seqno\x18\t \x01(\x03\x12H\n\rquery_options\x18\n \x01(\x0b\x32\x31.google.spanner.v1.ExecuteSqlRequest.QueryOptions\x12:\n\x0frequest_options\x18\x0b \x01(\x0b\x32!.google.spanner.v1.RequestOptions\x12\x45\n\x15\x64irected_read_options\x18\x0f \x01(\x0b\x32&.google.spanner.v1.DirectedReadOptions\x12\x1a\n\x12\x64\x61ta_boost_enabled\x18\x10 \x01(\x08\x12\x1b\n\x0elast_statement\x18\x11 \x01(\x08\x42\x03\xe0\x41\x01\x12\x39\n\x0crouting_hint\x18\x12 \x01(\x0b\x32\x1e.google.spanner.v1.RoutingHintB\x03\xe0\x41\x01\x1aO\n\x0cQueryOptions\x12\x19\n\x11optimizer_version\x18\x01 \x01(\t\x12$\n\x1coptimizer_statistics_package\x18\x02 \x01(\t\x1aJ\n\x0fParamTypesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12&\n\x05value\x18\x02 \x01(\x0b\x32\x17.google.spanner.v1.Type:\x02\x38\x01\"W\n\tQueryMode\x12\n\n\x06NORMAL\x10\x00\x12\x08\n\x04PLAN\x10\x01\x12\x0b\n\x07PROFILE\x10\x02\x12\x0e\n\nWITH_STATS\x10\x03\x12\x17\n\x13WITH_PLAN_AND_STATS\x10\x04\"\xbe\x04\n\x16\x45xecuteBatchDmlRequest\x12\x37\n\x07session\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1espanner.googleapis.com/Session\x12@\n\x0btransaction\x18\x02 \x01(\x0b\x32&.google.spanner.v1.TransactionSelectorB\x03\xe0\x41\x02\x12L\n\nstatements\x18\x03 \x03(\x0b\x32\x33.google.spanner.v1.ExecuteBatchDmlRequest.StatementB\x03\xe0\x41\x02\x12\x12\n\x05seqno\x18\x04 \x01(\x03\x42\x03\xe0\x41\x02\x12:\n\x0frequest_options\x18\x05 \x01(\x0b\x32!.google.spanner.v1.RequestOptions\x12\x1c\n\x0flast_statements\x18\x06 \x01(\x08\x42\x03\xe0\x41\x01\x1a\xec\x01\n\tStatement\x12\x10\n\x03sql\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\'\n\x06params\x18\x02 \x01(\x0b\x32\x17.google.protobuf.Struct\x12X\n\x0bparam_types\x18\x03 \x03(\x0b\x32\x43.google.spanner.v1.ExecuteBatchDmlRequest.Statement.ParamTypesEntry\x1aJ\n\x0fParamTypesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12&\n\x05value\x18\x02 \x01(\x0b\x32\x17.google.spanner.v1.Type:\x02\x38\x01\"\xc3\x01\n\x17\x45xecuteBatchDmlResponse\x12\x31\n\x0bresult_sets\x18\x01 \x03(\x0b\x32\x1c.google.spanner.v1.ResultSet\x12\"\n\x06status\x18\x02 \x01(\x0b\x32\x12.google.rpc.Status\x12Q\n\x0fprecommit_token\x18\x03 \x01(\x0b\x32\x33.google.spanner.v1.MultiplexedSessionPrecommitTokenB\x03\xe0\x41\x01\"H\n\x10PartitionOptions\x12\x1c\n\x14partition_size_bytes\x18\x01 \x01(\x03\x12\x16\n\x0emax_partitions\x18\x02 \x01(\x03\"\xad\x03\n\x15PartitionQueryRequest\x12\x37\n\x07session\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1espanner.googleapis.com/Session\x12;\n\x0btransaction\x18\x02 \x01(\x0b\x32&.google.spanner.v1.TransactionSelector\x12\x10\n\x03sql\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12,\n\x06params\x18\x04 \x01(\x0b\x32\x17.google.protobuf.StructB\x03\xe0\x41\x01\x12R\n\x0bparam_types\x18\x05 \x03(\x0b\x32\x38.google.spanner.v1.PartitionQueryRequest.ParamTypesEntryB\x03\xe0\x41\x01\x12>\n\x11partition_options\x18\x06 \x01(\x0b\x32#.google.spanner.v1.PartitionOptions\x1aJ\n\x0fParamTypesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12&\n\x05value\x18\x02 \x01(\x0b\x32\x17.google.spanner.v1.Type:\x02\x38\x01\"\xb1\x02\n\x14PartitionReadRequest\x12\x37\n\x07session\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1espanner.googleapis.com/Session\x12;\n\x0btransaction\x18\x02 \x01(\x0b\x32&.google.spanner.v1.TransactionSelector\x12\x12\n\x05table\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12\r\n\x05index\x18\x04 \x01(\t\x12\x0f\n\x07\x63olumns\x18\x05 \x03(\t\x12/\n\x07key_set\x18\x06 \x01(\x0b\x32\x19.google.spanner.v1.KeySetB\x03\xe0\x41\x02\x12>\n\x11partition_options\x18\t \x01(\x0b\x32#.google.spanner.v1.PartitionOptions\"$\n\tPartition\x12\x17\n\x0fpartition_token\x18\x01 \x01(\x0c\"z\n\x11PartitionResponse\x12\x30\n\npartitions\x18\x01 \x03(\x0b\x32\x1c.google.spanner.v1.Partition\x12\x33\n\x0btransaction\x18\x02 \x01(\x0b\x32\x1e.google.spanner.v1.Transaction\"\xb1\x06\n\x0bReadRequest\x12\x37\n\x07session\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1espanner.googleapis.com/Session\x12;\n\x0btransaction\x18\x02 \x01(\x0b\x32&.google.spanner.v1.TransactionSelector\x12\x12\n\x05table\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12\r\n\x05index\x18\x04 \x01(\t\x12\x14\n\x07\x63olumns\x18\x05 \x03(\tB\x03\xe0\x41\x02\x12/\n\x07key_set\x18\x06 \x01(\x0b\x32\x19.google.spanner.v1.KeySetB\x03\xe0\x41\x02\x12\r\n\x05limit\x18\x08 \x01(\x03\x12\x14\n\x0cresume_token\x18\t \x01(\x0c\x12\x17\n\x0fpartition_token\x18\n \x01(\x0c\x12:\n\x0frequest_options\x18\x0b \x01(\x0b\x32!.google.spanner.v1.RequestOptions\x12\x45\n\x15\x64irected_read_options\x18\x0e \x01(\x0b\x32&.google.spanner.v1.DirectedReadOptions\x12\x1a\n\x12\x64\x61ta_boost_enabled\x18\x0f \x01(\x08\x12=\n\x08order_by\x18\x10 \x01(\x0e\x32&.google.spanner.v1.ReadRequest.OrderByB\x03\xe0\x41\x01\x12?\n\tlock_hint\x18\x11 \x01(\x0e\x32\'.google.spanner.v1.ReadRequest.LockHintB\x03\xe0\x41\x01\x12\x39\n\x0crouting_hint\x18\x12 \x01(\x0b\x32\x1e.google.spanner.v1.RoutingHintB\x03\xe0\x41\x01\"T\n\x07OrderBy\x12\x18\n\x14ORDER_BY_UNSPECIFIED\x10\x00\x12\x18\n\x14ORDER_BY_PRIMARY_KEY\x10\x01\x12\x15\n\x11ORDER_BY_NO_ORDER\x10\x02\"T\n\x08LockHint\x12\x19\n\x15LOCK_HINT_UNSPECIFIED\x10\x00\x12\x14\n\x10LOCK_HINT_SHARED\x10\x01\x12\x17\n\x13LOCK_HINT_EXCLUSIVE\x10\x02\"\x83\x02\n\x17\x42\x65ginTransactionRequest\x12\x37\n\x07session\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1espanner.googleapis.com/Session\x12;\n\x07options\x18\x02 \x01(\x0b\x32%.google.spanner.v1.TransactionOptionsB\x03\xe0\x41\x02\x12:\n\x0frequest_options\x18\x03 \x01(\x0b\x32!.google.spanner.v1.RequestOptions\x12\x36\n\x0cmutation_key\x18\x04 \x01(\x0b\x32\x1b.google.spanner.v1.MutationB\x03\xe0\x41\x01\"\xd0\x03\n\rCommitRequest\x12\x37\n\x07session\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1espanner.googleapis.com/Session\x12\x18\n\x0etransaction_id\x18\x02 \x01(\x0cH\x00\x12G\n\x16single_use_transaction\x18\x03 \x01(\x0b\x32%.google.spanner.v1.TransactionOptionsH\x00\x12.\n\tmutations\x18\x04 \x03(\x0b\x32\x1b.google.spanner.v1.Mutation\x12\x1b\n\x13return_commit_stats\x18\x05 \x01(\x08\x12\x38\n\x10max_commit_delay\x18\x08 \x01(\x0b\x32\x19.google.protobuf.DurationB\x03\xe0\x41\x01\x12:\n\x0frequest_options\x18\x06 \x01(\x0b\x32!.google.spanner.v1.RequestOptions\x12Q\n\x0fprecommit_token\x18\t \x01(\x0b\x32\x33.google.spanner.v1.MultiplexedSessionPrecommitTokenB\x03\xe0\x41\x01\x42\r\n\x0btransaction\"g\n\x0fRollbackRequest\x12\x37\n\x07session\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1espanner.googleapis.com/Session\x12\x1b\n\x0etransaction_id\x18\x02 \x01(\x0c\x42\x03\xe0\x41\x02\"\xce\x02\n\x11\x42\x61tchWriteRequest\x12\x37\n\x07session\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1espanner.googleapis.com/Session\x12:\n\x0frequest_options\x18\x03 \x01(\x0b\x32!.google.spanner.v1.RequestOptions\x12P\n\x0fmutation_groups\x18\x04 \x03(\x0b\x32\x32.google.spanner.v1.BatchWriteRequest.MutationGroupB\x03\xe0\x41\x02\x12,\n\x1f\x65xclude_txn_from_change_streams\x18\x05 \x01(\x08\x42\x03\xe0\x41\x01\x1a\x44\n\rMutationGroup\x12\x33\n\tmutations\x18\x01 \x03(\x0b\x32\x1b.google.spanner.v1.MutationB\x03\xe0\x41\x02\"\x7f\n\x12\x42\x61tchWriteResponse\x12\x0f\n\x07indexes\x18\x01 \x03(\x05\x12\"\n\x06status\x18\x02 \x01(\x0b\x32\x12.google.rpc.Status\x12\x34\n\x10\x63ommit_timestamp\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp2\x8b\x18\n\x07Spanner\x12\xa6\x01\n\rCreateSession\x12\'.google.spanner.v1.CreateSessionRequest\x1a\x1a.google.spanner.v1.Session\"P\xda\x41\x08\x64\x61tabase\x82\xd3\xe4\x93\x02?\":/v1/{database=projects/*/instances/*/databases/*}/sessions:\x01*\x12\xe0\x01\n\x13\x42\x61tchCreateSessions\x12-.google.spanner.v1.BatchCreateSessionsRequest\x1a..google.spanner.v1.BatchCreateSessionsResponse\"j\xda\x41\x16\x64\x61tabase,session_count\x82\xd3\xe4\x93\x02K\"F/v1/{database=projects/*/instances/*/databases/*}/sessions:batchCreate:\x01*\x12\x97\x01\n\nGetSession\x12$.google.spanner.v1.GetSessionRequest\x1a\x1a.google.spanner.v1.Session\"G\xda\x41\x04name\x82\xd3\xe4\x93\x02:\x12\x38/v1/{name=projects/*/instances/*/databases/*/sessions/*}\x12\xae\x01\n\x0cListSessions\x12&.google.spanner.v1.ListSessionsRequest\x1a\'.google.spanner.v1.ListSessionsResponse\"M\xda\x41\x08\x64\x61tabase\x82\xd3\xe4\x93\x02<\x12:/v1/{database=projects/*/instances/*/databases/*}/sessions\x12\x99\x01\n\rDeleteSession\x12\'.google.spanner.v1.DeleteSessionRequest\x1a\x16.google.protobuf.Empty\"G\xda\x41\x04name\x82\xd3\xe4\x93\x02:*8/v1/{name=projects/*/instances/*/databases/*/sessions/*}\x12\xa3\x01\n\nExecuteSql\x12$.google.spanner.v1.ExecuteSqlRequest\x1a\x1c.google.spanner.v1.ResultSet\"Q\x82\xd3\xe4\x93\x02K\"F/v1/{session=projects/*/instances/*/databases/*/sessions/*}:executeSql:\x01*\x12\xbe\x01\n\x13\x45xecuteStreamingSql\x12$.google.spanner.v1.ExecuteSqlRequest\x1a#.google.spanner.v1.PartialResultSet\"Z\x82\xd3\xe4\x93\x02T\"O/v1/{session=projects/*/instances/*/databases/*/sessions/*}:executeStreamingSql:\x01*0\x01\x12\xc0\x01\n\x0f\x45xecuteBatchDml\x12).google.spanner.v1.ExecuteBatchDmlRequest\x1a*.google.spanner.v1.ExecuteBatchDmlResponse\"V\x82\xd3\xe4\x93\x02P\"K/v1/{session=projects/*/instances/*/databases/*/sessions/*}:executeBatchDml:\x01*\x12\x91\x01\n\x04Read\x12\x1e.google.spanner.v1.ReadRequest\x1a\x1c.google.spanner.v1.ResultSet\"K\x82\xd3\xe4\x93\x02\x45\"@/v1/{session=projects/*/instances/*/databases/*/sessions/*}:read:\x01*\x12\xac\x01\n\rStreamingRead\x12\x1e.google.spanner.v1.ReadRequest\x1a#.google.spanner.v1.PartialResultSet\"T\x82\xd3\xe4\x93\x02N\"I/v1/{session=projects/*/instances/*/databases/*/sessions/*}:streamingRead:\x01*0\x01\x12\xc9\x01\n\x10\x42\x65ginTransaction\x12*.google.spanner.v1.BeginTransactionRequest\x1a\x1e.google.spanner.v1.Transaction\"i\xda\x41\x0fsession,options\x82\xd3\xe4\x93\x02Q\"L/v1/{session=projects/*/instances/*/databases/*/sessions/*}:beginTransaction:\x01*\x12\xeb\x01\n\x06\x43ommit\x12 .google.spanner.v1.CommitRequest\x1a!.google.spanner.v1.CommitResponse\"\x9b\x01\xda\x41 session,transaction_id,mutations\xda\x41(session,single_use_transaction,mutations\x82\xd3\xe4\x93\x02G\"B/v1/{session=projects/*/instances/*/databases/*/sessions/*}:commit:\x01*\x12\xb0\x01\n\x08Rollback\x12\".google.spanner.v1.RollbackRequest\x1a\x16.google.protobuf.Empty\"h\xda\x41\x16session,transaction_id\x82\xd3\xe4\x93\x02I\"D/v1/{session=projects/*/instances/*/databases/*/sessions/*}:rollback:\x01*\x12\xb7\x01\n\x0ePartitionQuery\x12(.google.spanner.v1.PartitionQueryRequest\x1a$.google.spanner.v1.PartitionResponse\"U\x82\xd3\xe4\x93\x02O\"J/v1/{session=projects/*/instances/*/databases/*/sessions/*}:partitionQuery:\x01*\x12\xb4\x01\n\rPartitionRead\x12\'.google.spanner.v1.PartitionReadRequest\x1a$.google.spanner.v1.PartitionResponse\"T\x82\xd3\xe4\x93\x02N\"I/v1/{session=projects/*/instances/*/databases/*/sessions/*}:partitionRead:\x01*\x12\xc8\x01\n\nBatchWrite\x12$.google.spanner.v1.BatchWriteRequest\x1a%.google.spanner.v1.BatchWriteResponse\"k\xda\x41\x17session,mutation_groups\x82\xd3\xe4\x93\x02K\"F/v1/{session=projects/*/instances/*/databases/*/sessions/*}:batchWrite:\x01*0\x01\x1aw\xca\x41\x16spanner.googleapis.com\xd2\x41[https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/spanner.dataB\x91\x02\n\x15\x63om.google.spanner.v1B\x0cSpannerProtoP\x01Z5cloud.google.com/go/spanner/apiv1/spannerpb;spannerpb\xaa\x02\x17Google.Cloud.Spanner.V1\xca\x02\x17Google\\Cloud\\Spanner\\V1\xea\x02\x1aGoogle::Cloud::Spanner::V1\xea\x41_\n\x1fspanner.googleapis.com/Database\x12\n\x0ftype_annotation\x18\x04 \x01(\x0e\x32%.google.spanner.v1.TypeAnnotationCode\x12\x16\n\x0eproto_type_fqn\x18\x05 \x01(\t\"\x7f\n\nStructType\x12\x33\n\x06\x66ields\x18\x01 \x03(\x0b\x32#.google.spanner.v1.StructType.Field\x1a<\n\x05\x46ield\x12\x0c\n\x04name\x18\x01 \x01(\t\x12%\n\x04type\x18\x02 \x01(\x0b\x32\x17.google.spanner.v1.Type*\xdf\x01\n\x08TypeCode\x12\x19\n\x15TYPE_CODE_UNSPECIFIED\x10\x00\x12\x08\n\x04\x42OOL\x10\x01\x12\t\n\x05INT64\x10\x02\x12\x0b\n\x07\x46LOAT64\x10\x03\x12\x0b\n\x07\x46LOAT32\x10\x0f\x12\r\n\tTIMESTAMP\x10\x04\x12\x08\n\x04\x44\x41TE\x10\x05\x12\n\n\x06STRING\x10\x06\x12\t\n\x05\x42YTES\x10\x07\x12\t\n\x05\x41RRAY\x10\x08\x12\n\n\x06STRUCT\x10\t\x12\x0b\n\x07NUMERIC\x10\n\x12\x08\n\x04JSON\x10\x0b\x12\t\n\x05PROTO\x10\r\x12\x08\n\x04\x45NUM\x10\x0e\x12\x0c\n\x08INTERVAL\x10\x10\x12\x08\n\x04UUID\x10\x11*d\n\x12TypeAnnotationCode\x12$\n TYPE_ANNOTATION_CODE_UNSPECIFIED\x10\x00\x12\x0e\n\nPG_NUMERIC\x10\x02\x12\x0c\n\x08PG_JSONB\x10\x03\x12\n\n\x06PG_OID\x10\x04\x42\xac\x01\n\x15\x63om.google.spanner.v1B\tTypeProtoP\x01Z5cloud.google.com/go/spanner/apiv1/spannerpb;spannerpb\xaa\x02\x17Google.Cloud.Spanner.V1\xca\x02\x17Google\\Cloud\\Spanner\\V1\xea\x02\x1aGoogle::Cloud::Spanner::V1b\x06proto3" - -pool = Google::Protobuf::DescriptorPool.generated_pool - -begin - pool.add_serialized_file(descriptor_data) -rescue TypeError - # Compatibility code: will be removed in the next major version. - require 'google/protobuf/descriptor_pb' - parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) - parsed.clear_dependency - serialized = parsed.class.encode(parsed) - file = pool.add_serialized_file(serialized) - warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" - imports = [ - ] - imports.each do |type_name, expected_filename| - import_file = pool.lookup(type_name).file_descriptor - if import_file.name != expected_filename - warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" - end - end - warn "Each proto file must use a consistent fully-qualified name." - warn "This will become an error in the next major version." -end - -module Google - module Cloud - module Spanner - module V1 - Type = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.Type").msgclass - StructType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.StructType").msgclass - StructType::Field = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.StructType.Field").msgclass - TypeCode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.TypeCode").enummodule - TypeAnnotationCode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.TypeAnnotationCode").enummodule - end - end - end -end diff --git a/owl-bot-staging/google-cloud-spanner-v1/proto_docs/README.md b/owl-bot-staging/google-cloud-spanner-v1/proto_docs/README.md deleted file mode 100644 index 9e764966d911..000000000000 --- a/owl-bot-staging/google-cloud-spanner-v1/proto_docs/README.md +++ /dev/null @@ -1,4 +0,0 @@ -# Cloud Spanner V1 Protocol Buffer Documentation - -These files are for the YARD documentation of the generated protobuf files. -They are not intended to be required or loaded at runtime. diff --git a/owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/api/client.rb b/owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/api/client.rb deleted file mode 100644 index d59ba51a5612..000000000000 --- a/owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/api/client.rb +++ /dev/null @@ -1,473 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Api - # Required information for every language. - # @!attribute [rw] reference_docs_uri - # @deprecated This field is deprecated and may be removed in the next major version update. - # @return [::String] - # Link to automatically generated reference documentation. Example: - # https://cloud.google.com/nodejs/docs/reference/asset/latest - # @!attribute [rw] destinations - # @return [::Array<::Google::Api::ClientLibraryDestination>] - # The destination where API teams want this client library to be published. - # @!attribute [rw] selective_gapic_generation - # @return [::Google::Api::SelectiveGapicGeneration] - # Configuration for which RPCs should be generated in the GAPIC client. - class CommonLanguageSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Details about how and where to publish client libraries. - # @!attribute [rw] version - # @return [::String] - # Version of the API to apply these settings to. This is the full protobuf - # package for the API, ending in the version element. - # Examples: "google.cloud.speech.v1" and "google.spanner.admin.database.v1". - # @!attribute [rw] launch_stage - # @return [::Google::Api::LaunchStage] - # Launch stage of this version of the API. - # @!attribute [rw] rest_numeric_enums - # @return [::Boolean] - # When using transport=rest, the client request will encode enums as - # numbers rather than strings. - # @!attribute [rw] java_settings - # @return [::Google::Api::JavaSettings] - # Settings for legacy Java features, supported in the Service YAML. - # @!attribute [rw] cpp_settings - # @return [::Google::Api::CppSettings] - # Settings for C++ client libraries. - # @!attribute [rw] php_settings - # @return [::Google::Api::PhpSettings] - # Settings for PHP client libraries. - # @!attribute [rw] python_settings - # @return [::Google::Api::PythonSettings] - # Settings for Python client libraries. - # @!attribute [rw] node_settings - # @return [::Google::Api::NodeSettings] - # Settings for Node client libraries. - # @!attribute [rw] dotnet_settings - # @return [::Google::Api::DotnetSettings] - # Settings for .NET client libraries. - # @!attribute [rw] ruby_settings - # @return [::Google::Api::RubySettings] - # Settings for Ruby client libraries. - # @!attribute [rw] go_settings - # @return [::Google::Api::GoSettings] - # Settings for Go client libraries. - class ClientLibrarySettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # This message configures the settings for publishing [Google Cloud Client - # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) - # generated from the service config. - # @!attribute [rw] method_settings - # @return [::Array<::Google::Api::MethodSettings>] - # A list of API method settings, e.g. the behavior for methods that use the - # long-running operation pattern. - # @!attribute [rw] new_issue_uri - # @return [::String] - # Link to a *public* URI where users can report issues. Example: - # https://issuetracker.google.com/issues/new?component=190865&template=1161103 - # @!attribute [rw] documentation_uri - # @return [::String] - # Link to product home page. Example: - # https://cloud.google.com/asset-inventory/docs/overview - # @!attribute [rw] api_short_name - # @return [::String] - # Used as a tracking tag when collecting data about the APIs developer - # relations artifacts like docs, packages delivered to package managers, - # etc. Example: "speech". - # @!attribute [rw] github_label - # @return [::String] - # GitHub label to apply to issues and pull requests opened for this API. - # @!attribute [rw] codeowner_github_teams - # @return [::Array<::String>] - # GitHub teams to be added to CODEOWNERS in the directory in GitHub - # containing source code for the client libraries for this API. - # @!attribute [rw] doc_tag_prefix - # @return [::String] - # A prefix used in sample code when demarking regions to be included in - # documentation. - # @!attribute [rw] organization - # @return [::Google::Api::ClientLibraryOrganization] - # For whom the client library is being published. - # @!attribute [rw] library_settings - # @return [::Array<::Google::Api::ClientLibrarySettings>] - # Client library settings. If the same version string appears multiple - # times in this list, then the last one wins. Settings from earlier - # settings with the same version string are discarded. - # @!attribute [rw] proto_reference_documentation_uri - # @return [::String] - # Optional link to proto reference documentation. Example: - # https://cloud.google.com/pubsub/lite/docs/reference/rpc - # @!attribute [rw] rest_reference_documentation_uri - # @return [::String] - # Optional link to REST reference documentation. Example: - # https://cloud.google.com/pubsub/lite/docs/reference/rest - class Publishing - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Java client libraries. - # @!attribute [rw] library_package - # @return [::String] - # The package name to use in Java. Clobbers the java_package option - # set in the protobuf. This should be used **only** by APIs - # who have already set the language_settings.java.package_name" field - # in gapic.yaml. API teams should use the protobuf java_package option - # where possible. - # - # Example of a YAML configuration:: - # - # publishing: - # java_settings: - # library_package: com.google.cloud.pubsub.v1 - # @!attribute [rw] service_class_names - # @return [::Google::Protobuf::Map{::String => ::String}] - # Configure the Java class name to use instead of the service's for its - # corresponding generated GAPIC client. Keys are fully-qualified - # service names as they appear in the protobuf (including the full - # the language_settings.java.interface_names" field in gapic.yaml. API - # teams should otherwise use the service name as it appears in the - # protobuf. - # - # Example of a YAML configuration:: - # - # publishing: - # java_settings: - # service_class_names: - # - google.pubsub.v1.Publisher: TopicAdmin - # - google.pubsub.v1.Subscriber: SubscriptionAdmin - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class JavaSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class ServiceClassNamesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Settings for C++ client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class CppSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Php client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class PhpSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Python client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - # @!attribute [rw] experimental_features - # @return [::Google::Api::PythonSettings::ExperimentalFeatures] - # Experimental features to be included during client library generation. - class PythonSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Experimental features to be included during client library generation. - # These fields will be deprecated once the feature graduates and is enabled - # by default. - # @!attribute [rw] rest_async_io_enabled - # @return [::Boolean] - # Enables generation of asynchronous REST clients if `rest` transport is - # enabled. By default, asynchronous REST clients will not be generated. - # This feature will be enabled by default 1 month after launching the - # feature in preview packages. - # @!attribute [rw] protobuf_pythonic_types_enabled - # @return [::Boolean] - # Enables generation of protobuf code using new types that are more - # Pythonic which are included in `protobuf>=5.29.x`. This feature will be - # enabled by default 1 month after launching the feature in preview - # packages. - # @!attribute [rw] unversioned_package_disabled - # @return [::Boolean] - # Disables generation of an unversioned Python package for this client - # library. This means that the module names will need to be versioned in - # import statements. For example `import google.cloud.library_v2` instead - # of `import google.cloud.library`. - class ExperimentalFeatures - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Settings for Node client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class NodeSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Dotnet client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - # @!attribute [rw] renamed_services - # @return [::Google::Protobuf::Map{::String => ::String}] - # Map from original service names to renamed versions. - # This is used when the default generated types - # would cause a naming conflict. (Neither name is - # fully-qualified.) - # Example: Subscriber to SubscriberServiceApi. - # @!attribute [rw] renamed_resources - # @return [::Google::Protobuf::Map{::String => ::String}] - # Map from full resource types to the effective short name - # for the resource. This is used when otherwise resource - # named from different services would cause naming collisions. - # Example entry: - # "datalabeling.googleapis.com/Dataset": "DataLabelingDataset" - # @!attribute [rw] ignored_resources - # @return [::Array<::String>] - # List of full resource types to ignore during generation. - # This is typically used for API-specific Location resources, - # which should be handled by the generator as if they were actually - # the common Location resources. - # Example entry: "documentai.googleapis.com/Location" - # @!attribute [rw] forced_namespace_aliases - # @return [::Array<::String>] - # Namespaces which must be aliased in snippets due to - # a known (but non-generator-predictable) naming collision - # @!attribute [rw] handwritten_signatures - # @return [::Array<::String>] - # Method signatures (in the form "service.method(signature)") - # which are provided separately, so shouldn't be generated. - # Snippets *calling* these methods are still generated, however. - class DotnetSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class RenamedServicesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class RenamedResourcesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Settings for Ruby client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class RubySettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Go client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - # @!attribute [rw] renamed_services - # @return [::Google::Protobuf::Map{::String => ::String}] - # Map of service names to renamed services. Keys are the package relative - # service names and values are the name to be used for the service client - # and call options. - # - # publishing: - # go_settings: - # renamed_services: - # Publisher: TopicAdmin - class GoSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class RenamedServicesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Describes the generator configuration for a method. - # @!attribute [rw] selector - # @return [::String] - # The fully qualified name of the method, for which the options below apply. - # This is used to find the method to apply the options. - # - # Example: - # - # publishing: - # method_settings: - # - selector: google.storage.control.v2.StorageControl.CreateFolder - # # method settings for CreateFolder... - # @!attribute [rw] long_running - # @return [::Google::Api::MethodSettings::LongRunning] - # Describes settings to use for long-running operations when generating - # API methods for RPCs. Complements RPCs that use the annotations in - # google/longrunning/operations.proto. - # - # Example of a YAML configuration:: - # - # publishing: - # method_settings: - # - selector: google.cloud.speech.v2.Speech.BatchRecognize - # long_running: - # initial_poll_delay: 60s # 1 minute - # poll_delay_multiplier: 1.5 - # max_poll_delay: 360s # 6 minutes - # total_poll_timeout: 54000s # 90 minutes - # @!attribute [rw] auto_populated_fields - # @return [::Array<::String>] - # List of top-level fields of the request message, that should be - # automatically populated by the client libraries based on their - # (google.api.field_info).format. Currently supported format: UUID4. - # - # Example of a YAML configuration: - # - # publishing: - # method_settings: - # - selector: google.example.v1.ExampleService.CreateExample - # auto_populated_fields: - # - request_id - class MethodSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Describes settings to use when generating API methods that use the - # long-running operation pattern. - # All default values below are from those used in the client library - # generators (e.g. - # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). - # @!attribute [rw] initial_poll_delay - # @return [::Google::Protobuf::Duration] - # Initial delay after which the first poll request will be made. - # Default value: 5 seconds. - # @!attribute [rw] poll_delay_multiplier - # @return [::Float] - # Multiplier to gradually increase delay between subsequent polls until it - # reaches max_poll_delay. - # Default value: 1.5. - # @!attribute [rw] max_poll_delay - # @return [::Google::Protobuf::Duration] - # Maximum time between two subsequent poll requests. - # Default value: 45 seconds. - # @!attribute [rw] total_poll_timeout - # @return [::Google::Protobuf::Duration] - # Total polling timeout. - # Default value: 5 minutes. - class LongRunning - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # This message is used to configure the generation of a subset of the RPCs in - # a service for client libraries. - # @!attribute [rw] methods - # @return [::Array<::String>] - # An allowlist of the fully qualified names of RPCs that should be included - # on public client surfaces. - # @!attribute [rw] generate_omitted_as_internal - # @return [::Boolean] - # Setting this to true indicates to the client generators that methods - # that would be excluded from the generation should instead be generated - # in a way that indicates these methods should not be consumed by - # end users. How this is expressed is up to individual language - # implementations to decide. Some examples may be: added annotations, - # obfuscated identifiers, or other language idiomatic patterns. - class SelectiveGapicGeneration - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The organization for which the client libraries are being published. - # Affects the url where generated docs are published, etc. - module ClientLibraryOrganization - # Not useful. - CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 - - # Google Cloud Platform Org. - CLOUD = 1 - - # Ads (Advertising) Org. - ADS = 2 - - # Photos Org. - PHOTOS = 3 - - # Street View Org. - STREET_VIEW = 4 - - # Shopping Org. - SHOPPING = 5 - - # Geo Org. - GEO = 6 - - # Generative AI - https://developers.generativeai.google - GENERATIVE_AI = 7 - end - - # To where should client libraries be published? - module ClientLibraryDestination - # Client libraries will neither be generated nor published to package - # managers. - CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 - - # Generate the client library in a repo under github.com/googleapis, - # but don't publish it to package managers. - GITHUB = 10 - - # Publish the library to package managers like nuget.org and npmjs.com. - PACKAGE_MANAGER = 20 - end - end -end diff --git a/owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/api/field_behavior.rb b/owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/api/field_behavior.rb deleted file mode 100644 index 582be187d115..000000000000 --- a/owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/api/field_behavior.rb +++ /dev/null @@ -1,85 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Api - # An indicator of the behavior of a given field (for example, that a field - # is required in requests, or given as output but ignored as input). - # This **does not** change the behavior in protocol buffers itself; it only - # denotes the behavior and may affect how API tooling handles the field. - # - # Note: This enum **may** receive new values in the future. - module FieldBehavior - # Conventional default for enums. Do not use this. - FIELD_BEHAVIOR_UNSPECIFIED = 0 - - # Specifically denotes a field as optional. - # While all fields in protocol buffers are optional, this may be specified - # for emphasis if appropriate. - OPTIONAL = 1 - - # Denotes a field as required. - # This indicates that the field **must** be provided as part of the request, - # and failure to do so will cause an error (usually `INVALID_ARGUMENT`). - REQUIRED = 2 - - # Denotes a field as output only. - # This indicates that the field is provided in responses, but including the - # field in a request does nothing (the server *must* ignore it and - # *must not* throw an error as a result of the field's presence). - OUTPUT_ONLY = 3 - - # Denotes a field as input only. - # This indicates that the field is provided in requests, and the - # corresponding field is not included in output. - INPUT_ONLY = 4 - - # Denotes a field as immutable. - # This indicates that the field may be set once in a request to create a - # resource, but may not be changed thereafter. - IMMUTABLE = 5 - - # Denotes that a (repeated) field is an unordered list. - # This indicates that the service may provide the elements of the list - # in any arbitrary order, rather than the order the user originally - # provided. Additionally, the list's order may or may not be stable. - UNORDERED_LIST = 6 - - # Denotes that this field returns a non-empty default value if not set. - # This indicates that if the user provides the empty value in a request, - # a non-empty value will be returned. The user will not be aware of what - # non-empty value to expect. - NON_EMPTY_DEFAULT = 7 - - # Denotes that the field in a resource (a message annotated with - # google.api.resource) is used in the resource name to uniquely identify the - # resource. For AIP-compliant APIs, this should only be applied to the - # `name` field on the resource. - # - # This behavior should not be applied to references to other resources within - # the message. - # - # The identifier field of resources often have different field behavior - # depending on the request it is embedded in (e.g. for Create methods name - # is optional and unused, while for Update methods it is required). Instead - # of method-specific annotations, only `IDENTIFIER` is required. - IDENTIFIER = 8 - end - end -end diff --git a/owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/api/launch_stage.rb b/owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/api/launch_stage.rb deleted file mode 100644 index 9392a413fb1b..000000000000 --- a/owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/api/launch_stage.rb +++ /dev/null @@ -1,71 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Api - # The launch stage as defined by [Google Cloud Platform - # Launch Stages](https://cloud.google.com/terms/launch-stages). - module LaunchStage - # Do not use this default value. - LAUNCH_STAGE_UNSPECIFIED = 0 - - # The feature is not yet implemented. Users can not use it. - UNIMPLEMENTED = 6 - - # Prelaunch features are hidden from users and are only visible internally. - PRELAUNCH = 7 - - # Early Access features are limited to a closed group of testers. To use - # these features, you must sign up in advance and sign a Trusted Tester - # agreement (which includes confidentiality provisions). These features may - # be unstable, changed in backward-incompatible ways, and are not - # guaranteed to be released. - EARLY_ACCESS = 1 - - # Alpha is a limited availability test for releases before they are cleared - # for widespread use. By Alpha, all significant design issues are resolved - # and we are in the process of verifying functionality. Alpha customers - # need to apply for access, agree to applicable terms, and have their - # projects allowlisted. Alpha releases don't have to be feature complete, - # no SLAs are provided, and there are no technical support obligations, but - # they will be far enough along that customers can actually use them in - # test environments or for limited-use tests -- just like they would in - # normal production cases. - ALPHA = 2 - - # Beta is the point at which we are ready to open a release for any - # customer to use. There are no SLA or technical support obligations in a - # Beta release. Products will be complete from a feature perspective, but - # may have some open outstanding issues. Beta releases are suitable for - # limited production use cases. - BETA = 3 - - # GA features are open to all developers and are considered stable and - # fully qualified for production use. - GA = 4 - - # Deprecated features are scheduled to be shut down and removed. For more - # information, see the "Deprecation Policy" section of our [Terms of - # Service](https://cloud.google.com/terms/) - # and the [Google Cloud Platform Subject to the Deprecation - # Policy](https://cloud.google.com/terms/deprecation) documentation. - DEPRECATED = 5 - end - end -end diff --git a/owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/api/resource.rb b/owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/api/resource.rb deleted file mode 100644 index 25dec4847ac1..000000000000 --- a/owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/api/resource.rb +++ /dev/null @@ -1,227 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Api - # A simple descriptor of a resource type. - # - # ResourceDescriptor annotates a resource message (either by means of a - # protobuf annotation or use in the service config), and associates the - # resource's schema, the resource type, and the pattern of the resource name. - # - # Example: - # - # message Topic { - # // Indicates this message defines a resource schema. - # // Declares the resource type in the format of {service}/{kind}. - # // For Kubernetes resources, the format is {api group}/{kind}. - # option (google.api.resource) = { - # type: "pubsub.googleapis.com/Topic" - # pattern: "projects/{project}/topics/{topic}" - # }; - # } - # - # The ResourceDescriptor Yaml config will look like: - # - # resources: - # - type: "pubsub.googleapis.com/Topic" - # pattern: "projects/{project}/topics/{topic}" - # - # Sometimes, resources have multiple patterns, typically because they can - # live under multiple parents. - # - # Example: - # - # message LogEntry { - # option (google.api.resource) = { - # type: "logging.googleapis.com/LogEntry" - # pattern: "projects/{project}/logs/{log}" - # pattern: "folders/{folder}/logs/{log}" - # pattern: "organizations/{organization}/logs/{log}" - # pattern: "billingAccounts/{billing_account}/logs/{log}" - # }; - # } - # - # The ResourceDescriptor Yaml config will look like: - # - # resources: - # - type: 'logging.googleapis.com/LogEntry' - # pattern: "projects/{project}/logs/{log}" - # pattern: "folders/{folder}/logs/{log}" - # pattern: "organizations/{organization}/logs/{log}" - # pattern: "billingAccounts/{billing_account}/logs/{log}" - # @!attribute [rw] type - # @return [::String] - # The resource type. It must be in the format of - # \\{service_name}/\\{resource_type_kind}. The `resource_type_kind` must be - # singular and must not include version numbers. - # - # Example: `storage.googleapis.com/Bucket` - # - # The value of the resource_type_kind must follow the regular expression - # /[A-Za-z][a-zA-Z0-9]+/. It should start with an upper case character and - # should use PascalCase (UpperCamelCase). The maximum number of - # characters allowed for the `resource_type_kind` is 100. - # @!attribute [rw] pattern - # @return [::Array<::String>] - # Optional. The relative resource name pattern associated with this resource - # type. The DNS prefix of the full resource name shouldn't be specified here. - # - # The path pattern must follow the syntax, which aligns with HTTP binding - # syntax: - # - # Template = Segment { "/" Segment } ; - # Segment = LITERAL | Variable ; - # Variable = "{" LITERAL "}" ; - # - # Examples: - # - # - "projects/\\{project}/topics/\\{topic}" - # - "projects/\\{project}/knowledgeBases/\\{knowledge_base}" - # - # The components in braces correspond to the IDs for each resource in the - # hierarchy. It is expected that, if multiple patterns are provided, - # the same component name (e.g. "project") refers to IDs of the same - # type of resource. - # @!attribute [rw] name_field - # @return [::String] - # Optional. The field on the resource that designates the resource name - # field. If omitted, this is assumed to be "name". - # @!attribute [rw] history - # @return [::Google::Api::ResourceDescriptor::History] - # Optional. The historical or future-looking state of the resource pattern. - # - # Example: - # - # // The InspectTemplate message originally only supported resource - # // names with organization, and project was added later. - # message InspectTemplate { - # option (google.api.resource) = { - # type: "dlp.googleapis.com/InspectTemplate" - # pattern: - # "organizations/{organization}/inspectTemplates/{inspect_template}" - # pattern: "projects/{project}/inspectTemplates/{inspect_template}" - # history: ORIGINALLY_SINGLE_PATTERN - # }; - # } - # @!attribute [rw] plural - # @return [::String] - # The plural name used in the resource name and permission names, such as - # 'projects' for the resource name of 'projects/\\{project}' and the permission - # name of 'cloudresourcemanager.googleapis.com/projects.get'. One exception - # to this is for Nested Collections that have stuttering names, as defined - # in [AIP-122](https://google.aip.dev/122#nested-collections), where the - # collection ID in the resource name pattern does not necessarily directly - # match the `plural` value. - # - # It is the same concept of the `plural` field in k8s CRD spec - # https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/ - # - # Note: The plural form is required even for singleton resources. See - # https://aip.dev/156 - # @!attribute [rw] singular - # @return [::String] - # The same concept of the `singular` field in k8s CRD spec - # https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/ - # Such as "project" for the `resourcemanager.googleapis.com/Project` type. - # @!attribute [rw] style - # @return [::Array<::Google::Api::ResourceDescriptor::Style>] - # Style flag(s) for this resource. - # These indicate that a resource is expected to conform to a given - # style. See the specific style flags for additional information. - class ResourceDescriptor - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # A description of the historical or future-looking state of the - # resource pattern. - module History - # The "unset" value. - HISTORY_UNSPECIFIED = 0 - - # The resource originally had one pattern and launched as such, and - # additional patterns were added later. - ORIGINALLY_SINGLE_PATTERN = 1 - - # The resource has one pattern, but the API owner expects to add more - # later. (This is the inverse of ORIGINALLY_SINGLE_PATTERN, and prevents - # that from being necessary once there are multiple patterns.) - FUTURE_MULTI_PATTERN = 2 - end - - # A flag representing a specific style that a resource claims to conform to. - module Style - # The unspecified value. Do not use. - STYLE_UNSPECIFIED = 0 - - # This resource is intended to be "declarative-friendly". - # - # Declarative-friendly resources must be more strictly consistent, and - # setting this to true communicates to tools that this resource should - # adhere to declarative-friendly expectations. - # - # Note: This is used by the API linter (linter.aip.dev) to enable - # additional checks. - DECLARATIVE_FRIENDLY = 1 - end - end - - # Defines a proto annotation that describes a string field that refers to - # an API resource. - # @!attribute [rw] type - # @return [::String] - # The resource type that the annotated field references. - # - # Example: - # - # message Subscription { - # string topic = 2 [(google.api.resource_reference) = { - # type: "pubsub.googleapis.com/Topic" - # }]; - # } - # - # Occasionally, a field may reference an arbitrary resource. In this case, - # APIs use the special value * in their resource reference. - # - # Example: - # - # message GetIamPolicyRequest { - # string resource = 2 [(google.api.resource_reference) = { - # type: "*" - # }]; - # } - # @!attribute [rw] child_type - # @return [::String] - # The resource type of a child collection that the annotated field - # references. This is useful for annotating the `parent` field that - # doesn't have a fixed resource type. - # - # Example: - # - # message ListLogEntriesRequest { - # string parent = 1 [(google.api.resource_reference) = { - # child_type: "logging.googleapis.com/LogEntry" - # }; - # } - class ResourceReference - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/protobuf/any.rb b/owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/protobuf/any.rb deleted file mode 100644 index 58691995f02e..000000000000 --- a/owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/protobuf/any.rb +++ /dev/null @@ -1,145 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Protobuf - # `Any` contains an arbitrary serialized protocol buffer message along with a - # URL that describes the type of the serialized message. - # - # Protobuf library provides support to pack/unpack Any values in the form - # of utility functions or additional generated methods of the Any type. - # - # Example 1: Pack and unpack a message in C++. - # - # Foo foo = ...; - # Any any; - # any.PackFrom(foo); - # ... - # if (any.UnpackTo(&foo)) { - # ... - # } - # - # Example 2: Pack and unpack a message in Java. - # - # Foo foo = ...; - # Any any = Any.pack(foo); - # ... - # if (any.is(Foo.class)) { - # foo = any.unpack(Foo.class); - # } - # // or ... - # if (any.isSameTypeAs(Foo.getDefaultInstance())) { - # foo = any.unpack(Foo.getDefaultInstance()); - # } - # - # Example 3: Pack and unpack a message in Python. - # - # foo = Foo(...) - # any = Any() - # any.Pack(foo) - # ... - # if any.Is(Foo.DESCRIPTOR): - # any.Unpack(foo) - # ... - # - # Example 4: Pack and unpack a message in Go - # - # foo := &pb.Foo{...} - # any, err := anypb.New(foo) - # if err != nil { - # ... - # } - # ... - # foo := &pb.Foo{} - # if err := any.UnmarshalTo(foo); err != nil { - # ... - # } - # - # The pack methods provided by protobuf library will by default use - # 'type.googleapis.com/full.type.name' as the type URL and the unpack - # methods only use the fully qualified type name after the last '/' - # in the type URL, for example "foo.bar.com/x/y.z" will yield type - # name "y.z". - # - # JSON - # ==== - # The JSON representation of an `Any` value uses the regular - # representation of the deserialized, embedded message, with an - # additional field `@type` which contains the type URL. Example: - # - # package google.profile; - # message Person { - # string first_name = 1; - # string last_name = 2; - # } - # - # { - # "@type": "type.googleapis.com/google.profile.Person", - # "firstName": , - # "lastName": - # } - # - # If the embedded message type is well-known and has a custom JSON - # representation, that representation will be embedded adding a field - # `value` which holds the custom JSON in addition to the `@type` - # field. Example (for message [google.protobuf.Duration][]): - # - # { - # "@type": "type.googleapis.com/google.protobuf.Duration", - # "value": "1.212s" - # } - # @!attribute [rw] type_url - # @return [::String] - # A URL/resource name that uniquely identifies the type of the serialized - # protocol buffer message. This string must contain at least - # one "/" character. The last segment of the URL's path must represent - # the fully qualified name of the type (as in - # `path/google.protobuf.Duration`). The name should be in a canonical form - # (e.g., leading "." is not accepted). - # - # In practice, teams usually precompile into the binary all types that they - # expect it to use in the context of Any. However, for URLs which use the - # scheme `http`, `https`, or no scheme, one can optionally set up a type - # server that maps type URLs to message definitions as follows: - # - # * If no scheme is provided, `https` is assumed. - # * An HTTP GET on the URL must yield a [google.protobuf.Type][] - # value in binary format, or produce an error. - # * Applications are allowed to cache lookup results based on the - # URL, or have them precompiled into a binary to avoid any - # lookup. Therefore, binary compatibility needs to be preserved - # on changes to types. (Use versioned type names to manage - # breaking changes.) - # - # Note: this functionality is not currently available in the official - # protobuf release, and it is not used for type URLs beginning with - # type.googleapis.com. As of May 2023, there are no widely used type server - # implementations and no plans to implement one. - # - # Schemes other than `http`, `https` (or the empty scheme) might be - # used with implementation specific semantics. - # @!attribute [rw] value - # @return [::String] - # Must be a valid serialized protocol buffer of the above specified type. - class Any - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/protobuf/duration.rb b/owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/protobuf/duration.rb deleted file mode 100644 index ea59f1f91daf..000000000000 --- a/owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/protobuf/duration.rb +++ /dev/null @@ -1,98 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Protobuf - # A Duration represents a signed, fixed-length span of time represented - # as a count of seconds and fractions of seconds at nanosecond - # resolution. It is independent of any calendar and concepts like "day" - # or "month". It is related to Timestamp in that the difference between - # two Timestamp values is a Duration and it can be added or subtracted - # from a Timestamp. Range is approximately +-10,000 years. - # - # # Examples - # - # Example 1: Compute Duration from two Timestamps in pseudo code. - # - # Timestamp start = ...; - # Timestamp end = ...; - # Duration duration = ...; - # - # duration.seconds = end.seconds - start.seconds; - # duration.nanos = end.nanos - start.nanos; - # - # if (duration.seconds < 0 && duration.nanos > 0) { - # duration.seconds += 1; - # duration.nanos -= 1000000000; - # } else if (duration.seconds > 0 && duration.nanos < 0) { - # duration.seconds -= 1; - # duration.nanos += 1000000000; - # } - # - # Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. - # - # Timestamp start = ...; - # Duration duration = ...; - # Timestamp end = ...; - # - # end.seconds = start.seconds + duration.seconds; - # end.nanos = start.nanos + duration.nanos; - # - # if (end.nanos < 0) { - # end.seconds -= 1; - # end.nanos += 1000000000; - # } else if (end.nanos >= 1000000000) { - # end.seconds += 1; - # end.nanos -= 1000000000; - # } - # - # Example 3: Compute Duration from datetime.timedelta in Python. - # - # td = datetime.timedelta(days=3, minutes=10) - # duration = Duration() - # duration.FromTimedelta(td) - # - # # JSON Mapping - # - # In JSON format, the Duration type is encoded as a string rather than an - # object, where the string ends in the suffix "s" (indicating seconds) and - # is preceded by the number of seconds, with nanoseconds expressed as - # fractional seconds. For example, 3 seconds with 0 nanoseconds should be - # encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should - # be expressed in JSON format as "3.000000001s", and 3 seconds and 1 - # microsecond should be expressed in JSON format as "3.000001s". - # @!attribute [rw] seconds - # @return [::Integer] - # Signed seconds of the span of time. Must be from -315,576,000,000 - # to +315,576,000,000 inclusive. Note: these bounds are computed from: - # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years - # @!attribute [rw] nanos - # @return [::Integer] - # Signed fractions of a second at nanosecond resolution of the span - # of time. Durations less than one second are represented with a 0 - # `seconds` field and a positive or negative `nanos` field. For durations - # of one second or more, a non-zero value for the `nanos` field must be - # of the same sign as the `seconds` field. Must be from -999,999,999 - # to +999,999,999 inclusive. - class Duration - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/protobuf/empty.rb b/owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/protobuf/empty.rb deleted file mode 100644 index 83e4481834a6..000000000000 --- a/owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/protobuf/empty.rb +++ /dev/null @@ -1,34 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Protobuf - # A generic empty message that you can re-use to avoid defining duplicated - # empty messages in your APIs. A typical example is to use it as the request - # or the response type of an API method. For instance: - # - # service Foo { - # rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); - # } - class Empty - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/protobuf/struct.rb b/owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/protobuf/struct.rb deleted file mode 100644 index 39e1aca868d2..000000000000 --- a/owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/protobuf/struct.rb +++ /dev/null @@ -1,108 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Protobuf - # `Struct` represents a structured data value, consisting of fields - # which map to dynamically typed values. In some languages, `Struct` - # might be supported by a native representation. For example, in - # scripting languages like JS a struct is represented as an - # object. The details of that representation are described together - # with the proto support for the language. - # - # The JSON representation for `Struct` is JSON object. - # @!attribute [rw] fields - # @return [::Google::Protobuf::Map{::String => ::Google::Protobuf::Value}] - # Unordered map of dynamically typed values. - class Struct - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::Google::Protobuf::Value] - class FieldsEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # `Value` represents a dynamically typed value which can be either - # null, a number, a string, a boolean, a recursive struct value, or a - # list of values. A producer of value is expected to set one of these - # variants. Absence of any variant indicates an error. - # - # The JSON representation for `Value` is JSON value. - # @!attribute [rw] null_value - # @return [::Google::Protobuf::NullValue] - # Represents a null value. - # - # Note: The following fields are mutually exclusive: `null_value`, `number_value`, `string_value`, `bool_value`, `struct_value`, `list_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] number_value - # @return [::Float] - # Represents a double value. - # - # Note: The following fields are mutually exclusive: `number_value`, `null_value`, `string_value`, `bool_value`, `struct_value`, `list_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] string_value - # @return [::String] - # Represents a string value. - # - # Note: The following fields are mutually exclusive: `string_value`, `null_value`, `number_value`, `bool_value`, `struct_value`, `list_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] bool_value - # @return [::Boolean] - # Represents a boolean value. - # - # Note: The following fields are mutually exclusive: `bool_value`, `null_value`, `number_value`, `string_value`, `struct_value`, `list_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] struct_value - # @return [::Google::Protobuf::Struct] - # Represents a structured value. - # - # Note: The following fields are mutually exclusive: `struct_value`, `null_value`, `number_value`, `string_value`, `bool_value`, `list_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] list_value - # @return [::Google::Protobuf::ListValue] - # Represents a repeated `Value`. - # - # Note: The following fields are mutually exclusive: `list_value`, `null_value`, `number_value`, `string_value`, `bool_value`, `struct_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. - class Value - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # `ListValue` is a wrapper around a repeated field of values. - # - # The JSON representation for `ListValue` is JSON array. - # @!attribute [rw] values - # @return [::Array<::Google::Protobuf::Value>] - # Repeated field of dynamically typed values. - class ListValue - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # `NullValue` is a singleton enumeration to represent the null value for the - # `Value` type union. - # - # The JSON representation for `NullValue` is JSON `null`. - module NullValue - # Null value. - NULL_VALUE = 0 - end - end -end diff --git a/owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/protobuf/timestamp.rb b/owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/protobuf/timestamp.rb deleted file mode 100644 index 74352be9c58c..000000000000 --- a/owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/protobuf/timestamp.rb +++ /dev/null @@ -1,127 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Protobuf - # A Timestamp represents a point in time independent of any time zone or local - # calendar, encoded as a count of seconds and fractions of seconds at - # nanosecond resolution. The count is relative to an epoch at UTC midnight on - # January 1, 1970, in the proleptic Gregorian calendar which extends the - # Gregorian calendar backwards to year one. - # - # All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap - # second table is needed for interpretation, using a [24-hour linear - # smear](https://developers.google.com/time/smear). - # - # The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By - # restricting to that range, we ensure that we can convert to and from [RFC - # 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. - # - # # Examples - # - # Example 1: Compute Timestamp from POSIX `time()`. - # - # Timestamp timestamp; - # timestamp.set_seconds(time(NULL)); - # timestamp.set_nanos(0); - # - # Example 2: Compute Timestamp from POSIX `gettimeofday()`. - # - # struct timeval tv; - # gettimeofday(&tv, NULL); - # - # Timestamp timestamp; - # timestamp.set_seconds(tv.tv_sec); - # timestamp.set_nanos(tv.tv_usec * 1000); - # - # Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. - # - # FILETIME ft; - # GetSystemTimeAsFileTime(&ft); - # UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; - # - # // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z - # // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. - # Timestamp timestamp; - # timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); - # timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); - # - # Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. - # - # long millis = System.currentTimeMillis(); - # - # Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) - # .setNanos((int) ((millis % 1000) * 1000000)).build(); - # - # Example 5: Compute Timestamp from Java `Instant.now()`. - # - # Instant now = Instant.now(); - # - # Timestamp timestamp = - # Timestamp.newBuilder().setSeconds(now.getEpochSecond()) - # .setNanos(now.getNano()).build(); - # - # Example 6: Compute Timestamp from current time in Python. - # - # timestamp = Timestamp() - # timestamp.GetCurrentTime() - # - # # JSON Mapping - # - # In JSON format, the Timestamp type is encoded as a string in the - # [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the - # format is "\\{year}-\\{month}-\\{day}T\\{hour}:\\{min}:\\{sec}[.\\{frac_sec}]Z" - # where \\{year} is always expressed using four digits while \\{month}, \\{day}, - # \\{hour}, \\{min}, and \\{sec} are zero-padded to two digits each. The fractional - # seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), - # are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone - # is required. A proto3 JSON serializer should always use UTC (as indicated by - # "Z") when printing the Timestamp type and a proto3 JSON parser should be - # able to accept both UTC and other timezones (as indicated by an offset). - # - # For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past - # 01:30 UTC on January 15, 2017. - # - # In JavaScript, one can convert a Date object to this format using the - # standard - # [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) - # method. In Python, a standard `datetime.datetime` object can be converted - # to this format using - # [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with - # the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use - # the Joda Time's [`ISODateTimeFormat.dateTime()`]( - # http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() - # ) to obtain a formatter capable of generating timestamps in this format. - # @!attribute [rw] seconds - # @return [::Integer] - # Represents seconds of UTC time since Unix epoch - # 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to - # 9999-12-31T23:59:59Z inclusive. - # @!attribute [rw] nanos - # @return [::Integer] - # Non-negative fractions of a second at nanosecond resolution. Negative - # second values with fractions must still have non-negative nanos values - # that count forward in time. Must be from 0 to 999,999,999 - # inclusive. - class Timestamp - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/rpc/status.rb b/owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/rpc/status.rb deleted file mode 100644 index c1a1c07eb2db..000000000000 --- a/owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/rpc/status.rb +++ /dev/null @@ -1,48 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Rpc - # The `Status` type defines a logical error model that is suitable for - # different programming environments, including REST APIs and RPC APIs. It is - # used by [gRPC](https://github.com/grpc). Each `Status` message contains - # three pieces of data: error code, error message, and error details. - # - # You can find out more about this error model and how to work with it in the - # [API Design Guide](https://cloud.google.com/apis/design/errors). - # @!attribute [rw] code - # @return [::Integer] - # The status code, which should be an enum value of - # [google.rpc.Code][google.rpc.Code]. - # @!attribute [rw] message - # @return [::String] - # A developer-facing error message, which should be in English. Any - # user-facing error message should be localized and sent in the - # {::Google::Rpc::Status#details google.rpc.Status.details} field, or localized - # by the client. - # @!attribute [rw] details - # @return [::Array<::Google::Protobuf::Any>] - # A list of messages that carry the error details. There is a common set of - # message types for APIs to use. - class Status - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/spanner/v1/change_stream.rb b/owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/spanner/v1/change_stream.rb deleted file mode 100644 index 977e81d500bc..000000000000 --- a/owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/spanner/v1/change_stream.rb +++ /dev/null @@ -1,488 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module Spanner - module V1 - # Spanner Change Streams enable customers to capture and stream out changes to - # their Spanner databases in real-time. A change stream - # can be created with option partition_mode='IMMUTABLE_KEY_RANGE' or - # partition_mode='MUTABLE_KEY_RANGE'. - # - # This message is only used in Change Streams created with the option - # partition_mode='MUTABLE_KEY_RANGE'. Spanner automatically creates a special - # Table-Valued Function (TVF) along with each Change Streams. The function - # provides access to the change stream's records. The function is named - # READ_ (where is the - # name of the change stream), and it returns a table with only one column - # called ChangeRecord. - # @!attribute [rw] data_change_record - # @return [::Google::Cloud::Spanner::V1::ChangeStreamRecord::DataChangeRecord] - # Data change record describing a data change for a change stream - # partition. - # - # Note: The following fields are mutually exclusive: `data_change_record`, `heartbeat_record`, `partition_start_record`, `partition_end_record`, `partition_event_record`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] heartbeat_record - # @return [::Google::Cloud::Spanner::V1::ChangeStreamRecord::HeartbeatRecord] - # Heartbeat record describing a heartbeat for a change stream partition. - # - # Note: The following fields are mutually exclusive: `heartbeat_record`, `data_change_record`, `partition_start_record`, `partition_end_record`, `partition_event_record`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] partition_start_record - # @return [::Google::Cloud::Spanner::V1::ChangeStreamRecord::PartitionStartRecord] - # Partition start record describing a new change stream partition. - # - # Note: The following fields are mutually exclusive: `partition_start_record`, `data_change_record`, `heartbeat_record`, `partition_end_record`, `partition_event_record`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] partition_end_record - # @return [::Google::Cloud::Spanner::V1::ChangeStreamRecord::PartitionEndRecord] - # Partition end record describing a terminated change stream partition. - # - # Note: The following fields are mutually exclusive: `partition_end_record`, `data_change_record`, `heartbeat_record`, `partition_start_record`, `partition_event_record`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] partition_event_record - # @return [::Google::Cloud::Spanner::V1::ChangeStreamRecord::PartitionEventRecord] - # Partition event record describing key range changes for a change stream - # partition. - # - # Note: The following fields are mutually exclusive: `partition_event_record`, `data_change_record`, `heartbeat_record`, `partition_start_record`, `partition_end_record`. If a field in that set is populated, all other fields in the set will automatically be cleared. - class ChangeStreamRecord - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # A data change record contains a set of changes to a table with the same - # modification type (insert, update, or delete) committed at the same commit - # timestamp in one change stream partition for the same transaction. Multiple - # data change records can be returned for the same transaction across - # multiple change stream partitions. - # @!attribute [rw] commit_timestamp - # @return [::Google::Protobuf::Timestamp] - # Indicates the timestamp in which the change was committed. - # DataChangeRecord.commit_timestamps, - # PartitionStartRecord.start_timestamps, - # PartitionEventRecord.commit_timestamps, and - # PartitionEndRecord.end_timestamps can have the same value in the same - # partition. - # @!attribute [rw] record_sequence - # @return [::String] - # Record sequence numbers are unique and monotonically increasing (but not - # necessarily contiguous) for a specific timestamp across record - # types in the same partition. To guarantee ordered processing, the reader - # should process records (of potentially different types) in - # record_sequence order for a specific timestamp in the same partition. - # - # The record sequence number ordering across partitions is only meaningful - # in the context of a specific transaction. Record sequence numbers are - # unique across partitions for a specific transaction. Sort the - # DataChangeRecords for the same - # {::Google::Cloud::Spanner::V1::ChangeStreamRecord::DataChangeRecord#server_transaction_id server_transaction_id} - # by - # {::Google::Cloud::Spanner::V1::ChangeStreamRecord::DataChangeRecord#record_sequence record_sequence} - # to reconstruct the ordering of the changes within the transaction. - # @!attribute [rw] server_transaction_id - # @return [::String] - # Provides a globally unique string that represents the transaction in - # which the change was committed. Multiple transactions can have the same - # commit timestamp, but each transaction has a unique - # server_transaction_id. - # @!attribute [rw] is_last_record_in_transaction_in_partition - # @return [::Boolean] - # Indicates whether this is the last record for a transaction in the - # current partition. Clients can use this field to determine when all - # records for a transaction in the current partition have been received. - # @!attribute [rw] table - # @return [::String] - # Name of the table affected by the change. - # @!attribute [rw] column_metadata - # @return [::Array<::Google::Cloud::Spanner::V1::ChangeStreamRecord::DataChangeRecord::ColumnMetadata>] - # Provides metadata describing the columns associated with the - # {::Google::Cloud::Spanner::V1::ChangeStreamRecord::DataChangeRecord#mods mods} listed - # below. - # @!attribute [rw] mods - # @return [::Array<::Google::Cloud::Spanner::V1::ChangeStreamRecord::DataChangeRecord::Mod>] - # Describes the changes that were made. - # @!attribute [rw] mod_type - # @return [::Google::Cloud::Spanner::V1::ChangeStreamRecord::DataChangeRecord::ModType] - # Describes the type of change. - # @!attribute [rw] value_capture_type - # @return [::Google::Cloud::Spanner::V1::ChangeStreamRecord::DataChangeRecord::ValueCaptureType] - # Describes the value capture type that was specified in the change stream - # configuration when this change was captured. - # @!attribute [rw] number_of_records_in_transaction - # @return [::Integer] - # Indicates the number of data change records that are part of this - # transaction across all change stream partitions. This value can be used - # to assemble all the records associated with a particular transaction. - # @!attribute [rw] number_of_partitions_in_transaction - # @return [::Integer] - # Indicates the number of partitions that return data change records for - # this transaction. This value can be helpful in assembling all records - # associated with a particular transaction. - # @!attribute [rw] transaction_tag - # @return [::String] - # Indicates the transaction tag associated with this transaction. - # @!attribute [rw] is_system_transaction - # @return [::Boolean] - # Indicates whether the transaction is a system transaction. System - # transactions include those issued by time-to-live (TTL), column backfill, - # etc. - class DataChangeRecord - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Metadata for a column. - # @!attribute [rw] name - # @return [::String] - # Name of the column. - # @!attribute [rw] type - # @return [::Google::Cloud::Spanner::V1::Type] - # Type of the column. - # @!attribute [rw] is_primary_key - # @return [::Boolean] - # Indicates whether the column is a primary key column. - # @!attribute [rw] ordinal_position - # @return [::Integer] - # Ordinal position of the column based on the original table definition - # in the schema starting with a value of 1. - class ColumnMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Returns the value and associated metadata for a particular field of the - # {::Google::Cloud::Spanner::V1::ChangeStreamRecord::DataChangeRecord::Mod Mod}. - # @!attribute [rw] column_metadata_index - # @return [::Integer] - # Index within the repeated - # {::Google::Cloud::Spanner::V1::ChangeStreamRecord::DataChangeRecord#column_metadata column_metadata} - # field, to obtain the column metadata for the column that was modified. - # @!attribute [rw] value - # @return [::Google::Protobuf::Value] - # The value of the column. - class ModValue - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A mod describes all data changes in a watched table row. - # @!attribute [rw] keys - # @return [::Array<::Google::Cloud::Spanner::V1::ChangeStreamRecord::DataChangeRecord::ModValue>] - # Returns the value of the primary key of the modified row. - # @!attribute [rw] old_values - # @return [::Array<::Google::Cloud::Spanner::V1::ChangeStreamRecord::DataChangeRecord::ModValue>] - # Returns the old values before the change for the modified columns. - # Always empty for - # {::Google::Cloud::Spanner::V1::ChangeStreamRecord::DataChangeRecord::ModType::INSERT INSERT}, - # or if old values are not being captured specified by - # {::Google::Cloud::Spanner::V1::ChangeStreamRecord::DataChangeRecord::ValueCaptureType value_capture_type}. - # @!attribute [rw] new_values - # @return [::Array<::Google::Cloud::Spanner::V1::ChangeStreamRecord::DataChangeRecord::ModValue>] - # Returns the new values after the change for the modified columns. - # Always empty for - # {::Google::Cloud::Spanner::V1::ChangeStreamRecord::DataChangeRecord::ModType::DELETE DELETE}. - class Mod - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Mod type describes the type of change Spanner applied to the data. For - # example, if the client submits an INSERT_OR_UPDATE request, Spanner will - # perform an insert if there is no existing row and return ModType INSERT. - # Alternatively, if there is an existing row, Spanner will perform an - # update and return ModType UPDATE. - module ModType - # Not specified. - MOD_TYPE_UNSPECIFIED = 0 - - # Indicates data was inserted. - INSERT = 10 - - # Indicates existing data was updated. - UPDATE = 20 - - # Indicates existing data was deleted. - DELETE = 30 - end - - # Value capture type describes which values are recorded in the data - # change record. - module ValueCaptureType - # Not specified. - VALUE_CAPTURE_TYPE_UNSPECIFIED = 0 - - # Records both old and new values of the modified watched columns. - OLD_AND_NEW_VALUES = 10 - - # Records only new values of the modified watched columns. - NEW_VALUES = 20 - - # Records new values of all watched columns, including modified and - # unmodified columns. - NEW_ROW = 30 - - # Records the new values of all watched columns, including modified and - # unmodified columns. Also records the old values of the modified - # columns. - NEW_ROW_AND_OLD_VALUES = 40 - end - end - - # A heartbeat record is returned as a progress indicator, when there are no - # data changes or any other partition record types in the change stream - # partition. - # @!attribute [rw] timestamp - # @return [::Google::Protobuf::Timestamp] - # Indicates the timestamp at which the query has returned all the records - # in the change stream partition with timestamp <= heartbeat timestamp. - # The heartbeat timestamp will not be the same as the timestamps of other - # record types in the same partition. - class HeartbeatRecord - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A partition start record serves as a notification that the client should - # schedule the partitions to be queried. PartitionStartRecord returns - # information about one or more partitions. - # @!attribute [rw] start_timestamp - # @return [::Google::Protobuf::Timestamp] - # Start timestamp at which the partitions should be queried to return - # change stream records with timestamps >= start_timestamp. - # DataChangeRecord.commit_timestamps, - # PartitionStartRecord.start_timestamps, - # PartitionEventRecord.commit_timestamps, and - # PartitionEndRecord.end_timestamps can have the same value in the same - # partition. - # @!attribute [rw] record_sequence - # @return [::String] - # Record sequence numbers are unique and monotonically increasing (but not - # necessarily contiguous) for a specific timestamp across record - # types in the same partition. To guarantee ordered processing, the reader - # should process records (of potentially different types) in - # record_sequence order for a specific timestamp in the same partition. - # @!attribute [rw] partition_tokens - # @return [::Array<::String>] - # Unique partition identifiers to be used in queries. - class PartitionStartRecord - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A partition end record serves as a notification that the client should stop - # reading the partition. No further records are expected to be retrieved on - # it. - # @!attribute [rw] end_timestamp - # @return [::Google::Protobuf::Timestamp] - # End timestamp at which the change stream partition is terminated. All - # changes generated by this partition will have timestamps <= - # end_timestamp. DataChangeRecord.commit_timestamps, - # PartitionStartRecord.start_timestamps, - # PartitionEventRecord.commit_timestamps, and - # PartitionEndRecord.end_timestamps can have the same value in the same - # partition. PartitionEndRecord is the last record returned for a - # partition. - # @!attribute [rw] record_sequence - # @return [::String] - # Record sequence numbers are unique and monotonically increasing (but not - # necessarily contiguous) for a specific timestamp across record - # types in the same partition. To guarantee ordered processing, the reader - # should process records (of potentially different types) in - # record_sequence order for a specific timestamp in the same partition. - # @!attribute [rw] partition_token - # @return [::String] - # Unique partition identifier describing the terminated change stream - # partition. - # {::Google::Cloud::Spanner::V1::ChangeStreamRecord::PartitionEndRecord#partition_token partition_token} - # is equal to the partition token of the change stream partition currently - # queried to return this PartitionEndRecord. - class PartitionEndRecord - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A partition event record describes key range changes for a change stream - # partition. The changes to a row defined by its primary key can be captured - # in one change stream partition for a specific time range, and then be - # captured in a different change stream partition for a different time range. - # This movement of key ranges across change stream partitions is a reflection - # of activities, such as Spanner's dynamic splitting and load balancing, etc. - # Processing this event is needed if users want to guarantee processing of - # the changes for any key in timestamp order. If time ordered processing of - # changes for a primary key is not needed, this event can be ignored. - # To guarantee time ordered processing for each primary key, if the event - # describes move-ins, the reader of this partition needs to wait until the - # readers of the source partitions have processed all records with timestamps - # <= this PartitionEventRecord.commit_timestamp, before advancing beyond this - # PartitionEventRecord. If the event describes move-outs, the reader can - # notify the readers of the destination partitions that they can continue - # processing. - # @!attribute [rw] commit_timestamp - # @return [::Google::Protobuf::Timestamp] - # Indicates the commit timestamp at which the key range change occurred. - # DataChangeRecord.commit_timestamps, - # PartitionStartRecord.start_timestamps, - # PartitionEventRecord.commit_timestamps, and - # PartitionEndRecord.end_timestamps can have the same value in the same - # partition. - # @!attribute [rw] record_sequence - # @return [::String] - # Record sequence numbers are unique and monotonically increasing (but not - # necessarily contiguous) for a specific timestamp across record - # types in the same partition. To guarantee ordered processing, the reader - # should process records (of potentially different types) in - # record_sequence order for a specific timestamp in the same partition. - # @!attribute [rw] partition_token - # @return [::String] - # Unique partition identifier describing the partition this event - # occurred on. - # {::Google::Cloud::Spanner::V1::ChangeStreamRecord::PartitionEventRecord#partition_token partition_token} - # is equal to the partition token of the change stream partition currently - # queried to return this PartitionEventRecord. - # @!attribute [rw] move_in_events - # @return [::Array<::Google::Cloud::Spanner::V1::ChangeStreamRecord::PartitionEventRecord::MoveInEvent>] - # Set when one or more key ranges are moved into the change stream - # partition identified by - # {::Google::Cloud::Spanner::V1::ChangeStreamRecord::PartitionEventRecord#partition_token partition_token}. - # - # Example: Two key ranges are moved into partition (P1) from partition (P2) - # and partition (P3) in a single transaction at timestamp T. - # - # The PartitionEventRecord returned in P1 will reflect the move as: - # - # PartitionEventRecord { - # commit_timestamp: T - # partition_token: "P1" - # move_in_events { - # source_partition_token: "P2" - # } - # move_in_events { - # source_partition_token: "P3" - # } - # } - # - # The PartitionEventRecord returned in P2 will reflect the move as: - # - # PartitionEventRecord { - # commit_timestamp: T - # partition_token: "P2" - # move_out_events { - # destination_partition_token: "P1" - # } - # } - # - # The PartitionEventRecord returned in P3 will reflect the move as: - # - # PartitionEventRecord { - # commit_timestamp: T - # partition_token: "P3" - # move_out_events { - # destination_partition_token: "P1" - # } - # } - # @!attribute [rw] move_out_events - # @return [::Array<::Google::Cloud::Spanner::V1::ChangeStreamRecord::PartitionEventRecord::MoveOutEvent>] - # Set when one or more key ranges are moved out of the change stream - # partition identified by - # {::Google::Cloud::Spanner::V1::ChangeStreamRecord::PartitionEventRecord#partition_token partition_token}. - # - # Example: Two key ranges are moved out of partition (P1) to partition (P2) - # and partition (P3) in a single transaction at timestamp T. - # - # The PartitionEventRecord returned in P1 will reflect the move as: - # - # PartitionEventRecord { - # commit_timestamp: T - # partition_token: "P1" - # move_out_events { - # destination_partition_token: "P2" - # } - # move_out_events { - # destination_partition_token: "P3" - # } - # } - # - # The PartitionEventRecord returned in P2 will reflect the move as: - # - # PartitionEventRecord { - # commit_timestamp: T - # partition_token: "P2" - # move_in_events { - # source_partition_token: "P1" - # } - # } - # - # The PartitionEventRecord returned in P3 will reflect the move as: - # - # PartitionEventRecord { - # commit_timestamp: T - # partition_token: "P3" - # move_in_events { - # source_partition_token: "P1" - # } - # } - class PartitionEventRecord - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Describes move-in of the key ranges into the change stream partition - # identified by - # {::Google::Cloud::Spanner::V1::ChangeStreamRecord::PartitionEventRecord#partition_token partition_token}. - # - # To maintain processing the changes for a particular key in timestamp - # order, the query processing the change stream partition identified by - # {::Google::Cloud::Spanner::V1::ChangeStreamRecord::PartitionEventRecord#partition_token partition_token} - # should not advance beyond the partition event record commit timestamp - # until the queries processing the source change stream partitions have - # processed all change stream records with timestamps <= the partition - # event record commit timestamp. - # @!attribute [rw] source_partition_token - # @return [::String] - # An unique partition identifier describing the source change stream - # partition that recorded changes for the key range that is moving - # into this partition. - class MoveInEvent - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Describes move-out of the key ranges out of the change stream partition - # identified by - # {::Google::Cloud::Spanner::V1::ChangeStreamRecord::PartitionEventRecord#partition_token partition_token}. - # - # To maintain processing the changes for a particular key in timestamp - # order, the query processing the - # {::Google::Cloud::Spanner::V1::ChangeStreamRecord::PartitionEventRecord::MoveOutEvent MoveOutEvent} - # in the partition identified by - # {::Google::Cloud::Spanner::V1::ChangeStreamRecord::PartitionEventRecord#partition_token partition_token} - # should inform the queries processing the destination partitions that - # they can unblock and proceed processing records past the - # {::Google::Cloud::Spanner::V1::ChangeStreamRecord::PartitionEventRecord#commit_timestamp commit_timestamp}. - # @!attribute [rw] destination_partition_token - # @return [::String] - # An unique partition identifier describing the destination change - # stream partition that will record changes for the key range that is - # moving out of this partition. - class MoveOutEvent - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/spanner/v1/commit_response.rb b/owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/spanner/v1/commit_response.rb deleted file mode 100644 index 2ffe052a2cbc..000000000000 --- a/owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/spanner/v1/commit_response.rb +++ /dev/null @@ -1,65 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module Spanner - module V1 - # The response for {::Google::Cloud::Spanner::V1::Spanner::Client#commit Commit}. - # @!attribute [rw] commit_timestamp - # @return [::Google::Protobuf::Timestamp] - # The Cloud Spanner timestamp at which the transaction committed. - # @!attribute [rw] commit_stats - # @return [::Google::Cloud::Spanner::V1::CommitResponse::CommitStats] - # The statistics about this `Commit`. Not returned by default. - # For more information, see - # {::Google::Cloud::Spanner::V1::CommitRequest#return_commit_stats CommitRequest.return_commit_stats}. - # @!attribute [rw] precommit_token - # @return [::Google::Cloud::Spanner::V1::MultiplexedSessionPrecommitToken] - # If specified, transaction has not committed yet. - # You must retry the commit with the new precommit token. - # @!attribute [rw] snapshot_timestamp - # @return [::Google::Protobuf::Timestamp] - # If `TransactionOptions.isolation_level` is set to - # `IsolationLevel.REPEATABLE_READ`, then the snapshot timestamp is the - # timestamp at which all reads in the transaction ran. This timestamp is - # never returned. - class CommitResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Additional statistics about a commit. - # @!attribute [rw] mutation_count - # @return [::Integer] - # The total number of mutations for the transaction. Knowing the - # `mutation_count` value can help you maximize the number of mutations - # in a transaction and minimize the number of API round trips. You can - # also monitor this value to prevent transactions from exceeding the system - # [limit](https://cloud.google.com/spanner/quotas#limits_for_creating_reading_updating_and_deleting_data). - # If the number of mutations exceeds the limit, the server returns - # [INVALID_ARGUMENT](https://cloud.google.com/spanner/docs/reference/rest/v1/Code#ENUM_VALUES.INVALID_ARGUMENT). - class CommitStats - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/spanner/v1/keys.rb b/owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/spanner/v1/keys.rb deleted file mode 100644 index 5faebc2232ef..000000000000 --- a/owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/spanner/v1/keys.rb +++ /dev/null @@ -1,170 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module Spanner - module V1 - # KeyRange represents a range of rows in a table or index. - # - # A range has a start key and an end key. These keys can be open or - # closed, indicating if the range includes rows with that key. - # - # Keys are represented by lists, where the ith value in the list - # corresponds to the ith component of the table or index primary key. - # Individual values are encoded as described - # {::Google::Cloud::Spanner::V1::TypeCode here}. - # - # For example, consider the following table definition: - # - # CREATE TABLE UserEvents ( - # UserName STRING(MAX), - # EventDate STRING(10) - # ) PRIMARY KEY(UserName, EventDate); - # - # The following keys name rows in this table: - # - # ["Bob", "2014-09-23"] - # ["Alfred", "2015-06-12"] - # - # Since the `UserEvents` table's `PRIMARY KEY` clause names two - # columns, each `UserEvents` key has two elements; the first is the - # `UserName`, and the second is the `EventDate`. - # - # Key ranges with multiple components are interpreted - # lexicographically by component using the table or index key's declared - # sort order. For example, the following range returns all events for - # user `"Bob"` that occurred in the year 2015: - # - # "start_closed": ["Bob", "2015-01-01"] - # "end_closed": ["Bob", "2015-12-31"] - # - # Start and end keys can omit trailing key components. This affects the - # inclusion and exclusion of rows that exactly match the provided key - # components: if the key is closed, then rows that exactly match the - # provided components are included; if the key is open, then rows - # that exactly match are not included. - # - # For example, the following range includes all events for `"Bob"` that - # occurred during and after the year 2000: - # - # "start_closed": ["Bob", "2000-01-01"] - # "end_closed": ["Bob"] - # - # The next example retrieves all events for `"Bob"`: - # - # "start_closed": ["Bob"] - # "end_closed": ["Bob"] - # - # To retrieve events before the year 2000: - # - # "start_closed": ["Bob"] - # "end_open": ["Bob", "2000-01-01"] - # - # The following range includes all rows in the table: - # - # "start_closed": [] - # "end_closed": [] - # - # This range returns all users whose `UserName` begins with any - # character from A to C: - # - # "start_closed": ["A"] - # "end_open": ["D"] - # - # This range returns all users whose `UserName` begins with B: - # - # "start_closed": ["B"] - # "end_open": ["C"] - # - # Key ranges honor column sort order. For example, suppose a table is - # defined as follows: - # - # CREATE TABLE DescendingSortedTable { - # Key INT64, - # ... - # ) PRIMARY KEY(Key DESC); - # - # The following range retrieves all rows with key values between 1 - # and 100 inclusive: - # - # "start_closed": ["100"] - # "end_closed": ["1"] - # - # Note that 100 is passed as the start, and 1 is passed as the end, - # because `Key` is a descending column in the schema. - # @!attribute [rw] start_closed - # @return [::Google::Protobuf::ListValue] - # If the start is closed, then the range includes all rows whose - # first `len(start_closed)` key columns exactly match `start_closed`. - # - # Note: The following fields are mutually exclusive: `start_closed`, `start_open`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] start_open - # @return [::Google::Protobuf::ListValue] - # If the start is open, then the range excludes rows whose first - # `len(start_open)` key columns exactly match `start_open`. - # - # Note: The following fields are mutually exclusive: `start_open`, `start_closed`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] end_closed - # @return [::Google::Protobuf::ListValue] - # If the end is closed, then the range includes all rows whose - # first `len(end_closed)` key columns exactly match `end_closed`. - # - # Note: The following fields are mutually exclusive: `end_closed`, `end_open`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] end_open - # @return [::Google::Protobuf::ListValue] - # If the end is open, then the range excludes rows whose first - # `len(end_open)` key columns exactly match `end_open`. - # - # Note: The following fields are mutually exclusive: `end_open`, `end_closed`. If a field in that set is populated, all other fields in the set will automatically be cleared. - class KeyRange - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # `KeySet` defines a collection of Cloud Spanner keys and/or key ranges. All - # the keys are expected to be in the same table or index. The keys need - # not be sorted in any particular way. - # - # If the same key is specified multiple times in the set (for example - # if two ranges, two keys, or a key and a range overlap), Cloud Spanner - # behaves as if the key were only specified once. - # @!attribute [rw] keys - # @return [::Array<::Google::Protobuf::ListValue>] - # A list of specific keys. Entries in `keys` should have exactly as - # many elements as there are columns in the primary or index key - # with which this `KeySet` is used. Individual key values are - # encoded as described {::Google::Cloud::Spanner::V1::TypeCode here}. - # @!attribute [rw] ranges - # @return [::Array<::Google::Cloud::Spanner::V1::KeyRange>] - # A list of key ranges. See {::Google::Cloud::Spanner::V1::KeyRange KeyRange} for more - # information about key range specifications. - # @!attribute [rw] all - # @return [::Boolean] - # For convenience `all` can be set to `true` to indicate that this - # `KeySet` matches all keys in the table or index. Note that any keys - # specified in `keys` or `ranges` are only yielded once. - class KeySet - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/spanner/v1/location.rb b/owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/spanner/v1/location.rb deleted file mode 100644 index d79971bad844..000000000000 --- a/owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/spanner/v1/location.rb +++ /dev/null @@ -1,417 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module Spanner - module V1 - # A `Range` represents a range of keys in a database. The keys themselves - # are encoded in "sortable string format", also known as ssformat. Consult - # Spanner's open source client libraries for details on the encoding. - # - # Each range represents a contiguous range of rows, possibly from multiple - # tables/indexes. Each range is associated with a single paxos group (known as - # a "group" throughout this API), a split (which names the exact range within - # the group), and a generation that can be used to determine whether a given - # `Range` represents a newer or older location for the key range. - # @!attribute [rw] start_key - # @return [::String] - # The start key of the range, inclusive. Encoded in "sortable string format" - # (ssformat). - # @!attribute [rw] limit_key - # @return [::String] - # The limit key of the range, exclusive. Encoded in "sortable string format" - # (ssformat). - # @!attribute [rw] group_uid - # @return [::Integer] - # The UID of the paxos group where this range is stored. UIDs are unique - # within the database. References `Group.group_uid`. - # @!attribute [rw] split_id - # @return [::Integer] - # A group can store multiple ranges of keys. Each key range is named by an - # ID (the split ID). Within a group, split IDs are unique. The `split_id` - # names the exact split in `group_uid` where this range is stored. - # @!attribute [rw] generation - # @return [::String] - # `generation` indicates the freshness of the range information contained - # in this proto. Generations can be compared lexicographically; if generation - # A is greater than generation B, then the `Range` corresponding to A is - # newer than the `Range` corresponding to B, and should be used - # preferentially. - class Range - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A `Tablet` represents a single replica of a `Group`. A tablet is served by a - # single server at a time, and can move between servers due to server death or - # simply load balancing. - # @!attribute [rw] tablet_uid - # @return [::Integer] - # The UID of the tablet, unique within the database. Matches the - # `tablet_uids` and `leader_tablet_uid` fields in `Group`. - # @!attribute [rw] server_address - # @return [::String] - # The address of the server that is serving this tablet -- either an IP - # address or DNS hostname and a port number. - # @!attribute [rw] location - # @return [::String] - # Where this tablet is located. This is the name of a Google Cloud region, - # such as "us-central1". - # @!attribute [rw] role - # @return [::Google::Cloud::Spanner::V1::Tablet::Role] - # The role of the tablet. - # @!attribute [rw] incarnation - # @return [::String] - # `incarnation` indicates the freshness of the tablet information contained - # in this proto. Incarnations can be compared lexicographically; if - # incarnation A is greater than incarnation B, then the `Tablet` - # corresponding to A is newer than the `Tablet` corresponding to B, and - # should be used preferentially. - # @!attribute [rw] distance - # @return [::Integer] - # Distances help the client pick the closest tablet out of the list of - # tablets for a given request. Tablets with lower distances should generally - # be preferred. Tablets with the same distance are approximately equally - # close; the client can choose arbitrarily. - # - # Distances do not correspond precisely to expected latency, geographical - # distance, or anything else. Distances should be compared only between - # tablets of the same group; they are not meaningful between different - # groups. - # - # A value of zero indicates that the tablet may be in the same zone as - # the client, and have minimum network latency. A value less than or equal to - # five indicates that the tablet is thought to be in the same region as the - # client, and may have a few milliseconds of network latency. Values greater - # than five are most likely in a different region, with non-trivial network - # latency. - # - # Clients should use the following algorithm: - # * If the request is using a directed read, eliminate any tablets that - # do not match the directed read's target zone and/or replica type. - # * (Read-write transactions only) Choose leader tablet if it has an - # distance <=5. - # * Group and sort tablets by distance. Choose a random - # tablet with the lowest distance. If the request - # is not a directed read, only consider replicas with distances <=5. - # * Send the request to the fallback endpoint. - # - # The tablet picked by this algorithm may be skipped, either because it is - # marked as `skip` by the server or because the corresponding server is - # unreachable, flow controlled, etc. Skipped tablets should be added to the - # `skipped_tablet_uid` field in `RoutingHint`; the algorithm above should - # then be re-run without including the skipped tablet(s) to pick the next - # best tablet. - # @!attribute [rw] skip - # @return [::Boolean] - # If true, the tablet should not be chosen by the client. Typically, this - # signals that the tablet is unhealthy in some way. Tablets with `skip` - # set to true should be reported back to the server in - # `RoutingHint.skipped_tablet_uid`; this cues the server to send updated - # information for this tablet should it become usable again. - class Tablet - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Indicates the role of the tablet. - module Role - # Not specified. - ROLE_UNSPECIFIED = 0 - - # The tablet can perform reads and (if elected leader) writes. - READ_WRITE = 1 - - # The tablet can only perform reads. - READ_ONLY = 2 - end - end - - # A `Group` represents a paxos group in a database. A group is a set of - # tablets that are replicated across multiple servers. Groups may have a leader - # tablet. Groups store one (or sometimes more) ranges of keys. - # @!attribute [rw] group_uid - # @return [::Integer] - # The UID of the paxos group, unique within the database. Matches the - # `group_uid` field in `Range`. - # @!attribute [rw] tablets - # @return [::Array<::Google::Cloud::Spanner::V1::Tablet>] - # A list of tablets that are part of the group. Note that this list may not - # be exhaustive; it will only include tablets the server considers useful - # to the client. The returned list is ordered ascending by distance. - # - # Tablet UIDs reference `Tablet.tablet_uid`. - # @!attribute [rw] leader_index - # @return [::Integer] - # The last known leader tablet of the group as an index into `tablets`. May - # be negative if the group has no known leader. - # @!attribute [rw] generation - # @return [::String] - # `generation` indicates the freshness of the group information (including - # leader information) contained in this proto. Generations can be compared - # lexicographically; if generation A is greater than generation B, then the - # `Group` corresponding to A is newer than the `Group` corresponding to B, - # and should be used preferentially. - class Group - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A `KeyRecipe` provides the metadata required to translate reads, mutations, - # and queries into a byte array in "sortable string format" (ssformat)that can - # be used with `Range`s to route requests. Note that the client *must* tolerate - # `KeyRecipe`s that appear to be invalid, since the `KeyRecipe` format may - # change over time. Requests with invalid `KeyRecipe`s should be routed to a - # default server. - # @!attribute [rw] table_name - # @return [::String] - # A table name, matching the name from the database schema. - # - # Note: The following fields are mutually exclusive: `table_name`, `index_name`, `operation_uid`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] index_name - # @return [::String] - # An index name, matching the name from the database schema. - # - # Note: The following fields are mutually exclusive: `index_name`, `table_name`, `operation_uid`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] operation_uid - # @return [::Integer] - # The UID of a query, matching the UID from `RoutingHint`. - # - # Note: The following fields are mutually exclusive: `operation_uid`, `table_name`, `index_name`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] part - # @return [::Array<::Google::Cloud::Spanner::V1::KeyRecipe::Part>] - # Parts are in the order they should appear in the encoded key. - class KeyRecipe - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # An ssformat key is composed of a sequence of tag numbers and key column - # values. `Part` represents a single tag or key column value. - # @!attribute [rw] tag - # @return [::Integer] - # If non-zero, `tag` is the only field present in this `Part`. The part - # is encoded by appending `tag` to the ssformat key. - # @!attribute [rw] order - # @return [::Google::Cloud::Spanner::V1::KeyRecipe::Part::Order] - # Whether the key column is sorted ascending or descending. Only present - # if `tag` is zero. - # @!attribute [rw] null_order - # @return [::Google::Cloud::Spanner::V1::KeyRecipe::Part::NullOrder] - # How NULLs are represented in the encoded key part. Only present if `tag` - # is zero. - # @!attribute [rw] type - # @return [::Google::Cloud::Spanner::V1::Type] - # The type of the key part. Only present if `tag` is zero. - # @!attribute [rw] identifier - # @return [::String] - # `identifier` is the name of the column or query parameter. - # - # Note: The following fields are mutually exclusive: `identifier`, `value`, `random`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] value - # @return [::Google::Protobuf::Value] - # The constant value of the key part. - # It is present when query uses a constant as a part of the key. - # - # Note: The following fields are mutually exclusive: `value`, `identifier`, `random`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] random - # @return [::Boolean] - # If true, the client is responsible to fill in the value randomly. - # It's relevant only for the INT64 type. - # - # Note: The following fields are mutually exclusive: `random`, `identifier`, `value`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] struct_identifiers - # @return [::Array<::Integer>] - # It is a repeated field to support fetching key columns from nested - # structs, such as `STRUCT` query parameters. - class Part - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The remaining fields encode column values. - module Order - # Default value, equivalent to `ASCENDING`. - ORDER_UNSPECIFIED = 0 - - # The key is ascending - corresponds to `ASC` in the schema definition. - ASCENDING = 1 - - # The key is descending - corresponds to `DESC` in the schema definition. - DESCENDING = 2 - end - - # The null order of the key column. This dictates where NULL values sort - # in the sorted order. Note that columns which are `NOT NULL` can have a - # special encoding. - module NullOrder - # Default value. This value is unused. - NULL_ORDER_UNSPECIFIED = 0 - - # NULL values sort before any non-NULL values. - NULLS_FIRST = 1 - - # NULL values sort after any non-NULL values. - NULLS_LAST = 2 - - # The column does not support NULL values. - NOT_NULL = 3 - end - end - end - - # A `RecipeList` contains a list of `KeyRecipe`s, which share the same - # schema generation. - # @!attribute [rw] schema_generation - # @return [::String] - # The schema generation of the recipes. To be sent to the server in - # `RoutingHint.schema_generation` whenever one of the recipes is used. - # `schema_generation` values are comparable with each other; if generation A - # compares greater than generation B, then A is a more recent schema than B. - # Clients should in general aim to cache only the latest schema generation, - # and discard more stale recipes. - # @!attribute [rw] recipe - # @return [::Array<::Google::Cloud::Spanner::V1::KeyRecipe>] - # A list of recipes to be cached. - class RecipeList - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A `CacheUpdate` expresses a set of changes the client should incorporate into - # its location cache. These changes may or may not be newer than what the - # client has in its cache, and should be discarded if necessary. `CacheUpdate`s - # can be obtained in response to requests that included a `RoutingHint` - # field, but may also be obtained by explicit location-fetching RPCs which may - # be added in the future. - # @!attribute [rw] database_id - # @return [::Integer] - # An internal ID for the database. Database names can be reused if a database - # is deleted and re-created. Each time the database is re-created, it will - # get a new database ID, which will never be re-used for any other database. - # @!attribute [rw] range - # @return [::Array<::Google::Cloud::Spanner::V1::Range>] - # A list of ranges to be cached. - # @!attribute [rw] group - # @return [::Array<::Google::Cloud::Spanner::V1::Group>] - # A list of groups to be cached. - # @!attribute [rw] key_recipes - # @return [::Google::Cloud::Spanner::V1::RecipeList] - # A list of recipes to be cached. - class CacheUpdate - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # `RoutingHint` can be optionally added to location-aware Spanner - # requests. It gives the server hints that can be used to route the request to - # an appropriate server, potentially significantly decreasing latency and - # improving throughput. To achieve improved performance, most fields must be - # filled in with accurate values. - # - # The presence of a valid `RoutingHint` tells the server that the client - # is location-aware. - # - # `RoutingHint` does not change the semantics of the request; it is - # purely a performance hint; the request will perform the same actions on the - # database's data as if `RoutingHint` were not present. However, if - # the `RoutingHint` is incomplete or incorrect, the response may include - # a `CacheUpdate` the client can use to correct its location cache. - # @!attribute [rw] operation_uid - # @return [::Integer] - # A session-scoped unique ID for the operation, computed client-side. - # Requests with the same `operation_uid` should have a shared 'shape', - # meaning that some fields are expected to be the same, such as the SQL - # query, the target table/columns (for reads) etc. Requests with the same - # `operation_uid` are meant to differ only in fields like keys/key - # ranges/query parameters, transaction IDs, etc. - # - # `operation_uid` must be non-zero for `RoutingHint` to be valid. - # @!attribute [rw] database_id - # @return [::Integer] - # The database ID of the database being accessed, see - # `CacheUpdate.database_id`. Should match the cache entries that were used - # to generate the rest of the fields in this `RoutingHint`. - # @!attribute [rw] schema_generation - # @return [::String] - # The schema generation of the recipe that was used to generate `key` and - # `limit_key`. See also `RecipeList.schema_generation`. - # @!attribute [rw] key - # @return [::String] - # The key / key range that this request accesses. For operations that - # access a single key, `key` should be set and `limit_key` should be empty. - # For operations that access a key range, `key` and `limit_key` should both - # be set, to the inclusive start and exclusive end of the range respectively. - # - # The keys are encoded in "sortable string format" (ssformat), using a - # `KeyRecipe` that is appropriate for the request. See `KeyRecipe` for more - # details. - # @!attribute [rw] limit_key - # @return [::String] - # If this request targets a key range, this is the exclusive end of the - # range. See `key` for more details. - # @!attribute [rw] group_uid - # @return [::Integer] - # The group UID of the group that the client believes serves the range - # defined by `key` and `limit_key`. See `Range.group_uid` for more details. - # @!attribute [rw] split_id - # @return [::Integer] - # The split ID of the split that the client believes contains the range - # defined by `key` and `limit_key`. See `Range.split_id` for more details. - # @!attribute [rw] tablet_uid - # @return [::Integer] - # The tablet UID of the tablet from group `group_uid` that the client - # believes is best to serve this request. See `Group.local_tablet_uids` and - # `Group.leader_tablet_uid`. - # @!attribute [rw] skipped_tablet_uid - # @return [::Array<::Google::Cloud::Spanner::V1::RoutingHint::SkippedTablet>] - # If the client had multiple options for tablet selection, and some of its - # first choices were unhealthy (e.g., the server is unreachable, or - # `Tablet.skip` is true), this field will contain the tablet UIDs of those - # tablets, with their incarnations. The server may include a `CacheUpdate` - # with new locations for those tablets. - # @!attribute [rw] client_location - # @return [::String] - # If present, the client's current location. This should be the name of a - # Google Cloud zone or region, such as "us-central1". - # - # If absent, the client's location will be assumed to be the same as the - # location of the server the client ends up connected to. - # - # Locations are primarily valuable for clients that connect from regions - # other than the ones that contain the Spanner database. - class RoutingHint - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # A tablet that was skipped by the client. See `Tablet.tablet_uid` and - # `Tablet.incarnation`. - # @!attribute [rw] tablet_uid - # @return [::Integer] - # The tablet UID of the tablet that was skipped. See `Tablet.tablet_uid`. - # @!attribute [rw] incarnation - # @return [::String] - # The incarnation of the tablet that was skipped. See `Tablet.incarnation`. - class SkippedTablet - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/spanner/v1/mutation.rb b/owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/spanner/v1/mutation.rb deleted file mode 100644 index 5c0d3caa5bb8..000000000000 --- a/owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/spanner/v1/mutation.rb +++ /dev/null @@ -1,178 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module Spanner - module V1 - # A modification to one or more Cloud Spanner rows. Mutations can be - # applied to a Cloud Spanner database by sending them in a - # {::Google::Cloud::Spanner::V1::Spanner::Client#commit Commit} call. - # @!attribute [rw] insert - # @return [::Google::Cloud::Spanner::V1::Mutation::Write] - # Insert new rows in a table. If any of the rows already exist, - # the write or transaction fails with error `ALREADY_EXISTS`. - # - # Note: The following fields are mutually exclusive: `insert`, `update`, `insert_or_update`, `replace`, `delete`, `send`, `ack`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] update - # @return [::Google::Cloud::Spanner::V1::Mutation::Write] - # Update existing rows in a table. If any of the rows does not - # already exist, the transaction fails with error `NOT_FOUND`. - # - # Note: The following fields are mutually exclusive: `update`, `insert`, `insert_or_update`, `replace`, `delete`, `send`, `ack`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] insert_or_update - # @return [::Google::Cloud::Spanner::V1::Mutation::Write] - # Like {::Google::Cloud::Spanner::V1::Mutation#insert insert}, except that if the row - # already exists, then its column values are overwritten with the ones - # provided. Any column values not explicitly written are preserved. - # - # When using - # {::Google::Cloud::Spanner::V1::Mutation#insert_or_update insert_or_update}, just as - # when using {::Google::Cloud::Spanner::V1::Mutation#insert insert}, all `NOT NULL` - # columns in the table must be given a value. This holds true even when the - # row already exists and will therefore actually be updated. - # - # Note: The following fields are mutually exclusive: `insert_or_update`, `insert`, `update`, `replace`, `delete`, `send`, `ack`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] replace - # @return [::Google::Cloud::Spanner::V1::Mutation::Write] - # Like {::Google::Cloud::Spanner::V1::Mutation#insert insert}, except that if the row - # already exists, it is deleted, and the column values provided are - # inserted instead. Unlike - # {::Google::Cloud::Spanner::V1::Mutation#insert_or_update insert_or_update}, this - # means any values not explicitly written become `NULL`. - # - # In an interleaved table, if you create the child table with the - # `ON DELETE CASCADE` annotation, then replacing a parent row - # also deletes the child rows. Otherwise, you must delete the - # child rows before you replace the parent row. - # - # Note: The following fields are mutually exclusive: `replace`, `insert`, `update`, `insert_or_update`, `delete`, `send`, `ack`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] delete - # @return [::Google::Cloud::Spanner::V1::Mutation::Delete] - # Delete rows from a table. Succeeds whether or not the named - # rows were present. - # - # Note: The following fields are mutually exclusive: `delete`, `insert`, `update`, `insert_or_update`, `replace`, `send`, `ack`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] send - # @return [::Google::Cloud::Spanner::V1::Mutation::Send] - # Send a message to a queue. - # - # Note: The following fields are mutually exclusive: `send`, `insert`, `update`, `insert_or_update`, `replace`, `delete`, `ack`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] ack - # @return [::Google::Cloud::Spanner::V1::Mutation::Ack] - # Ack a message from a queue. - # - # Note: The following fields are mutually exclusive: `ack`, `insert`, `update`, `insert_or_update`, `replace`, `delete`, `send`. If a field in that set is populated, all other fields in the set will automatically be cleared. - class Mutation - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Arguments to {::Google::Cloud::Spanner::V1::Mutation#insert insert}, - # {::Google::Cloud::Spanner::V1::Mutation#update update}, - # {::Google::Cloud::Spanner::V1::Mutation#insert_or_update insert_or_update}, and - # {::Google::Cloud::Spanner::V1::Mutation#replace replace} operations. - # @!attribute [rw] table - # @return [::String] - # Required. The table whose rows will be written. - # @!attribute [rw] columns - # @return [::Array<::String>] - # The names of the columns in - # {::Google::Cloud::Spanner::V1::Mutation::Write#table table} to be written. - # - # The list of columns must contain enough columns to allow - # Cloud Spanner to derive values for all primary key columns in the - # row(s) to be modified. - # @!attribute [rw] values - # @return [::Array<::Google::Protobuf::ListValue>] - # The values to be written. `values` can contain more than one - # list of values. If it does, then multiple rows are written, one - # for each entry in `values`. Each list in `values` must have - # exactly as many entries as there are entries in - # {::Google::Cloud::Spanner::V1::Mutation::Write#columns columns} above. Sending - # multiple lists is equivalent to sending multiple `Mutation`s, each - # containing one `values` entry and repeating - # {::Google::Cloud::Spanner::V1::Mutation::Write#table table} and - # {::Google::Cloud::Spanner::V1::Mutation::Write#columns columns}. Individual values in - # each list are encoded as described {::Google::Cloud::Spanner::V1::TypeCode here}. - class Write - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Arguments to {::Google::Cloud::Spanner::V1::Mutation#delete delete} operations. - # @!attribute [rw] table - # @return [::String] - # Required. The table whose rows will be deleted. - # @!attribute [rw] key_set - # @return [::Google::Cloud::Spanner::V1::KeySet] - # Required. The primary keys of the rows within - # {::Google::Cloud::Spanner::V1::Mutation::Delete#table table} to delete. The primary - # keys must be specified in the order in which they appear in the `PRIMARY - # KEY()` clause of the table's equivalent DDL statement (the DDL statement - # used to create the table). Delete is idempotent. The transaction will - # succeed even if some or all rows do not exist. - class Delete - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Arguments to {::Google::Cloud::Spanner::V1::Mutation#send send} operations. - # @!attribute [rw] queue - # @return [::String] - # Required. The queue to which the message will be sent. - # @!attribute [rw] key - # @return [::Google::Protobuf::ListValue] - # Required. The primary key of the message to be sent. - # @!attribute [rw] deliver_time - # @return [::Google::Protobuf::Timestamp] - # The time at which Spanner will begin attempting to deliver the message. - # If `deliver_time` is not set, Spanner will deliver the message - # immediately. If `deliver_time` is in the past, Spanner will replace it - # with a value closer to the current time. - # @!attribute [rw] payload - # @return [::Google::Protobuf::Value] - # The payload of the message. - class Send - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Arguments to {::Google::Cloud::Spanner::V1::Mutation#ack ack} operations. - # @!attribute [rw] queue - # @return [::String] - # Required. The queue where the message to be acked is stored. - # @!attribute [rw] key - # @return [::Google::Protobuf::ListValue] - # Required. The primary key of the message to be acked. - # @!attribute [rw] ignore_not_found - # @return [::Boolean] - # By default, an attempt to ack a message that does not exist will fail - # with a `NOT_FOUND` error. With `ignore_not_found` set to true, the ack - # will succeed even if the message does not exist. This is useful for - # unconditionally acking a message, even if it is missing or has already - # been acked. - class Ack - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/spanner/v1/query_plan.rb b/owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/spanner/v1/query_plan.rb deleted file mode 100644 index a213c6fbe1d4..000000000000 --- a/owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/spanner/v1/query_plan.rb +++ /dev/null @@ -1,180 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module Spanner - module V1 - # Node information for nodes appearing in a - # {::Google::Cloud::Spanner::V1::QueryPlan#plan_nodes QueryPlan.plan_nodes}. - # @!attribute [rw] index - # @return [::Integer] - # The `PlanNode`'s index in [node - # list][google.spanner.v1.QueryPlan.plan_nodes]. - # @!attribute [rw] kind - # @return [::Google::Cloud::Spanner::V1::PlanNode::Kind] - # Used to determine the type of node. May be needed for visualizing - # different kinds of nodes differently. For example, If the node is a - # {::Google::Cloud::Spanner::V1::PlanNode::Kind::SCALAR SCALAR} node, it will have a - # condensed representation which can be used to directly embed a description - # of the node in its parent. - # @!attribute [rw] display_name - # @return [::String] - # The display name for the node. - # @!attribute [rw] child_links - # @return [::Array<::Google::Cloud::Spanner::V1::PlanNode::ChildLink>] - # List of child node `index`es and their relationship to this parent. - # @!attribute [rw] short_representation - # @return [::Google::Cloud::Spanner::V1::PlanNode::ShortRepresentation] - # Condensed representation for - # {::Google::Cloud::Spanner::V1::PlanNode::Kind::SCALAR SCALAR} nodes. - # @!attribute [rw] metadata - # @return [::Google::Protobuf::Struct] - # Attributes relevant to the node contained in a group of key-value pairs. - # For example, a Parameter Reference node could have the following - # information in its metadata: - # - # { - # "parameter_reference": "param1", - # "parameter_type": "array" - # } - # @!attribute [rw] execution_stats - # @return [::Google::Protobuf::Struct] - # The execution statistics associated with the node, contained in a group of - # key-value pairs. Only present if the plan was returned as a result of a - # profile query. For example, number of executions, number of rows/time per - # execution etc. - class PlanNode - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Metadata associated with a parent-child relationship appearing in a - # {::Google::Cloud::Spanner::V1::PlanNode PlanNode}. - # @!attribute [rw] child_index - # @return [::Integer] - # The node to which the link points. - # @!attribute [rw] type - # @return [::String] - # The type of the link. For example, in Hash Joins this could be used to - # distinguish between the build child and the probe child, or in the case - # of the child being an output variable, to represent the tag associated - # with the output variable. - # @!attribute [rw] variable - # @return [::String] - # Only present if the child node is - # {::Google::Cloud::Spanner::V1::PlanNode::Kind::SCALAR SCALAR} and corresponds to an - # output variable of the parent node. The field carries the name of the - # output variable. For example, a `TableScan` operator that reads rows from - # a table will have child links to the `SCALAR` nodes representing the - # output variables created for each column that is read by the operator. - # The corresponding `variable` fields will be set to the variable names - # assigned to the columns. - class ChildLink - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Condensed representation of a node and its subtree. Only present for - # `SCALAR` [PlanNode(s)][google.spanner.v1.PlanNode]. - # @!attribute [rw] description - # @return [::String] - # A string representation of the expression subtree rooted at this node. - # @!attribute [rw] subqueries - # @return [::Google::Protobuf::Map{::String => ::Integer}] - # A mapping of (subquery variable name) -> (subquery node id) for cases - # where the `description` string of this node references a `SCALAR` - # subquery contained in the expression subtree rooted at this node. The - # referenced `SCALAR` subquery may not necessarily be a direct child of - # this node. - class ShortRepresentation - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::Integer] - class SubqueriesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # The kind of {::Google::Cloud::Spanner::V1::PlanNode PlanNode}. Distinguishes between - # the two different kinds of nodes that can appear in a query plan. - module Kind - # Not specified. - KIND_UNSPECIFIED = 0 - - # Denotes a Relational operator node in the expression tree. Relational - # operators represent iterative processing of rows during query execution. - # For example, a `TableScan` operation that reads rows from a table. - RELATIONAL = 1 - - # Denotes a Scalar node in the expression tree. Scalar nodes represent - # non-iterable entities in the query plan. For example, constants or - # arithmetic operators appearing inside predicate expressions or references - # to column names. - SCALAR = 2 - end - end - - # Output of query advisor analysis. - # @!attribute [rw] index_advice - # @return [::Array<::Google::Cloud::Spanner::V1::QueryAdvisorResult::IndexAdvice>] - # Optional. Index Recommendation for a query. This is an optional field and - # the recommendation will only be available when the recommendation - # guarantees significant improvement in query performance. - class QueryAdvisorResult - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Recommendation to add new indexes to run queries more efficiently. - # @!attribute [rw] ddl - # @return [::Array<::String>] - # Optional. DDL statements to add new indexes that will improve the query. - # @!attribute [rw] improvement_factor - # @return [::Float] - # Optional. Estimated latency improvement factor. For example if the query - # currently takes 500 ms to run and the estimated latency with new indexes - # is 100 ms this field will be 5. - class IndexAdvice - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Contains an ordered list of nodes appearing in the query plan. - # @!attribute [rw] plan_nodes - # @return [::Array<::Google::Cloud::Spanner::V1::PlanNode>] - # The nodes in the query plan. Plan nodes are returned in pre-order starting - # with the plan root. Each {::Google::Cloud::Spanner::V1::PlanNode PlanNode}'s `id` - # corresponds to its index in `plan_nodes`. - # @!attribute [rw] query_advice - # @return [::Google::Cloud::Spanner::V1::QueryAdvisorResult] - # Optional. The advise/recommendations for a query. Currently this field will - # be serving index recommendations for a query. - class QueryPlan - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/spanner/v1/result_set.rb b/owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/spanner/v1/result_set.rb deleted file mode 100644 index 965cab4685b9..000000000000 --- a/owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/spanner/v1/result_set.rb +++ /dev/null @@ -1,265 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module Spanner - module V1 - # Results from {::Google::Cloud::Spanner::V1::Spanner::Client#read Read} or - # {::Google::Cloud::Spanner::V1::Spanner::Client#execute_sql ExecuteSql}. - # @!attribute [rw] metadata - # @return [::Google::Cloud::Spanner::V1::ResultSetMetadata] - # Metadata about the result set, such as row type information. - # @!attribute [rw] rows - # @return [::Array<::Google::Protobuf::ListValue>] - # Each element in `rows` is a row whose format is defined by - # {::Google::Cloud::Spanner::V1::ResultSetMetadata#row_type metadata.row_type}. The ith - # element in each row matches the ith field in - # {::Google::Cloud::Spanner::V1::ResultSetMetadata#row_type metadata.row_type}. Elements - # are encoded based on type as described {::Google::Cloud::Spanner::V1::TypeCode here}. - # @!attribute [rw] stats - # @return [::Google::Cloud::Spanner::V1::ResultSetStats] - # Query plan and execution statistics for the SQL statement that - # produced this result set. These can be requested by setting - # {::Google::Cloud::Spanner::V1::ExecuteSqlRequest#query_mode ExecuteSqlRequest.query_mode}. - # DML statements always produce stats containing the number of rows - # modified, unless executed using the - # {::Google::Cloud::Spanner::V1::ExecuteSqlRequest::QueryMode::PLAN ExecuteSqlRequest.QueryMode.PLAN} - # {::Google::Cloud::Spanner::V1::ExecuteSqlRequest#query_mode ExecuteSqlRequest.query_mode}. - # Other fields might or might not be populated, based on the - # {::Google::Cloud::Spanner::V1::ExecuteSqlRequest#query_mode ExecuteSqlRequest.query_mode}. - # @!attribute [rw] precommit_token - # @return [::Google::Cloud::Spanner::V1::MultiplexedSessionPrecommitToken] - # Optional. A precommit token is included if the read-write transaction is on - # a multiplexed session. Pass the precommit token with the highest sequence - # number from this transaction attempt to the - # {::Google::Cloud::Spanner::V1::Spanner::Client#commit Commit} request for this transaction. - # @!attribute [rw] cache_update - # @return [::Google::Cloud::Spanner::V1::CacheUpdate] - # Optional. A cache update expresses a set of changes the client should - # incorporate into its location cache. The client should discard the changes - # if they are older than the data it already has. This data can be obtained - # in response to requests that included a `RoutingHint` field, but may also - # be obtained by explicit location-fetching RPCs which may be added in the - # future. - class ResultSet - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Partial results from a streaming read or SQL query. Streaming reads and - # SQL queries better tolerate large result sets, large rows, and large - # values, but are a little trickier to consume. - # @!attribute [rw] metadata - # @return [::Google::Cloud::Spanner::V1::ResultSetMetadata] - # Metadata about the result set, such as row type information. - # Only present in the first response. - # @!attribute [rw] values - # @return [::Array<::Google::Protobuf::Value>] - # A streamed result set consists of a stream of values, which might - # be split into many `PartialResultSet` messages to accommodate - # large rows and/or large values. Every N complete values defines a - # row, where N is equal to the number of entries in - # {::Google::Cloud::Spanner::V1::StructType#fields metadata.row_type.fields}. - # - # Most values are encoded based on type as described - # {::Google::Cloud::Spanner::V1::TypeCode here}. - # - # It's possible that the last value in values is "chunked", - # meaning that the rest of the value is sent in subsequent - # `PartialResultSet`(s). This is denoted by the - # {::Google::Cloud::Spanner::V1::PartialResultSet#chunked_value chunked_value} field. - # Two or more chunked values can be merged to form a complete value as - # follows: - # - # * `bool/number/null`: can't be chunked - # * `string`: concatenate the strings - # * `list`: concatenate the lists. If the last element in a list is a - # `string`, `list`, or `object`, merge it with the first element in - # the next list by applying these rules recursively. - # * `object`: concatenate the (field name, field value) pairs. If a - # field name is duplicated, then apply these rules recursively - # to merge the field values. - # - # Some examples of merging: - # - # Strings are concatenated. - # "foo", "bar" => "foobar" - # - # Lists of non-strings are concatenated. - # [2, 3], [4] => [2, 3, 4] - # - # Lists are concatenated, but the last and first elements are merged - # because they are strings. - # ["a", "b"], ["c", "d"] => ["a", "bc", "d"] - # - # Lists are concatenated, but the last and first elements are merged - # because they are lists. Recursively, the last and first elements - # of the inner lists are merged because they are strings. - # ["a", ["b", "c"]], [["d"], "e"] => ["a", ["b", "cd"], "e"] - # - # Non-overlapping object fields are combined. - # {"a": "1"}, {"b": "2"} => {"a": "1", "b": 2"} - # - # Overlapping object fields are merged. - # {"a": "1"}, {"a": "2"} => {"a": "12"} - # - # Examples of merging objects containing lists of strings. - # {"a": ["1"]}, {"a": ["2"]} => {"a": ["12"]} - # - # For a more complete example, suppose a streaming SQL query is - # yielding a result set whose rows contain a single string - # field. The following `PartialResultSet`s might be yielded: - # - # { - # "metadata": { ... } - # "values": ["Hello", "W"] - # "chunked_value": true - # "resume_token": "Af65..." - # } - # { - # "values": ["orl"] - # "chunked_value": true - # } - # { - # "values": ["d"] - # "resume_token": "Zx1B..." - # } - # - # This sequence of `PartialResultSet`s encodes two rows, one - # containing the field value `"Hello"`, and a second containing the - # field value `"World" = "W" + "orl" + "d"`. - # - # Not all `PartialResultSet`s contain a `resume_token`. Execution can only be - # resumed from a previously yielded `resume_token`. For the above sequence of - # `PartialResultSet`s, resuming the query with `"resume_token": "Af65..."` - # yields results from the `PartialResultSet` with value "orl". - # @!attribute [rw] chunked_value - # @return [::Boolean] - # If true, then the final value in - # {::Google::Cloud::Spanner::V1::PartialResultSet#values values} is chunked, and must be - # combined with more values from subsequent `PartialResultSet`s to obtain a - # complete field value. - # @!attribute [rw] resume_token - # @return [::String] - # Streaming calls might be interrupted for a variety of reasons, such - # as TCP connection loss. If this occurs, the stream of results can - # be resumed by re-sending the original request and including - # `resume_token`. Note that executing any other transaction in the - # same session invalidates the token. - # @!attribute [rw] stats - # @return [::Google::Cloud::Spanner::V1::ResultSetStats] - # Query plan and execution statistics for the statement that produced this - # streaming result set. These can be requested by setting - # {::Google::Cloud::Spanner::V1::ExecuteSqlRequest#query_mode ExecuteSqlRequest.query_mode} - # and are sent only once with the last response in the stream. This field is - # also present in the last response for DML statements. - # @!attribute [rw] precommit_token - # @return [::Google::Cloud::Spanner::V1::MultiplexedSessionPrecommitToken] - # Optional. A precommit token is included if the read-write transaction - # has multiplexed sessions enabled. Pass the precommit token with the highest - # sequence number from this transaction attempt to the - # {::Google::Cloud::Spanner::V1::Spanner::Client#commit Commit} request for this transaction. - # @!attribute [rw] last - # @return [::Boolean] - # Optional. Indicates whether this is the last `PartialResultSet` in the - # stream. The server might optionally set this field. Clients shouldn't rely - # on this field being set in all cases. - # @!attribute [rw] cache_update - # @return [::Google::Cloud::Spanner::V1::CacheUpdate] - # Optional. A cache update expresses a set of changes the client should - # incorporate into its location cache. The client should discard the changes - # if they are older than the data it already has. This data can be obtained - # in response to requests that included a `RoutingHint` field, but may also - # be obtained by explicit location-fetching RPCs which may be added in the - # future. - class PartialResultSet - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Metadata about a {::Google::Cloud::Spanner::V1::ResultSet ResultSet} or - # {::Google::Cloud::Spanner::V1::PartialResultSet PartialResultSet}. - # @!attribute [rw] row_type - # @return [::Google::Cloud::Spanner::V1::StructType] - # Indicates the field names and types for the rows in the result - # set. For example, a SQL query like `"SELECT UserId, UserName FROM - # Users"` could return a `row_type` value like: - # - # "fields": [ - # { "name": "UserId", "type": { "code": "INT64" } }, - # { "name": "UserName", "type": { "code": "STRING" } }, - # ] - # @!attribute [rw] transaction - # @return [::Google::Cloud::Spanner::V1::Transaction] - # If the read or SQL query began a transaction as a side-effect, the - # information about the new transaction is yielded here. - # @!attribute [rw] undeclared_parameters - # @return [::Google::Cloud::Spanner::V1::StructType] - # A SQL query can be parameterized. In PLAN mode, these parameters can be - # undeclared. This indicates the field names and types for those undeclared - # parameters in the SQL query. For example, a SQL query like `"SELECT * FROM - # Users where UserId = @userId and UserName = @userName "` could return a - # `undeclared_parameters` value like: - # - # "fields": [ - # { "name": "UserId", "type": { "code": "INT64" } }, - # { "name": "UserName", "type": { "code": "STRING" } }, - # ] - class ResultSetMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Additional statistics about a {::Google::Cloud::Spanner::V1::ResultSet ResultSet} or - # {::Google::Cloud::Spanner::V1::PartialResultSet PartialResultSet}. - # @!attribute [rw] query_plan - # @return [::Google::Cloud::Spanner::V1::QueryPlan] - # {::Google::Cloud::Spanner::V1::QueryPlan QueryPlan} for the query associated with this - # result. - # @!attribute [rw] query_stats - # @return [::Google::Protobuf::Struct] - # Aggregated statistics from the execution of the query. Only present when - # the query is profiled. For example, a query could return the statistics as - # follows: - # - # { - # "rows_returned": "3", - # "elapsed_time": "1.22 secs", - # "cpu_time": "1.19 secs" - # } - # @!attribute [rw] row_count_exact - # @return [::Integer] - # Standard DML returns an exact count of rows that were modified. - # - # Note: The following fields are mutually exclusive: `row_count_exact`, `row_count_lower_bound`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] row_count_lower_bound - # @return [::Integer] - # Partitioned DML doesn't offer exactly-once semantics, so it - # returns a lower bound of the rows modified. - # - # Note: The following fields are mutually exclusive: `row_count_lower_bound`, `row_count_exact`. If a field in that set is populated, all other fields in the set will automatically be cleared. - class ResultSetStats - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/spanner/v1/spanner.rb b/owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/spanner/v1/spanner.rb deleted file mode 100644 index 1d34a7d5ebff..000000000000 --- a/owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/spanner/v1/spanner.rb +++ /dev/null @@ -1,1187 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module Spanner - module V1 - # The request for {::Google::Cloud::Spanner::V1::Spanner::Client#create_session CreateSession}. - # @!attribute [rw] database - # @return [::String] - # Required. The database in which the new session is created. - # @!attribute [rw] session - # @return [::Google::Cloud::Spanner::V1::Session] - # Required. The session to create. - class CreateSessionRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request for - # {::Google::Cloud::Spanner::V1::Spanner::Client#batch_create_sessions BatchCreateSessions}. - # @!attribute [rw] database - # @return [::String] - # Required. The database in which the new sessions are created. - # @!attribute [rw] session_template - # @return [::Google::Cloud::Spanner::V1::Session] - # Parameters to apply to each created session. - # @!attribute [rw] session_count - # @return [::Integer] - # Required. The number of sessions to be created in this batch call. At least - # one session is created. The API can return fewer than the requested number - # of sessions. If a specific number of sessions are desired, the client can - # make additional calls to `BatchCreateSessions` (adjusting - # {::Google::Cloud::Spanner::V1::BatchCreateSessionsRequest#session_count session_count} - # as necessary). - class BatchCreateSessionsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The response for - # {::Google::Cloud::Spanner::V1::Spanner::Client#batch_create_sessions BatchCreateSessions}. - # @!attribute [rw] session - # @return [::Array<::Google::Cloud::Spanner::V1::Session>] - # The freshly created sessions. - class BatchCreateSessionsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A session in the Cloud Spanner API. - # @!attribute [r] name - # @return [::String] - # Output only. The name of the session. This is always system-assigned. - # @!attribute [rw] labels - # @return [::Google::Protobuf::Map{::String => ::String}] - # The labels for the session. - # - # * Label keys must be between 1 and 63 characters long and must conform to - # the following regular expression: `[a-z]([-a-z0-9]*[a-z0-9])?`. - # * Label values must be between 0 and 63 characters long and must conform - # to the regular expression `([a-z]([-a-z0-9]*[a-z0-9])?)?`. - # * No more than 64 labels can be associated with a given session. - # - # See https://goo.gl/xmQnxf for more information on and examples of labels. - # @!attribute [r] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The timestamp when the session is created. - # @!attribute [r] approximate_last_use_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The approximate timestamp when the session is last used. It's - # typically earlier than the actual last use time. - # @!attribute [rw] creator_role - # @return [::String] - # The database role which created this session. - # @!attribute [rw] multiplexed - # @return [::Boolean] - # Optional. If `true`, specifies a multiplexed session. Use a multiplexed - # session for multiple, concurrent operations including any combination of - # read-only and read-write transactions. Use - # {::Google::Cloud::Spanner::V1::Spanner::Client#create_session `sessions.create`} to create - # multiplexed sessions. Don't use - # {::Google::Cloud::Spanner::V1::Spanner::Client#batch_create_sessions BatchCreateSessions} to - # create a multiplexed session. You can't delete or list multiplexed - # sessions. - class Session - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class LabelsEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # The request for {::Google::Cloud::Spanner::V1::Spanner::Client#get_session GetSession}. - # @!attribute [rw] name - # @return [::String] - # Required. The name of the session to retrieve. - class GetSessionRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request for {::Google::Cloud::Spanner::V1::Spanner::Client#list_sessions ListSessions}. - # @!attribute [rw] database - # @return [::String] - # Required. The database in which to list sessions. - # @!attribute [rw] page_size - # @return [::Integer] - # Number of sessions to be returned in the response. If 0 or less, defaults - # to the server's maximum allowed page size. - # @!attribute [rw] page_token - # @return [::String] - # If non-empty, `page_token` should contain a - # {::Google::Cloud::Spanner::V1::ListSessionsResponse#next_page_token next_page_token} - # from a previous - # {::Google::Cloud::Spanner::V1::ListSessionsResponse ListSessionsResponse}. - # @!attribute [rw] filter - # @return [::String] - # An expression for filtering the results of the request. Filter rules are - # case insensitive. The fields eligible for filtering are: - # - # * `labels.key` where key is the name of a label - # - # Some examples of using filters are: - # - # * `labels.env:*` --> The session has the label "env". - # * `labels.env:dev` --> The session has the label "env" and the value of - # the label contains the string "dev". - class ListSessionsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The response for {::Google::Cloud::Spanner::V1::Spanner::Client#list_sessions ListSessions}. - # @!attribute [rw] sessions - # @return [::Array<::Google::Cloud::Spanner::V1::Session>] - # The list of requested sessions. - # @!attribute [rw] next_page_token - # @return [::String] - # `next_page_token` can be sent in a subsequent - # {::Google::Cloud::Spanner::V1::Spanner::Client#list_sessions ListSessions} call to fetch more - # of the matching sessions. - class ListSessionsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request for {::Google::Cloud::Spanner::V1::Spanner::Client#delete_session DeleteSession}. - # @!attribute [rw] name - # @return [::String] - # Required. The name of the session to delete. - class DeleteSessionRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Common request options for various APIs. - # @!attribute [rw] priority - # @return [::Google::Cloud::Spanner::V1::RequestOptions::Priority] - # Priority for the request. - # @!attribute [rw] request_tag - # @return [::String] - # A per-request tag which can be applied to queries or reads, used for - # statistics collection. - # Both `request_tag` and `transaction_tag` can be specified for a read or - # query that belongs to a transaction. - # This field is ignored for requests where it's not applicable (for example, - # `CommitRequest`). - # Legal characters for `request_tag` values are all printable characters - # (ASCII 32 - 126) and the length of a request_tag is limited to 50 - # characters. Values that exceed this limit are truncated. - # Any leading underscore (_) characters are removed from the string. - # @!attribute [rw] transaction_tag - # @return [::String] - # A tag used for statistics collection about this transaction. - # Both `request_tag` and `transaction_tag` can be specified for a read or - # query that belongs to a transaction. - # To enable tagging on a transaction, `transaction_tag` must be set to the - # same value for all requests belonging to the same transaction, including - # {::Google::Cloud::Spanner::V1::Spanner::Client#begin_transaction BeginTransaction}. - # If this request doesn't belong to any transaction, `transaction_tag` is - # ignored. - # Legal characters for `transaction_tag` values are all printable characters - # (ASCII 32 - 126) and the length of a `transaction_tag` is limited to 50 - # characters. Values that exceed this limit are truncated. - # Any leading underscore (_) characters are removed from the string. - # @!attribute [rw] client_context - # @return [::Google::Cloud::Spanner::V1::RequestOptions::ClientContext] - # Optional. Optional context that may be needed for some requests. - class RequestOptions - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Container for various pieces of client-owned context attached to a request. - # @!attribute [rw] secure_context - # @return [::Google::Protobuf::Map{::String => ::Google::Protobuf::Value}] - # Optional. Map of parameter name to value for this request. These values - # will be returned by any SECURE_CONTEXT() calls invoked by this request - # (e.g., by queries against Parameterized Secure Views). - class ClientContext - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::Google::Protobuf::Value] - class SecureContextEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # The relative priority for requests. Note that priority isn't applicable - # for {::Google::Cloud::Spanner::V1::Spanner::Client#begin_transaction BeginTransaction}. - # - # The priority acts as a hint to the Cloud Spanner scheduler and doesn't - # guarantee priority or order of execution. For example: - # - # * Some parts of a write operation always execute at `PRIORITY_HIGH`, - # regardless of the specified priority. This can cause you to see an - # increase in high priority workload even when executing a low priority - # request. This can also potentially cause a priority inversion where a - # lower priority request is fulfilled ahead of a higher priority - # request. - # * If a transaction contains multiple operations with different priorities, - # Cloud Spanner doesn't guarantee to process the higher priority - # operations first. There might be other constraints to satisfy, such as - # the order of operations. - module Priority - # `PRIORITY_UNSPECIFIED` is equivalent to `PRIORITY_HIGH`. - PRIORITY_UNSPECIFIED = 0 - - # This specifies that the request is low priority. - PRIORITY_LOW = 1 - - # This specifies that the request is medium priority. - PRIORITY_MEDIUM = 2 - - # This specifies that the request is high priority. - PRIORITY_HIGH = 3 - end - end - - # The `DirectedReadOptions` can be used to indicate which replicas or regions - # should be used for non-transactional reads or queries. - # - # `DirectedReadOptions` can only be specified for a read-only transaction, - # otherwise the API returns an `INVALID_ARGUMENT` error. - # @!attribute [rw] include_replicas - # @return [::Google::Cloud::Spanner::V1::DirectedReadOptions::IncludeReplicas] - # `Include_replicas` indicates the order of replicas (as they appear in - # this list) to process the request. If `auto_failover_disabled` is set to - # `true` and all replicas are exhausted without finding a healthy replica, - # Spanner waits for a replica in the list to become available, requests - # might fail due to `DEADLINE_EXCEEDED` errors. - # - # Note: The following fields are mutually exclusive: `include_replicas`, `exclude_replicas`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] exclude_replicas - # @return [::Google::Cloud::Spanner::V1::DirectedReadOptions::ExcludeReplicas] - # `Exclude_replicas` indicates that specified replicas should be excluded - # from serving requests. Spanner doesn't route requests to the replicas - # in this list. - # - # Note: The following fields are mutually exclusive: `exclude_replicas`, `include_replicas`. If a field in that set is populated, all other fields in the set will automatically be cleared. - class DirectedReadOptions - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The directed read replica selector. - # Callers must provide one or more of the following fields for replica - # selection: - # - # * `location` - The location must be one of the regions within the - # multi-region configuration of your database. - # * `type` - The type of the replica. - # - # Some examples of using replica_selectors are: - # - # * `location:us-east1` --> The "us-east1" replica(s) of any available type - # is used to process the request. - # * `type:READ_ONLY` --> The "READ_ONLY" type replica(s) in the nearest - # available location are used to process the - # request. - # * `location:us-east1 type:READ_ONLY` --> The "READ_ONLY" type replica(s) - # in location "us-east1" is used to process - # the request. - # @!attribute [rw] location - # @return [::String] - # The location or region of the serving requests, for example, "us-east1". - # @!attribute [rw] type - # @return [::Google::Cloud::Spanner::V1::DirectedReadOptions::ReplicaSelection::Type] - # The type of replica. - class ReplicaSelection - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Indicates the type of replica. - module Type - # Not specified. - TYPE_UNSPECIFIED = 0 - - # Read-write replicas support both reads and writes. - READ_WRITE = 1 - - # Read-only replicas only support reads (not writes). - READ_ONLY = 2 - end - end - - # An `IncludeReplicas` contains a repeated set of `ReplicaSelection` which - # indicates the order in which replicas should be considered. - # @!attribute [rw] replica_selections - # @return [::Array<::Google::Cloud::Spanner::V1::DirectedReadOptions::ReplicaSelection>] - # The directed read replica selector. - # @!attribute [rw] auto_failover_disabled - # @return [::Boolean] - # If `true`, Spanner doesn't route requests to a replica outside the - # <`include_replicas` list when all of the specified replicas are - # unavailable or unhealthy. Default value is `false`. - class IncludeReplicas - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # An ExcludeReplicas contains a repeated set of ReplicaSelection that should - # be excluded from serving requests. - # @!attribute [rw] replica_selections - # @return [::Array<::Google::Cloud::Spanner::V1::DirectedReadOptions::ReplicaSelection>] - # The directed read replica selector. - class ExcludeReplicas - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # The request for {::Google::Cloud::Spanner::V1::Spanner::Client#execute_sql ExecuteSql} and - # {::Google::Cloud::Spanner::V1::Spanner::Client#execute_streaming_sql ExecuteStreamingSql}. - # @!attribute [rw] session - # @return [::String] - # Required. The session in which the SQL query should be performed. - # @!attribute [rw] transaction - # @return [::Google::Cloud::Spanner::V1::TransactionSelector] - # The transaction to use. - # - # For queries, if none is provided, the default is a temporary read-only - # transaction with strong concurrency. - # - # Standard DML statements require a read-write transaction. To protect - # against replays, single-use transactions are not supported. The caller - # must either supply an existing transaction ID or begin a new transaction. - # - # Partitioned DML requires an existing Partitioned DML transaction ID. - # @!attribute [rw] sql - # @return [::String] - # Required. The SQL string. - # @!attribute [rw] params - # @return [::Google::Protobuf::Struct] - # Parameter names and values that bind to placeholders in the SQL string. - # - # A parameter placeholder consists of the `@` character followed by the - # parameter name (for example, `@firstName`). Parameter names must conform - # to the naming requirements of identifiers as specified at - # https://cloud.google.com/spanner/docs/lexical#identifiers. - # - # Parameters can appear anywhere that a literal value is expected. The same - # parameter name can be used more than once, for example: - # - # `"WHERE id > @msg_id AND id < @msg_id + 100"` - # - # It's an error to execute a SQL statement with unbound parameters. - # @!attribute [rw] param_types - # @return [::Google::Protobuf::Map{::String => ::Google::Cloud::Spanner::V1::Type}] - # It isn't always possible for Cloud Spanner to infer the right SQL type - # from a JSON value. For example, values of type `BYTES` and values - # of type `STRING` both appear in - # {::Google::Cloud::Spanner::V1::ExecuteSqlRequest#params params} as JSON strings. - # - # In these cases, you can use `param_types` to specify the exact - # SQL type for some or all of the SQL statement parameters. See the - # definition of {::Google::Cloud::Spanner::V1::Type Type} for more information - # about SQL types. - # @!attribute [rw] resume_token - # @return [::String] - # If this request is resuming a previously interrupted SQL statement - # execution, `resume_token` should be copied from the last - # {::Google::Cloud::Spanner::V1::PartialResultSet PartialResultSet} yielded before the - # interruption. Doing this enables the new SQL statement execution to resume - # where the last one left off. The rest of the request parameters must - # exactly match the request that yielded this token. - # @!attribute [rw] query_mode - # @return [::Google::Cloud::Spanner::V1::ExecuteSqlRequest::QueryMode] - # Used to control the amount of debugging information returned in - # {::Google::Cloud::Spanner::V1::ResultSetStats ResultSetStats}. If - # {::Google::Cloud::Spanner::V1::ExecuteSqlRequest#partition_token partition_token} is - # set, {::Google::Cloud::Spanner::V1::ExecuteSqlRequest#query_mode query_mode} can only - # be set to - # {::Google::Cloud::Spanner::V1::ExecuteSqlRequest::QueryMode::NORMAL QueryMode.NORMAL}. - # @!attribute [rw] partition_token - # @return [::String] - # If present, results are restricted to the specified partition - # previously created using `PartitionQuery`. There must be an exact - # match for the values of fields common to this message and the - # `PartitionQueryRequest` message used to create this `partition_token`. - # @!attribute [rw] seqno - # @return [::Integer] - # A per-transaction sequence number used to identify this request. This field - # makes each request idempotent such that if the request is received multiple - # times, at most one succeeds. - # - # The sequence number must be monotonically increasing within the - # transaction. If a request arrives for the first time with an out-of-order - # sequence number, the transaction can be aborted. Replays of previously - # handled requests yield the same response as the first execution. - # - # Required for DML statements. Ignored for queries. - # @!attribute [rw] query_options - # @return [::Google::Cloud::Spanner::V1::ExecuteSqlRequest::QueryOptions] - # Query optimizer configuration to use for the given query. - # @!attribute [rw] request_options - # @return [::Google::Cloud::Spanner::V1::RequestOptions] - # Common options for this request. - # @!attribute [rw] directed_read_options - # @return [::Google::Cloud::Spanner::V1::DirectedReadOptions] - # Directed read options for this request. - # @!attribute [rw] data_boost_enabled - # @return [::Boolean] - # If this is for a partitioned query and this field is set to `true`, the - # request is executed with Spanner Data Boost independent compute resources. - # - # If the field is set to `true` but the request doesn't set - # `partition_token`, the API returns an `INVALID_ARGUMENT` error. - # @!attribute [rw] last_statement - # @return [::Boolean] - # Optional. If set to `true`, this statement marks the end of the - # transaction. After this statement executes, you must commit or abort the - # transaction. Attempts to execute any other requests against this - # transaction (including reads and queries) are rejected. - # - # For DML statements, setting this option might cause some error reporting to - # be deferred until commit time (for example, validation of unique - # constraints). Given this, successful execution of a DML statement shouldn't - # be assumed until a subsequent `Commit` call completes successfully. - # @!attribute [rw] routing_hint - # @return [::Google::Cloud::Spanner::V1::RoutingHint] - # Optional. If present, it makes the Spanner requests location-aware. - # - # It gives the server hints that can be used to route the request - # to an appropriate server, potentially significantly decreasing latency and - # improving throughput. To achieve improved performance, most fields must be - # filled in with accurate values. - class ExecuteSqlRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Query optimizer configuration. - # @!attribute [rw] optimizer_version - # @return [::String] - # An option to control the selection of optimizer version. - # - # This parameter allows individual queries to pick different query - # optimizer versions. - # - # Specifying `latest` as a value instructs Cloud Spanner to use the - # latest supported query optimizer version. If not specified, Cloud Spanner - # uses the optimizer version set at the database level options. Any other - # positive integer (from the list of supported optimizer versions) - # overrides the default optimizer version for query execution. - # - # The list of supported optimizer versions can be queried from - # `SPANNER_SYS.SUPPORTED_OPTIMIZER_VERSIONS`. - # - # Executing a SQL statement with an invalid optimizer version fails with - # an `INVALID_ARGUMENT` error. - # - # See - # https://cloud.google.com/spanner/docs/query-optimizer/manage-query-optimizer - # for more information on managing the query optimizer. - # - # The `optimizer_version` statement hint has precedence over this setting. - # @!attribute [rw] optimizer_statistics_package - # @return [::String] - # An option to control the selection of optimizer statistics package. - # - # This parameter allows individual queries to use a different query - # optimizer statistics package. - # - # Specifying `latest` as a value instructs Cloud Spanner to use the latest - # generated statistics package. If not specified, Cloud Spanner uses - # the statistics package set at the database level options, or the latest - # package if the database option isn't set. - # - # The statistics package requested by the query has to be exempt from - # garbage collection. This can be achieved with the following DDL - # statement: - # - # ```sql - # ALTER STATISTICS SET OPTIONS (allow_gc=false) - # ``` - # - # The list of available statistics packages can be queried from - # `INFORMATION_SCHEMA.SPANNER_STATISTICS`. - # - # Executing a SQL statement with an invalid optimizer statistics package - # or with a statistics package that allows garbage collection fails with - # an `INVALID_ARGUMENT` error. - class QueryOptions - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::Google::Cloud::Spanner::V1::Type] - class ParamTypesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Mode in which the statement must be processed. - module QueryMode - # The default mode. Only the statement results are returned. - NORMAL = 0 - - # This mode returns only the query plan, without any results or - # execution statistics information. - PLAN = 1 - - # This mode returns the query plan, overall execution statistics, - # operator level execution statistics along with the results. This has a - # performance overhead compared to the other modes. It isn't recommended - # to use this mode for production traffic. - PROFILE = 2 - - # This mode returns the overall (but not operator-level) execution - # statistics along with the results. - WITH_STATS = 3 - - # This mode returns the query plan, overall (but not operator-level) - # execution statistics along with the results. - WITH_PLAN_AND_STATS = 4 - end - end - - # The request for {::Google::Cloud::Spanner::V1::Spanner::Client#execute_batch_dml ExecuteBatchDml}. - # @!attribute [rw] session - # @return [::String] - # Required. The session in which the DML statements should be performed. - # @!attribute [rw] transaction - # @return [::Google::Cloud::Spanner::V1::TransactionSelector] - # Required. The transaction to use. Must be a read-write transaction. - # - # To protect against replays, single-use transactions are not supported. The - # caller must either supply an existing transaction ID or begin a new - # transaction. - # @!attribute [rw] statements - # @return [::Array<::Google::Cloud::Spanner::V1::ExecuteBatchDmlRequest::Statement>] - # Required. The list of statements to execute in this batch. Statements are - # executed serially, such that the effects of statement `i` are visible to - # statement `i+1`. Each statement must be a DML statement. Execution stops at - # the first failed statement; the remaining statements are not executed. - # - # Callers must provide at least one statement. - # @!attribute [rw] seqno - # @return [::Integer] - # Required. A per-transaction sequence number used to identify this request. - # This field makes each request idempotent such that if the request is - # received multiple times, at most one succeeds. - # - # The sequence number must be monotonically increasing within the - # transaction. If a request arrives for the first time with an out-of-order - # sequence number, the transaction might be aborted. Replays of previously - # handled requests yield the same response as the first execution. - # @!attribute [rw] request_options - # @return [::Google::Cloud::Spanner::V1::RequestOptions] - # Common options for this request. - # @!attribute [rw] last_statements - # @return [::Boolean] - # Optional. If set to `true`, this request marks the end of the transaction. - # After these statements execute, you must commit or abort the transaction. - # Attempts to execute any other requests against this transaction - # (including reads and queries) are rejected. - # - # Setting this option might cause some error reporting to be deferred until - # commit time (for example, validation of unique constraints). Given this, - # successful execution of statements shouldn't be assumed until a subsequent - # `Commit` call completes successfully. - class ExecuteBatchDmlRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # A single DML statement. - # @!attribute [rw] sql - # @return [::String] - # Required. The DML string. - # @!attribute [rw] params - # @return [::Google::Protobuf::Struct] - # Parameter names and values that bind to placeholders in the DML string. - # - # A parameter placeholder consists of the `@` character followed by the - # parameter name (for example, `@firstName`). Parameter names can contain - # letters, numbers, and underscores. - # - # Parameters can appear anywhere that a literal value is expected. The - # same parameter name can be used more than once, for example: - # - # `"WHERE id > @msg_id AND id < @msg_id + 100"` - # - # It's an error to execute a SQL statement with unbound parameters. - # @!attribute [rw] param_types - # @return [::Google::Protobuf::Map{::String => ::Google::Cloud::Spanner::V1::Type}] - # It isn't always possible for Cloud Spanner to infer the right SQL type - # from a JSON value. For example, values of type `BYTES` and values - # of type `STRING` both appear in - # {::Google::Cloud::Spanner::V1::ExecuteBatchDmlRequest::Statement#params params} as - # JSON strings. - # - # In these cases, `param_types` can be used to specify the exact - # SQL type for some or all of the SQL statement parameters. See the - # definition of {::Google::Cloud::Spanner::V1::Type Type} for more information - # about SQL types. - class Statement - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::Google::Cloud::Spanner::V1::Type] - class ParamTypesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - - # The response for - # {::Google::Cloud::Spanner::V1::Spanner::Client#execute_batch_dml ExecuteBatchDml}. Contains a list - # of {::Google::Cloud::Spanner::V1::ResultSet ResultSet} messages, one for each DML - # statement that has successfully executed, in the same order as the statements - # in the request. If a statement fails, the status in the response body - # identifies the cause of the failure. - # - # To check for DML statements that failed, use the following approach: - # - # 1. Check the status in the response message. The - # [google.rpc.Code][google.rpc.Code] enum - # value `OK` indicates that all statements were executed successfully. - # 2. If the status was not `OK`, check the number of result sets in the - # response. If the response contains `N` - # {::Google::Cloud::Spanner::V1::ResultSet ResultSet} messages, then statement `N+1` in - # the request failed. - # - # Example 1: - # - # * Request: 5 DML statements, all executed successfully. - # * Response: 5 {::Google::Cloud::Spanner::V1::ResultSet ResultSet} messages, with the - # status `OK`. - # - # Example 2: - # - # * Request: 5 DML statements. The third statement has a syntax error. - # * Response: 2 {::Google::Cloud::Spanner::V1::ResultSet ResultSet} messages, and a syntax - # error (`INVALID_ARGUMENT`) - # status. The number of {::Google::Cloud::Spanner::V1::ResultSet ResultSet} messages - # indicates that the third statement failed, and the fourth and fifth - # statements were not executed. - # @!attribute [rw] result_sets - # @return [::Array<::Google::Cloud::Spanner::V1::ResultSet>] - # One {::Google::Cloud::Spanner::V1::ResultSet ResultSet} for each statement in the - # request that ran successfully, in the same order as the statements in the - # request. Each {::Google::Cloud::Spanner::V1::ResultSet ResultSet} does not contain any - # rows. The {::Google::Cloud::Spanner::V1::ResultSetStats ResultSetStats} in each - # {::Google::Cloud::Spanner::V1::ResultSet ResultSet} contain the number of rows - # modified by the statement. - # - # Only the first {::Google::Cloud::Spanner::V1::ResultSet ResultSet} in the response - # contains valid {::Google::Cloud::Spanner::V1::ResultSetMetadata ResultSetMetadata}. - # @!attribute [rw] status - # @return [::Google::Rpc::Status] - # If all DML statements are executed successfully, the status is `OK`. - # Otherwise, the error status of the first failed statement. - # @!attribute [rw] precommit_token - # @return [::Google::Cloud::Spanner::V1::MultiplexedSessionPrecommitToken] - # Optional. A precommit token is included if the read-write transaction - # is on a multiplexed session. Pass the precommit token with the highest - # sequence number from this transaction attempt should be passed to the - # {::Google::Cloud::Spanner::V1::Spanner::Client#commit Commit} request for this transaction. - class ExecuteBatchDmlResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Options for a `PartitionQueryRequest` and `PartitionReadRequest`. - # @!attribute [rw] partition_size_bytes - # @return [::Integer] - # **Note:** This hint is currently ignored by `PartitionQuery` and - # `PartitionRead` requests. - # - # The desired data size for each partition generated. The default for this - # option is currently 1 GiB. This is only a hint. The actual size of each - # partition can be smaller or larger than this size request. - # @!attribute [rw] max_partitions - # @return [::Integer] - # **Note:** This hint is currently ignored by `PartitionQuery` and - # `PartitionRead` requests. - # - # The desired maximum number of partitions to return. For example, this - # might be set to the number of workers available. The default for this - # option is currently 10,000. The maximum value is currently 200,000. This - # is only a hint. The actual number of partitions returned can be smaller or - # larger than this maximum count request. - class PartitionOptions - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request for {::Google::Cloud::Spanner::V1::Spanner::Client#partition_query PartitionQuery} - # @!attribute [rw] session - # @return [::String] - # Required. The session used to create the partitions. - # @!attribute [rw] transaction - # @return [::Google::Cloud::Spanner::V1::TransactionSelector] - # Read-only snapshot transactions are supported, read and write and - # single-use transactions are not. - # @!attribute [rw] sql - # @return [::String] - # Required. The query request to generate partitions for. The request fails - # if the query isn't root partitionable. For a query to be root - # partitionable, it needs to satisfy a few conditions. For example, if the - # query execution plan contains a distributed union operator, then it must be - # the first operator in the plan. For more information about other - # conditions, see [Read data in - # parallel](https://cloud.google.com/spanner/docs/reads#read_data_in_parallel). - # - # The query request must not contain DML commands, such as `INSERT`, - # `UPDATE`, or `DELETE`. Use - # {::Google::Cloud::Spanner::V1::Spanner::Client#execute_streaming_sql `ExecuteStreamingSql`} with - # a `PartitionedDml` transaction for large, partition-friendly DML - # operations. - # @!attribute [rw] params - # @return [::Google::Protobuf::Struct] - # Optional. Parameter names and values that bind to placeholders in the SQL - # string. - # - # A parameter placeholder consists of the `@` character followed by the - # parameter name (for example, `@firstName`). Parameter names can contain - # letters, numbers, and underscores. - # - # Parameters can appear anywhere that a literal value is expected. The same - # parameter name can be used more than once, for example: - # - # `"WHERE id > @msg_id AND id < @msg_id + 100"` - # - # It's an error to execute a SQL statement with unbound parameters. - # @!attribute [rw] param_types - # @return [::Google::Protobuf::Map{::String => ::Google::Cloud::Spanner::V1::Type}] - # Optional. It isn't always possible for Cloud Spanner to infer the right SQL - # type from a JSON value. For example, values of type `BYTES` and values of - # type `STRING` both appear in - # {::Google::Cloud::Spanner::V1::PartitionQueryRequest#params params} as JSON strings. - # - # In these cases, `param_types` can be used to specify the exact - # SQL type for some or all of the SQL query parameters. See the - # definition of {::Google::Cloud::Spanner::V1::Type Type} for more information - # about SQL types. - # @!attribute [rw] partition_options - # @return [::Google::Cloud::Spanner::V1::PartitionOptions] - # Additional options that affect how many partitions are created. - class PartitionQueryRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::Google::Cloud::Spanner::V1::Type] - class ParamTypesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # The request for {::Google::Cloud::Spanner::V1::Spanner::Client#partition_read PartitionRead} - # @!attribute [rw] session - # @return [::String] - # Required. The session used to create the partitions. - # @!attribute [rw] transaction - # @return [::Google::Cloud::Spanner::V1::TransactionSelector] - # Read only snapshot transactions are supported, read/write and single use - # transactions are not. - # @!attribute [rw] table - # @return [::String] - # Required. The name of the table in the database to be read. - # @!attribute [rw] index - # @return [::String] - # If non-empty, the name of an index on - # {::Google::Cloud::Spanner::V1::PartitionReadRequest#table table}. This index is used - # instead of the table primary key when interpreting - # {::Google::Cloud::Spanner::V1::PartitionReadRequest#key_set key_set} and sorting - # result rows. See {::Google::Cloud::Spanner::V1::PartitionReadRequest#key_set key_set} - # for further information. - # @!attribute [rw] columns - # @return [::Array<::String>] - # The columns of {::Google::Cloud::Spanner::V1::PartitionReadRequest#table table} to be - # returned for each row matching this request. - # @!attribute [rw] key_set - # @return [::Google::Cloud::Spanner::V1::KeySet] - # Required. `key_set` identifies the rows to be yielded. `key_set` names the - # primary keys of the rows in - # {::Google::Cloud::Spanner::V1::PartitionReadRequest#table table} to be yielded, unless - # {::Google::Cloud::Spanner::V1::PartitionReadRequest#index index} is present. If - # {::Google::Cloud::Spanner::V1::PartitionReadRequest#index index} is present, then - # {::Google::Cloud::Spanner::V1::PartitionReadRequest#key_set key_set} instead names - # index keys in {::Google::Cloud::Spanner::V1::PartitionReadRequest#index index}. - # - # It isn't an error for the `key_set` to name rows that don't - # exist in the database. Read yields nothing for nonexistent rows. - # @!attribute [rw] partition_options - # @return [::Google::Cloud::Spanner::V1::PartitionOptions] - # Additional options that affect how many partitions are created. - class PartitionReadRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Information returned for each partition returned in a - # PartitionResponse. - # @!attribute [rw] partition_token - # @return [::String] - # This token can be passed to `Read`, `StreamingRead`, `ExecuteSql`, or - # `ExecuteStreamingSql` requests to restrict the results to those identified - # by this partition token. - class Partition - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The response for {::Google::Cloud::Spanner::V1::Spanner::Client#partition_query PartitionQuery} - # or {::Google::Cloud::Spanner::V1::Spanner::Client#partition_read PartitionRead} - # @!attribute [rw] partitions - # @return [::Array<::Google::Cloud::Spanner::V1::Partition>] - # Partitions created by this request. - # @!attribute [rw] transaction - # @return [::Google::Cloud::Spanner::V1::Transaction] - # Transaction created by this request. - class PartitionResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request for {::Google::Cloud::Spanner::V1::Spanner::Client#read Read} and - # {::Google::Cloud::Spanner::V1::Spanner::Client#streaming_read StreamingRead}. - # @!attribute [rw] session - # @return [::String] - # Required. The session in which the read should be performed. - # @!attribute [rw] transaction - # @return [::Google::Cloud::Spanner::V1::TransactionSelector] - # The transaction to use. If none is provided, the default is a - # temporary read-only transaction with strong concurrency. - # @!attribute [rw] table - # @return [::String] - # Required. The name of the table in the database to be read. - # @!attribute [rw] index - # @return [::String] - # If non-empty, the name of an index on - # {::Google::Cloud::Spanner::V1::ReadRequest#table table}. This index is used instead of - # the table primary key when interpreting - # {::Google::Cloud::Spanner::V1::ReadRequest#key_set key_set} and sorting result rows. - # See {::Google::Cloud::Spanner::V1::ReadRequest#key_set key_set} for further - # information. - # @!attribute [rw] columns - # @return [::Array<::String>] - # Required. The columns of {::Google::Cloud::Spanner::V1::ReadRequest#table table} to be - # returned for each row matching this request. - # @!attribute [rw] key_set - # @return [::Google::Cloud::Spanner::V1::KeySet] - # Required. `key_set` identifies the rows to be yielded. `key_set` names the - # primary keys of the rows in {::Google::Cloud::Spanner::V1::ReadRequest#table table} to - # be yielded, unless {::Google::Cloud::Spanner::V1::ReadRequest#index index} is present. - # If {::Google::Cloud::Spanner::V1::ReadRequest#index index} is present, then - # {::Google::Cloud::Spanner::V1::ReadRequest#key_set key_set} instead names index keys - # in {::Google::Cloud::Spanner::V1::ReadRequest#index index}. - # - # If the {::Google::Cloud::Spanner::V1::ReadRequest#partition_token partition_token} - # field is empty, rows are yielded in table primary key order (if - # {::Google::Cloud::Spanner::V1::ReadRequest#index index} is empty) or index key order - # (if {::Google::Cloud::Spanner::V1::ReadRequest#index index} is non-empty). If the - # {::Google::Cloud::Spanner::V1::ReadRequest#partition_token partition_token} field - # isn't empty, rows are yielded in an unspecified order. - # - # It isn't an error for the `key_set` to name rows that don't - # exist in the database. Read yields nothing for nonexistent rows. - # @!attribute [rw] limit - # @return [::Integer] - # If greater than zero, only the first `limit` rows are yielded. If `limit` - # is zero, the default is no limit. A limit can't be specified if - # `partition_token` is set. - # @!attribute [rw] resume_token - # @return [::String] - # If this request is resuming a previously interrupted read, - # `resume_token` should be copied from the last - # {::Google::Cloud::Spanner::V1::PartialResultSet PartialResultSet} yielded before the - # interruption. Doing this enables the new read to resume where the last read - # left off. The rest of the request parameters must exactly match the request - # that yielded this token. - # @!attribute [rw] partition_token - # @return [::String] - # If present, results are restricted to the specified partition - # previously created using `PartitionRead`. There must be an exact - # match for the values of fields common to this message and the - # PartitionReadRequest message used to create this partition_token. - # @!attribute [rw] request_options - # @return [::Google::Cloud::Spanner::V1::RequestOptions] - # Common options for this request. - # @!attribute [rw] directed_read_options - # @return [::Google::Cloud::Spanner::V1::DirectedReadOptions] - # Directed read options for this request. - # @!attribute [rw] data_boost_enabled - # @return [::Boolean] - # If this is for a partitioned read and this field is set to `true`, the - # request is executed with Spanner Data Boost independent compute resources. - # - # If the field is set to `true` but the request doesn't set - # `partition_token`, the API returns an `INVALID_ARGUMENT` error. - # @!attribute [rw] order_by - # @return [::Google::Cloud::Spanner::V1::ReadRequest::OrderBy] - # Optional. Order for the returned rows. - # - # By default, Spanner returns result rows in primary key order except for - # PartitionRead requests. For applications that don't require rows to be - # returned in primary key (`ORDER_BY_PRIMARY_KEY`) order, setting - # `ORDER_BY_NO_ORDER` option allows Spanner to optimize row retrieval, - # resulting in lower latencies in certain cases (for example, bulk point - # lookups). - # @!attribute [rw] lock_hint - # @return [::Google::Cloud::Spanner::V1::ReadRequest::LockHint] - # Optional. Lock Hint for the request, it can only be used with read-write - # transactions. - # @!attribute [rw] routing_hint - # @return [::Google::Cloud::Spanner::V1::RoutingHint] - # Optional. If present, it makes the Spanner requests location-aware. - # - # It gives the server hints that can be used to route the request - # to an appropriate server, potentially significantly decreasing latency and - # improving throughput. To achieve improved performance, most fields must be - # filled in with accurate values. - class ReadRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # An option to control the order in which rows are returned from a read. - module OrderBy - # Default value. - # - # `ORDER_BY_UNSPECIFIED` is equivalent to `ORDER_BY_PRIMARY_KEY`. - ORDER_BY_UNSPECIFIED = 0 - - # Read rows are returned in primary key order. - # - # In the event that this option is used in conjunction with the - # `partition_token` field, the API returns an `INVALID_ARGUMENT` error. - ORDER_BY_PRIMARY_KEY = 1 - - # Read rows are returned in any order. - ORDER_BY_NO_ORDER = 2 - end - - # A lock hint mechanism for reads done within a transaction. - module LockHint - # Default value. - # - # `LOCK_HINT_UNSPECIFIED` is equivalent to `LOCK_HINT_SHARED`. - LOCK_HINT_UNSPECIFIED = 0 - - # Acquire shared locks. - # - # By default when you perform a read as part of a read-write transaction, - # Spanner acquires shared read locks, which allows other reads to still - # access the data until your transaction is ready to commit. When your - # transaction is committing and writes are being applied, the transaction - # attempts to upgrade to an exclusive lock for any data you are writing. - # For more information about locks, see [Lock - # modes](https://cloud.google.com/spanner/docs/introspection/lock-statistics#explain-lock-modes). - LOCK_HINT_SHARED = 1 - - # Acquire exclusive locks. - # - # Requesting exclusive locks is beneficial if you observe high write - # contention, which means you notice that multiple transactions are - # concurrently trying to read and write to the same data, resulting in a - # large number of aborts. This problem occurs when two transactions - # initially acquire shared locks and then both try to upgrade to exclusive - # locks at the same time. In this situation both transactions are waiting - # for the other to give up their lock, resulting in a deadlocked situation. - # Spanner is able to detect this occurring and force one of the - # transactions to abort. However, this is a slow and expensive operation - # and results in lower performance. In this case it makes sense to acquire - # exclusive locks at the start of the transaction because then when - # multiple transactions try to act on the same data, they automatically get - # serialized. Each transaction waits its turn to acquire the lock and - # avoids getting into deadlock situations. - # - # Because the exclusive lock hint is just a hint, it shouldn't be - # considered equivalent to a mutex. In other words, you shouldn't use - # Spanner exclusive locks as a mutual exclusion mechanism for the execution - # of code outside of Spanner. - # - # **Note:** Request exclusive locks judiciously because they block others - # from reading that data for the entire transaction, rather than just when - # the writes are being performed. Unless you observe high write contention, - # you should use the default of shared read locks so you don't prematurely - # block other clients from reading the data that you're writing to. - LOCK_HINT_EXCLUSIVE = 2 - end - end - - # The request for - # {::Google::Cloud::Spanner::V1::Spanner::Client#begin_transaction BeginTransaction}. - # @!attribute [rw] session - # @return [::String] - # Required. The session in which the transaction runs. - # @!attribute [rw] options - # @return [::Google::Cloud::Spanner::V1::TransactionOptions] - # Required. Options for the new transaction. - # @!attribute [rw] request_options - # @return [::Google::Cloud::Spanner::V1::RequestOptions] - # Common options for this request. - # Priority is ignored for this request. Setting the priority in this - # `request_options` struct doesn't do anything. To set the priority for a - # transaction, set it on the reads and writes that are part of this - # transaction instead. - # @!attribute [rw] mutation_key - # @return [::Google::Cloud::Spanner::V1::Mutation] - # Optional. Required for read-write transactions on a multiplexed session - # that commit mutations but don't perform any reads or queries. You must - # randomly select one of the mutations from the mutation set and send it as a - # part of this request. - class BeginTransactionRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request for {::Google::Cloud::Spanner::V1::Spanner::Client#commit Commit}. - # @!attribute [rw] session - # @return [::String] - # Required. The session in which the transaction to be committed is running. - # @!attribute [rw] transaction_id - # @return [::String] - # Commit a previously-started transaction. - # - # Note: The following fields are mutually exclusive: `transaction_id`, `single_use_transaction`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] single_use_transaction - # @return [::Google::Cloud::Spanner::V1::TransactionOptions] - # Execute mutations in a temporary transaction. Note that unlike - # commit of a previously-started transaction, commit with a - # temporary transaction is non-idempotent. That is, if the - # `CommitRequest` is sent to Cloud Spanner more than once (for - # instance, due to retries in the application, or in the - # transport library), it's possible that the mutations are - # executed more than once. If this is undesirable, use - # {::Google::Cloud::Spanner::V1::Spanner::Client#begin_transaction BeginTransaction} and - # {::Google::Cloud::Spanner::V1::Spanner::Client#commit Commit} instead. - # - # Note: The following fields are mutually exclusive: `single_use_transaction`, `transaction_id`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] mutations - # @return [::Array<::Google::Cloud::Spanner::V1::Mutation>] - # The mutations to be executed when this transaction commits. All - # mutations are applied atomically, in the order they appear in - # this list. - # @!attribute [rw] return_commit_stats - # @return [::Boolean] - # If `true`, then statistics related to the transaction is included in - # the {::Google::Cloud::Spanner::V1::CommitResponse#commit_stats CommitResponse}. - # Default value is `false`. - # @!attribute [rw] max_commit_delay - # @return [::Google::Protobuf::Duration] - # Optional. The amount of latency this request is configured to incur in - # order to improve throughput. If this field isn't set, Spanner assumes - # requests are relatively latency sensitive and automatically determines an - # appropriate delay time. You can specify a commit delay value between 0 and - # 500 ms. - # @!attribute [rw] request_options - # @return [::Google::Cloud::Spanner::V1::RequestOptions] - # Common options for this request. - # @!attribute [rw] precommit_token - # @return [::Google::Cloud::Spanner::V1::MultiplexedSessionPrecommitToken] - # Optional. If the read-write transaction was executed on a multiplexed - # session, then you must include the precommit token with the highest - # sequence number received in this transaction attempt. Failing to do so - # results in a `FailedPrecondition` error. - class CommitRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request for {::Google::Cloud::Spanner::V1::Spanner::Client#rollback Rollback}. - # @!attribute [rw] session - # @return [::String] - # Required. The session in which the transaction to roll back is running. - # @!attribute [rw] transaction_id - # @return [::String] - # Required. The transaction to roll back. - class RollbackRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request for {::Google::Cloud::Spanner::V1::Spanner::Client#batch_write BatchWrite}. - # @!attribute [rw] session - # @return [::String] - # Required. The session in which the batch request is to be run. - # @!attribute [rw] request_options - # @return [::Google::Cloud::Spanner::V1::RequestOptions] - # Common options for this request. - # @!attribute [rw] mutation_groups - # @return [::Array<::Google::Cloud::Spanner::V1::BatchWriteRequest::MutationGroup>] - # Required. The groups of mutations to be applied. - # @!attribute [rw] exclude_txn_from_change_streams - # @return [::Boolean] - # Optional. If you don't set the `exclude_txn_from_change_streams` option or - # if it's set to `false`, then any change streams monitoring columns modified - # by transactions will capture the updates made within that transaction. - class BatchWriteRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # A group of mutations to be committed together. Related mutations should be - # placed in a group. For example, two mutations inserting rows with the same - # primary key prefix in both parent and child tables are related. - # @!attribute [rw] mutations - # @return [::Array<::Google::Cloud::Spanner::V1::Mutation>] - # Required. The mutations in this group. - class MutationGroup - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # The result of applying a batch of mutations. - # @!attribute [rw] indexes - # @return [::Array<::Integer>] - # The mutation groups applied in this batch. The values index into the - # `mutation_groups` field in the corresponding `BatchWriteRequest`. - # @!attribute [rw] status - # @return [::Google::Rpc::Status] - # An `OK` status indicates success. Any other status indicates a failure. - # @!attribute [rw] commit_timestamp - # @return [::Google::Protobuf::Timestamp] - # The commit timestamp of the transaction that applied this batch. - # Present if status is OK and the mutation groups were applied, absent - # otherwise. - # - # For mutation groups with conditions, a status=OK and missing - # commit_timestamp means that the mutation groups were not applied due to the - # condition not being satisfied after evaluation. - class BatchWriteResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/spanner/v1/transaction.rb b/owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/spanner/v1/transaction.rb deleted file mode 100644 index 85ccfc1d5b1e..000000000000 --- a/owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/spanner/v1/transaction.rb +++ /dev/null @@ -1,338 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module Spanner - module V1 - # Options to use for transactions. - # @!attribute [rw] read_write - # @return [::Google::Cloud::Spanner::V1::TransactionOptions::ReadWrite] - # Transaction may write. - # - # Authorization to begin a read-write transaction requires - # `spanner.databases.beginOrRollbackReadWriteTransaction` permission - # on the `session` resource. - # - # Note: The following fields are mutually exclusive: `read_write`, `partitioned_dml`, `read_only`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] partitioned_dml - # @return [::Google::Cloud::Spanner::V1::TransactionOptions::PartitionedDml] - # Partitioned DML transaction. - # - # Authorization to begin a Partitioned DML transaction requires - # `spanner.databases.beginPartitionedDmlTransaction` permission - # on the `session` resource. - # - # Note: The following fields are mutually exclusive: `partitioned_dml`, `read_write`, `read_only`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] read_only - # @return [::Google::Cloud::Spanner::V1::TransactionOptions::ReadOnly] - # Transaction does not write. - # - # Authorization to begin a read-only transaction requires - # `spanner.databases.beginReadOnlyTransaction` permission - # on the `session` resource. - # - # Note: The following fields are mutually exclusive: `read_only`, `read_write`, `partitioned_dml`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] exclude_txn_from_change_streams - # @return [::Boolean] - # When `exclude_txn_from_change_streams` is set to `true`, it prevents read - # or write transactions from being tracked in change streams. - # - # * If the DDL option `allow_txn_exclusion` is set to `true`, then the - # updates - # made within this transaction aren't recorded in the change stream. - # - # * If you don't set the DDL option `allow_txn_exclusion` or if it's - # set to `false`, then the updates made within this transaction are - # recorded in the change stream. - # - # When `exclude_txn_from_change_streams` is set to `false` or not set, - # modifications from this transaction are recorded in all change streams - # that are tracking columns modified by these transactions. - # - # The `exclude_txn_from_change_streams` option can only be specified - # for read-write or partitioned DML transactions, otherwise the API returns - # an `INVALID_ARGUMENT` error. - # @!attribute [rw] isolation_level - # @return [::Google::Cloud::Spanner::V1::TransactionOptions::IsolationLevel] - # Isolation level for the transaction. - class TransactionOptions - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Message type to initiate a read-write transaction. Currently this - # transaction type has no options. - # @!attribute [rw] read_lock_mode - # @return [::Google::Cloud::Spanner::V1::TransactionOptions::ReadWrite::ReadLockMode] - # Read lock mode for the transaction. - # @!attribute [rw] multiplexed_session_previous_transaction_id - # @return [::String] - # Optional. Clients should pass the transaction ID of the previous - # transaction attempt that was aborted if this transaction is being - # executed on a multiplexed session. - class ReadWrite - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # `ReadLockMode` is used to set the read lock mode for read-write - # transactions. - module ReadLockMode - # Default value. - # - # * If isolation level is - # {::Google::Cloud::Spanner::V1::TransactionOptions::IsolationLevel::REPEATABLE_READ REPEATABLE_READ}, - # then it is an error to specify `read_lock_mode`. Locking semantics - # default to `OPTIMISTIC`. No validation checks are done for reads, - # except to validate that the data that was served at the snapshot time - # is unchanged at commit time in the following cases: - # 1. reads done as part of queries that use `SELECT FOR UPDATE` - # 2. reads done as part of statements with a `LOCK_SCANNED_RANGES` - # hint - # 3. reads done as part of DML statements - # * At all other isolation levels, if `read_lock_mode` is the default - # value, then pessimistic read locks are used. - READ_LOCK_MODE_UNSPECIFIED = 0 - - # Pessimistic lock mode. - # - # Read locks are acquired immediately on read. - # Semantics described only applies to - # {::Google::Cloud::Spanner::V1::TransactionOptions::IsolationLevel::SERIALIZABLE SERIALIZABLE} - # isolation. - PESSIMISTIC = 1 - - # Optimistic lock mode. - # - # Locks for reads within the transaction are not acquired on read. - # Instead the locks are acquired on a commit to validate that - # read/queried data has not changed since the transaction started. - # Semantics described only applies to - # {::Google::Cloud::Spanner::V1::TransactionOptions::IsolationLevel::SERIALIZABLE SERIALIZABLE} - # isolation. - OPTIMISTIC = 2 - end - end - - # Message type to initiate a Partitioned DML transaction. - class PartitionedDml - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message type to initiate a read-only transaction. - # @!attribute [rw] strong - # @return [::Boolean] - # Read at a timestamp where all previously committed transactions - # are visible. - # - # Note: The following fields are mutually exclusive: `strong`, `min_read_timestamp`, `max_staleness`, `read_timestamp`, `exact_staleness`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] min_read_timestamp - # @return [::Google::Protobuf::Timestamp] - # Executes all reads at a timestamp >= `min_read_timestamp`. - # - # This is useful for requesting fresher data than some previous - # read, or data that is fresh enough to observe the effects of some - # previously committed transaction whose timestamp is known. - # - # Note that this option can only be used in single-use transactions. - # - # A timestamp in RFC3339 UTC \"Zulu\" format, accurate to nanoseconds. - # Example: `"2014-10-02T15:01:23.045123456Z"`. - # - # Note: The following fields are mutually exclusive: `min_read_timestamp`, `strong`, `max_staleness`, `read_timestamp`, `exact_staleness`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] max_staleness - # @return [::Google::Protobuf::Duration] - # Read data at a timestamp >= `NOW - max_staleness` - # seconds. Guarantees that all writes that have committed more - # than the specified number of seconds ago are visible. Because - # Cloud Spanner chooses the exact timestamp, this mode works even if - # the client's local clock is substantially skewed from Cloud Spanner - # commit timestamps. - # - # Useful for reading the freshest data available at a nearby - # replica, while bounding the possible staleness if the local - # replica has fallen behind. - # - # Note that this option can only be used in single-use - # transactions. - # - # Note: The following fields are mutually exclusive: `max_staleness`, `strong`, `min_read_timestamp`, `read_timestamp`, `exact_staleness`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] read_timestamp - # @return [::Google::Protobuf::Timestamp] - # Executes all reads at the given timestamp. Unlike other modes, - # reads at a specific timestamp are repeatable; the same read at - # the same timestamp always returns the same data. If the - # timestamp is in the future, the read is blocked until the - # specified timestamp, modulo the read's deadline. - # - # Useful for large scale consistent reads such as mapreduces, or - # for coordinating many reads against a consistent snapshot of the - # data. - # - # A timestamp in RFC3339 UTC \"Zulu\" format, accurate to nanoseconds. - # Example: `"2014-10-02T15:01:23.045123456Z"`. - # - # Note: The following fields are mutually exclusive: `read_timestamp`, `strong`, `min_read_timestamp`, `max_staleness`, `exact_staleness`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] exact_staleness - # @return [::Google::Protobuf::Duration] - # Executes all reads at a timestamp that is `exact_staleness` - # old. The timestamp is chosen soon after the read is started. - # - # Guarantees that all writes that have committed more than the - # specified number of seconds ago are visible. Because Cloud Spanner - # chooses the exact timestamp, this mode works even if the client's - # local clock is substantially skewed from Cloud Spanner commit - # timestamps. - # - # Useful for reading at nearby replicas without the distributed - # timestamp negotiation overhead of `max_staleness`. - # - # Note: The following fields are mutually exclusive: `exact_staleness`, `strong`, `min_read_timestamp`, `max_staleness`, `read_timestamp`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] return_read_timestamp - # @return [::Boolean] - # If true, the Cloud Spanner-selected read timestamp is included in - # the {::Google::Cloud::Spanner::V1::Transaction Transaction} message that describes - # the transaction. - class ReadOnly - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # `IsolationLevel` is used when setting the [isolation - # level](https://cloud.google.com/spanner/docs/isolation-levels) for a - # transaction. - module IsolationLevel - # Default value. - # - # If the value is not specified, the `SERIALIZABLE` isolation level is - # used. - ISOLATION_LEVEL_UNSPECIFIED = 0 - - # All transactions appear as if they executed in a serial order, even if - # some of the reads, writes, and other operations of distinct transactions - # actually occurred in parallel. Spanner assigns commit timestamps that - # reflect the order of committed transactions to implement this property. - # Spanner offers a stronger guarantee than serializability called external - # consistency. For more information, see - # [TrueTime and external - # consistency](https://cloud.google.com/spanner/docs/true-time-external-consistency#serializability). - SERIALIZABLE = 1 - - # All reads performed during the transaction observe a consistent snapshot - # of the database, and the transaction is only successfully committed in - # the absence of conflicts between its updates and any concurrent updates - # that have occurred since that snapshot. Consequently, in contrast to - # `SERIALIZABLE` transactions, only write-write conflicts are detected in - # snapshot transactions. - # - # This isolation level does not support read-only and partitioned DML - # transactions. - # - # When `REPEATABLE_READ` is specified on a read-write transaction, the - # locking semantics default to `OPTIMISTIC`. - REPEATABLE_READ = 2 - end - end - - # A transaction. - # @!attribute [rw] id - # @return [::String] - # `id` may be used to identify the transaction in subsequent - # {::Google::Cloud::Spanner::V1::Spanner::Client#read Read}, - # {::Google::Cloud::Spanner::V1::Spanner::Client#execute_sql ExecuteSql}, - # {::Google::Cloud::Spanner::V1::Spanner::Client#commit Commit}, or - # {::Google::Cloud::Spanner::V1::Spanner::Client#rollback Rollback} calls. - # - # Single-use read-only transactions do not have IDs, because - # single-use transactions do not support multiple requests. - # @!attribute [rw] read_timestamp - # @return [::Google::Protobuf::Timestamp] - # For snapshot read-only transactions, the read timestamp chosen - # for the transaction. Not returned by default: see - # {::Google::Cloud::Spanner::V1::TransactionOptions::ReadOnly#return_read_timestamp TransactionOptions.ReadOnly.return_read_timestamp}. - # - # A timestamp in RFC3339 UTC \"Zulu\" format, accurate to nanoseconds. - # Example: `"2014-10-02T15:01:23.045123456Z"`. - # @!attribute [rw] precommit_token - # @return [::Google::Cloud::Spanner::V1::MultiplexedSessionPrecommitToken] - # A precommit token is included in the response of a BeginTransaction - # request if the read-write transaction is on a multiplexed session and - # a mutation_key was specified in the - # {::Google::Cloud::Spanner::V1::BeginTransactionRequest BeginTransaction}. - # The precommit token with the highest sequence number from this transaction - # attempt should be passed to the {::Google::Cloud::Spanner::V1::Spanner::Client#commit Commit} - # request for this transaction. - class Transaction - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # This message is used to select the transaction in which a - # {::Google::Cloud::Spanner::V1::Spanner::Client#read Read} or - # {::Google::Cloud::Spanner::V1::Spanner::Client#execute_sql ExecuteSql} call runs. - # - # See {::Google::Cloud::Spanner::V1::TransactionOptions TransactionOptions} for more - # information about transactions. - # @!attribute [rw] single_use - # @return [::Google::Cloud::Spanner::V1::TransactionOptions] - # Execute the read or SQL query in a temporary transaction. - # This is the most efficient way to execute a transaction that - # consists of a single SQL query. - # - # Note: The following fields are mutually exclusive: `single_use`, `id`, `begin`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] id - # @return [::String] - # Execute the read or SQL query in a previously-started transaction. - # - # Note: The following fields are mutually exclusive: `id`, `single_use`, `begin`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] begin - # @return [::Google::Cloud::Spanner::V1::TransactionOptions] - # Begin a new transaction and execute this read or SQL query in - # it. The transaction ID of the new transaction is returned in - # {::Google::Cloud::Spanner::V1::ResultSetMetadata#transaction ResultSetMetadata.transaction}, - # which is a {::Google::Cloud::Spanner::V1::Transaction Transaction}. - # - # Note: The following fields are mutually exclusive: `begin`, `single_use`, `id`. If a field in that set is populated, all other fields in the set will automatically be cleared. - class TransactionSelector - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # When a read-write transaction is executed on a multiplexed session, - # this precommit token is sent back to the client - # as a part of the {::Google::Cloud::Spanner::V1::Transaction Transaction} message in the - # {::Google::Cloud::Spanner::V1::BeginTransactionRequest BeginTransaction} response and - # also as a part of the {::Google::Cloud::Spanner::V1::ResultSet ResultSet} and - # {::Google::Cloud::Spanner::V1::PartialResultSet PartialResultSet} responses. - # @!attribute [rw] precommit_token - # @return [::String] - # Opaque precommit token. - # @!attribute [rw] seq_num - # @return [::Integer] - # An incrementing seq number is generated on every precommit token - # that is returned. Clients should remember the precommit token with the - # highest sequence number from the current transaction attempt. - class MultiplexedSessionPrecommitToken - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/spanner/v1/type.rb b/owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/spanner/v1/type.rb deleted file mode 100644 index 693060eddddf..000000000000 --- a/owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/spanner/v1/type.rb +++ /dev/null @@ -1,222 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module Spanner - module V1 - # `Type` indicates the type of a Cloud Spanner value, as might be stored in a - # table cell or returned from an SQL query. - # @!attribute [rw] code - # @return [::Google::Cloud::Spanner::V1::TypeCode] - # Required. The {::Google::Cloud::Spanner::V1::TypeCode TypeCode} for this type. - # @!attribute [rw] array_element_type - # @return [::Google::Cloud::Spanner::V1::Type] - # If {::Google::Cloud::Spanner::V1::Type#code code} == - # {::Google::Cloud::Spanner::V1::TypeCode::ARRAY ARRAY}, then `array_element_type` is the - # type of the array elements. - # @!attribute [rw] struct_type - # @return [::Google::Cloud::Spanner::V1::StructType] - # If {::Google::Cloud::Spanner::V1::Type#code code} == - # {::Google::Cloud::Spanner::V1::TypeCode::STRUCT STRUCT}, then `struct_type` provides - # type information for the struct's fields. - # @!attribute [rw] type_annotation - # @return [::Google::Cloud::Spanner::V1::TypeAnnotationCode] - # The {::Google::Cloud::Spanner::V1::TypeAnnotationCode TypeAnnotationCode} that - # disambiguates SQL type that Spanner will use to represent values of this - # type during query processing. This is necessary for some type codes because - # a single {::Google::Cloud::Spanner::V1::TypeCode TypeCode} can be mapped to different - # SQL types depending on the SQL dialect. - # {::Google::Cloud::Spanner::V1::Type#type_annotation type_annotation} typically is not - # needed to process the content of a value (it doesn't affect serialization) - # and clients can ignore it on the read path. - # @!attribute [rw] proto_type_fqn - # @return [::String] - # If {::Google::Cloud::Spanner::V1::Type#code code} == - # {::Google::Cloud::Spanner::V1::TypeCode::PROTO PROTO} or - # {::Google::Cloud::Spanner::V1::Type#code code} == - # {::Google::Cloud::Spanner::V1::TypeCode::ENUM ENUM}, then `proto_type_fqn` is the fully - # qualified name of the proto type representing the proto/enum definition. - class Type - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # `StructType` defines the fields of a - # {::Google::Cloud::Spanner::V1::TypeCode::STRUCT STRUCT} type. - # @!attribute [rw] fields - # @return [::Array<::Google::Cloud::Spanner::V1::StructType::Field>] - # The list of fields that make up this struct. Order is - # significant, because values of this struct type are represented as - # lists, where the order of field values matches the order of - # fields in the {::Google::Cloud::Spanner::V1::StructType StructType}. In turn, the - # order of fields matches the order of columns in a read request, or the - # order of fields in the `SELECT` clause of a query. - class StructType - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Message representing a single field of a struct. - # @!attribute [rw] name - # @return [::String] - # The name of the field. For reads, this is the column name. For - # SQL queries, it is the column alias (e.g., `"Word"` in the - # query `"SELECT 'hello' AS Word"`), or the column name (e.g., - # `"ColName"` in the query `"SELECT ColName FROM Table"`). Some - # columns might have an empty name (e.g., `"SELECT - # UPPER(ColName)"`). Note that a query result can contain - # multiple fields with the same name. - # @!attribute [rw] type - # @return [::Google::Cloud::Spanner::V1::Type] - # The type of the field. - class Field - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # `TypeCode` is used as part of {::Google::Cloud::Spanner::V1::Type Type} to - # indicate the type of a Cloud Spanner value. - # - # Each legal value of a type can be encoded to or decoded from a JSON - # value, using the encodings described below. All Cloud Spanner values can - # be `null`, regardless of type; `null`s are always encoded as a JSON - # `null`. - module TypeCode - # Not specified. - TYPE_CODE_UNSPECIFIED = 0 - - # Encoded as JSON `true` or `false`. - BOOL = 1 - - # Encoded as `string`, in decimal format. - INT64 = 2 - - # Encoded as `number`, or the strings `"NaN"`, `"Infinity"`, or - # `"-Infinity"`. - FLOAT64 = 3 - - # Encoded as `number`, or the strings `"NaN"`, `"Infinity"`, or - # `"-Infinity"`. - FLOAT32 = 15 - - # Encoded as `string` in RFC 3339 timestamp format. The time zone - # must be present, and must be `"Z"`. - # - # If the schema has the column option - # `allow_commit_timestamp=true`, the placeholder string - # `"spanner.commit_timestamp()"` can be used to instruct the system - # to insert the commit timestamp associated with the transaction - # commit. - TIMESTAMP = 4 - - # Encoded as `string` in RFC 3339 date format. - DATE = 5 - - # Encoded as `string`. - STRING = 6 - - # Encoded as a base64-encoded `string`, as described in RFC 4648, - # section 4. - BYTES = 7 - - # Encoded as `list`, where the list elements are represented - # according to - # {::Google::Cloud::Spanner::V1::Type#array_element_type array_element_type}. - ARRAY = 8 - - # Encoded as `list`, where list element `i` is represented according - # to [struct_type.fields[i]][google.spanner.v1.StructType.fields]. - STRUCT = 9 - - # Encoded as `string`, in decimal format or scientific notation format. - # Decimal format: - # `[+-]Digits[.[Digits]]` or - # `[+-][Digits].Digits` - # - # Scientific notation: - # `[+-]Digits[.[Digits]][ExponentIndicator[+-]Digits]` or - # `[+-][Digits].Digits[ExponentIndicator[+-]Digits]` - # (ExponentIndicator is `"e"` or `"E"`) - NUMERIC = 10 - - # Encoded as a JSON-formatted `string` as described in RFC 7159. The - # following rules are applied when parsing JSON input: - # - # - Whitespace characters are not preserved. - # - If a JSON object has duplicate keys, only the first key is preserved. - # - Members of a JSON object are not guaranteed to have their order - # preserved. - # - JSON array elements will have their order preserved. - JSON = 11 - - # Encoded as a base64-encoded `string`, as described in RFC 4648, - # section 4. - PROTO = 13 - - # Encoded as `string`, in decimal format. - ENUM = 14 - - # Encoded as `string`, in `ISO8601` duration format - - # `P[n]Y[n]M[n]DT[n]H[n]M[n[.fraction]]S` - # where `n` is an integer. - # For example, `P1Y2M3DT4H5M6.5S` represents time duration of 1 year, 2 - # months, 3 days, 4 hours, 5 minutes, and 6.5 seconds. - INTERVAL = 16 - - # Encoded as `string`, in lower-case hexa-decimal format, as described - # in RFC 9562, section 4. - UUID = 17 - end - - # `TypeAnnotationCode` is used as a part of {::Google::Cloud::Spanner::V1::Type Type} to - # disambiguate SQL types that should be used for a given Cloud Spanner value. - # Disambiguation is needed because the same Cloud Spanner type can be mapped to - # different SQL types depending on SQL dialect. TypeAnnotationCode doesn't - # affect the way value is serialized. - module TypeAnnotationCode - # Not specified. - TYPE_ANNOTATION_CODE_UNSPECIFIED = 0 - - # PostgreSQL compatible NUMERIC type. This annotation needs to be applied to - # {::Google::Cloud::Spanner::V1::Type Type} instances having - # {::Google::Cloud::Spanner::V1::TypeCode::NUMERIC NUMERIC} type code to specify that - # values of this type should be treated as PostgreSQL NUMERIC values. - # Currently this annotation is always needed for - # {::Google::Cloud::Spanner::V1::TypeCode::NUMERIC NUMERIC} when a client interacts with - # PostgreSQL-enabled Spanner databases. - PG_NUMERIC = 2 - - # PostgreSQL compatible JSONB type. This annotation needs to be applied to - # {::Google::Cloud::Spanner::V1::Type Type} instances having - # {::Google::Cloud::Spanner::V1::TypeCode::JSON JSON} type code to specify that values of - # this type should be treated as PostgreSQL JSONB values. Currently this - # annotation is always needed for {::Google::Cloud::Spanner::V1::TypeCode::JSON JSON} - # when a client interacts with PostgreSQL-enabled Spanner databases. - PG_JSONB = 3 - - # PostgreSQL compatible OID type. This annotation can be used by a client - # interacting with PostgreSQL-enabled Spanner database to specify that a - # value should be treated using the semantics of the OID type. - PG_OID = 4 - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-spanner-v1/snippets/Gemfile b/owl-bot-staging/google-cloud-spanner-v1/snippets/Gemfile deleted file mode 100644 index 77b0e1097706..000000000000 --- a/owl-bot-staging/google-cloud-spanner-v1/snippets/Gemfile +++ /dev/null @@ -1,32 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -source "https://rubygems.org" - -if ENV["GOOGLE_CLOUD_SAMPLES_TEST"] == "master" - gem "google-cloud-spanner-v1", path: "../" -else - gem "google-cloud-spanner-v1" -end - -group :test do - gem "google-style", "~> 1.26.1" - gem "minitest", "~> 5.16" - gem "minitest-focus", "~> 1.1" - gem "minitest-hooks", "~> 1.5" -end diff --git a/owl-bot-staging/google-cloud-spanner-v1/snippets/snippet_metadata_google.spanner.v1.json b/owl-bot-staging/google-cloud-spanner-v1/snippets/snippet_metadata_google.spanner.v1.json deleted file mode 100644 index 7aed2197752d..000000000000 --- a/owl-bot-staging/google-cloud-spanner-v1/snippets/snippet_metadata_google.spanner.v1.json +++ /dev/null @@ -1,655 +0,0 @@ -{ - "client_library": { - "name": "google-cloud-spanner-v1", - "version": "", - "language": "RUBY", - "apis": [ - { - "id": "google.spanner.v1", - "version": "v1" - } - ] - }, - "snippets": [ - { - "region_tag": "spanner_v1_generated_Spanner_CreateSession_sync", - "title": "Snippet for the create_session call in the Spanner service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Spanner::V1::Spanner::Client#create_session.", - "file": "spanner/create_session.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_session", - "full_name": "::Google::Cloud::Spanner::V1::Spanner::Client#create_session", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Spanner::V1::CreateSessionRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Spanner::V1::Session", - "client": { - "short_name": "Spanner::Client", - "full_name": "::Google::Cloud::Spanner::V1::Spanner::Client" - }, - "method": { - "short_name": "CreateSession", - "full_name": "google.spanner.v1.Spanner.CreateSession", - "service": { - "short_name": "Spanner", - "full_name": "google.spanner.v1.Spanner" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "spanner_v1_generated_Spanner_BatchCreateSessions_sync", - "title": "Snippet for the batch_create_sessions call in the Spanner service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Spanner::V1::Spanner::Client#batch_create_sessions.", - "file": "spanner/batch_create_sessions.rb", - "language": "RUBY", - "client_method": { - "short_name": "batch_create_sessions", - "full_name": "::Google::Cloud::Spanner::V1::Spanner::Client#batch_create_sessions", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Spanner::V1::BatchCreateSessionsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Spanner::V1::BatchCreateSessionsResponse", - "client": { - "short_name": "Spanner::Client", - "full_name": "::Google::Cloud::Spanner::V1::Spanner::Client" - }, - "method": { - "short_name": "BatchCreateSessions", - "full_name": "google.spanner.v1.Spanner.BatchCreateSessions", - "service": { - "short_name": "Spanner", - "full_name": "google.spanner.v1.Spanner" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "spanner_v1_generated_Spanner_GetSession_sync", - "title": "Snippet for the get_session call in the Spanner service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Spanner::V1::Spanner::Client#get_session.", - "file": "spanner/get_session.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_session", - "full_name": "::Google::Cloud::Spanner::V1::Spanner::Client#get_session", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Spanner::V1::GetSessionRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Spanner::V1::Session", - "client": { - "short_name": "Spanner::Client", - "full_name": "::Google::Cloud::Spanner::V1::Spanner::Client" - }, - "method": { - "short_name": "GetSession", - "full_name": "google.spanner.v1.Spanner.GetSession", - "service": { - "short_name": "Spanner", - "full_name": "google.spanner.v1.Spanner" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "spanner_v1_generated_Spanner_ListSessions_sync", - "title": "Snippet for the list_sessions call in the Spanner service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Spanner::V1::Spanner::Client#list_sessions.", - "file": "spanner/list_sessions.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_sessions", - "full_name": "::Google::Cloud::Spanner::V1::Spanner::Client#list_sessions", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Spanner::V1::ListSessionsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Spanner::V1::ListSessionsResponse", - "client": { - "short_name": "Spanner::Client", - "full_name": "::Google::Cloud::Spanner::V1::Spanner::Client" - }, - "method": { - "short_name": "ListSessions", - "full_name": "google.spanner.v1.Spanner.ListSessions", - "service": { - "short_name": "Spanner", - "full_name": "google.spanner.v1.Spanner" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "spanner_v1_generated_Spanner_DeleteSession_sync", - "title": "Snippet for the delete_session call in the Spanner service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Spanner::V1::Spanner::Client#delete_session.", - "file": "spanner/delete_session.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_session", - "full_name": "::Google::Cloud::Spanner::V1::Spanner::Client#delete_session", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Spanner::V1::DeleteSessionRequest", - "name": "request" - } - ], - "result_type": "::Google::Protobuf::Empty", - "client": { - "short_name": "Spanner::Client", - "full_name": "::Google::Cloud::Spanner::V1::Spanner::Client" - }, - "method": { - "short_name": "DeleteSession", - "full_name": "google.spanner.v1.Spanner.DeleteSession", - "service": { - "short_name": "Spanner", - "full_name": "google.spanner.v1.Spanner" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "spanner_v1_generated_Spanner_ExecuteSql_sync", - "title": "Snippet for the execute_sql call in the Spanner service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Spanner::V1::Spanner::Client#execute_sql.", - "file": "spanner/execute_sql.rb", - "language": "RUBY", - "client_method": { - "short_name": "execute_sql", - "full_name": "::Google::Cloud::Spanner::V1::Spanner::Client#execute_sql", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Spanner::V1::ExecuteSqlRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Spanner::V1::ResultSet", - "client": { - "short_name": "Spanner::Client", - "full_name": "::Google::Cloud::Spanner::V1::Spanner::Client" - }, - "method": { - "short_name": "ExecuteSql", - "full_name": "google.spanner.v1.Spanner.ExecuteSql", - "service": { - "short_name": "Spanner", - "full_name": "google.spanner.v1.Spanner" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "spanner_v1_generated_Spanner_ExecuteStreamingSql_sync", - "title": "Snippet for the execute_streaming_sql call in the Spanner service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Spanner::V1::Spanner::Client#execute_streaming_sql.", - "file": "spanner/execute_streaming_sql.rb", - "language": "RUBY", - "client_method": { - "short_name": "execute_streaming_sql", - "full_name": "::Google::Cloud::Spanner::V1::Spanner::Client#execute_streaming_sql", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Spanner::V1::ExecuteSqlRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Spanner::V1::PartialResultSet", - "client": { - "short_name": "Spanner::Client", - "full_name": "::Google::Cloud::Spanner::V1::Spanner::Client" - }, - "method": { - "short_name": "ExecuteStreamingSql", - "full_name": "google.spanner.v1.Spanner.ExecuteStreamingSql", - "service": { - "short_name": "Spanner", - "full_name": "google.spanner.v1.Spanner" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 49, - "type": "FULL" - } - ] - }, - { - "region_tag": "spanner_v1_generated_Spanner_ExecuteBatchDml_sync", - "title": "Snippet for the execute_batch_dml call in the Spanner service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Spanner::V1::Spanner::Client#execute_batch_dml.", - "file": "spanner/execute_batch_dml.rb", - "language": "RUBY", - "client_method": { - "short_name": "execute_batch_dml", - "full_name": "::Google::Cloud::Spanner::V1::Spanner::Client#execute_batch_dml", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Spanner::V1::ExecuteBatchDmlRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Spanner::V1::ExecuteBatchDmlResponse", - "client": { - "short_name": "Spanner::Client", - "full_name": "::Google::Cloud::Spanner::V1::Spanner::Client" - }, - "method": { - "short_name": "ExecuteBatchDml", - "full_name": "google.spanner.v1.Spanner.ExecuteBatchDml", - "service": { - "short_name": "Spanner", - "full_name": "google.spanner.v1.Spanner" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "spanner_v1_generated_Spanner_Read_sync", - "title": "Snippet for the read call in the Spanner service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Spanner::V1::Spanner::Client#read.", - "file": "spanner/read.rb", - "language": "RUBY", - "client_method": { - "short_name": "read", - "full_name": "::Google::Cloud::Spanner::V1::Spanner::Client#read", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Spanner::V1::ReadRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Spanner::V1::ResultSet", - "client": { - "short_name": "Spanner::Client", - "full_name": "::Google::Cloud::Spanner::V1::Spanner::Client" - }, - "method": { - "short_name": "Read", - "full_name": "google.spanner.v1.Spanner.Read", - "service": { - "short_name": "Spanner", - "full_name": "google.spanner.v1.Spanner" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "spanner_v1_generated_Spanner_StreamingRead_sync", - "title": "Snippet for the streaming_read call in the Spanner service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Spanner::V1::Spanner::Client#streaming_read.", - "file": "spanner/streaming_read.rb", - "language": "RUBY", - "client_method": { - "short_name": "streaming_read", - "full_name": "::Google::Cloud::Spanner::V1::Spanner::Client#streaming_read", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Spanner::V1::ReadRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Spanner::V1::PartialResultSet", - "client": { - "short_name": "Spanner::Client", - "full_name": "::Google::Cloud::Spanner::V1::Spanner::Client" - }, - "method": { - "short_name": "StreamingRead", - "full_name": "google.spanner.v1.Spanner.StreamingRead", - "service": { - "short_name": "Spanner", - "full_name": "google.spanner.v1.Spanner" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 49, - "type": "FULL" - } - ] - }, - { - "region_tag": "spanner_v1_generated_Spanner_BeginTransaction_sync", - "title": "Snippet for the begin_transaction call in the Spanner service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Spanner::V1::Spanner::Client#begin_transaction.", - "file": "spanner/begin_transaction.rb", - "language": "RUBY", - "client_method": { - "short_name": "begin_transaction", - "full_name": "::Google::Cloud::Spanner::V1::Spanner::Client#begin_transaction", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Spanner::V1::BeginTransactionRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Spanner::V1::Transaction", - "client": { - "short_name": "Spanner::Client", - "full_name": "::Google::Cloud::Spanner::V1::Spanner::Client" - }, - "method": { - "short_name": "BeginTransaction", - "full_name": "google.spanner.v1.Spanner.BeginTransaction", - "service": { - "short_name": "Spanner", - "full_name": "google.spanner.v1.Spanner" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "spanner_v1_generated_Spanner_Commit_sync", - "title": "Snippet for the commit call in the Spanner service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Spanner::V1::Spanner::Client#commit.", - "file": "spanner/commit.rb", - "language": "RUBY", - "client_method": { - "short_name": "commit", - "full_name": "::Google::Cloud::Spanner::V1::Spanner::Client#commit", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Spanner::V1::CommitRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Spanner::V1::CommitResponse", - "client": { - "short_name": "Spanner::Client", - "full_name": "::Google::Cloud::Spanner::V1::Spanner::Client" - }, - "method": { - "short_name": "Commit", - "full_name": "google.spanner.v1.Spanner.Commit", - "service": { - "short_name": "Spanner", - "full_name": "google.spanner.v1.Spanner" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "spanner_v1_generated_Spanner_Rollback_sync", - "title": "Snippet for the rollback call in the Spanner service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Spanner::V1::Spanner::Client#rollback.", - "file": "spanner/rollback.rb", - "language": "RUBY", - "client_method": { - "short_name": "rollback", - "full_name": "::Google::Cloud::Spanner::V1::Spanner::Client#rollback", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Spanner::V1::RollbackRequest", - "name": "request" - } - ], - "result_type": "::Google::Protobuf::Empty", - "client": { - "short_name": "Spanner::Client", - "full_name": "::Google::Cloud::Spanner::V1::Spanner::Client" - }, - "method": { - "short_name": "Rollback", - "full_name": "google.spanner.v1.Spanner.Rollback", - "service": { - "short_name": "Spanner", - "full_name": "google.spanner.v1.Spanner" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "spanner_v1_generated_Spanner_PartitionQuery_sync", - "title": "Snippet for the partition_query call in the Spanner service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Spanner::V1::Spanner::Client#partition_query.", - "file": "spanner/partition_query.rb", - "language": "RUBY", - "client_method": { - "short_name": "partition_query", - "full_name": "::Google::Cloud::Spanner::V1::Spanner::Client#partition_query", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Spanner::V1::PartitionQueryRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Spanner::V1::PartitionResponse", - "client": { - "short_name": "Spanner::Client", - "full_name": "::Google::Cloud::Spanner::V1::Spanner::Client" - }, - "method": { - "short_name": "PartitionQuery", - "full_name": "google.spanner.v1.Spanner.PartitionQuery", - "service": { - "short_name": "Spanner", - "full_name": "google.spanner.v1.Spanner" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "spanner_v1_generated_Spanner_PartitionRead_sync", - "title": "Snippet for the partition_read call in the Spanner service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Spanner::V1::Spanner::Client#partition_read.", - "file": "spanner/partition_read.rb", - "language": "RUBY", - "client_method": { - "short_name": "partition_read", - "full_name": "::Google::Cloud::Spanner::V1::Spanner::Client#partition_read", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Spanner::V1::PartitionReadRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Spanner::V1::PartitionResponse", - "client": { - "short_name": "Spanner::Client", - "full_name": "::Google::Cloud::Spanner::V1::Spanner::Client" - }, - "method": { - "short_name": "PartitionRead", - "full_name": "google.spanner.v1.Spanner.PartitionRead", - "service": { - "short_name": "Spanner", - "full_name": "google.spanner.v1.Spanner" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "spanner_v1_generated_Spanner_BatchWrite_sync", - "title": "Snippet for the batch_write call in the Spanner service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Spanner::V1::Spanner::Client#batch_write.", - "file": "spanner/batch_write.rb", - "language": "RUBY", - "client_method": { - "short_name": "batch_write", - "full_name": "::Google::Cloud::Spanner::V1::Spanner::Client#batch_write", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Spanner::V1::BatchWriteRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Spanner::V1::BatchWriteResponse", - "client": { - "short_name": "Spanner::Client", - "full_name": "::Google::Cloud::Spanner::V1::Spanner::Client" - }, - "method": { - "short_name": "BatchWrite", - "full_name": "google.spanner.v1.Spanner.BatchWrite", - "service": { - "short_name": "Spanner", - "full_name": "google.spanner.v1.Spanner" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 49, - "type": "FULL" - } - ] - } - ] -} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/batch_create_sessions.rb b/owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/batch_create_sessions.rb deleted file mode 100644 index 0586ea617219..000000000000 --- a/owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/batch_create_sessions.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START spanner_v1_generated_Spanner_BatchCreateSessions_sync] -require "google/cloud/spanner/v1" - -## -# Snippet for the batch_create_sessions call in the Spanner service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Spanner::V1::Spanner::Client#batch_create_sessions. -# -def batch_create_sessions - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Spanner::V1::Spanner::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Spanner::V1::BatchCreateSessionsRequest.new - - # Call the batch_create_sessions method. - result = client.batch_create_sessions request - - # The returned object is of type Google::Cloud::Spanner::V1::BatchCreateSessionsResponse. - p result -end -# [END spanner_v1_generated_Spanner_BatchCreateSessions_sync] diff --git a/owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/batch_write.rb b/owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/batch_write.rb deleted file mode 100644 index b95914412706..000000000000 --- a/owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/batch_write.rb +++ /dev/null @@ -1,50 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START spanner_v1_generated_Spanner_BatchWrite_sync] -require "google/cloud/spanner/v1" - -## -# Snippet for the batch_write call in the Spanner service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Spanner::V1::Spanner::Client#batch_write. -# -def batch_write - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Spanner::V1::Spanner::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Spanner::V1::BatchWriteRequest.new - - # Call the batch_write method to start streaming. - output = client.batch_write request - - # The returned object is a streamed enumerable yielding elements of type - # ::Google::Cloud::Spanner::V1::BatchWriteResponse - output.each do |current_response| - p current_response - end -end -# [END spanner_v1_generated_Spanner_BatchWrite_sync] diff --git a/owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/begin_transaction.rb b/owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/begin_transaction.rb deleted file mode 100644 index 491b1932c86d..000000000000 --- a/owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/begin_transaction.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START spanner_v1_generated_Spanner_BeginTransaction_sync] -require "google/cloud/spanner/v1" - -## -# Snippet for the begin_transaction call in the Spanner service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Spanner::V1::Spanner::Client#begin_transaction. -# -def begin_transaction - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Spanner::V1::Spanner::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Spanner::V1::BeginTransactionRequest.new - - # Call the begin_transaction method. - result = client.begin_transaction request - - # The returned object is of type Google::Cloud::Spanner::V1::Transaction. - p result -end -# [END spanner_v1_generated_Spanner_BeginTransaction_sync] diff --git a/owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/commit.rb b/owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/commit.rb deleted file mode 100644 index bdef590c536b..000000000000 --- a/owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/commit.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START spanner_v1_generated_Spanner_Commit_sync] -require "google/cloud/spanner/v1" - -## -# Snippet for the commit call in the Spanner service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Spanner::V1::Spanner::Client#commit. -# -def commit - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Spanner::V1::Spanner::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Spanner::V1::CommitRequest.new - - # Call the commit method. - result = client.commit request - - # The returned object is of type Google::Cloud::Spanner::V1::CommitResponse. - p result -end -# [END spanner_v1_generated_Spanner_Commit_sync] diff --git a/owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/create_session.rb b/owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/create_session.rb deleted file mode 100644 index 2978e20b708d..000000000000 --- a/owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/create_session.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START spanner_v1_generated_Spanner_CreateSession_sync] -require "google/cloud/spanner/v1" - -## -# Snippet for the create_session call in the Spanner service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Spanner::V1::Spanner::Client#create_session. -# -def create_session - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Spanner::V1::Spanner::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Spanner::V1::CreateSessionRequest.new - - # Call the create_session method. - result = client.create_session request - - # The returned object is of type Google::Cloud::Spanner::V1::Session. - p result -end -# [END spanner_v1_generated_Spanner_CreateSession_sync] diff --git a/owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/delete_session.rb b/owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/delete_session.rb deleted file mode 100644 index 0fe6714eefc1..000000000000 --- a/owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/delete_session.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START spanner_v1_generated_Spanner_DeleteSession_sync] -require "google/cloud/spanner/v1" - -## -# Snippet for the delete_session call in the Spanner service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Spanner::V1::Spanner::Client#delete_session. -# -def delete_session - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Spanner::V1::Spanner::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Spanner::V1::DeleteSessionRequest.new - - # Call the delete_session method. - result = client.delete_session request - - # The returned object is of type Google::Protobuf::Empty. - p result -end -# [END spanner_v1_generated_Spanner_DeleteSession_sync] diff --git a/owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/execute_batch_dml.rb b/owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/execute_batch_dml.rb deleted file mode 100644 index 0dfff556a81d..000000000000 --- a/owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/execute_batch_dml.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START spanner_v1_generated_Spanner_ExecuteBatchDml_sync] -require "google/cloud/spanner/v1" - -## -# Snippet for the execute_batch_dml call in the Spanner service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Spanner::V1::Spanner::Client#execute_batch_dml. -# -def execute_batch_dml - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Spanner::V1::Spanner::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Spanner::V1::ExecuteBatchDmlRequest.new - - # Call the execute_batch_dml method. - result = client.execute_batch_dml request - - # The returned object is of type Google::Cloud::Spanner::V1::ExecuteBatchDmlResponse. - p result -end -# [END spanner_v1_generated_Spanner_ExecuteBatchDml_sync] diff --git a/owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/execute_sql.rb b/owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/execute_sql.rb deleted file mode 100644 index 25fda1b8ff3f..000000000000 --- a/owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/execute_sql.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START spanner_v1_generated_Spanner_ExecuteSql_sync] -require "google/cloud/spanner/v1" - -## -# Snippet for the execute_sql call in the Spanner service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Spanner::V1::Spanner::Client#execute_sql. -# -def execute_sql - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Spanner::V1::Spanner::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Spanner::V1::ExecuteSqlRequest.new - - # Call the execute_sql method. - result = client.execute_sql request - - # The returned object is of type Google::Cloud::Spanner::V1::ResultSet. - p result -end -# [END spanner_v1_generated_Spanner_ExecuteSql_sync] diff --git a/owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/execute_streaming_sql.rb b/owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/execute_streaming_sql.rb deleted file mode 100644 index e96077064cca..000000000000 --- a/owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/execute_streaming_sql.rb +++ /dev/null @@ -1,50 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START spanner_v1_generated_Spanner_ExecuteStreamingSql_sync] -require "google/cloud/spanner/v1" - -## -# Snippet for the execute_streaming_sql call in the Spanner service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Spanner::V1::Spanner::Client#execute_streaming_sql. -# -def execute_streaming_sql - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Spanner::V1::Spanner::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Spanner::V1::ExecuteSqlRequest.new - - # Call the execute_streaming_sql method to start streaming. - output = client.execute_streaming_sql request - - # The returned object is a streamed enumerable yielding elements of type - # ::Google::Cloud::Spanner::V1::PartialResultSet - output.each do |current_response| - p current_response - end -end -# [END spanner_v1_generated_Spanner_ExecuteStreamingSql_sync] diff --git a/owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/get_session.rb b/owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/get_session.rb deleted file mode 100644 index 57e3f09069af..000000000000 --- a/owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/get_session.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START spanner_v1_generated_Spanner_GetSession_sync] -require "google/cloud/spanner/v1" - -## -# Snippet for the get_session call in the Spanner service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Spanner::V1::Spanner::Client#get_session. -# -def get_session - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Spanner::V1::Spanner::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Spanner::V1::GetSessionRequest.new - - # Call the get_session method. - result = client.get_session request - - # The returned object is of type Google::Cloud::Spanner::V1::Session. - p result -end -# [END spanner_v1_generated_Spanner_GetSession_sync] diff --git a/owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/list_sessions.rb b/owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/list_sessions.rb deleted file mode 100644 index ad2e46e5db36..000000000000 --- a/owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/list_sessions.rb +++ /dev/null @@ -1,51 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START spanner_v1_generated_Spanner_ListSessions_sync] -require "google/cloud/spanner/v1" - -## -# Snippet for the list_sessions call in the Spanner service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Spanner::V1::Spanner::Client#list_sessions. -# -def list_sessions - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Spanner::V1::Spanner::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Spanner::V1::ListSessionsRequest.new - - # Call the list_sessions method. - result = client.list_sessions request - - # The returned object is of type Gapic::PagedEnumerable. You can iterate - # over elements, and API calls will be issued to fetch pages as needed. - result.each do |item| - # Each element is of type ::Google::Cloud::Spanner::V1::Session. - p item - end -end -# [END spanner_v1_generated_Spanner_ListSessions_sync] diff --git a/owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/partition_query.rb b/owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/partition_query.rb deleted file mode 100644 index fe7511916bee..000000000000 --- a/owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/partition_query.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START spanner_v1_generated_Spanner_PartitionQuery_sync] -require "google/cloud/spanner/v1" - -## -# Snippet for the partition_query call in the Spanner service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Spanner::V1::Spanner::Client#partition_query. -# -def partition_query - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Spanner::V1::Spanner::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Spanner::V1::PartitionQueryRequest.new - - # Call the partition_query method. - result = client.partition_query request - - # The returned object is of type Google::Cloud::Spanner::V1::PartitionResponse. - p result -end -# [END spanner_v1_generated_Spanner_PartitionQuery_sync] diff --git a/owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/partition_read.rb b/owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/partition_read.rb deleted file mode 100644 index 548247d9a655..000000000000 --- a/owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/partition_read.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START spanner_v1_generated_Spanner_PartitionRead_sync] -require "google/cloud/spanner/v1" - -## -# Snippet for the partition_read call in the Spanner service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Spanner::V1::Spanner::Client#partition_read. -# -def partition_read - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Spanner::V1::Spanner::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Spanner::V1::PartitionReadRequest.new - - # Call the partition_read method. - result = client.partition_read request - - # The returned object is of type Google::Cloud::Spanner::V1::PartitionResponse. - p result -end -# [END spanner_v1_generated_Spanner_PartitionRead_sync] diff --git a/owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/read.rb b/owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/read.rb deleted file mode 100644 index e0ae8f6a89bd..000000000000 --- a/owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/read.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START spanner_v1_generated_Spanner_Read_sync] -require "google/cloud/spanner/v1" - -## -# Snippet for the read call in the Spanner service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Spanner::V1::Spanner::Client#read. -# -def read - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Spanner::V1::Spanner::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Spanner::V1::ReadRequest.new - - # Call the read method. - result = client.read request - - # The returned object is of type Google::Cloud::Spanner::V1::ResultSet. - p result -end -# [END spanner_v1_generated_Spanner_Read_sync] diff --git a/owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/rollback.rb b/owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/rollback.rb deleted file mode 100644 index aa46e63322b9..000000000000 --- a/owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/rollback.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START spanner_v1_generated_Spanner_Rollback_sync] -require "google/cloud/spanner/v1" - -## -# Snippet for the rollback call in the Spanner service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Spanner::V1::Spanner::Client#rollback. -# -def rollback - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Spanner::V1::Spanner::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Spanner::V1::RollbackRequest.new - - # Call the rollback method. - result = client.rollback request - - # The returned object is of type Google::Protobuf::Empty. - p result -end -# [END spanner_v1_generated_Spanner_Rollback_sync] diff --git a/owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/streaming_read.rb b/owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/streaming_read.rb deleted file mode 100644 index 858dafcebeb7..000000000000 --- a/owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/streaming_read.rb +++ /dev/null @@ -1,50 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START spanner_v1_generated_Spanner_StreamingRead_sync] -require "google/cloud/spanner/v1" - -## -# Snippet for the streaming_read call in the Spanner service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Spanner::V1::Spanner::Client#streaming_read. -# -def streaming_read - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Spanner::V1::Spanner::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Spanner::V1::ReadRequest.new - - # Call the streaming_read method to start streaming. - output = client.streaming_read request - - # The returned object is a streamed enumerable yielding elements of type - # ::Google::Cloud::Spanner::V1::PartialResultSet - output.each do |current_response| - p current_response - end -end -# [END spanner_v1_generated_Spanner_StreamingRead_sync] diff --git a/owl-bot-staging/google-cloud-spanner-v1/test/google/cloud/spanner/v1/spanner_paths_test.rb b/owl-bot-staging/google-cloud-spanner-v1/test/google/cloud/spanner/v1/spanner_paths_test.rb deleted file mode 100644 index f1898edbaf00..000000000000 --- a/owl-bot-staging/google-cloud-spanner-v1/test/google/cloud/spanner/v1/spanner_paths_test.rb +++ /dev/null @@ -1,67 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/spanner/v1/spanner" - -class ::Google::Cloud::Spanner::V1::Spanner::ClientPathsTest < Minitest::Test - class DummyStub - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_database_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Spanner::V1::Spanner::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.database_path project: "value0", instance: "value1", database: "value2" - assert_equal "projects/value0/instances/value1/databases/value2", path - end - end - - def test_session_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Spanner::V1::Spanner::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.session_path project: "value0", instance: "value1", database: "value2", session: "value3" - assert_equal "projects/value0/instances/value1/databases/value2/sessions/value3", path - end - end -end diff --git a/owl-bot-staging/google-cloud-spanner-v1/test/google/cloud/spanner/v1/spanner_test.rb b/owl-bot-staging/google-cloud-spanner-v1/test/google/cloud/spanner/v1/spanner_test.rb deleted file mode 100644 index 262fd4461e4f..000000000000 --- a/owl-bot-staging/google-cloud-spanner-v1/test/google/cloud/spanner/v1/spanner_test.rb +++ /dev/null @@ -1,1265 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/spanner/v1/spanner_pb" -require "google/cloud/spanner/v1/spanner" - -class ::Google::Cloud::Spanner::V1::Spanner::ClientTest < Minitest::Test - class ClientStub - attr_accessor :call_rpc_count, :requests - - def initialize response, operation, &block - @response = response - @operation = operation - @block = block - @call_rpc_count = 0 - @requests = [] - end - - def call_rpc *args, **kwargs - @call_rpc_count += 1 - - @requests << @block&.call(*args, **kwargs) - - catch :response do - yield @response, @operation if block_given? - @response - end - end - - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_create_session - # Create GRPC objects. - grpc_response = ::Google::Cloud::Spanner::V1::Session.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - database = "hello world" - session = {} - - create_session_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_session, name - assert_kind_of ::Google::Cloud::Spanner::V1::CreateSessionRequest, request - assert_equal "hello world", request["database"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Spanner::V1::Session), request["session"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_session_client_stub do - # Create client - client = ::Google::Cloud::Spanner::V1::Spanner::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_session({ database: database, session: session }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.create_session database: database, session: session do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.create_session ::Google::Cloud::Spanner::V1::CreateSessionRequest.new(database: database, session: session) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.create_session({ database: database, session: session }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.create_session(::Google::Cloud::Spanner::V1::CreateSessionRequest.new(database: database, session: session), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, create_session_client_stub.call_rpc_count - end - end - - def test_batch_create_sessions - # Create GRPC objects. - grpc_response = ::Google::Cloud::Spanner::V1::BatchCreateSessionsResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - database = "hello world" - session_template = {} - session_count = 42 - - batch_create_sessions_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :batch_create_sessions, name - assert_kind_of ::Google::Cloud::Spanner::V1::BatchCreateSessionsRequest, request - assert_equal "hello world", request["database"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Spanner::V1::Session), request["session_template"] - assert_equal 42, request["session_count"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, batch_create_sessions_client_stub do - # Create client - client = ::Google::Cloud::Spanner::V1::Spanner::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.batch_create_sessions({ database: database, session_template: session_template, session_count: session_count }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.batch_create_sessions database: database, session_template: session_template, session_count: session_count do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.batch_create_sessions ::Google::Cloud::Spanner::V1::BatchCreateSessionsRequest.new(database: database, session_template: session_template, session_count: session_count) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.batch_create_sessions({ database: database, session_template: session_template, session_count: session_count }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.batch_create_sessions(::Google::Cloud::Spanner::V1::BatchCreateSessionsRequest.new(database: database, session_template: session_template, session_count: session_count), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, batch_create_sessions_client_stub.call_rpc_count - end - end - - def test_get_session - # Create GRPC objects. - grpc_response = ::Google::Cloud::Spanner::V1::Session.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_session_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_session, name - assert_kind_of ::Google::Cloud::Spanner::V1::GetSessionRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_session_client_stub do - # Create client - client = ::Google::Cloud::Spanner::V1::Spanner::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_session({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_session name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_session ::Google::Cloud::Spanner::V1::GetSessionRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_session({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_session(::Google::Cloud::Spanner::V1::GetSessionRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, get_session_client_stub.call_rpc_count - end - end - - def test_list_sessions - # Create GRPC objects. - grpc_response = ::Google::Cloud::Spanner::V1::ListSessionsResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - database = "hello world" - page_size = 42 - page_token = "hello world" - filter = "hello world" - - list_sessions_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_sessions, name - assert_kind_of ::Google::Cloud::Spanner::V1::ListSessionsRequest, request - assert_equal "hello world", request["database"] - assert_equal 42, request["page_size"] - assert_equal "hello world", request["page_token"] - assert_equal "hello world", request["filter"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_sessions_client_stub do - # Create client - client = ::Google::Cloud::Spanner::V1::Spanner::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_sessions({ database: database, page_size: page_size, page_token: page_token, filter: filter }) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.list_sessions database: database, page_size: page_size, page_token: page_token, filter: filter do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.list_sessions ::Google::Cloud::Spanner::V1::ListSessionsRequest.new(database: database, page_size: page_size, page_token: page_token, filter: filter) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.list_sessions({ database: database, page_size: page_size, page_token: page_token, filter: filter }, grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.list_sessions(::Google::Cloud::Spanner::V1::ListSessionsRequest.new(database: database, page_size: page_size, page_token: page_token, filter: filter), grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, list_sessions_client_stub.call_rpc_count - end - end - - def test_delete_session - # Create GRPC objects. - grpc_response = ::Google::Protobuf::Empty.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - delete_session_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_session, name - assert_kind_of ::Google::Cloud::Spanner::V1::DeleteSessionRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_session_client_stub do - # Create client - client = ::Google::Cloud::Spanner::V1::Spanner::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_session({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.delete_session name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.delete_session ::Google::Cloud::Spanner::V1::DeleteSessionRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.delete_session({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.delete_session(::Google::Cloud::Spanner::V1::DeleteSessionRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, delete_session_client_stub.call_rpc_count - end - end - - def test_execute_sql - # Create GRPC objects. - grpc_response = ::Google::Cloud::Spanner::V1::ResultSet.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - session = "hello world" - transaction = {} - sql = "hello world" - params = {} - param_types = {} - resume_token = "hello world" - query_mode = :NORMAL - partition_token = "hello world" - seqno = 42 - query_options = {} - request_options = {} - directed_read_options = {} - data_boost_enabled = true - last_statement = true - routing_hint = {} - - execute_sql_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :execute_sql, name - assert_kind_of ::Google::Cloud::Spanner::V1::ExecuteSqlRequest, request - assert_equal "hello world", request["session"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Spanner::V1::TransactionSelector), request["transaction"] - assert_equal "hello world", request["sql"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Struct), request["params"] - assert_equal({}, request["param_types"].to_h) - assert_equal "hello world", request["resume_token"] - assert_equal :NORMAL, request["query_mode"] - assert_equal "hello world", request["partition_token"] - assert_equal 42, request["seqno"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Spanner::V1::ExecuteSqlRequest::QueryOptions), request["query_options"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Spanner::V1::RequestOptions), request["request_options"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Spanner::V1::DirectedReadOptions), request["directed_read_options"] - assert_equal true, request["data_boost_enabled"] - assert_equal true, request["last_statement"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Spanner::V1::RoutingHint), request["routing_hint"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, execute_sql_client_stub do - # Create client - client = ::Google::Cloud::Spanner::V1::Spanner::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.execute_sql({ session: session, transaction: transaction, sql: sql, params: params, param_types: param_types, resume_token: resume_token, query_mode: query_mode, partition_token: partition_token, seqno: seqno, query_options: query_options, request_options: request_options, directed_read_options: directed_read_options, data_boost_enabled: data_boost_enabled, last_statement: last_statement, routing_hint: routing_hint }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.execute_sql session: session, transaction: transaction, sql: sql, params: params, param_types: param_types, resume_token: resume_token, query_mode: query_mode, partition_token: partition_token, seqno: seqno, query_options: query_options, request_options: request_options, directed_read_options: directed_read_options, data_boost_enabled: data_boost_enabled, last_statement: last_statement, routing_hint: routing_hint do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.execute_sql ::Google::Cloud::Spanner::V1::ExecuteSqlRequest.new(session: session, transaction: transaction, sql: sql, params: params, param_types: param_types, resume_token: resume_token, query_mode: query_mode, partition_token: partition_token, seqno: seqno, query_options: query_options, request_options: request_options, directed_read_options: directed_read_options, data_boost_enabled: data_boost_enabled, last_statement: last_statement, routing_hint: routing_hint) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.execute_sql({ session: session, transaction: transaction, sql: sql, params: params, param_types: param_types, resume_token: resume_token, query_mode: query_mode, partition_token: partition_token, seqno: seqno, query_options: query_options, request_options: request_options, directed_read_options: directed_read_options, data_boost_enabled: data_boost_enabled, last_statement: last_statement, routing_hint: routing_hint }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.execute_sql(::Google::Cloud::Spanner::V1::ExecuteSqlRequest.new(session: session, transaction: transaction, sql: sql, params: params, param_types: param_types, resume_token: resume_token, query_mode: query_mode, partition_token: partition_token, seqno: seqno, query_options: query_options, request_options: request_options, directed_read_options: directed_read_options, data_boost_enabled: data_boost_enabled, last_statement: last_statement, routing_hint: routing_hint), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, execute_sql_client_stub.call_rpc_count - end - end - - def test_execute_streaming_sql - # Create GRPC objects. - grpc_response = ::Google::Cloud::Spanner::V1::PartialResultSet.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a server streaming method. - session = "hello world" - transaction = {} - sql = "hello world" - params = {} - param_types = {} - resume_token = "hello world" - query_mode = :NORMAL - partition_token = "hello world" - seqno = 42 - query_options = {} - request_options = {} - directed_read_options = {} - data_boost_enabled = true - last_statement = true - routing_hint = {} - - execute_streaming_sql_client_stub = ClientStub.new [grpc_response].to_enum, grpc_operation do |name, request, options:| - assert_equal :execute_streaming_sql, name - assert_kind_of ::Google::Cloud::Spanner::V1::ExecuteSqlRequest, request - assert_equal "hello world", request["session"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Spanner::V1::TransactionSelector), request["transaction"] - assert_equal "hello world", request["sql"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Struct), request["params"] - assert_equal({}, request["param_types"].to_h) - assert_equal "hello world", request["resume_token"] - assert_equal :NORMAL, request["query_mode"] - assert_equal "hello world", request["partition_token"] - assert_equal 42, request["seqno"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Spanner::V1::ExecuteSqlRequest::QueryOptions), request["query_options"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Spanner::V1::RequestOptions), request["request_options"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Spanner::V1::DirectedReadOptions), request["directed_read_options"] - assert_equal true, request["data_boost_enabled"] - assert_equal true, request["last_statement"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Spanner::V1::RoutingHint), request["routing_hint"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, execute_streaming_sql_client_stub do - # Create client - client = ::Google::Cloud::Spanner::V1::Spanner::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.execute_streaming_sql({ session: session, transaction: transaction, sql: sql, params: params, param_types: param_types, resume_token: resume_token, query_mode: query_mode, partition_token: partition_token, seqno: seqno, query_options: query_options, request_options: request_options, directed_read_options: directed_read_options, data_boost_enabled: data_boost_enabled, last_statement: last_statement, routing_hint: routing_hint }) do |response, operation| - assert_kind_of Enumerable, response - response.to_a.each do |r| - assert_kind_of ::Google::Cloud::Spanner::V1::PartialResultSet, r - end - assert_equal grpc_operation, operation - end - - # Use named arguments - client.execute_streaming_sql session: session, transaction: transaction, sql: sql, params: params, param_types: param_types, resume_token: resume_token, query_mode: query_mode, partition_token: partition_token, seqno: seqno, query_options: query_options, request_options: request_options, directed_read_options: directed_read_options, data_boost_enabled: data_boost_enabled, last_statement: last_statement, routing_hint: routing_hint do |response, operation| - assert_kind_of Enumerable, response - response.to_a.each do |r| - assert_kind_of ::Google::Cloud::Spanner::V1::PartialResultSet, r - end - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.execute_streaming_sql ::Google::Cloud::Spanner::V1::ExecuteSqlRequest.new(session: session, transaction: transaction, sql: sql, params: params, param_types: param_types, resume_token: resume_token, query_mode: query_mode, partition_token: partition_token, seqno: seqno, query_options: query_options, request_options: request_options, directed_read_options: directed_read_options, data_boost_enabled: data_boost_enabled, last_statement: last_statement, routing_hint: routing_hint) do |response, operation| - assert_kind_of Enumerable, response - response.to_a.each do |r| - assert_kind_of ::Google::Cloud::Spanner::V1::PartialResultSet, r - end - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.execute_streaming_sql({ session: session, transaction: transaction, sql: sql, params: params, param_types: param_types, resume_token: resume_token, query_mode: query_mode, partition_token: partition_token, seqno: seqno, query_options: query_options, request_options: request_options, directed_read_options: directed_read_options, data_boost_enabled: data_boost_enabled, last_statement: last_statement, routing_hint: routing_hint }, grpc_options) do |response, operation| - assert_kind_of Enumerable, response - response.to_a.each do |r| - assert_kind_of ::Google::Cloud::Spanner::V1::PartialResultSet, r - end - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.execute_streaming_sql(::Google::Cloud::Spanner::V1::ExecuteSqlRequest.new(session: session, transaction: transaction, sql: sql, params: params, param_types: param_types, resume_token: resume_token, query_mode: query_mode, partition_token: partition_token, seqno: seqno, query_options: query_options, request_options: request_options, directed_read_options: directed_read_options, data_boost_enabled: data_boost_enabled, last_statement: last_statement, routing_hint: routing_hint), grpc_options) do |response, operation| - assert_kind_of Enumerable, response - response.to_a.each do |r| - assert_kind_of ::Google::Cloud::Spanner::V1::PartialResultSet, r - end - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, execute_streaming_sql_client_stub.call_rpc_count - end - end - - def test_execute_batch_dml - # Create GRPC objects. - grpc_response = ::Google::Cloud::Spanner::V1::ExecuteBatchDmlResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - session = "hello world" - transaction = {} - statements = [{}] - seqno = 42 - request_options = {} - last_statements = true - - execute_batch_dml_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :execute_batch_dml, name - assert_kind_of ::Google::Cloud::Spanner::V1::ExecuteBatchDmlRequest, request - assert_equal "hello world", request["session"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Spanner::V1::TransactionSelector), request["transaction"] - assert_kind_of ::Google::Cloud::Spanner::V1::ExecuteBatchDmlRequest::Statement, request["statements"].first - assert_equal 42, request["seqno"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Spanner::V1::RequestOptions), request["request_options"] - assert_equal true, request["last_statements"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, execute_batch_dml_client_stub do - # Create client - client = ::Google::Cloud::Spanner::V1::Spanner::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.execute_batch_dml({ session: session, transaction: transaction, statements: statements, seqno: seqno, request_options: request_options, last_statements: last_statements }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.execute_batch_dml session: session, transaction: transaction, statements: statements, seqno: seqno, request_options: request_options, last_statements: last_statements do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.execute_batch_dml ::Google::Cloud::Spanner::V1::ExecuteBatchDmlRequest.new(session: session, transaction: transaction, statements: statements, seqno: seqno, request_options: request_options, last_statements: last_statements) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.execute_batch_dml({ session: session, transaction: transaction, statements: statements, seqno: seqno, request_options: request_options, last_statements: last_statements }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.execute_batch_dml(::Google::Cloud::Spanner::V1::ExecuteBatchDmlRequest.new(session: session, transaction: transaction, statements: statements, seqno: seqno, request_options: request_options, last_statements: last_statements), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, execute_batch_dml_client_stub.call_rpc_count - end - end - - def test_read - # Create GRPC objects. - grpc_response = ::Google::Cloud::Spanner::V1::ResultSet.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - session = "hello world" - transaction = {} - table = "hello world" - index = "hello world" - columns = ["hello world"] - key_set = {} - limit = 42 - resume_token = "hello world" - partition_token = "hello world" - request_options = {} - directed_read_options = {} - data_boost_enabled = true - order_by = :ORDER_BY_UNSPECIFIED - lock_hint = :LOCK_HINT_UNSPECIFIED - routing_hint = {} - - read_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :read, name - assert_kind_of ::Google::Cloud::Spanner::V1::ReadRequest, request - assert_equal "hello world", request["session"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Spanner::V1::TransactionSelector), request["transaction"] - assert_equal "hello world", request["table"] - assert_equal "hello world", request["index"] - assert_equal ["hello world"], request["columns"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Spanner::V1::KeySet), request["key_set"] - assert_equal 42, request["limit"] - assert_equal "hello world", request["resume_token"] - assert_equal "hello world", request["partition_token"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Spanner::V1::RequestOptions), request["request_options"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Spanner::V1::DirectedReadOptions), request["directed_read_options"] - assert_equal true, request["data_boost_enabled"] - assert_equal :ORDER_BY_UNSPECIFIED, request["order_by"] - assert_equal :LOCK_HINT_UNSPECIFIED, request["lock_hint"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Spanner::V1::RoutingHint), request["routing_hint"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, read_client_stub do - # Create client - client = ::Google::Cloud::Spanner::V1::Spanner::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.read({ session: session, transaction: transaction, table: table, index: index, columns: columns, key_set: key_set, limit: limit, resume_token: resume_token, partition_token: partition_token, request_options: request_options, directed_read_options: directed_read_options, data_boost_enabled: data_boost_enabled, order_by: order_by, lock_hint: lock_hint, routing_hint: routing_hint }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.read session: session, transaction: transaction, table: table, index: index, columns: columns, key_set: key_set, limit: limit, resume_token: resume_token, partition_token: partition_token, request_options: request_options, directed_read_options: directed_read_options, data_boost_enabled: data_boost_enabled, order_by: order_by, lock_hint: lock_hint, routing_hint: routing_hint do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.read ::Google::Cloud::Spanner::V1::ReadRequest.new(session: session, transaction: transaction, table: table, index: index, columns: columns, key_set: key_set, limit: limit, resume_token: resume_token, partition_token: partition_token, request_options: request_options, directed_read_options: directed_read_options, data_boost_enabled: data_boost_enabled, order_by: order_by, lock_hint: lock_hint, routing_hint: routing_hint) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.read({ session: session, transaction: transaction, table: table, index: index, columns: columns, key_set: key_set, limit: limit, resume_token: resume_token, partition_token: partition_token, request_options: request_options, directed_read_options: directed_read_options, data_boost_enabled: data_boost_enabled, order_by: order_by, lock_hint: lock_hint, routing_hint: routing_hint }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.read(::Google::Cloud::Spanner::V1::ReadRequest.new(session: session, transaction: transaction, table: table, index: index, columns: columns, key_set: key_set, limit: limit, resume_token: resume_token, partition_token: partition_token, request_options: request_options, directed_read_options: directed_read_options, data_boost_enabled: data_boost_enabled, order_by: order_by, lock_hint: lock_hint, routing_hint: routing_hint), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, read_client_stub.call_rpc_count - end - end - - def test_streaming_read - # Create GRPC objects. - grpc_response = ::Google::Cloud::Spanner::V1::PartialResultSet.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a server streaming method. - session = "hello world" - transaction = {} - table = "hello world" - index = "hello world" - columns = ["hello world"] - key_set = {} - limit = 42 - resume_token = "hello world" - partition_token = "hello world" - request_options = {} - directed_read_options = {} - data_boost_enabled = true - order_by = :ORDER_BY_UNSPECIFIED - lock_hint = :LOCK_HINT_UNSPECIFIED - routing_hint = {} - - streaming_read_client_stub = ClientStub.new [grpc_response].to_enum, grpc_operation do |name, request, options:| - assert_equal :streaming_read, name - assert_kind_of ::Google::Cloud::Spanner::V1::ReadRequest, request - assert_equal "hello world", request["session"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Spanner::V1::TransactionSelector), request["transaction"] - assert_equal "hello world", request["table"] - assert_equal "hello world", request["index"] - assert_equal ["hello world"], request["columns"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Spanner::V1::KeySet), request["key_set"] - assert_equal 42, request["limit"] - assert_equal "hello world", request["resume_token"] - assert_equal "hello world", request["partition_token"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Spanner::V1::RequestOptions), request["request_options"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Spanner::V1::DirectedReadOptions), request["directed_read_options"] - assert_equal true, request["data_boost_enabled"] - assert_equal :ORDER_BY_UNSPECIFIED, request["order_by"] - assert_equal :LOCK_HINT_UNSPECIFIED, request["lock_hint"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Spanner::V1::RoutingHint), request["routing_hint"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, streaming_read_client_stub do - # Create client - client = ::Google::Cloud::Spanner::V1::Spanner::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.streaming_read({ session: session, transaction: transaction, table: table, index: index, columns: columns, key_set: key_set, limit: limit, resume_token: resume_token, partition_token: partition_token, request_options: request_options, directed_read_options: directed_read_options, data_boost_enabled: data_boost_enabled, order_by: order_by, lock_hint: lock_hint, routing_hint: routing_hint }) do |response, operation| - assert_kind_of Enumerable, response - response.to_a.each do |r| - assert_kind_of ::Google::Cloud::Spanner::V1::PartialResultSet, r - end - assert_equal grpc_operation, operation - end - - # Use named arguments - client.streaming_read session: session, transaction: transaction, table: table, index: index, columns: columns, key_set: key_set, limit: limit, resume_token: resume_token, partition_token: partition_token, request_options: request_options, directed_read_options: directed_read_options, data_boost_enabled: data_boost_enabled, order_by: order_by, lock_hint: lock_hint, routing_hint: routing_hint do |response, operation| - assert_kind_of Enumerable, response - response.to_a.each do |r| - assert_kind_of ::Google::Cloud::Spanner::V1::PartialResultSet, r - end - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.streaming_read ::Google::Cloud::Spanner::V1::ReadRequest.new(session: session, transaction: transaction, table: table, index: index, columns: columns, key_set: key_set, limit: limit, resume_token: resume_token, partition_token: partition_token, request_options: request_options, directed_read_options: directed_read_options, data_boost_enabled: data_boost_enabled, order_by: order_by, lock_hint: lock_hint, routing_hint: routing_hint) do |response, operation| - assert_kind_of Enumerable, response - response.to_a.each do |r| - assert_kind_of ::Google::Cloud::Spanner::V1::PartialResultSet, r - end - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.streaming_read({ session: session, transaction: transaction, table: table, index: index, columns: columns, key_set: key_set, limit: limit, resume_token: resume_token, partition_token: partition_token, request_options: request_options, directed_read_options: directed_read_options, data_boost_enabled: data_boost_enabled, order_by: order_by, lock_hint: lock_hint, routing_hint: routing_hint }, grpc_options) do |response, operation| - assert_kind_of Enumerable, response - response.to_a.each do |r| - assert_kind_of ::Google::Cloud::Spanner::V1::PartialResultSet, r - end - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.streaming_read(::Google::Cloud::Spanner::V1::ReadRequest.new(session: session, transaction: transaction, table: table, index: index, columns: columns, key_set: key_set, limit: limit, resume_token: resume_token, partition_token: partition_token, request_options: request_options, directed_read_options: directed_read_options, data_boost_enabled: data_boost_enabled, order_by: order_by, lock_hint: lock_hint, routing_hint: routing_hint), grpc_options) do |response, operation| - assert_kind_of Enumerable, response - response.to_a.each do |r| - assert_kind_of ::Google::Cloud::Spanner::V1::PartialResultSet, r - end - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, streaming_read_client_stub.call_rpc_count - end - end - - def test_begin_transaction - # Create GRPC objects. - grpc_response = ::Google::Cloud::Spanner::V1::Transaction.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - session = "hello world" - options = {} - request_options = {} - mutation_key = {} - - begin_transaction_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :begin_transaction, name - assert_kind_of ::Google::Cloud::Spanner::V1::BeginTransactionRequest, request - assert_equal "hello world", request["session"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Spanner::V1::TransactionOptions), request["options"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Spanner::V1::RequestOptions), request["request_options"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Spanner::V1::Mutation), request["mutation_key"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, begin_transaction_client_stub do - # Create client - client = ::Google::Cloud::Spanner::V1::Spanner::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.begin_transaction({ session: session, options: options, request_options: request_options, mutation_key: mutation_key }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.begin_transaction session: session, options: options, request_options: request_options, mutation_key: mutation_key do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.begin_transaction ::Google::Cloud::Spanner::V1::BeginTransactionRequest.new(session: session, options: options, request_options: request_options, mutation_key: mutation_key) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.begin_transaction({ session: session, options: options, request_options: request_options, mutation_key: mutation_key }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.begin_transaction(::Google::Cloud::Spanner::V1::BeginTransactionRequest.new(session: session, options: options, request_options: request_options, mutation_key: mutation_key), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, begin_transaction_client_stub.call_rpc_count - end - end - - def test_commit - # Create GRPC objects. - grpc_response = ::Google::Cloud::Spanner::V1::CommitResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - session = "hello world" - transaction_id = "hello world" - mutations = [{}] - return_commit_stats = true - max_commit_delay = {} - request_options = {} - precommit_token = {} - - commit_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :commit, name - assert_kind_of ::Google::Cloud::Spanner::V1::CommitRequest, request - assert_equal "hello world", request["session"] - assert_equal "hello world", request["transaction_id"] - assert_equal :transaction_id, request.transaction - assert_kind_of ::Google::Cloud::Spanner::V1::Mutation, request["mutations"].first - assert_equal true, request["return_commit_stats"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Duration), request["max_commit_delay"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Spanner::V1::RequestOptions), request["request_options"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Spanner::V1::MultiplexedSessionPrecommitToken), request["precommit_token"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, commit_client_stub do - # Create client - client = ::Google::Cloud::Spanner::V1::Spanner::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.commit({ session: session, transaction_id: transaction_id, mutations: mutations, return_commit_stats: return_commit_stats, max_commit_delay: max_commit_delay, request_options: request_options, precommit_token: precommit_token }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.commit session: session, transaction_id: transaction_id, mutations: mutations, return_commit_stats: return_commit_stats, max_commit_delay: max_commit_delay, request_options: request_options, precommit_token: precommit_token do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.commit ::Google::Cloud::Spanner::V1::CommitRequest.new(session: session, transaction_id: transaction_id, mutations: mutations, return_commit_stats: return_commit_stats, max_commit_delay: max_commit_delay, request_options: request_options, precommit_token: precommit_token) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.commit({ session: session, transaction_id: transaction_id, mutations: mutations, return_commit_stats: return_commit_stats, max_commit_delay: max_commit_delay, request_options: request_options, precommit_token: precommit_token }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.commit(::Google::Cloud::Spanner::V1::CommitRequest.new(session: session, transaction_id: transaction_id, mutations: mutations, return_commit_stats: return_commit_stats, max_commit_delay: max_commit_delay, request_options: request_options, precommit_token: precommit_token), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, commit_client_stub.call_rpc_count - end - end - - def test_rollback - # Create GRPC objects. - grpc_response = ::Google::Protobuf::Empty.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - session = "hello world" - transaction_id = "hello world" - - rollback_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :rollback, name - assert_kind_of ::Google::Cloud::Spanner::V1::RollbackRequest, request - assert_equal "hello world", request["session"] - assert_equal "hello world", request["transaction_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, rollback_client_stub do - # Create client - client = ::Google::Cloud::Spanner::V1::Spanner::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.rollback({ session: session, transaction_id: transaction_id }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.rollback session: session, transaction_id: transaction_id do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.rollback ::Google::Cloud::Spanner::V1::RollbackRequest.new(session: session, transaction_id: transaction_id) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.rollback({ session: session, transaction_id: transaction_id }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.rollback(::Google::Cloud::Spanner::V1::RollbackRequest.new(session: session, transaction_id: transaction_id), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, rollback_client_stub.call_rpc_count - end - end - - def test_partition_query - # Create GRPC objects. - grpc_response = ::Google::Cloud::Spanner::V1::PartitionResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - session = "hello world" - transaction = {} - sql = "hello world" - params = {} - param_types = {} - partition_options = {} - - partition_query_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :partition_query, name - assert_kind_of ::Google::Cloud::Spanner::V1::PartitionQueryRequest, request - assert_equal "hello world", request["session"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Spanner::V1::TransactionSelector), request["transaction"] - assert_equal "hello world", request["sql"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Struct), request["params"] - assert_equal({}, request["param_types"].to_h) - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Spanner::V1::PartitionOptions), request["partition_options"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, partition_query_client_stub do - # Create client - client = ::Google::Cloud::Spanner::V1::Spanner::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.partition_query({ session: session, transaction: transaction, sql: sql, params: params, param_types: param_types, partition_options: partition_options }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.partition_query session: session, transaction: transaction, sql: sql, params: params, param_types: param_types, partition_options: partition_options do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.partition_query ::Google::Cloud::Spanner::V1::PartitionQueryRequest.new(session: session, transaction: transaction, sql: sql, params: params, param_types: param_types, partition_options: partition_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.partition_query({ session: session, transaction: transaction, sql: sql, params: params, param_types: param_types, partition_options: partition_options }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.partition_query(::Google::Cloud::Spanner::V1::PartitionQueryRequest.new(session: session, transaction: transaction, sql: sql, params: params, param_types: param_types, partition_options: partition_options), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, partition_query_client_stub.call_rpc_count - end - end - - def test_partition_read - # Create GRPC objects. - grpc_response = ::Google::Cloud::Spanner::V1::PartitionResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - session = "hello world" - transaction = {} - table = "hello world" - index = "hello world" - columns = ["hello world"] - key_set = {} - partition_options = {} - - partition_read_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :partition_read, name - assert_kind_of ::Google::Cloud::Spanner::V1::PartitionReadRequest, request - assert_equal "hello world", request["session"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Spanner::V1::TransactionSelector), request["transaction"] - assert_equal "hello world", request["table"] - assert_equal "hello world", request["index"] - assert_equal ["hello world"], request["columns"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Spanner::V1::KeySet), request["key_set"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Spanner::V1::PartitionOptions), request["partition_options"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, partition_read_client_stub do - # Create client - client = ::Google::Cloud::Spanner::V1::Spanner::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.partition_read({ session: session, transaction: transaction, table: table, index: index, columns: columns, key_set: key_set, partition_options: partition_options }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.partition_read session: session, transaction: transaction, table: table, index: index, columns: columns, key_set: key_set, partition_options: partition_options do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.partition_read ::Google::Cloud::Spanner::V1::PartitionReadRequest.new(session: session, transaction: transaction, table: table, index: index, columns: columns, key_set: key_set, partition_options: partition_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.partition_read({ session: session, transaction: transaction, table: table, index: index, columns: columns, key_set: key_set, partition_options: partition_options }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.partition_read(::Google::Cloud::Spanner::V1::PartitionReadRequest.new(session: session, transaction: transaction, table: table, index: index, columns: columns, key_set: key_set, partition_options: partition_options), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, partition_read_client_stub.call_rpc_count - end - end - - def test_batch_write - # Create GRPC objects. - grpc_response = ::Google::Cloud::Spanner::V1::BatchWriteResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a server streaming method. - session = "hello world" - request_options = {} - mutation_groups = [{}] - exclude_txn_from_change_streams = true - - batch_write_client_stub = ClientStub.new [grpc_response].to_enum, grpc_operation do |name, request, options:| - assert_equal :batch_write, name - assert_kind_of ::Google::Cloud::Spanner::V1::BatchWriteRequest, request - assert_equal "hello world", request["session"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Spanner::V1::RequestOptions), request["request_options"] - assert_kind_of ::Google::Cloud::Spanner::V1::BatchWriteRequest::MutationGroup, request["mutation_groups"].first - assert_equal true, request["exclude_txn_from_change_streams"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, batch_write_client_stub do - # Create client - client = ::Google::Cloud::Spanner::V1::Spanner::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.batch_write({ session: session, request_options: request_options, mutation_groups: mutation_groups, exclude_txn_from_change_streams: exclude_txn_from_change_streams }) do |response, operation| - assert_kind_of Enumerable, response - response.to_a.each do |r| - assert_kind_of ::Google::Cloud::Spanner::V1::BatchWriteResponse, r - end - assert_equal grpc_operation, operation - end - - # Use named arguments - client.batch_write session: session, request_options: request_options, mutation_groups: mutation_groups, exclude_txn_from_change_streams: exclude_txn_from_change_streams do |response, operation| - assert_kind_of Enumerable, response - response.to_a.each do |r| - assert_kind_of ::Google::Cloud::Spanner::V1::BatchWriteResponse, r - end - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.batch_write ::Google::Cloud::Spanner::V1::BatchWriteRequest.new(session: session, request_options: request_options, mutation_groups: mutation_groups, exclude_txn_from_change_streams: exclude_txn_from_change_streams) do |response, operation| - assert_kind_of Enumerable, response - response.to_a.each do |r| - assert_kind_of ::Google::Cloud::Spanner::V1::BatchWriteResponse, r - end - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.batch_write({ session: session, request_options: request_options, mutation_groups: mutation_groups, exclude_txn_from_change_streams: exclude_txn_from_change_streams }, grpc_options) do |response, operation| - assert_kind_of Enumerable, response - response.to_a.each do |r| - assert_kind_of ::Google::Cloud::Spanner::V1::BatchWriteResponse, r - end - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.batch_write(::Google::Cloud::Spanner::V1::BatchWriteRequest.new(session: session, request_options: request_options, mutation_groups: mutation_groups, exclude_txn_from_change_streams: exclude_txn_from_change_streams), grpc_options) do |response, operation| - assert_kind_of Enumerable, response - response.to_a.each do |r| - assert_kind_of ::Google::Cloud::Spanner::V1::BatchWriteResponse, r - end - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, batch_write_client_stub.call_rpc_count - end - end - - def test_configure - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - - client = block_config = config = nil - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::Spanner::V1::Spanner::Client.new do |config| - config.credentials = grpc_channel - end - end - - config = client.configure do |c| - block_config = c - end - - assert_same block_config, config - assert_kind_of ::Google::Cloud::Spanner::V1::Spanner::Client::Configuration, config - end - - def test_credentials - key = OpenSSL::PKey::RSA.new 2048 - cred_json = { - "private_key" => key.to_pem, - "client_email" => "app@developer.gserviceaccount.com", - "type" => "service_account" - } - key_file = StringIO.new cred_json.to_json - creds = Google::Auth::ServiceAccountCredentials.make_creds({ json_key_io: key_file }) - - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::Spanner::V1::Spanner::Client.new do |config| - config.credentials = creds - end - assert_kind_of ::Google::Cloud::Spanner::V1::Spanner::Client, client - assert_equal creds, client.configure.credentials - end - end -end diff --git a/owl-bot-staging/google-cloud-spanner-v1/test/helper.rb b/owl-bot-staging/google-cloud-spanner-v1/test/helper.rb deleted file mode 100644 index f0e715458fa2..000000000000 --- a/owl-bot-staging/google-cloud-spanner-v1/test/helper.rb +++ /dev/null @@ -1,25 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "minitest/autorun" -require "minitest/focus" -require "minitest/rg" - -require "grpc" - -require "ostruct"