From de23d4f787b317a71bc435018e5408859ebd2f96 Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Wed, 17 Dec 2025 21:18:53 +0000 Subject: [PATCH 1/2] feat: Exposing total CPU related fields in AutoscalingConfig docs: Update high_priority_cpu_utilization_percent in AutoscalingConfig to be Optional and clarify its behavior when not specified PiperOrigin-RevId: 845819318 Source-Link: https://github.com/googleapis/googleapis/commit/6e20492aec2aab4837928440f1026d32a6251fa0 Source-Link: https://github.com/googleapis/googleapis-gen/commit/3bb618d17925323172ed8c153fbabd31d6110a13 Copy-Tag: eyJwIjoiZ29vZ2xlLWNsb3VkLXNwYW5uZXItYWRtaW4taW5zdGFuY2UtdjEvLk93bEJvdC55YW1sIiwiaCI6IjNiYjYxOGQxNzkyNTMyMzE3MmVkOGMxNTNmYmFiZDMxZDYxMTBhMTMifQ== --- .../.gitignore | 22 + .../.repo-metadata.json | 18 + .../.rubocop.yml | 33 + .../.toys.rb | 28 + .../.yardopts | 12 + .../AUTHENTICATION.md | 122 + .../CHANGELOG.md | 2 + .../Gemfile | 11 + .../LICENSE.md | 201 ++ .../README.md | 153 + .../Rakefile | 169 + .../gapic_metadata.json | 123 + ...le-cloud-spanner-admin-instance-v1.gemspec | 29 + .../google-cloud-spanner-admin-instance-v1.rb | 21 + .../google/cloud/spanner/admin/instance/v1.rb | 49 + .../admin/instance/v1/instance_admin.rb | 80 + .../instance/v1/instance_admin/client.rb | 3140 +++++++++++++++++ .../instance/v1/instance_admin/credentials.rb | 56 + .../instance/v1/instance_admin/operations.rb | 845 +++++ .../admin/instance/v1/instance_admin/paths.rb | 104 + .../admin/instance/v1/instance_admin/rest.rb | 77 + .../instance/v1/instance_admin/rest/client.rb | 2948 ++++++++++++++++ .../v1/instance_admin/rest/operations.rb | 1068 ++++++ .../v1/instance_admin/rest/service_stub.rb | 1376 ++++++++ .../cloud/spanner/admin/instance/v1/rest.rb | 41 + .../spanner/admin/instance/v1/version.rb | 32 + .../spanner/admin/instance/v1/common_pb.rb | 53 + .../instance/v1/spanner_instance_admin_pb.rb | 114 + .../v1/spanner_instance_admin_services_pb.rb | 463 +++ .../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/iam/v1/iam_policy.rb | 87 + .../proto_docs/google/iam/v1/options.rb | 50 + .../proto_docs/google/iam/v1/policy.rb | 426 +++ .../google/longrunning/operations.rb | 191 + .../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/field_mask.rb | 229 ++ .../proto_docs/google/protobuf/timestamp.rb | 127 + .../proto_docs/google/rpc/status.rb | 48 + .../spanner/admin/instance/v1/common.rb | 71 + .../instance/v1/spanner_instance_admin.rb | 1561 ++++++++ .../proto_docs/google/type/expr.rb | 75 + .../snippets/Gemfile | 32 + .../instance_admin/create_instance.rb | 54 + .../instance_admin/create_instance_config.rb | 54 + .../create_instance_partition.rb | 54 + .../instance_admin/delete_instance.rb | 47 + .../instance_admin/delete_instance_config.rb | 47 + .../delete_instance_partition.rb | 47 + .../snippets/instance_admin/get_iam_policy.rb | 47 + .../snippets/instance_admin/get_instance.rb | 47 + .../instance_admin/get_instance_config.rb | 47 + .../instance_admin/get_instance_partition.rb | 47 + .../list_instance_config_operations.rb | 51 + .../instance_admin/list_instance_configs.rb | 51 + .../list_instance_partition_operations.rb | 51 + .../list_instance_partitions.rb | 51 + .../snippets/instance_admin/list_instances.rb | 51 + .../snippets/instance_admin/move_instance.rb | 54 + .../snippets/instance_admin/set_iam_policy.rb | 47 + .../instance_admin/test_iam_permissions.rb | 47 + .../instance_admin/update_instance.rb | 54 + .../instance_admin/update_instance_config.rb | 54 + .../update_instance_partition.rb | 54 + ...data_google.spanner.admin.instance.v1.json | 855 +++++ .../v1/instance_admin_operations_test.rb | 400 +++ .../instance/v1/instance_admin_paths_test.rb | 91 + .../instance/v1/instance_admin_rest_test.rb | 1269 +++++++ .../admin/instance/v1/instance_admin_test.rb | 1468 ++++++++ .../test/helper.rb | 25 + 75 files changed, 20588 insertions(+) create mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/.gitignore create mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/.repo-metadata.json create mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/.rubocop.yml create mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/.toys.rb create mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/.yardopts create mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/AUTHENTICATION.md create mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/CHANGELOG.md create mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/Gemfile create mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/LICENSE.md create mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/README.md create mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/Rakefile create mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/gapic_metadata.json create mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/google-cloud-spanner-admin-instance-v1.gemspec create mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google-cloud-spanner-admin-instance-v1.rb create mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google/cloud/spanner/admin/instance/v1.rb create mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google/cloud/spanner/admin/instance/v1/instance_admin.rb create mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google/cloud/spanner/admin/instance/v1/instance_admin/client.rb create mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google/cloud/spanner/admin/instance/v1/instance_admin/credentials.rb create mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google/cloud/spanner/admin/instance/v1/instance_admin/operations.rb create mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google/cloud/spanner/admin/instance/v1/instance_admin/paths.rb create mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google/cloud/spanner/admin/instance/v1/instance_admin/rest.rb create mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google/cloud/spanner/admin/instance/v1/instance_admin/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google/cloud/spanner/admin/instance/v1/instance_admin/rest/operations.rb create mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google/cloud/spanner/admin/instance/v1/instance_admin/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google/cloud/spanner/admin/instance/v1/rest.rb create mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google/cloud/spanner/admin/instance/v1/version.rb create mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google/spanner/admin/instance/v1/common_pb.rb create mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google/spanner/admin/instance/v1/spanner_instance_admin_pb.rb create mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google/spanner/admin/instance/v1/spanner_instance_admin_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/proto_docs/README.md create mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/proto_docs/google/api/client.rb create mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/proto_docs/google/api/field_behavior.rb create mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/proto_docs/google/api/launch_stage.rb create mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/proto_docs/google/api/resource.rb create mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/proto_docs/google/iam/v1/iam_policy.rb create mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/proto_docs/google/iam/v1/options.rb create mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/proto_docs/google/iam/v1/policy.rb create mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/proto_docs/google/longrunning/operations.rb create mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/proto_docs/google/protobuf/any.rb create mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/proto_docs/google/protobuf/duration.rb create mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/proto_docs/google/protobuf/empty.rb create mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/proto_docs/google/protobuf/field_mask.rb create mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/proto_docs/google/protobuf/timestamp.rb create mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/proto_docs/google/rpc/status.rb create mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/proto_docs/google/spanner/admin/instance/v1/common.rb create mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/proto_docs/google/spanner/admin/instance/v1/spanner_instance_admin.rb create mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/proto_docs/google/type/expr.rb create mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/Gemfile create mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/create_instance.rb create mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/create_instance_config.rb create mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/create_instance_partition.rb create mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/delete_instance.rb create mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/delete_instance_config.rb create mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/delete_instance_partition.rb create mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/get_iam_policy.rb create mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/get_instance.rb create mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/get_instance_config.rb create mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/get_instance_partition.rb create mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/list_instance_config_operations.rb create mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/list_instance_configs.rb create mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/list_instance_partition_operations.rb create mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/list_instance_partitions.rb create mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/list_instances.rb create mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/move_instance.rb create mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/set_iam_policy.rb create mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/test_iam_permissions.rb create mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/update_instance.rb create mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/update_instance_config.rb create mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/update_instance_partition.rb create mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/snippet_metadata_google.spanner.admin.instance.v1.json create mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/test/google/cloud/spanner/admin/instance/v1/instance_admin_operations_test.rb create mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/test/google/cloud/spanner/admin/instance/v1/instance_admin_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/test/google/cloud/spanner/admin/instance/v1/instance_admin_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/test/google/cloud/spanner/admin/instance/v1/instance_admin_test.rb create mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/test/helper.rb diff --git a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/.gitignore b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/.gitignore new file mode 100644 index 000000000000..0135b6bc6cfc --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-admin-instance-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-admin-instance-v1/.repo-metadata.json b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/.repo-metadata.json new file mode 100644 index 000000000000..f5020bbedc04 --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-admin-instance-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-admin-instance-v1/latest", + "distribution_name": "google-cloud-spanner-admin-instance-v1", + "is_cloud": true, + "language": "ruby", + "name": "spanner", + "name_pretty": "Cloud Spanner Instance Admin 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-admin-instance-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-admin-instance-v1/.rubocop.yml b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/.rubocop.yml new file mode 100644 index 000000000000..d1a683d9ac76 --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/.rubocop.yml @@ -0,0 +1,33 @@ +inherit_gem: + google-style: google-style.yml + +AllCops: + Exclude: + - "google-cloud-spanner-admin-instance-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-admin-instance-v1.rb" diff --git a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/.toys.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/.toys.rb new file mode 100644 index 000000000000..9a210f1427c7 --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/.toys.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true + +# Copyright 2025 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-admin-instance-v1/.yardopts b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/.yardopts new file mode 100644 index 000000000000..5a169a006a69 --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/.yardopts @@ -0,0 +1,12 @@ +--no-private +--title="Cloud Spanner Instance Admin 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-admin-instance-v1/AUTHENTICATION.md b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/AUTHENTICATION.md new file mode 100644 index 000000000000..cfb0ca7fb54f --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/AUTHENTICATION.md @@ -0,0 +1,122 @@ +# Authentication + +The recommended way to authenticate to the google-cloud-spanner-admin-instance-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-admin-instance-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/admin/instance/v1" + +client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::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/admin/instance/v1" + +::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.configure do |config| + config.credentials = "path/to/credentialfile.json" +end + +client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::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-admin-instance-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/admin/instance/v1" + +ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" + +client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::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-admin-instance-v1/CHANGELOG.md b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/CHANGELOG.md new file mode 100644 index 000000000000..f88957a62ba2 --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/CHANGELOG.md @@ -0,0 +1,2 @@ +# Release History + diff --git a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/Gemfile b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/Gemfile new file mode 100644 index 000000000000..6442df18fa2f --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-admin-instance-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-admin-instance-v1/LICENSE.md b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/LICENSE.md new file mode 100644 index 000000000000..c261857ba6ad --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-admin-instance-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-admin-instance-v1/README.md b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/README.md new file mode 100644 index 000000000000..b579b9d0f741 --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/README.md @@ -0,0 +1,153 @@ +# Ruby Client for the Cloud Spanner Instance Admin 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 Instance Admin 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-admin-instance-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/admin/instance/v1" + +client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new +request = ::Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigsRequest.new # (request fields as keyword arguments...) +response = client.list_instance_configs request +``` + +View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-spanner-admin-instance-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/admin/instance/v1" +require "logger" + +client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::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-admin-instance-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-admin-instance-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-admin-instance-v1/Rakefile b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/Rakefile new file mode 100644 index 000000000000..2f4393f5525a --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/Rakefile @@ -0,0 +1,169 @@ +# frozen_string_literal: true + +# Copyright 2025 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-admin-instance-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/admin/instance/v1/instance_admin/credentials" + ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::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-admin-instance-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-admin-instance-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-admin-instance-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-admin-instance-v1 gem does not have doctest tests." +end + +desc "Run the CI build" +task :ci do + header "BUILDING google-cloud-spanner-admin-instance-v1" + header "google-cloud-spanner-admin-instance-v1 rubocop", "*" + Rake::Task[:rubocop].invoke + header "google-cloud-spanner-admin-instance-v1 yard", "*" + Rake::Task[:yard].invoke + header "google-cloud-spanner-admin-instance-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-admin-instance-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-admin-instance-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-admin-instance-v1/gapic_metadata.json b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/gapic_metadata.json new file mode 100644 index 000000000000..2e44d0f21e72 --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/gapic_metadata.json @@ -0,0 +1,123 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "ruby", + "protoPackage": "google.spanner.admin.instance.v1", + "libraryPackage": "::Google::Cloud::Spanner::Admin::Instance::V1", + "services": { + "InstanceAdmin": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client", + "rpcs": { + "ListInstanceConfigs": { + "methods": [ + "list_instance_configs" + ] + }, + "GetInstanceConfig": { + "methods": [ + "get_instance_config" + ] + }, + "CreateInstanceConfig": { + "methods": [ + "create_instance_config" + ] + }, + "UpdateInstanceConfig": { + "methods": [ + "update_instance_config" + ] + }, + "DeleteInstanceConfig": { + "methods": [ + "delete_instance_config" + ] + }, + "ListInstanceConfigOperations": { + "methods": [ + "list_instance_config_operations" + ] + }, + "ListInstances": { + "methods": [ + "list_instances" + ] + }, + "ListInstancePartitions": { + "methods": [ + "list_instance_partitions" + ] + }, + "GetInstance": { + "methods": [ + "get_instance" + ] + }, + "CreateInstance": { + "methods": [ + "create_instance" + ] + }, + "UpdateInstance": { + "methods": [ + "update_instance" + ] + }, + "DeleteInstance": { + "methods": [ + "delete_instance" + ] + }, + "SetIamPolicy": { + "methods": [ + "set_iam_policy" + ] + }, + "GetIamPolicy": { + "methods": [ + "get_iam_policy" + ] + }, + "TestIamPermissions": { + "methods": [ + "test_iam_permissions" + ] + }, + "GetInstancePartition": { + "methods": [ + "get_instance_partition" + ] + }, + "CreateInstancePartition": { + "methods": [ + "create_instance_partition" + ] + }, + "DeleteInstancePartition": { + "methods": [ + "delete_instance_partition" + ] + }, + "UpdateInstancePartition": { + "methods": [ + "update_instance_partition" + ] + }, + "ListInstancePartitionOperations": { + "methods": [ + "list_instance_partition_operations" + ] + }, + "MoveInstance": { + "methods": [ + "move_instance" + ] + } + } + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/google-cloud-spanner-admin-instance-v1.gemspec b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/google-cloud-spanner-admin-instance-v1.gemspec new file mode 100644 index 000000000000..cf8cdfdcad2d --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/google-cloud-spanner-admin-instance-v1.gemspec @@ -0,0 +1,29 @@ +# -*- ruby -*- +# encoding: utf-8 + +require File.expand_path("lib/google/cloud/spanner/admin/instance/v1/version", __dir__) + +Gem::Specification.new do |gem| + gem.name = "google-cloud-spanner-admin-instance-v1" + gem.version = Google::Cloud::Spanner::Admin::Instance::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-admin-instance-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" + gem.add_dependency "grpc-google-iam-v1", "~> 1.11" +end diff --git a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google-cloud-spanner-admin-instance-v1.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google-cloud-spanner-admin-instance-v1.rb new file mode 100644 index 000000000000..ea7eae68d97a --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google-cloud-spanner-admin-instance-v1.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +# Copyright 2025 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/admin/instance/v1" diff --git a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google/cloud/spanner/admin/instance/v1.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google/cloud/spanner/admin/instance/v1.rb new file mode 100644 index 000000000000..200b087804f7 --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google/cloud/spanner/admin/instance/v1.rb @@ -0,0 +1,49 @@ +# frozen_string_literal: true + +# Copyright 2025 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/admin/instance/v1/instance_admin" +require "google/cloud/spanner/admin/instance/v1/version" + +module Google + module Cloud + module Spanner + module Admin + module Instance + ## + # API client module. + # + # @example Load this package, including all its services, and instantiate a gRPC client + # + # require "google/cloud/spanner/admin/instance/v1" + # client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new + # + # @example Load this package, including all its services, and instantiate a REST client + # + # require "google/cloud/spanner/admin/instance/v1" + # client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::Client.new + # + module V1 + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "v1", "_helpers.rb" +require "google/cloud/spanner/admin/instance/v1/_helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google/cloud/spanner/admin/instance/v1/instance_admin.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google/cloud/spanner/admin/instance/v1/instance_admin.rb new file mode 100644 index 000000000000..65ae6790d4a4 --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google/cloud/spanner/admin/instance/v1/instance_admin.rb @@ -0,0 +1,80 @@ +# frozen_string_literal: true + +# Copyright 2025 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/admin/instance/v1/version" + +require "google/cloud/spanner/admin/instance/v1/instance_admin/credentials" +require "google/cloud/spanner/admin/instance/v1/instance_admin/paths" +require "google/cloud/spanner/admin/instance/v1/instance_admin/operations" +require "google/cloud/spanner/admin/instance/v1/instance_admin/client" +require "google/cloud/spanner/admin/instance/v1/instance_admin/rest" + +module Google + module Cloud + module Spanner + module Admin + module Instance + module V1 + ## + # Cloud Spanner Instance Admin API + # + # The Cloud Spanner Instance Admin API can be used to create, delete, + # modify and list instances. Instances are dedicated Cloud Spanner serving + # and storage resources to be used by Cloud Spanner databases. + # + # Each instance has a "configuration", which dictates where the + # serving resources for the Cloud Spanner instance are located (e.g., + # US-central, Europe). Configurations are created by Google based on + # resource availability. + # + # Cloud Spanner billing is based on the instances that exist and their + # sizes. After an instance exists, there are no additional + # per-database or per-operation charges for use of the instance + # (though there may be additional network bandwidth charges). + # Instances offer isolation: problems with databases in one instance + # will not affect other instances. However, within an instance + # databases can affect each other. For example, if one database in an + # instance receives a lot of requests and consumes most of the + # instance resources, fewer resources are available for other + # databases in that instance, and their performance may suffer. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/spanner/admin/instance/v1/instance_admin" + # client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/spanner/admin/instance/v1/instance_admin/rest" + # client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::Client.new + # + module InstanceAdmin + end + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "instance_admin", "helpers.rb" +require "google/cloud/spanner/admin/instance/v1/instance_admin/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google/cloud/spanner/admin/instance/v1/instance_admin/client.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google/cloud/spanner/admin/instance/v1/instance_admin/client.rb new file mode 100644 index 000000000000..eced27ed0014 --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google/cloud/spanner/admin/instance/v1/instance_admin/client.rb @@ -0,0 +1,3140 @@ +# frozen_string_literal: true + +# Copyright 2025 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/admin/instance/v1/spanner_instance_admin_pb" + +module Google + module Cloud + module Spanner + module Admin + module Instance + module V1 + module InstanceAdmin + ## + # Client for the InstanceAdmin service. + # + # Cloud Spanner Instance Admin API + # + # The Cloud Spanner Instance Admin API can be used to create, delete, + # modify and list instances. Instances are dedicated Cloud Spanner serving + # and storage resources to be used by Cloud Spanner databases. + # + # Each instance has a "configuration", which dictates where the + # serving resources for the Cloud Spanner instance are located (e.g., + # US-central, Europe). Configurations are created by Google based on + # resource availability. + # + # Cloud Spanner billing is based on the instances that exist and their + # sizes. After an instance exists, there are no additional + # per-database or per-operation charges for use of the instance + # (though there may be additional network bandwidth charges). + # Instances offer isolation: problems with databases in one instance + # will not affect other instances. However, within an instance + # databases can affect each other. For example, if one database in an + # instance receives a lot of requests and consumes most of the + # instance resources, fewer resources are available for other + # databases in that instance, and their performance may suffer. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "spanner.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :instance_admin_stub + + ## + # Configure the InstanceAdmin Client class. + # + # See {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all InstanceAdmin clients + # ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::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", "Admin", "Instance", "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.list_instance_configs.timeout = 3600.0 + default_config.rpcs.list_instance_configs.retry_policy = { + initial_delay: 1.0, max_delay: 32.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.get_instance_config.timeout = 3600.0 + default_config.rpcs.get_instance_config.retry_policy = { + initial_delay: 1.0, max_delay: 32.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.list_instances.timeout = 3600.0 + default_config.rpcs.list_instances.retry_policy = { + initial_delay: 1.0, max_delay: 32.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.get_instance.timeout = 3600.0 + default_config.rpcs.get_instance.retry_policy = { + initial_delay: 1.0, max_delay: 32.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.create_instance.timeout = 3600.0 + + default_config.rpcs.update_instance.timeout = 3600.0 + + default_config.rpcs.delete_instance.timeout = 3600.0 + default_config.rpcs.delete_instance.retry_policy = { + initial_delay: 1.0, max_delay: 32.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.set_iam_policy.timeout = 30.0 + + default_config.rpcs.get_iam_policy.timeout = 30.0 + default_config.rpcs.get_iam_policy.retry_policy = { + initial_delay: 1.0, max_delay: 32.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.test_iam_permissions.timeout = 30.0 + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the InstanceAdmin 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::Admin::Instance::V1::InstanceAdmin::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 + @instance_admin_stub.universe_domain + end + + ## + # Create a new InstanceAdmin client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the InstanceAdmin 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/admin/instance/v1/spanner_instance_admin_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 + + @operations_client = Operations.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @config.endpoint + config.universe_domain = @config.universe_domain + end + + @instance_admin_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::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 + ) + + @instance_admin_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 + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Operations] + # + attr_reader :operations_client + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @instance_admin_stub.logger + end + + # Service calls + + ## + # Lists the supported instance configurations for a given project. + # + # Returns both Google-managed configurations and user-managed + # configurations. + # + # @overload list_instance_configs(request, options = nil) + # Pass arguments to `list_instance_configs` via a request object, either of type + # {::Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigsRequest, ::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_instance_configs(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_instance_configs` 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 parent [::String] + # Required. The name of the project for which a list of supported instance + # configurations is requested. Values are of the form + # `projects/`. + # @param page_size [::Integer] + # Number of instance configurations 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::Admin::Instance::V1::ListInstanceConfigsResponse#next_page_token next_page_token} + # from a previous + # {::Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigsResponse ListInstanceConfigsResponse}. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/spanner/admin/instance/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigsRequest.new + # + # # Call the list_instance_configs method. + # result = client.list_instance_configs 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::Admin::Instance::V1::InstanceConfig. + # p item + # end + # + def list_instance_configs request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigsRequest + + # 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_instance_configs.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::Admin::Instance::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.parent + header_params["parent"] = request.parent + 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_instance_configs.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_instance_configs.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @instance_admin_stub.call_rpc :list_instance_configs, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @instance_admin_stub, :list_instance_configs, 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 + + ## + # Gets information about a particular instance configuration. + # + # @overload get_instance_config(request, options = nil) + # Pass arguments to `get_instance_config` via a request object, either of type + # {::Google::Cloud::Spanner::Admin::Instance::V1::GetInstanceConfigRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Spanner::Admin::Instance::V1::GetInstanceConfigRequest, ::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_instance_config(name: nil) + # Pass arguments to `get_instance_config` 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 requested instance configuration. Values are of + # the form `projects//instanceConfigs/`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/spanner/admin/instance/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Spanner::Admin::Instance::V1::GetInstanceConfigRequest.new + # + # # Call the get_instance_config method. + # result = client.get_instance_config request + # + # # The returned object is of type Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig. + # p result + # + def get_instance_config request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Instance::V1::GetInstanceConfigRequest + + # 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_instance_config.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::Admin::Instance::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_instance_config.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_instance_config.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @instance_admin_stub.call_rpc :get_instance_config, 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 an instance configuration and begins preparing it to be used. The + # returned long-running operation + # can be used to track the progress of preparing the new + # instance configuration. The instance configuration name is assigned by the + # caller. If the named instance configuration already exists, + # `CreateInstanceConfig` returns `ALREADY_EXISTS`. + # + # Immediately after the request returns: + # + # * The instance configuration is readable via the API, with all requested + # attributes. The instance configuration's + # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig#reconciling reconciling} + # field is set to true. Its state is `CREATING`. + # + # While the operation is pending: + # + # * Cancelling the operation renders the instance configuration immediately + # unreadable via the API. + # * Except for deleting the creating resource, all other attempts to modify + # the instance configuration are rejected. + # + # Upon completion of the returned operation: + # + # * Instances can be created using the instance configuration. + # * The instance configuration's + # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig#reconciling reconciling} + # field becomes false. Its state becomes `READY`. + # + # The returned long-running operation will + # have a name of the format + # `/operations/` and can be used to track + # creation of the instance configuration. The + # metadata field type is + # {::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstanceConfigMetadata CreateInstanceConfigMetadata}. + # The response field type is + # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig InstanceConfig}, if + # successful. + # + # Authorization requires `spanner.instanceConfigs.create` permission on + # the resource + # {::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstanceConfigRequest#parent parent}. + # + # @overload create_instance_config(request, options = nil) + # Pass arguments to `create_instance_config` via a request object, either of type + # {::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstanceConfigRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstanceConfigRequest, ::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_instance_config(parent: nil, instance_config_id: nil, instance_config: nil, validate_only: nil) + # Pass arguments to `create_instance_config` 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 parent [::String] + # Required. The name of the project in which to create the instance + # configuration. Values are of the form `projects/`. + # @param instance_config_id [::String] + # Required. The ID of the instance configuration to create. Valid identifiers + # are of the form `custom-[-a-z0-9]*[a-z0-9]` and must be between 2 and 64 + # characters in length. The `custom-` prefix is required to avoid name + # conflicts with Google-managed configurations. + # @param instance_config [::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig, ::Hash] + # Required. The `InstanceConfig` proto of the configuration to create. + # `instance_config.name` must be + # `/instanceConfigs/`. + # `instance_config.base_config` must be a Google-managed configuration name, + # e.g. /instanceConfigs/us-east1, /instanceConfigs/nam3. + # @param validate_only [::Boolean] + # An option to validate, but not actually execute, a request, + # and provide the same response. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/spanner/admin/instance/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Spanner::Admin::Instance::V1::CreateInstanceConfigRequest.new + # + # # Call the create_instance_config method. + # result = client.create_instance_config request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def create_instance_config request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstanceConfigRequest + + # 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_instance_config.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::Admin::Instance::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.parent + header_params["parent"] = request.parent + 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_instance_config.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_instance_config.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @instance_admin_stub.call_rpc :create_instance_config, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates an instance configuration. The returned + # long-running operation can be used to track + # the progress of updating the instance. If the named instance configuration + # does not exist, returns `NOT_FOUND`. + # + # Only user-managed configurations can be updated. + # + # Immediately after the request returns: + # + # * The instance configuration's + # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig#reconciling reconciling} + # field is set to true. + # + # While the operation is pending: + # + # * Cancelling the operation sets its metadata's + # {::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstanceConfigMetadata#cancel_time cancel_time}. + # The operation is guaranteed to succeed at undoing all changes, after + # which point it terminates with a `CANCELLED` status. + # * All other attempts to modify the instance configuration are rejected. + # * Reading the instance configuration via the API continues to give the + # pre-request values. + # + # Upon completion of the returned operation: + # + # * Creating instances using the instance configuration uses the new + # values. + # * The new values of the instance configuration are readable via the API. + # * The instance configuration's + # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig#reconciling reconciling} + # field becomes false. + # + # The returned long-running operation will + # have a name of the format + # `/operations/` and can be used to track + # the instance configuration modification. The + # metadata field type is + # {::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstanceConfigMetadata UpdateInstanceConfigMetadata}. + # The response field type is + # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig InstanceConfig}, if + # successful. + # + # Authorization requires `spanner.instanceConfigs.update` permission on + # the resource {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig#name name}. + # + # @overload update_instance_config(request, options = nil) + # Pass arguments to `update_instance_config` via a request object, either of type + # {::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstanceConfigRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstanceConfigRequest, ::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 update_instance_config(instance_config: nil, update_mask: nil, validate_only: nil) + # Pass arguments to `update_instance_config` 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 instance_config [::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig, ::Hash] + # Required. The user instance configuration to update, which must always + # include the instance configuration name. Otherwise, only fields mentioned + # in + # {::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstanceConfigRequest#update_mask update_mask} + # need be included. To prevent conflicts of concurrent updates, + # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig#reconciling etag} can + # be used. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. A mask specifying which fields in + # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig InstanceConfig} should be + # updated. The field mask must always be specified; this prevents any future + # fields in {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig InstanceConfig} + # from being erased accidentally by clients that do not know about them. Only + # display_name and labels can be updated. + # @param validate_only [::Boolean] + # An option to validate, but not actually execute, a request, + # and provide the same response. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/spanner/admin/instance/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstanceConfigRequest.new + # + # # Call the update_instance_config method. + # result = client.update_instance_config request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def update_instance_config request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstanceConfigRequest + + # 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.update_instance_config.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::Admin::Instance::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.instance_config&.name + header_params["instance_config.name"] = request.instance_config.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.update_instance_config.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_instance_config.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @instance_admin_stub.call_rpc :update_instance_config, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes the instance configuration. Deletion is only allowed when no + # instances are using the configuration. If any instances are using + # the configuration, returns `FAILED_PRECONDITION`. + # + # Only user-managed configurations can be deleted. + # + # Authorization requires `spanner.instanceConfigs.delete` permission on + # the resource {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig#name name}. + # + # @overload delete_instance_config(request, options = nil) + # Pass arguments to `delete_instance_config` via a request object, either of type + # {::Google::Cloud::Spanner::Admin::Instance::V1::DeleteInstanceConfigRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Spanner::Admin::Instance::V1::DeleteInstanceConfigRequest, ::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_instance_config(name: nil, etag: nil, validate_only: nil) + # Pass arguments to `delete_instance_config` 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 instance configuration to be deleted. + # Values are of the form + # `projects//instanceConfigs/` + # @param etag [::String] + # Used for optimistic concurrency control as a way to help prevent + # simultaneous deletes of an instance configuration from overwriting each + # other. If not empty, the API + # only deletes the instance configuration when the etag provided matches the + # current status of the requested instance configuration. Otherwise, deletes + # the instance configuration without checking the current status of the + # requested instance configuration. + # @param validate_only [::Boolean] + # An option to validate, but not actually execute, a request, + # and provide the same response. + # + # @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/admin/instance/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Spanner::Admin::Instance::V1::DeleteInstanceConfigRequest.new + # + # # Call the delete_instance_config method. + # result = client.delete_instance_config request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_instance_config request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Instance::V1::DeleteInstanceConfigRequest + + # 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_instance_config.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::Admin::Instance::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_instance_config.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_instance_config.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @instance_admin_stub.call_rpc :delete_instance_config, 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 the user-managed instance configuration long-running + # operations in the given project. An instance + # configuration operation has a name of the form + # `projects//instanceConfigs//operations/`. + # The long-running operation + # metadata field type + # `metadata.type_url` describes the type of the metadata. Operations returned + # include those that have completed/failed/canceled within the last 7 days, + # and pending operations. Operations returned are ordered by + # `operation.metadata.value.start_time` in descending order starting + # from the most recently started operation. + # + # @overload list_instance_config_operations(request, options = nil) + # Pass arguments to `list_instance_config_operations` via a request object, either of type + # {::Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigOperationsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigOperationsRequest, ::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_instance_config_operations(parent: nil, filter: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_instance_config_operations` 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 parent [::String] + # Required. The project of the instance configuration operations. + # Values are of the form `projects/`. + # @param filter [::String] + # An expression that filters the list of returned operations. + # + # A filter expression consists of a field name, a + # comparison operator, and a value for filtering. + # The value must be a string, a number, or a boolean. The comparison operator + # must be one of: `<`, `>`, `<=`, `>=`, `!=`, `=`, or `:`. + # Colon `:` is the contains operator. Filter rules are not case sensitive. + # + # The following fields in the Operation are eligible for filtering: + # + # * `name` - The name of the long-running operation + # * `done` - False if the operation is in progress, else true. + # * `metadata.@type` - the type of metadata. For example, the type string + # for + # {::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstanceConfigMetadata CreateInstanceConfigMetadata} + # is + # `type.googleapis.com/google.spanner.admin.instance.v1.CreateInstanceConfigMetadata`. + # * `metadata.` - any field in metadata.value. + # `metadata.@type` must be specified first, if filtering on metadata + # fields. + # * `error` - Error associated with the long-running operation. + # * `response.@type` - the type of response. + # * `response.` - any field in response.value. + # + # You can combine multiple expressions by enclosing each expression in + # parentheses. By default, expressions are combined with AND logic. However, + # you can specify AND, OR, and NOT logic explicitly. + # + # Here are a few examples: + # + # * `done:true` - The operation is complete. + # * `(metadata.@type=` \ + # `type.googleapis.com/google.spanner.admin.instance.v1.CreateInstanceConfigMetadata) + # AND` \ + # `(metadata.instance_config.name:custom-config) AND` \ + # `(metadata.progress.start_time < \"2021-03-28T14:50:00Z\") AND` \ + # `(error:*)` - Return operations where: + # * The operation's metadata type is + # {::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstanceConfigMetadata CreateInstanceConfigMetadata}. + # * The instance configuration name contains "custom-config". + # * The operation started before 2021-03-28T14:50:00Z. + # * The operation resulted in an error. + # @param page_size [::Integer] + # Number of operations 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::Admin::Instance::V1::ListInstanceConfigOperationsResponse#next_page_token next_page_token} + # from a previous + # {::Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigOperationsResponse ListInstanceConfigOperationsResponse} + # to the same `parent` and with the same `filter`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Gapic::Operation>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Gapic::Operation>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/spanner/admin/instance/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigOperationsRequest.new + # + # # Call the list_instance_config_operations method. + # result = client.list_instance_config_operations 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::Longrunning::Operation. + # p item + # end + # + def list_instance_config_operations request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigOperationsRequest + + # 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_instance_config_operations.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::Admin::Instance::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.parent + header_params["parent"] = request.parent + 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_instance_config_operations.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_instance_config_operations.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @instance_admin_stub.call_rpc :list_instance_config_operations, request, options: options do |response, operation| + wrap_lro_operation = ->(op_response) { ::Gapic::Operation.new op_response, @operations_client } + response = ::Gapic::PagedEnumerable.new @instance_admin_stub, :list_instance_config_operations, request, response, operation, options, format_resource: wrap_lro_operation + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists all instances in the given project. + # + # @overload list_instances(request, options = nil) + # Pass arguments to `list_instances` via a request object, either of type + # {::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancesRequest, ::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_instances(parent: nil, page_size: nil, page_token: nil, filter: nil, instance_deadline: nil) + # Pass arguments to `list_instances` 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 parent [::String] + # Required. The name of the project for which a list of instances is + # requested. Values are of the form `projects/`. + # @param page_size [::Integer] + # Number of instances 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::Admin::Instance::V1::ListInstancesResponse#next_page_token next_page_token} + # from a previous + # {::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancesResponse ListInstancesResponse}. + # @param filter [::String] + # An expression for filtering the results of the request. Filter rules are + # case insensitive. The fields eligible for filtering are: + # + # * `name` + # * `display_name` + # * `labels.key` where key is the name of a label + # + # Some examples of using filters are: + # + # * `name:*` --> The instance has a name. + # * `name:Howl` --> The instance's name contains the string "howl". + # * `name:HOWL` --> Equivalent to above. + # * `NAME:howl` --> Equivalent to above. + # * `labels.env:*` --> The instance has the label "env". + # * `labels.env:dev` --> The instance has the label "env" and the value of + # the label contains the string "dev". + # * `name:howl labels.env:dev` --> The instance's name contains "howl" and + # it has the label "env" with its value + # containing "dev". + # @param instance_deadline [::Google::Protobuf::Timestamp, ::Hash] + # Deadline used while retrieving metadata for instances. + # Instances whose metadata cannot be retrieved within this deadline will be + # added to + # {::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancesResponse#unreachable unreachable} + # in + # {::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancesResponse ListInstancesResponse}. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Spanner::Admin::Instance::V1::Instance>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::Spanner::Admin::Instance::V1::Instance>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/spanner/admin/instance/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Spanner::Admin::Instance::V1::ListInstancesRequest.new + # + # # Call the list_instances method. + # result = client.list_instances 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::Admin::Instance::V1::Instance. + # p item + # end + # + def list_instances request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancesRequest + + # 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_instances.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::Admin::Instance::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.parent + header_params["parent"] = request.parent + 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_instances.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_instances.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @instance_admin_stub.call_rpc :list_instances, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @instance_admin_stub, :list_instances, 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 + + ## + # Lists all instance partitions for the given instance. + # + # @overload list_instance_partitions(request, options = nil) + # Pass arguments to `list_instance_partitions` via a request object, either of type + # {::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionsRequest, ::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_instance_partitions(parent: nil, page_size: nil, page_token: nil, instance_partition_deadline: nil) + # Pass arguments to `list_instance_partitions` 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 parent [::String] + # Required. The instance whose instance partitions should be listed. Values + # are of the form `projects//instances/`. Use `{instance} + # = '-'` to list instance partitions for all Instances in a project, e.g., + # `projects/myproject/instances/-`. + # @param page_size [::Integer] + # Number of instance partitions 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::Admin::Instance::V1::ListInstancePartitionsResponse#next_page_token next_page_token} + # from a previous + # {::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionsResponse ListInstancePartitionsResponse}. + # @param instance_partition_deadline [::Google::Protobuf::Timestamp, ::Hash] + # Optional. Deadline used while retrieving metadata for instance partitions. + # Instance partitions whose metadata cannot be retrieved within this deadline + # will be added to + # {::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionsResponse#unreachable unreachable} + # in + # {::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionsResponse ListInstancePartitionsResponse}. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Spanner::Admin::Instance::V1::InstancePartition>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::Spanner::Admin::Instance::V1::InstancePartition>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/spanner/admin/instance/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionsRequest.new + # + # # Call the list_instance_partitions method. + # result = client.list_instance_partitions 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::Admin::Instance::V1::InstancePartition. + # p item + # end + # + def list_instance_partitions request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionsRequest + + # 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_instance_partitions.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::Admin::Instance::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.parent + header_params["parent"] = request.parent + 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_instance_partitions.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_instance_partitions.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @instance_admin_stub.call_rpc :list_instance_partitions, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @instance_admin_stub, :list_instance_partitions, 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 + + ## + # Gets information about a particular instance. + # + # @overload get_instance(request, options = nil) + # Pass arguments to `get_instance` via a request object, either of type + # {::Google::Cloud::Spanner::Admin::Instance::V1::GetInstanceRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Spanner::Admin::Instance::V1::GetInstanceRequest, ::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_instance(name: nil, field_mask: nil) + # Pass arguments to `get_instance` 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 requested instance. Values are of the form + # `projects//instances/`. + # @param field_mask [::Google::Protobuf::FieldMask, ::Hash] + # If field_mask is present, specifies the subset of + # {::Google::Cloud::Spanner::Admin::Instance::V1::Instance Instance} fields that should be + # returned. If absent, all + # {::Google::Cloud::Spanner::Admin::Instance::V1::Instance Instance} fields are returned. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Spanner::Admin::Instance::V1::Instance] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Spanner::Admin::Instance::V1::Instance] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/spanner/admin/instance/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Spanner::Admin::Instance::V1::GetInstanceRequest.new + # + # # Call the get_instance method. + # result = client.get_instance request + # + # # The returned object is of type Google::Cloud::Spanner::Admin::Instance::V1::Instance. + # p result + # + def get_instance request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Instance::V1::GetInstanceRequest + + # 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_instance.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::Admin::Instance::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_instance.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_instance.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @instance_admin_stub.call_rpc :get_instance, 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 an instance and begins preparing it to begin serving. The + # returned long-running operation + # can be used to track the progress of preparing the new + # instance. The instance name is assigned by the caller. If the + # named instance already exists, `CreateInstance` returns + # `ALREADY_EXISTS`. + # + # Immediately upon completion of this request: + # + # * The instance is readable via the API, with all requested attributes + # but no allocated resources. Its state is `CREATING`. + # + # Until completion of the returned operation: + # + # * Cancelling the operation renders the instance immediately unreadable + # via the API. + # * The instance can be deleted. + # * All other attempts to modify the instance are rejected. + # + # Upon completion of the returned operation: + # + # * Billing for all successfully-allocated resources begins (some types + # may have lower than the requested levels). + # * Databases can be created in the instance. + # * The instance's allocated resource levels are readable via the API. + # * The instance's state becomes `READY`. + # + # The returned long-running operation will + # have a name of the format `/operations/` and + # can be used to track creation of the instance. The + # metadata field type is + # {::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstanceMetadata CreateInstanceMetadata}. + # The response field type is + # {::Google::Cloud::Spanner::Admin::Instance::V1::Instance Instance}, if successful. + # + # @overload create_instance(request, options = nil) + # Pass arguments to `create_instance` via a request object, either of type + # {::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstanceRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstanceRequest, ::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_instance(parent: nil, instance_id: nil, instance: nil) + # Pass arguments to `create_instance` 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 parent [::String] + # Required. The name of the project in which to create the instance. Values + # are of the form `projects/`. + # @param instance_id [::String] + # Required. The ID of the instance to create. Valid identifiers are of the + # form `[a-z][-a-z0-9]*[a-z0-9]` and must be between 2 and 64 characters in + # length. + # @param instance [::Google::Cloud::Spanner::Admin::Instance::V1::Instance, ::Hash] + # Required. The instance to create. The name may be omitted, but if + # specified must be `/instances/`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/spanner/admin/instance/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Spanner::Admin::Instance::V1::CreateInstanceRequest.new + # + # # Call the create_instance method. + # result = client.create_instance request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def create_instance request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstanceRequest + + # 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_instance.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::Admin::Instance::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.parent + header_params["parent"] = request.parent + 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_instance.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_instance.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @instance_admin_stub.call_rpc :create_instance, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates an instance, and begins allocating or releasing resources + # as requested. The returned long-running operation can be used to track the + # progress of updating the instance. If the named instance does not + # exist, returns `NOT_FOUND`. + # + # Immediately upon completion of this request: + # + # * For resource types for which a decrease in the instance's allocation + # has been requested, billing is based on the newly-requested level. + # + # Until completion of the returned operation: + # + # * Cancelling the operation sets its metadata's + # {::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstanceMetadata#cancel_time cancel_time}, + # and begins restoring resources to their pre-request values. The + # operation is guaranteed to succeed at undoing all resource changes, + # after which point it terminates with a `CANCELLED` status. + # * All other attempts to modify the instance are rejected. + # * Reading the instance via the API continues to give the pre-request + # resource levels. + # + # Upon completion of the returned operation: + # + # * Billing begins for all successfully-allocated resources (some types + # may have lower than the requested levels). + # * All newly-reserved resources are available for serving the instance's + # tables. + # * The instance's new resource levels are readable via the API. + # + # The returned long-running operation will + # have a name of the format `/operations/` and + # can be used to track the instance modification. The + # metadata field type is + # {::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstanceMetadata UpdateInstanceMetadata}. + # The response field type is + # {::Google::Cloud::Spanner::Admin::Instance::V1::Instance Instance}, if successful. + # + # Authorization requires `spanner.instances.update` permission on + # the resource {::Google::Cloud::Spanner::Admin::Instance::V1::Instance#name name}. + # + # @overload update_instance(request, options = nil) + # Pass arguments to `update_instance` via a request object, either of type + # {::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstanceRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstanceRequest, ::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 update_instance(instance: nil, field_mask: nil) + # Pass arguments to `update_instance` 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 instance [::Google::Cloud::Spanner::Admin::Instance::V1::Instance, ::Hash] + # Required. The instance to update, which must always include the instance + # name. Otherwise, only fields mentioned in + # {::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstanceRequest#field_mask field_mask} + # need be included. + # @param field_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. A mask specifying which fields in + # {::Google::Cloud::Spanner::Admin::Instance::V1::Instance Instance} should be updated. + # The field mask must always be specified; this prevents any future fields in + # {::Google::Cloud::Spanner::Admin::Instance::V1::Instance Instance} from being erased + # accidentally by clients that do not know about them. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/spanner/admin/instance/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstanceRequest.new + # + # # Call the update_instance method. + # result = client.update_instance request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def update_instance request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstanceRequest + + # 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.update_instance.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::Admin::Instance::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.instance&.name + header_params["instance.name"] = request.instance.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.update_instance.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_instance.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @instance_admin_stub.call_rpc :update_instance, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes an instance. + # + # Immediately upon completion of the request: + # + # * Billing ceases for all of the instance's reserved resources. + # + # Soon afterward: + # + # * The instance and *all of its databases* immediately and + # irrevocably disappear from the API. All data in the databases + # is permanently deleted. + # + # @overload delete_instance(request, options = nil) + # Pass arguments to `delete_instance` via a request object, either of type + # {::Google::Cloud::Spanner::Admin::Instance::V1::DeleteInstanceRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Spanner::Admin::Instance::V1::DeleteInstanceRequest, ::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_instance(name: nil) + # Pass arguments to `delete_instance` 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 instance to be deleted. Values are of the form + # `projects//instances/` + # + # @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/admin/instance/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Spanner::Admin::Instance::V1::DeleteInstanceRequest.new + # + # # Call the delete_instance method. + # result = client.delete_instance request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_instance request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Instance::V1::DeleteInstanceRequest + + # 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_instance.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::Admin::Instance::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_instance.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_instance.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @instance_admin_stub.call_rpc :delete_instance, 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 + + ## + # Sets the access control policy on an instance resource. Replaces any + # existing policy. + # + # Authorization requires `spanner.instances.setIamPolicy` on + # [resource][google.iam.v1.SetIamPolicyRequest.resource]. + # + # @overload set_iam_policy(request, options = nil) + # Pass arguments to `set_iam_policy` via a request object, either of type + # {::Google::Iam::V1::SetIamPolicyRequest} or an equivalent Hash. + # + # @param request [::Google::Iam::V1::SetIamPolicyRequest, ::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 set_iam_policy(resource: nil, policy: nil, update_mask: nil) + # Pass arguments to `set_iam_policy` 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 resource [::String] + # REQUIRED: The resource for which the policy is being specified. + # See the operation documentation for the appropriate value for this field. + # @param policy [::Google::Iam::V1::Policy, ::Hash] + # REQUIRED: The complete policy to be applied to the `resource`. The size of + # the policy is limited to a few 10s of KB. An empty policy is a + # valid policy but certain Cloud Platform services (such as Projects) + # might reject them. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only + # the fields in the mask will be modified. If no mask is provided, the + # following default mask is used: + # + # `paths: "bindings, etag"` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Iam::V1::Policy] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Iam::V1::Policy] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/spanner/admin/instance/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Iam::V1::SetIamPolicyRequest.new + # + # # Call the set_iam_policy method. + # result = client.set_iam_policy request + # + # # The returned object is of type Google::Iam::V1::Policy. + # p result + # + def set_iam_policy request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::SetIamPolicyRequest + + # 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.set_iam_policy.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::Admin::Instance::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.resource + header_params["resource"] = request.resource + 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.set_iam_policy.timeout, + metadata: metadata, + retry_policy: @config.rpcs.set_iam_policy.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @instance_admin_stub.call_rpc :set_iam_policy, 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 the access control policy for an instance resource. Returns an empty + # policy if an instance exists but does not have a policy set. + # + # Authorization requires `spanner.instances.getIamPolicy` on + # [resource][google.iam.v1.GetIamPolicyRequest.resource]. + # + # @overload get_iam_policy(request, options = nil) + # Pass arguments to `get_iam_policy` via a request object, either of type + # {::Google::Iam::V1::GetIamPolicyRequest} or an equivalent Hash. + # + # @param request [::Google::Iam::V1::GetIamPolicyRequest, ::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_iam_policy(resource: nil, options: nil) + # Pass arguments to `get_iam_policy` 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 resource [::String] + # REQUIRED: The resource for which the policy is being requested. + # See the operation documentation for the appropriate value for this field. + # @param options [::Google::Iam::V1::GetPolicyOptions, ::Hash] + # OPTIONAL: A `GetPolicyOptions` object for specifying options to + # `GetIamPolicy`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Iam::V1::Policy] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Iam::V1::Policy] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/spanner/admin/instance/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Iam::V1::GetIamPolicyRequest.new + # + # # Call the get_iam_policy method. + # result = client.get_iam_policy request + # + # # The returned object is of type Google::Iam::V1::Policy. + # p result + # + def get_iam_policy request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::GetIamPolicyRequest + + # 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_iam_policy.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::Admin::Instance::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.resource + header_params["resource"] = request.resource + 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_iam_policy.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_iam_policy.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @instance_admin_stub.call_rpc :get_iam_policy, 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 + + ## + # Returns permissions that the caller has on the specified instance resource. + # + # Attempting this RPC on a non-existent Cloud Spanner instance resource will + # result in a NOT_FOUND error if the user has `spanner.instances.list` + # permission on the containing Google Cloud Project. Otherwise returns an + # empty set of permissions. + # + # @overload test_iam_permissions(request, options = nil) + # Pass arguments to `test_iam_permissions` via a request object, either of type + # {::Google::Iam::V1::TestIamPermissionsRequest} or an equivalent Hash. + # + # @param request [::Google::Iam::V1::TestIamPermissionsRequest, ::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 test_iam_permissions(resource: nil, permissions: nil) + # Pass arguments to `test_iam_permissions` 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 resource [::String] + # REQUIRED: The resource for which the policy detail is being requested. + # See the operation documentation for the appropriate value for this field. + # @param permissions [::Array<::String>] + # The set of permissions to check for the `resource`. Permissions with + # wildcards (such as '*' or 'storage.*') are not allowed. For more + # information see + # [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Iam::V1::TestIamPermissionsResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Iam::V1::TestIamPermissionsResponse] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/spanner/admin/instance/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Iam::V1::TestIamPermissionsRequest.new + # + # # Call the test_iam_permissions method. + # result = client.test_iam_permissions request + # + # # The returned object is of type Google::Iam::V1::TestIamPermissionsResponse. + # p result + # + def test_iam_permissions request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::TestIamPermissionsRequest + + # 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.test_iam_permissions.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::Admin::Instance::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.resource + header_params["resource"] = request.resource + 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.test_iam_permissions.timeout, + metadata: metadata, + retry_policy: @config.rpcs.test_iam_permissions.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @instance_admin_stub.call_rpc :test_iam_permissions, 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 information about a particular instance partition. + # + # @overload get_instance_partition(request, options = nil) + # Pass arguments to `get_instance_partition` via a request object, either of type + # {::Google::Cloud::Spanner::Admin::Instance::V1::GetInstancePartitionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Spanner::Admin::Instance::V1::GetInstancePartitionRequest, ::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_instance_partition(name: nil) + # Pass arguments to `get_instance_partition` 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 requested instance partition. Values are of + # the form + # `projects/{project}/instances/{instance}/instancePartitions/{instance_partition}`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Spanner::Admin::Instance::V1::InstancePartition] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Spanner::Admin::Instance::V1::InstancePartition] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/spanner/admin/instance/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Spanner::Admin::Instance::V1::GetInstancePartitionRequest.new + # + # # Call the get_instance_partition method. + # result = client.get_instance_partition request + # + # # The returned object is of type Google::Cloud::Spanner::Admin::Instance::V1::InstancePartition. + # p result + # + def get_instance_partition request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Instance::V1::GetInstancePartitionRequest + + # 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_instance_partition.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::Admin::Instance::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_instance_partition.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_instance_partition.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @instance_admin_stub.call_rpc :get_instance_partition, 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 an instance partition and begins preparing it to be used. The + # returned long-running operation + # can be used to track the progress of preparing the new instance partition. + # The instance partition name is assigned by the caller. If the named + # instance partition already exists, `CreateInstancePartition` returns + # `ALREADY_EXISTS`. + # + # Immediately upon completion of this request: + # + # * The instance partition is readable via the API, with all requested + # attributes but no allocated resources. Its state is `CREATING`. + # + # Until completion of the returned operation: + # + # * Cancelling the operation renders the instance partition immediately + # unreadable via the API. + # * The instance partition can be deleted. + # * All other attempts to modify the instance partition are rejected. + # + # Upon completion of the returned operation: + # + # * Billing for all successfully-allocated resources begins (some types + # may have lower than the requested levels). + # * Databases can start using this instance partition. + # * The instance partition's allocated resource levels are readable via the + # API. + # * The instance partition's state becomes `READY`. + # + # The returned long-running operation will + # have a name of the format + # `/operations/` and can be used to + # track creation of the instance partition. The + # metadata field type is + # {::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstancePartitionMetadata CreateInstancePartitionMetadata}. + # The response field type is + # {::Google::Cloud::Spanner::Admin::Instance::V1::InstancePartition InstancePartition}, if + # successful. + # + # @overload create_instance_partition(request, options = nil) + # Pass arguments to `create_instance_partition` via a request object, either of type + # {::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstancePartitionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstancePartitionRequest, ::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_instance_partition(parent: nil, instance_partition_id: nil, instance_partition: nil) + # Pass arguments to `create_instance_partition` 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 parent [::String] + # Required. The name of the instance in which to create the instance + # partition. Values are of the form + # `projects//instances/`. + # @param instance_partition_id [::String] + # Required. The ID of the instance partition to create. Valid identifiers are + # of the form `[a-z][-a-z0-9]*[a-z0-9]` and must be between 2 and 64 + # characters in length. + # @param instance_partition [::Google::Cloud::Spanner::Admin::Instance::V1::InstancePartition, ::Hash] + # Required. The instance partition to create. The instance_partition.name may + # be omitted, but if specified must be + # `/instancePartitions/`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/spanner/admin/instance/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Spanner::Admin::Instance::V1::CreateInstancePartitionRequest.new + # + # # Call the create_instance_partition method. + # result = client.create_instance_partition request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def create_instance_partition request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstancePartitionRequest + + # 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_instance_partition.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::Admin::Instance::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.parent + header_params["parent"] = request.parent + 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_instance_partition.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_instance_partition.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @instance_admin_stub.call_rpc :create_instance_partition, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes an existing instance partition. Requires that the + # instance partition is not used by any database or backup and is not the + # default instance partition of an instance. + # + # Authorization requires `spanner.instancePartitions.delete` permission on + # the resource + # {::Google::Cloud::Spanner::Admin::Instance::V1::InstancePartition#name name}. + # + # @overload delete_instance_partition(request, options = nil) + # Pass arguments to `delete_instance_partition` via a request object, either of type + # {::Google::Cloud::Spanner::Admin::Instance::V1::DeleteInstancePartitionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Spanner::Admin::Instance::V1::DeleteInstancePartitionRequest, ::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_instance_partition(name: nil, etag: nil) + # Pass arguments to `delete_instance_partition` 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 instance partition to be deleted. + # Values are of the form + # `projects/{project}/instances/{instance}/instancePartitions/{instance_partition}` + # @param etag [::String] + # Optional. If not empty, the API only deletes the instance partition when + # the etag provided matches the current status of the requested instance + # partition. Otherwise, deletes the instance partition without checking the + # current status of the requested instance partition. + # + # @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/admin/instance/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Spanner::Admin::Instance::V1::DeleteInstancePartitionRequest.new + # + # # Call the delete_instance_partition method. + # result = client.delete_instance_partition request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_instance_partition request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Instance::V1::DeleteInstancePartitionRequest + + # 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_instance_partition.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::Admin::Instance::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_instance_partition.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_instance_partition.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @instance_admin_stub.call_rpc :delete_instance_partition, 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 + + ## + # Updates an instance partition, and begins allocating or releasing resources + # as requested. The returned long-running operation can be used to track the + # progress of updating the instance partition. If the named instance + # partition does not exist, returns `NOT_FOUND`. + # + # Immediately upon completion of this request: + # + # * For resource types for which a decrease in the instance partition's + # allocation has been requested, billing is based on the newly-requested + # level. + # + # Until completion of the returned operation: + # + # * Cancelling the operation sets its metadata's + # {::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstancePartitionMetadata#cancel_time cancel_time}, + # and begins restoring resources to their pre-request values. The + # operation is guaranteed to succeed at undoing all resource changes, + # after which point it terminates with a `CANCELLED` status. + # * All other attempts to modify the instance partition are rejected. + # * Reading the instance partition via the API continues to give the + # pre-request resource levels. + # + # Upon completion of the returned operation: + # + # * Billing begins for all successfully-allocated resources (some types + # may have lower than the requested levels). + # * All newly-reserved resources are available for serving the instance + # partition's tables. + # * The instance partition's new resource levels are readable via the API. + # + # The returned long-running operation will + # have a name of the format + # `/operations/` and can be used to + # track the instance partition modification. The + # metadata field type is + # {::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstancePartitionMetadata UpdateInstancePartitionMetadata}. + # The response field type is + # {::Google::Cloud::Spanner::Admin::Instance::V1::InstancePartition InstancePartition}, if + # successful. + # + # Authorization requires `spanner.instancePartitions.update` permission on + # the resource + # {::Google::Cloud::Spanner::Admin::Instance::V1::InstancePartition#name name}. + # + # @overload update_instance_partition(request, options = nil) + # Pass arguments to `update_instance_partition` via a request object, either of type + # {::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstancePartitionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstancePartitionRequest, ::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 update_instance_partition(instance_partition: nil, field_mask: nil) + # Pass arguments to `update_instance_partition` 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 instance_partition [::Google::Cloud::Spanner::Admin::Instance::V1::InstancePartition, ::Hash] + # Required. The instance partition to update, which must always include the + # instance partition name. Otherwise, only fields mentioned in + # {::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstancePartitionRequest#field_mask field_mask} + # need be included. + # @param field_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. A mask specifying which fields in + # {::Google::Cloud::Spanner::Admin::Instance::V1::InstancePartition InstancePartition} + # should be updated. The field mask must always be specified; this prevents + # any future fields in + # {::Google::Cloud::Spanner::Admin::Instance::V1::InstancePartition InstancePartition} + # from being erased accidentally by clients that do not know about them. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/spanner/admin/instance/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstancePartitionRequest.new + # + # # Call the update_instance_partition method. + # result = client.update_instance_partition request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def update_instance_partition request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstancePartitionRequest + + # 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.update_instance_partition.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::Admin::Instance::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.instance_partition&.name + header_params["instance_partition.name"] = request.instance_partition.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.update_instance_partition.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_instance_partition.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @instance_admin_stub.call_rpc :update_instance_partition, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists instance partition long-running operations in the given instance. + # An instance partition operation has a name of the form + # `projects//instances//instancePartitions//operations/`. + # The long-running operation + # metadata field type + # `metadata.type_url` describes the type of the metadata. Operations returned + # include those that have completed/failed/canceled within the last 7 days, + # and pending operations. Operations returned are ordered by + # `operation.metadata.value.start_time` in descending order starting from the + # most recently started operation. + # + # Authorization requires `spanner.instancePartitionOperations.list` + # permission on the resource + # {::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionOperationsRequest#parent parent}. + # + # @overload list_instance_partition_operations(request, options = nil) + # Pass arguments to `list_instance_partition_operations` via a request object, either of type + # {::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionOperationsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionOperationsRequest, ::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_instance_partition_operations(parent: nil, filter: nil, page_size: nil, page_token: nil, instance_partition_deadline: nil) + # Pass arguments to `list_instance_partition_operations` 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 parent [::String] + # Required. The parent instance of the instance partition operations. + # Values are of the form `projects//instances/`. + # @param filter [::String] + # Optional. An expression that filters the list of returned operations. + # + # A filter expression consists of a field name, a + # comparison operator, and a value for filtering. + # The value must be a string, a number, or a boolean. The comparison operator + # must be one of: `<`, `>`, `<=`, `>=`, `!=`, `=`, or `:`. + # Colon `:` is the contains operator. Filter rules are not case sensitive. + # + # The following fields in the Operation are eligible for filtering: + # + # * `name` - The name of the long-running operation + # * `done` - False if the operation is in progress, else true. + # * `metadata.@type` - the type of metadata. For example, the type string + # for + # {::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstancePartitionMetadata CreateInstancePartitionMetadata} + # is + # `type.googleapis.com/google.spanner.admin.instance.v1.CreateInstancePartitionMetadata`. + # * `metadata.` - any field in metadata.value. + # `metadata.@type` must be specified first, if filtering on metadata + # fields. + # * `error` - Error associated with the long-running operation. + # * `response.@type` - the type of response. + # * `response.` - any field in response.value. + # + # You can combine multiple expressions by enclosing each expression in + # parentheses. By default, expressions are combined with AND logic. However, + # you can specify AND, OR, and NOT logic explicitly. + # + # Here are a few examples: + # + # * `done:true` - The operation is complete. + # * `(metadata.@type=` \ + # `type.googleapis.com/google.spanner.admin.instance.v1.CreateInstancePartitionMetadata) + # AND` \ + # `(metadata.instance_partition.name:custom-instance-partition) AND` \ + # `(metadata.start_time < \"2021-03-28T14:50:00Z\") AND` \ + # `(error:*)` - Return operations where: + # * The operation's metadata type is + # {::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstancePartitionMetadata CreateInstancePartitionMetadata}. + # * The instance partition name contains "custom-instance-partition". + # * The operation started before 2021-03-28T14:50:00Z. + # * The operation resulted in an error. + # @param page_size [::Integer] + # Optional. Number of operations to be returned in the response. If 0 or + # less, defaults to the server's maximum allowed page size. + # @param page_token [::String] + # Optional. If non-empty, `page_token` should contain a + # {::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionOperationsResponse#next_page_token next_page_token} + # from a previous + # {::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionOperationsResponse ListInstancePartitionOperationsResponse} + # to the same `parent` and with the same `filter`. + # @param instance_partition_deadline [::Google::Protobuf::Timestamp, ::Hash] + # Optional. Deadline used while retrieving metadata for instance partition + # operations. Instance partitions whose operation metadata cannot be + # retrieved within this deadline will be added to + # {::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionOperationsResponse#unreachable_instance_partitions unreachable_instance_partitions} + # in + # {::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionOperationsResponse ListInstancePartitionOperationsResponse}. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Gapic::Operation>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Gapic::Operation>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/spanner/admin/instance/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionOperationsRequest.new + # + # # Call the list_instance_partition_operations method. + # result = client.list_instance_partition_operations 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::Longrunning::Operation. + # p item + # end + # + def list_instance_partition_operations request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionOperationsRequest + + # 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_instance_partition_operations.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::Admin::Instance::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.parent + header_params["parent"] = request.parent + 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_instance_partition_operations.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_instance_partition_operations.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @instance_admin_stub.call_rpc :list_instance_partition_operations, request, options: options do |response, operation| + wrap_lro_operation = ->(op_response) { ::Gapic::Operation.new op_response, @operations_client } + response = ::Gapic::PagedEnumerable.new @instance_admin_stub, :list_instance_partition_operations, request, response, operation, options, format_resource: wrap_lro_operation + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Moves an instance to the target instance configuration. You can use the + # returned long-running operation to track + # the progress of moving the instance. + # + # `MoveInstance` returns `FAILED_PRECONDITION` if the instance meets any of + # the following criteria: + # + # * Is undergoing a move to a different instance configuration + # * Has backups + # * Has an ongoing update + # * Contains any CMEK-enabled databases + # * Is a free trial instance + # + # While the operation is pending: + # + # * All other attempts to modify the instance, including changes to its + # compute capacity, are rejected. + # * The following database and backup admin operations are rejected: + # + # * `DatabaseAdmin.CreateDatabase` + # * `DatabaseAdmin.UpdateDatabaseDdl` (disabled if default_leader is + # specified in the request.) + # * `DatabaseAdmin.RestoreDatabase` + # * `DatabaseAdmin.CreateBackup` + # * `DatabaseAdmin.CopyBackup` + # + # * Both the source and target instance configurations are subject to + # hourly compute and storage charges. + # * The instance might experience higher read-write latencies and a higher + # transaction abort rate. However, moving an instance doesn't cause any + # downtime. + # + # The returned long-running operation has + # a name of the format + # `/operations/` and can be used to track + # the move instance operation. The + # metadata field type is + # {::Google::Cloud::Spanner::Admin::Instance::V1::MoveInstanceMetadata MoveInstanceMetadata}. + # The response field type is + # {::Google::Cloud::Spanner::Admin::Instance::V1::Instance Instance}, + # if successful. + # Cancelling the operation sets its metadata's + # {::Google::Cloud::Spanner::Admin::Instance::V1::MoveInstanceMetadata#cancel_time cancel_time}. + # Cancellation is not immediate because it involves moving any data + # previously moved to the target instance configuration back to the original + # instance configuration. You can use this operation to track the progress of + # the cancellation. Upon successful completion of the cancellation, the + # operation terminates with `CANCELLED` status. + # + # If not cancelled, upon completion of the returned operation: + # + # * The instance successfully moves to the target instance + # configuration. + # * You are billed for compute and storage in target instance + # configuration. + # + # Authorization requires the `spanner.instances.update` permission on + # the resource {::Google::Cloud::Spanner::Admin::Instance::V1::Instance instance}. + # + # For more details, see + # [Move an instance](https://cloud.google.com/spanner/docs/move-instance). + # + # @overload move_instance(request, options = nil) + # Pass arguments to `move_instance` via a request object, either of type + # {::Google::Cloud::Spanner::Admin::Instance::V1::MoveInstanceRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Spanner::Admin::Instance::V1::MoveInstanceRequest, ::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 move_instance(name: nil, target_config: nil) + # Pass arguments to `move_instance` 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 instance to move. + # Values are of the form `projects//instances/`. + # @param target_config [::String] + # Required. The target instance configuration where to move the instance. + # Values are of the form `projects//instanceConfigs/`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/spanner/admin/instance/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Spanner::Admin::Instance::V1::MoveInstanceRequest.new + # + # # Call the move_instance method. + # result = client.move_instance request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def move_instance request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Instance::V1::MoveInstanceRequest + + # 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.move_instance.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::Admin::Instance::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.move_instance.timeout, + metadata: metadata, + retry_policy: @config.rpcs.move_instance.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @instance_admin_stub.call_rpc :move_instance, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the InstanceAdmin API. + # + # This class represents the configuration for InstanceAdmin, + # 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::Admin::Instance::V1::InstanceAdmin::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 + # # list_instance_configs to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_instance_configs.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_instance_configs.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::Admin::Instance::V1::InstanceAdmin::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 InstanceAdmin 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 `list_instance_configs` + # @return [::Gapic::Config::Method] + # + attr_reader :list_instance_configs + ## + # RPC-specific configuration for `get_instance_config` + # @return [::Gapic::Config::Method] + # + attr_reader :get_instance_config + ## + # RPC-specific configuration for `create_instance_config` + # @return [::Gapic::Config::Method] + # + attr_reader :create_instance_config + ## + # RPC-specific configuration for `update_instance_config` + # @return [::Gapic::Config::Method] + # + attr_reader :update_instance_config + ## + # RPC-specific configuration for `delete_instance_config` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_instance_config + ## + # RPC-specific configuration for `list_instance_config_operations` + # @return [::Gapic::Config::Method] + # + attr_reader :list_instance_config_operations + ## + # RPC-specific configuration for `list_instances` + # @return [::Gapic::Config::Method] + # + attr_reader :list_instances + ## + # RPC-specific configuration for `list_instance_partitions` + # @return [::Gapic::Config::Method] + # + attr_reader :list_instance_partitions + ## + # RPC-specific configuration for `get_instance` + # @return [::Gapic::Config::Method] + # + attr_reader :get_instance + ## + # RPC-specific configuration for `create_instance` + # @return [::Gapic::Config::Method] + # + attr_reader :create_instance + ## + # RPC-specific configuration for `update_instance` + # @return [::Gapic::Config::Method] + # + attr_reader :update_instance + ## + # RPC-specific configuration for `delete_instance` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_instance + ## + # RPC-specific configuration for `set_iam_policy` + # @return [::Gapic::Config::Method] + # + attr_reader :set_iam_policy + ## + # RPC-specific configuration for `get_iam_policy` + # @return [::Gapic::Config::Method] + # + attr_reader :get_iam_policy + ## + # RPC-specific configuration for `test_iam_permissions` + # @return [::Gapic::Config::Method] + # + attr_reader :test_iam_permissions + ## + # RPC-specific configuration for `get_instance_partition` + # @return [::Gapic::Config::Method] + # + attr_reader :get_instance_partition + ## + # RPC-specific configuration for `create_instance_partition` + # @return [::Gapic::Config::Method] + # + attr_reader :create_instance_partition + ## + # RPC-specific configuration for `delete_instance_partition` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_instance_partition + ## + # RPC-specific configuration for `update_instance_partition` + # @return [::Gapic::Config::Method] + # + attr_reader :update_instance_partition + ## + # RPC-specific configuration for `list_instance_partition_operations` + # @return [::Gapic::Config::Method] + # + attr_reader :list_instance_partition_operations + ## + # RPC-specific configuration for `move_instance` + # @return [::Gapic::Config::Method] + # + attr_reader :move_instance + + # @private + def initialize parent_rpcs = nil + list_instance_configs_config = parent_rpcs.list_instance_configs if parent_rpcs.respond_to? :list_instance_configs + @list_instance_configs = ::Gapic::Config::Method.new list_instance_configs_config + get_instance_config_config = parent_rpcs.get_instance_config if parent_rpcs.respond_to? :get_instance_config + @get_instance_config = ::Gapic::Config::Method.new get_instance_config_config + create_instance_config_config = parent_rpcs.create_instance_config if parent_rpcs.respond_to? :create_instance_config + @create_instance_config = ::Gapic::Config::Method.new create_instance_config_config + update_instance_config_config = parent_rpcs.update_instance_config if parent_rpcs.respond_to? :update_instance_config + @update_instance_config = ::Gapic::Config::Method.new update_instance_config_config + delete_instance_config_config = parent_rpcs.delete_instance_config if parent_rpcs.respond_to? :delete_instance_config + @delete_instance_config = ::Gapic::Config::Method.new delete_instance_config_config + list_instance_config_operations_config = parent_rpcs.list_instance_config_operations if parent_rpcs.respond_to? :list_instance_config_operations + @list_instance_config_operations = ::Gapic::Config::Method.new list_instance_config_operations_config + list_instances_config = parent_rpcs.list_instances if parent_rpcs.respond_to? :list_instances + @list_instances = ::Gapic::Config::Method.new list_instances_config + list_instance_partitions_config = parent_rpcs.list_instance_partitions if parent_rpcs.respond_to? :list_instance_partitions + @list_instance_partitions = ::Gapic::Config::Method.new list_instance_partitions_config + get_instance_config = parent_rpcs.get_instance if parent_rpcs.respond_to? :get_instance + @get_instance = ::Gapic::Config::Method.new get_instance_config + create_instance_config = parent_rpcs.create_instance if parent_rpcs.respond_to? :create_instance + @create_instance = ::Gapic::Config::Method.new create_instance_config + update_instance_config = parent_rpcs.update_instance if parent_rpcs.respond_to? :update_instance + @update_instance = ::Gapic::Config::Method.new update_instance_config + delete_instance_config = parent_rpcs.delete_instance if parent_rpcs.respond_to? :delete_instance + @delete_instance = ::Gapic::Config::Method.new delete_instance_config + set_iam_policy_config = parent_rpcs.set_iam_policy if parent_rpcs.respond_to? :set_iam_policy + @set_iam_policy = ::Gapic::Config::Method.new set_iam_policy_config + get_iam_policy_config = parent_rpcs.get_iam_policy if parent_rpcs.respond_to? :get_iam_policy + @get_iam_policy = ::Gapic::Config::Method.new get_iam_policy_config + test_iam_permissions_config = parent_rpcs.test_iam_permissions if parent_rpcs.respond_to? :test_iam_permissions + @test_iam_permissions = ::Gapic::Config::Method.new test_iam_permissions_config + get_instance_partition_config = parent_rpcs.get_instance_partition if parent_rpcs.respond_to? :get_instance_partition + @get_instance_partition = ::Gapic::Config::Method.new get_instance_partition_config + create_instance_partition_config = parent_rpcs.create_instance_partition if parent_rpcs.respond_to? :create_instance_partition + @create_instance_partition = ::Gapic::Config::Method.new create_instance_partition_config + delete_instance_partition_config = parent_rpcs.delete_instance_partition if parent_rpcs.respond_to? :delete_instance_partition + @delete_instance_partition = ::Gapic::Config::Method.new delete_instance_partition_config + update_instance_partition_config = parent_rpcs.update_instance_partition if parent_rpcs.respond_to? :update_instance_partition + @update_instance_partition = ::Gapic::Config::Method.new update_instance_partition_config + list_instance_partition_operations_config = parent_rpcs.list_instance_partition_operations if parent_rpcs.respond_to? :list_instance_partition_operations + @list_instance_partition_operations = ::Gapic::Config::Method.new list_instance_partition_operations_config + move_instance_config = parent_rpcs.move_instance if parent_rpcs.respond_to? :move_instance + @move_instance = ::Gapic::Config::Method.new move_instance_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google/cloud/spanner/admin/instance/v1/instance_admin/credentials.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google/cloud/spanner/admin/instance/v1/instance_admin/credentials.rb new file mode 100644 index 000000000000..612f72034300 --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google/cloud/spanner/admin/instance/v1/instance_admin/credentials.rb @@ -0,0 +1,56 @@ +# frozen_string_literal: true + +# Copyright 2025 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 Admin + module Instance + module V1 + module InstanceAdmin + # Credentials for the InstanceAdmin API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/spanner.admin" + ] + 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 + end +end diff --git a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google/cloud/spanner/admin/instance/v1/instance_admin/operations.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google/cloud/spanner/admin/instance/v1/instance_admin/operations.rb new file mode 100644 index 000000000000..77ebf3d5a0cd --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google/cloud/spanner/admin/instance/v1/instance_admin/operations.rb @@ -0,0 +1,845 @@ +# frozen_string_literal: true + +# Copyright 2025 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/operation" +require "google/longrunning/operations_pb" + +module Google + module Cloud + module Spanner + module Admin + module Instance + module V1 + module InstanceAdmin + # Service that implements Longrunning Operations API. + class Operations + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "spanner.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :operations_stub + + ## + # Configuration for the InstanceAdmin Operations API. + # + # @yield [config] Configure the Operations client. + # @yieldparam config [Operations::Configuration] + # + # @return [Operations::Configuration] + # + def self.configure + @configure ||= Operations::Configuration.new + yield @configure if block_given? + @configure + end + + ## + # Configure the InstanceAdmin Operations 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 {Operations.configure}. + # + # @yield [config] Configure the Operations client. + # @yieldparam config [Operations::Configuration] + # + # @return [Operations::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @operations_stub.universe_domain + end + + ## + # Create a new Operations client object. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Operations::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/longrunning/operations_services_pb" + + # Create the configuration object + @config = Configuration.new Operations.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + credentials ||= Credentials.default scope: @config.scope + 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 + + @operations_stub = ::Gapic::ServiceStub.new( + ::Google::Longrunning::Operations::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 + ) + + # Used by an LRO wrapper for some methods of this service + @operations_client = self + end + + # Service calls + + ## + # Lists operations that match the specified filter in the request. If the + # server doesn't support this method, it returns `UNIMPLEMENTED`. + # + # @overload list_operations(request, options = nil) + # Pass arguments to `list_operations` via a request object, either of type + # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::ListOperationsRequest, ::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_operations(name: nil, filter: nil, page_size: nil, page_token: nil, return_partial_success: nil) + # Pass arguments to `list_operations` 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] + # The name of the operation's parent resource. + # @param filter [::String] + # The standard list filter. + # @param page_size [::Integer] + # The standard list page size. + # @param page_token [::String] + # The standard list page token. + # @param return_partial_success [::Boolean] + # When set to `true`, operations that are reachable are returned as normal, + # and those that are unreachable are returned in the + # [ListOperationsResponse.unreachable] field. + # + # This can only be `true` when reading across collections e.g. when `parent` + # is set to `"projects/example/locations/-"`. + # + # This field is not by default supported and will result in an + # `UNIMPLEMENTED` error if set unless explicitly documented otherwise in + # service or product specific documentation. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Gapic::Operation>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Gapic::Operation>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::ListOperationsRequest.new + # + # # Call the list_operations method. + # result = client.list_operations 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::Longrunning::Operation. + # p item + # end + # + def list_operations request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::ListOperationsRequest + + # 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_operations.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::Admin::Instance::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.list_operations.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_operations.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :list_operations, request, options: options do |response, operation| + wrap_lro_operation = ->(op_response) { ::Gapic::Operation.new op_response, @operations_client } + response = ::Gapic::PagedEnumerable.new @operations_stub, :list_operations, request, response, operation, options, format_resource: wrap_lro_operation + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets the latest state of a long-running operation. Clients can use this + # method to poll the operation result at intervals as recommended by the API + # service. + # + # @overload get_operation(request, options = nil) + # Pass arguments to `get_operation` via a request object, either of type + # {::Google::Longrunning::GetOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::GetOperationRequest, ::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_operation(name: nil) + # Pass arguments to `get_operation` 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] + # The name of the operation resource. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::GetOperationRequest.new + # + # # Call the get_operation method. + # result = client.get_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def get_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::GetOperationRequest + + # 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_operation.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::Admin::Instance::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_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :get_operation, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a long-running operation. This method indicates that the client is + # no longer interested in the operation result. It does not cancel the + # operation. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # + # @overload delete_operation(request, options = nil) + # Pass arguments to `delete_operation` via a request object, either of type + # {::Google::Longrunning::DeleteOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::DeleteOperationRequest, ::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_operation(name: nil) + # Pass arguments to `delete_operation` 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] + # The name of the operation resource to be deleted. + # + # @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/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::DeleteOperationRequest.new + # + # # Call the delete_operation method. + # result = client.delete_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::DeleteOperationRequest + + # 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_operation.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::Admin::Instance::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_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :delete_operation, 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 + + ## + # Starts asynchronous cancellation on a long-running operation. The server + # makes a best effort to cancel the operation, but success is not + # guaranteed. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. Clients can use + # Operations.GetOperation or + # other methods to check whether the cancellation succeeded or whether the + # operation completed despite cancellation. On successful cancellation, + # the operation is not deleted; instead, it becomes an operation with + # an {::Google::Longrunning::Operation#error Operation.error} value with a + # {::Google::Rpc::Status#code google.rpc.Status.code} of `1`, corresponding to + # `Code.CANCELLED`. + # + # @overload cancel_operation(request, options = nil) + # Pass arguments to `cancel_operation` via a request object, either of type + # {::Google::Longrunning::CancelOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::CancelOperationRequest, ::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 cancel_operation(name: nil) + # Pass arguments to `cancel_operation` 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] + # The name of the operation resource to be cancelled. + # + # @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/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::CancelOperationRequest.new + # + # # Call the cancel_operation method. + # result = client.cancel_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def cancel_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::CancelOperationRequest + + # 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.cancel_operation.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::Admin::Instance::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.cancel_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.cancel_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :cancel_operation, 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 + + ## + # Waits until the specified long-running operation is done or reaches at most + # a specified timeout, returning the latest state. If the operation is + # already done, the latest state is immediately returned. If the timeout + # specified is greater than the default HTTP/RPC timeout, the HTTP/RPC + # timeout is used. If the server does not support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # Note that this method is on a best-effort basis. It may return the latest + # state before the specified timeout (including immediately), meaning even an + # immediate response is no guarantee that the operation is done. + # + # @overload wait_operation(request, options = nil) + # Pass arguments to `wait_operation` via a request object, either of type + # {::Google::Longrunning::WaitOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::WaitOperationRequest, ::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 wait_operation(name: nil, timeout: nil) + # Pass arguments to `wait_operation` 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] + # The name of the operation resource to wait on. + # @param timeout [::Google::Protobuf::Duration, ::Hash] + # The maximum duration to wait before timing out. If left blank, the wait + # will be at most the time permitted by the underlying HTTP/RPC protocol. + # If RPC context deadline is also specified, the shorter one will be used. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::WaitOperationRequest.new + # + # # Call the wait_operation method. + # result = client.wait_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def wait_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::WaitOperationRequest + + # 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.wait_operation.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::Admin::Instance::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 + + options.apply_defaults timeout: @config.rpcs.wait_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.wait_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :wait_operation, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the Operations API. + # + # This class represents the configuration for Operations, + # 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::Longrunning::Operations::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 + # # list_operations to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Longrunning::Operations::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Longrunning::Operations::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.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::Longrunning::Operations::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 Operations 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 `list_operations` + # @return [::Gapic::Config::Method] + # + attr_reader :list_operations + ## + # RPC-specific configuration for `get_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :get_operation + ## + # RPC-specific configuration for `delete_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_operation + ## + # RPC-specific configuration for `cancel_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :cancel_operation + ## + # RPC-specific configuration for `wait_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :wait_operation + + # @private + def initialize parent_rpcs = nil + list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations + @list_operations = ::Gapic::Config::Method.new list_operations_config + get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation + @get_operation = ::Gapic::Config::Method.new get_operation_config + delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation + @delete_operation = ::Gapic::Config::Method.new delete_operation_config + cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation + @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config + wait_operation_config = parent_rpcs.wait_operation if parent_rpcs.respond_to? :wait_operation + @wait_operation = ::Gapic::Config::Method.new wait_operation_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google/cloud/spanner/admin/instance/v1/instance_admin/paths.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google/cloud/spanner/admin/instance/v1/instance_admin/paths.rb new file mode 100644 index 000000000000..bc0b43688e93 --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google/cloud/spanner/admin/instance/v1/instance_admin/paths.rb @@ -0,0 +1,104 @@ +# frozen_string_literal: true + +# Copyright 2025 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 Admin + module Instance + module V1 + module InstanceAdmin + # Path helper methods for the InstanceAdmin API. + module Paths + ## + # Create a fully-qualified Instance resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/instances/{instance}` + # + # @param project [String] + # @param instance [String] + # + # @return [::String] + def instance_path project:, instance: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + + "projects/#{project}/instances/#{instance}" + end + + ## + # Create a fully-qualified InstanceConfig resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/instanceConfigs/{instance_config}` + # + # @param project [String] + # @param instance_config [String] + # + # @return [::String] + def instance_config_path project:, instance_config: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + + "projects/#{project}/instanceConfigs/#{instance_config}" + end + + ## + # Create a fully-qualified InstancePartition resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/instances/{instance}/instancePartitions/{instance_partition}` + # + # @param project [String] + # @param instance [String] + # @param instance_partition [String] + # + # @return [::String] + def instance_partition_path project:, instance:, instance_partition: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "instance cannot contain /" if instance.to_s.include? "/" + + "projects/#{project}/instances/#{instance}/instancePartitions/#{instance_partition}" + end + + ## + # Create a fully-qualified Project resource string. + # + # The resource will be in the following format: + # + # `projects/{project}` + # + # @param project [String] + # + # @return [::String] + def project_path project: + "projects/#{project}" + end + + extend self + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google/cloud/spanner/admin/instance/v1/instance_admin/rest.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google/cloud/spanner/admin/instance/v1/instance_admin/rest.rb new file mode 100644 index 000000000000..cd77a4203fb8 --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google/cloud/spanner/admin/instance/v1/instance_admin/rest.rb @@ -0,0 +1,77 @@ +# frozen_string_literal: true + +# Copyright 2025 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/rest" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/spanner/admin/instance/v1/version" + +require "google/cloud/spanner/admin/instance/v1/instance_admin/credentials" +require "google/cloud/spanner/admin/instance/v1/instance_admin/paths" +require "google/cloud/spanner/admin/instance/v1/instance_admin/rest/operations" +require "google/cloud/spanner/admin/instance/v1/instance_admin/rest/client" + +module Google + module Cloud + module Spanner + module Admin + module Instance + module V1 + ## + # Cloud Spanner Instance Admin API + # + # The Cloud Spanner Instance Admin API can be used to create, delete, + # modify and list instances. Instances are dedicated Cloud Spanner serving + # and storage resources to be used by Cloud Spanner databases. + # + # Each instance has a "configuration", which dictates where the + # serving resources for the Cloud Spanner instance are located (e.g., + # US-central, Europe). Configurations are created by Google based on + # resource availability. + # + # Cloud Spanner billing is based on the instances that exist and their + # sizes. After an instance exists, there are no additional + # per-database or per-operation charges for use of the instance + # (though there may be additional network bandwidth charges). + # Instances offer isolation: problems with databases in one instance + # will not affect other instances. However, within an instance + # databases can affect each other. For example, if one database in an + # instance receives a lot of requests and consumes most of the + # instance resources, fewer resources are available for other + # databases in that instance, and their performance may suffer. + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/spanner/admin/instance/v1/instance_admin/rest" + # client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::Client.new + # + module InstanceAdmin + # Client for the REST transport + module Rest + end + end + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "rest", "helpers.rb" +require "google/cloud/spanner/admin/instance/v1/instance_admin/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google/cloud/spanner/admin/instance/v1/instance_admin/rest/client.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google/cloud/spanner/admin/instance/v1/instance_admin/rest/client.rb new file mode 100644 index 000000000000..13352411f4fa --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google/cloud/spanner/admin/instance/v1/instance_admin/rest/client.rb @@ -0,0 +1,2948 @@ +# frozen_string_literal: true + +# Copyright 2025 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/admin/instance/v1/spanner_instance_admin_pb" +require "google/cloud/spanner/admin/instance/v1/instance_admin/rest/service_stub" + +module Google + module Cloud + module Spanner + module Admin + module Instance + module V1 + module InstanceAdmin + module Rest + ## + # REST client for the InstanceAdmin service. + # + # Cloud Spanner Instance Admin API + # + # The Cloud Spanner Instance Admin API can be used to create, delete, + # modify and list instances. Instances are dedicated Cloud Spanner serving + # and storage resources to be used by Cloud Spanner databases. + # + # Each instance has a "configuration", which dictates where the + # serving resources for the Cloud Spanner instance are located (e.g., + # US-central, Europe). Configurations are created by Google based on + # resource availability. + # + # Cloud Spanner billing is based on the instances that exist and their + # sizes. After an instance exists, there are no additional + # per-database or per-operation charges for use of the instance + # (though there may be additional network bandwidth charges). + # Instances offer isolation: problems with databases in one instance + # will not affect other instances. However, within an instance + # databases can affect each other. For example, if one database in an + # instance receives a lot of requests and consumes most of the + # instance resources, fewer resources are available for other + # databases in that instance, and their performance may suffer. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "spanner.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :instance_admin_stub + + ## + # Configure the InstanceAdmin Client class. + # + # See {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all InstanceAdmin clients + # ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::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", "Admin", "Instance", "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.list_instance_configs.timeout = 3600.0 + default_config.rpcs.list_instance_configs.retry_policy = { + initial_delay: 1.0, max_delay: 32.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.get_instance_config.timeout = 3600.0 + default_config.rpcs.get_instance_config.retry_policy = { + initial_delay: 1.0, max_delay: 32.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.list_instances.timeout = 3600.0 + default_config.rpcs.list_instances.retry_policy = { + initial_delay: 1.0, max_delay: 32.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.get_instance.timeout = 3600.0 + default_config.rpcs.get_instance.retry_policy = { + initial_delay: 1.0, max_delay: 32.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.create_instance.timeout = 3600.0 + + default_config.rpcs.update_instance.timeout = 3600.0 + + default_config.rpcs.delete_instance.timeout = 3600.0 + default_config.rpcs.delete_instance.retry_policy = { + initial_delay: 1.0, max_delay: 32.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.set_iam_policy.timeout = 30.0 + + default_config.rpcs.get_iam_policy.timeout = 30.0 + default_config.rpcs.get_iam_policy.retry_policy = { + initial_delay: 1.0, max_delay: 32.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.test_iam_permissions.timeout = 30.0 + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the InstanceAdmin 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::Admin::Instance::V1::InstanceAdmin::Rest::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 + @instance_admin_stub.universe_domain + end + + ## + # Create a new InstanceAdmin REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the InstanceAdmin client. + # @yieldparam config [Client::Configuration] + # + def initialize + # 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 + + @operations_client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::Operations.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @config.endpoint + config.universe_domain = @config.universe_domain + end + + @instance_admin_stub = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @instance_admin_stub.logger(stub: true)&.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 + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::Operations] + # + attr_reader :operations_client + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @instance_admin_stub.logger + end + + # Service calls + + ## + # Lists the supported instance configurations for a given project. + # + # Returns both Google-managed configurations and user-managed + # configurations. + # + # @overload list_instance_configs(request, options = nil) + # Pass arguments to `list_instance_configs` via a request object, either of type + # {::Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigsRequest, ::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_instance_configs(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_instance_configs` 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 parent [::String] + # Required. The name of the project for which a list of supported instance + # configurations is requested. Values are of the form + # `projects/`. + # @param page_size [::Integer] + # Number of instance configurations 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::Admin::Instance::V1::ListInstanceConfigsResponse#next_page_token next_page_token} + # from a previous + # {::Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigsResponse ListInstanceConfigsResponse}. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/spanner/admin/instance/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigsRequest.new + # + # # Call the list_instance_configs method. + # result = client.list_instance_configs 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::Admin::Instance::V1::InstanceConfig. + # p item + # end + # + def list_instance_configs request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigsRequest + + # 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 + call_metadata = @config.rpcs.list_instance_configs.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_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::Admin::Instance::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_instance_configs.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_instance_configs.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @instance_admin_stub.list_instance_configs request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @instance_admin_stub, :list_instance_configs, "instance_configs", request, result, options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets information about a particular instance configuration. + # + # @overload get_instance_config(request, options = nil) + # Pass arguments to `get_instance_config` via a request object, either of type + # {::Google::Cloud::Spanner::Admin::Instance::V1::GetInstanceConfigRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Spanner::Admin::Instance::V1::GetInstanceConfigRequest, ::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_instance_config(name: nil) + # Pass arguments to `get_instance_config` 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 requested instance configuration. Values are of + # the form `projects//instanceConfigs/`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/spanner/admin/instance/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Spanner::Admin::Instance::V1::GetInstanceConfigRequest.new + # + # # Call the get_instance_config method. + # result = client.get_instance_config request + # + # # The returned object is of type Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig. + # p result + # + def get_instance_config request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Instance::V1::GetInstanceConfigRequest + + # 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 + call_metadata = @config.rpcs.get_instance_config.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_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::Admin::Instance::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_instance_config.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_instance_config.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @instance_admin_stub.get_instance_config request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates an instance configuration and begins preparing it to be used. The + # returned long-running operation + # can be used to track the progress of preparing the new + # instance configuration. The instance configuration name is assigned by the + # caller. If the named instance configuration already exists, + # `CreateInstanceConfig` returns `ALREADY_EXISTS`. + # + # Immediately after the request returns: + # + # * The instance configuration is readable via the API, with all requested + # attributes. The instance configuration's + # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig#reconciling reconciling} + # field is set to true. Its state is `CREATING`. + # + # While the operation is pending: + # + # * Cancelling the operation renders the instance configuration immediately + # unreadable via the API. + # * Except for deleting the creating resource, all other attempts to modify + # the instance configuration are rejected. + # + # Upon completion of the returned operation: + # + # * Instances can be created using the instance configuration. + # * The instance configuration's + # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig#reconciling reconciling} + # field becomes false. Its state becomes `READY`. + # + # The returned long-running operation will + # have a name of the format + # `/operations/` and can be used to track + # creation of the instance configuration. The + # metadata field type is + # {::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstanceConfigMetadata CreateInstanceConfigMetadata}. + # The response field type is + # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig InstanceConfig}, if + # successful. + # + # Authorization requires `spanner.instanceConfigs.create` permission on + # the resource + # {::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstanceConfigRequest#parent parent}. + # + # @overload create_instance_config(request, options = nil) + # Pass arguments to `create_instance_config` via a request object, either of type + # {::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstanceConfigRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstanceConfigRequest, ::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_instance_config(parent: nil, instance_config_id: nil, instance_config: nil, validate_only: nil) + # Pass arguments to `create_instance_config` 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 parent [::String] + # Required. The name of the project in which to create the instance + # configuration. Values are of the form `projects/`. + # @param instance_config_id [::String] + # Required. The ID of the instance configuration to create. Valid identifiers + # are of the form `custom-[-a-z0-9]*[a-z0-9]` and must be between 2 and 64 + # characters in length. The `custom-` prefix is required to avoid name + # conflicts with Google-managed configurations. + # @param instance_config [::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig, ::Hash] + # Required. The `InstanceConfig` proto of the configuration to create. + # `instance_config.name` must be + # `/instanceConfigs/`. + # `instance_config.base_config` must be a Google-managed configuration name, + # e.g. /instanceConfigs/us-east1, /instanceConfigs/nam3. + # @param validate_only [::Boolean] + # An option to validate, but not actually execute, a request, + # and provide the same response. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/spanner/admin/instance/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Spanner::Admin::Instance::V1::CreateInstanceConfigRequest.new + # + # # Call the create_instance_config method. + # result = client.create_instance_config request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def create_instance_config request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstanceConfigRequest + + # 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 + call_metadata = @config.rpcs.create_instance_config.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_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::Admin::Instance::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.create_instance_config.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_instance_config.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @instance_admin_stub.create_instance_config request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates an instance configuration. The returned + # long-running operation can be used to track + # the progress of updating the instance. If the named instance configuration + # does not exist, returns `NOT_FOUND`. + # + # Only user-managed configurations can be updated. + # + # Immediately after the request returns: + # + # * The instance configuration's + # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig#reconciling reconciling} + # field is set to true. + # + # While the operation is pending: + # + # * Cancelling the operation sets its metadata's + # {::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstanceConfigMetadata#cancel_time cancel_time}. + # The operation is guaranteed to succeed at undoing all changes, after + # which point it terminates with a `CANCELLED` status. + # * All other attempts to modify the instance configuration are rejected. + # * Reading the instance configuration via the API continues to give the + # pre-request values. + # + # Upon completion of the returned operation: + # + # * Creating instances using the instance configuration uses the new + # values. + # * The new values of the instance configuration are readable via the API. + # * The instance configuration's + # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig#reconciling reconciling} + # field becomes false. + # + # The returned long-running operation will + # have a name of the format + # `/operations/` and can be used to track + # the instance configuration modification. The + # metadata field type is + # {::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstanceConfigMetadata UpdateInstanceConfigMetadata}. + # The response field type is + # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig InstanceConfig}, if + # successful. + # + # Authorization requires `spanner.instanceConfigs.update` permission on + # the resource {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig#name name}. + # + # @overload update_instance_config(request, options = nil) + # Pass arguments to `update_instance_config` via a request object, either of type + # {::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstanceConfigRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstanceConfigRequest, ::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 update_instance_config(instance_config: nil, update_mask: nil, validate_only: nil) + # Pass arguments to `update_instance_config` 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 instance_config [::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig, ::Hash] + # Required. The user instance configuration to update, which must always + # include the instance configuration name. Otherwise, only fields mentioned + # in + # {::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstanceConfigRequest#update_mask update_mask} + # need be included. To prevent conflicts of concurrent updates, + # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig#reconciling etag} can + # be used. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. A mask specifying which fields in + # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig InstanceConfig} should be + # updated. The field mask must always be specified; this prevents any future + # fields in {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig InstanceConfig} + # from being erased accidentally by clients that do not know about them. Only + # display_name and labels can be updated. + # @param validate_only [::Boolean] + # An option to validate, but not actually execute, a request, + # and provide the same response. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/spanner/admin/instance/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstanceConfigRequest.new + # + # # Call the update_instance_config method. + # result = client.update_instance_config request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def update_instance_config request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstanceConfigRequest + + # 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 + call_metadata = @config.rpcs.update_instance_config.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_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::Admin::Instance::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.update_instance_config.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_instance_config.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @instance_admin_stub.update_instance_config request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes the instance configuration. Deletion is only allowed when no + # instances are using the configuration. If any instances are using + # the configuration, returns `FAILED_PRECONDITION`. + # + # Only user-managed configurations can be deleted. + # + # Authorization requires `spanner.instanceConfigs.delete` permission on + # the resource {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig#name name}. + # + # @overload delete_instance_config(request, options = nil) + # Pass arguments to `delete_instance_config` via a request object, either of type + # {::Google::Cloud::Spanner::Admin::Instance::V1::DeleteInstanceConfigRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Spanner::Admin::Instance::V1::DeleteInstanceConfigRequest, ::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_instance_config(name: nil, etag: nil, validate_only: nil) + # Pass arguments to `delete_instance_config` 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 instance configuration to be deleted. + # Values are of the form + # `projects//instanceConfigs/` + # @param etag [::String] + # Used for optimistic concurrency control as a way to help prevent + # simultaneous deletes of an instance configuration from overwriting each + # other. If not empty, the API + # only deletes the instance configuration when the etag provided matches the + # current status of the requested instance configuration. Otherwise, deletes + # the instance configuration without checking the current status of the + # requested instance configuration. + # @param validate_only [::Boolean] + # An option to validate, but not actually execute, a request, + # and provide the same response. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/spanner/admin/instance/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Spanner::Admin::Instance::V1::DeleteInstanceConfigRequest.new + # + # # Call the delete_instance_config method. + # result = client.delete_instance_config request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_instance_config request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Instance::V1::DeleteInstanceConfigRequest + + # 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 + call_metadata = @config.rpcs.delete_instance_config.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_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::Admin::Instance::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.delete_instance_config.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_instance_config.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @instance_admin_stub.delete_instance_config request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists the user-managed instance configuration long-running + # operations in the given project. An instance + # configuration operation has a name of the form + # `projects//instanceConfigs//operations/`. + # The long-running operation + # metadata field type + # `metadata.type_url` describes the type of the metadata. Operations returned + # include those that have completed/failed/canceled within the last 7 days, + # and pending operations. Operations returned are ordered by + # `operation.metadata.value.start_time` in descending order starting + # from the most recently started operation. + # + # @overload list_instance_config_operations(request, options = nil) + # Pass arguments to `list_instance_config_operations` via a request object, either of type + # {::Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigOperationsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigOperationsRequest, ::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_instance_config_operations(parent: nil, filter: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_instance_config_operations` 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 parent [::String] + # Required. The project of the instance configuration operations. + # Values are of the form `projects/`. + # @param filter [::String] + # An expression that filters the list of returned operations. + # + # A filter expression consists of a field name, a + # comparison operator, and a value for filtering. + # The value must be a string, a number, or a boolean. The comparison operator + # must be one of: `<`, `>`, `<=`, `>=`, `!=`, `=`, or `:`. + # Colon `:` is the contains operator. Filter rules are not case sensitive. + # + # The following fields in the Operation are eligible for filtering: + # + # * `name` - The name of the long-running operation + # * `done` - False if the operation is in progress, else true. + # * `metadata.@type` - the type of metadata. For example, the type string + # for + # {::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstanceConfigMetadata CreateInstanceConfigMetadata} + # is + # `type.googleapis.com/google.spanner.admin.instance.v1.CreateInstanceConfigMetadata`. + # * `metadata.` - any field in metadata.value. + # `metadata.@type` must be specified first, if filtering on metadata + # fields. + # * `error` - Error associated with the long-running operation. + # * `response.@type` - the type of response. + # * `response.` - any field in response.value. + # + # You can combine multiple expressions by enclosing each expression in + # parentheses. By default, expressions are combined with AND logic. However, + # you can specify AND, OR, and NOT logic explicitly. + # + # Here are a few examples: + # + # * `done:true` - The operation is complete. + # * `(metadata.@type=` \ + # `type.googleapis.com/google.spanner.admin.instance.v1.CreateInstanceConfigMetadata) + # AND` \ + # `(metadata.instance_config.name:custom-config) AND` \ + # `(metadata.progress.start_time < \"2021-03-28T14:50:00Z\") AND` \ + # `(error:*)` - Return operations where: + # * The operation's metadata type is + # {::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstanceConfigMetadata CreateInstanceConfigMetadata}. + # * The instance configuration name contains "custom-config". + # * The operation started before 2021-03-28T14:50:00Z. + # * The operation resulted in an error. + # @param page_size [::Integer] + # Number of operations 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::Admin::Instance::V1::ListInstanceConfigOperationsResponse#next_page_token next_page_token} + # from a previous + # {::Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigOperationsResponse ListInstanceConfigOperationsResponse} + # to the same `parent` and with the same `filter`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/spanner/admin/instance/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigOperationsRequest.new + # + # # Call the list_instance_config_operations method. + # result = client.list_instance_config_operations 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::Longrunning::Operation. + # p item + # end + # + def list_instance_config_operations request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigOperationsRequest + + # 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 + call_metadata = @config.rpcs.list_instance_config_operations.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_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::Admin::Instance::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_instance_config_operations.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_instance_config_operations.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @instance_admin_stub.list_instance_config_operations request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @instance_admin_stub, :list_instance_config_operations, "operations", request, result, options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists all instances in the given project. + # + # @overload list_instances(request, options = nil) + # Pass arguments to `list_instances` via a request object, either of type + # {::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancesRequest, ::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_instances(parent: nil, page_size: nil, page_token: nil, filter: nil, instance_deadline: nil) + # Pass arguments to `list_instances` 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 parent [::String] + # Required. The name of the project for which a list of instances is + # requested. Values are of the form `projects/`. + # @param page_size [::Integer] + # Number of instances 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::Admin::Instance::V1::ListInstancesResponse#next_page_token next_page_token} + # from a previous + # {::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancesResponse ListInstancesResponse}. + # @param filter [::String] + # An expression for filtering the results of the request. Filter rules are + # case insensitive. The fields eligible for filtering are: + # + # * `name` + # * `display_name` + # * `labels.key` where key is the name of a label + # + # Some examples of using filters are: + # + # * `name:*` --> The instance has a name. + # * `name:Howl` --> The instance's name contains the string "howl". + # * `name:HOWL` --> Equivalent to above. + # * `NAME:howl` --> Equivalent to above. + # * `labels.env:*` --> The instance has the label "env". + # * `labels.env:dev` --> The instance has the label "env" and the value of + # the label contains the string "dev". + # * `name:howl labels.env:dev` --> The instance's name contains "howl" and + # it has the label "env" with its value + # containing "dev". + # @param instance_deadline [::Google::Protobuf::Timestamp, ::Hash] + # Deadline used while retrieving metadata for instances. + # Instances whose metadata cannot be retrieved within this deadline will be + # added to + # {::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancesResponse#unreachable unreachable} + # in + # {::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancesResponse ListInstancesResponse}. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Spanner::Admin::Instance::V1::Instance>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Spanner::Admin::Instance::V1::Instance>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/spanner/admin/instance/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Spanner::Admin::Instance::V1::ListInstancesRequest.new + # + # # Call the list_instances method. + # result = client.list_instances 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::Admin::Instance::V1::Instance. + # p item + # end + # + def list_instances request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancesRequest + + # 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 + call_metadata = @config.rpcs.list_instances.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_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::Admin::Instance::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_instances.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_instances.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @instance_admin_stub.list_instances request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @instance_admin_stub, :list_instances, "instances", request, result, options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists all instance partitions for the given instance. + # + # @overload list_instance_partitions(request, options = nil) + # Pass arguments to `list_instance_partitions` via a request object, either of type + # {::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionsRequest, ::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_instance_partitions(parent: nil, page_size: nil, page_token: nil, instance_partition_deadline: nil) + # Pass arguments to `list_instance_partitions` 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 parent [::String] + # Required. The instance whose instance partitions should be listed. Values + # are of the form `projects//instances/`. Use `{instance} + # = '-'` to list instance partitions for all Instances in a project, e.g., + # `projects/myproject/instances/-`. + # @param page_size [::Integer] + # Number of instance partitions 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::Admin::Instance::V1::ListInstancePartitionsResponse#next_page_token next_page_token} + # from a previous + # {::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionsResponse ListInstancePartitionsResponse}. + # @param instance_partition_deadline [::Google::Protobuf::Timestamp, ::Hash] + # Optional. Deadline used while retrieving metadata for instance partitions. + # Instance partitions whose metadata cannot be retrieved within this deadline + # will be added to + # {::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionsResponse#unreachable unreachable} + # in + # {::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionsResponse ListInstancePartitionsResponse}. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Spanner::Admin::Instance::V1::InstancePartition>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Spanner::Admin::Instance::V1::InstancePartition>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/spanner/admin/instance/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionsRequest.new + # + # # Call the list_instance_partitions method. + # result = client.list_instance_partitions 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::Admin::Instance::V1::InstancePartition. + # p item + # end + # + def list_instance_partitions request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionsRequest + + # 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 + call_metadata = @config.rpcs.list_instance_partitions.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_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::Admin::Instance::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_instance_partitions.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_instance_partitions.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @instance_admin_stub.list_instance_partitions request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @instance_admin_stub, :list_instance_partitions, "instance_partitions", request, result, options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets information about a particular instance. + # + # @overload get_instance(request, options = nil) + # Pass arguments to `get_instance` via a request object, either of type + # {::Google::Cloud::Spanner::Admin::Instance::V1::GetInstanceRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Spanner::Admin::Instance::V1::GetInstanceRequest, ::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_instance(name: nil, field_mask: nil) + # Pass arguments to `get_instance` 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 requested instance. Values are of the form + # `projects//instances/`. + # @param field_mask [::Google::Protobuf::FieldMask, ::Hash] + # If field_mask is present, specifies the subset of + # {::Google::Cloud::Spanner::Admin::Instance::V1::Instance Instance} fields that should be + # returned. If absent, all + # {::Google::Cloud::Spanner::Admin::Instance::V1::Instance Instance} fields are returned. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Spanner::Admin::Instance::V1::Instance] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Spanner::Admin::Instance::V1::Instance] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/spanner/admin/instance/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Spanner::Admin::Instance::V1::GetInstanceRequest.new + # + # # Call the get_instance method. + # result = client.get_instance request + # + # # The returned object is of type Google::Cloud::Spanner::Admin::Instance::V1::Instance. + # p result + # + def get_instance request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Instance::V1::GetInstanceRequest + + # 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 + call_metadata = @config.rpcs.get_instance.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_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::Admin::Instance::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_instance.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_instance.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @instance_admin_stub.get_instance request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates an instance and begins preparing it to begin serving. The + # returned long-running operation + # can be used to track the progress of preparing the new + # instance. The instance name is assigned by the caller. If the + # named instance already exists, `CreateInstance` returns + # `ALREADY_EXISTS`. + # + # Immediately upon completion of this request: + # + # * The instance is readable via the API, with all requested attributes + # but no allocated resources. Its state is `CREATING`. + # + # Until completion of the returned operation: + # + # * Cancelling the operation renders the instance immediately unreadable + # via the API. + # * The instance can be deleted. + # * All other attempts to modify the instance are rejected. + # + # Upon completion of the returned operation: + # + # * Billing for all successfully-allocated resources begins (some types + # may have lower than the requested levels). + # * Databases can be created in the instance. + # * The instance's allocated resource levels are readable via the API. + # * The instance's state becomes `READY`. + # + # The returned long-running operation will + # have a name of the format `/operations/` and + # can be used to track creation of the instance. The + # metadata field type is + # {::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstanceMetadata CreateInstanceMetadata}. + # The response field type is + # {::Google::Cloud::Spanner::Admin::Instance::V1::Instance Instance}, if successful. + # + # @overload create_instance(request, options = nil) + # Pass arguments to `create_instance` via a request object, either of type + # {::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstanceRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstanceRequest, ::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_instance(parent: nil, instance_id: nil, instance: nil) + # Pass arguments to `create_instance` 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 parent [::String] + # Required. The name of the project in which to create the instance. Values + # are of the form `projects/`. + # @param instance_id [::String] + # Required. The ID of the instance to create. Valid identifiers are of the + # form `[a-z][-a-z0-9]*[a-z0-9]` and must be between 2 and 64 characters in + # length. + # @param instance [::Google::Cloud::Spanner::Admin::Instance::V1::Instance, ::Hash] + # Required. The instance to create. The name may be omitted, but if + # specified must be `/instances/`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/spanner/admin/instance/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Spanner::Admin::Instance::V1::CreateInstanceRequest.new + # + # # Call the create_instance method. + # result = client.create_instance request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def create_instance request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstanceRequest + + # 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 + call_metadata = @config.rpcs.create_instance.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_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::Admin::Instance::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.create_instance.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_instance.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @instance_admin_stub.create_instance request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates an instance, and begins allocating or releasing resources + # as requested. The returned long-running operation can be used to track the + # progress of updating the instance. If the named instance does not + # exist, returns `NOT_FOUND`. + # + # Immediately upon completion of this request: + # + # * For resource types for which a decrease in the instance's allocation + # has been requested, billing is based on the newly-requested level. + # + # Until completion of the returned operation: + # + # * Cancelling the operation sets its metadata's + # {::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstanceMetadata#cancel_time cancel_time}, + # and begins restoring resources to their pre-request values. The + # operation is guaranteed to succeed at undoing all resource changes, + # after which point it terminates with a `CANCELLED` status. + # * All other attempts to modify the instance are rejected. + # * Reading the instance via the API continues to give the pre-request + # resource levels. + # + # Upon completion of the returned operation: + # + # * Billing begins for all successfully-allocated resources (some types + # may have lower than the requested levels). + # * All newly-reserved resources are available for serving the instance's + # tables. + # * The instance's new resource levels are readable via the API. + # + # The returned long-running operation will + # have a name of the format `/operations/` and + # can be used to track the instance modification. The + # metadata field type is + # {::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstanceMetadata UpdateInstanceMetadata}. + # The response field type is + # {::Google::Cloud::Spanner::Admin::Instance::V1::Instance Instance}, if successful. + # + # Authorization requires `spanner.instances.update` permission on + # the resource {::Google::Cloud::Spanner::Admin::Instance::V1::Instance#name name}. + # + # @overload update_instance(request, options = nil) + # Pass arguments to `update_instance` via a request object, either of type + # {::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstanceRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstanceRequest, ::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 update_instance(instance: nil, field_mask: nil) + # Pass arguments to `update_instance` 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 instance [::Google::Cloud::Spanner::Admin::Instance::V1::Instance, ::Hash] + # Required. The instance to update, which must always include the instance + # name. Otherwise, only fields mentioned in + # {::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstanceRequest#field_mask field_mask} + # need be included. + # @param field_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. A mask specifying which fields in + # {::Google::Cloud::Spanner::Admin::Instance::V1::Instance Instance} should be updated. + # The field mask must always be specified; this prevents any future fields in + # {::Google::Cloud::Spanner::Admin::Instance::V1::Instance Instance} from being erased + # accidentally by clients that do not know about them. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/spanner/admin/instance/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstanceRequest.new + # + # # Call the update_instance method. + # result = client.update_instance request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def update_instance request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstanceRequest + + # 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 + call_metadata = @config.rpcs.update_instance.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_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::Admin::Instance::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.update_instance.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_instance.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @instance_admin_stub.update_instance request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes an instance. + # + # Immediately upon completion of the request: + # + # * Billing ceases for all of the instance's reserved resources. + # + # Soon afterward: + # + # * The instance and *all of its databases* immediately and + # irrevocably disappear from the API. All data in the databases + # is permanently deleted. + # + # @overload delete_instance(request, options = nil) + # Pass arguments to `delete_instance` via a request object, either of type + # {::Google::Cloud::Spanner::Admin::Instance::V1::DeleteInstanceRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Spanner::Admin::Instance::V1::DeleteInstanceRequest, ::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_instance(name: nil) + # Pass arguments to `delete_instance` 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 instance to be deleted. Values are of the form + # `projects//instances/` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/spanner/admin/instance/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Spanner::Admin::Instance::V1::DeleteInstanceRequest.new + # + # # Call the delete_instance method. + # result = client.delete_instance request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_instance request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Instance::V1::DeleteInstanceRequest + + # 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 + call_metadata = @config.rpcs.delete_instance.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_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::Admin::Instance::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.delete_instance.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_instance.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @instance_admin_stub.delete_instance request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Sets the access control policy on an instance resource. Replaces any + # existing policy. + # + # Authorization requires `spanner.instances.setIamPolicy` on + # [resource][google.iam.v1.SetIamPolicyRequest.resource]. + # + # @overload set_iam_policy(request, options = nil) + # Pass arguments to `set_iam_policy` via a request object, either of type + # {::Google::Iam::V1::SetIamPolicyRequest} or an equivalent Hash. + # + # @param request [::Google::Iam::V1::SetIamPolicyRequest, ::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 set_iam_policy(resource: nil, policy: nil, update_mask: nil) + # Pass arguments to `set_iam_policy` 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 resource [::String] + # REQUIRED: The resource for which the policy is being specified. + # See the operation documentation for the appropriate value for this field. + # @param policy [::Google::Iam::V1::Policy, ::Hash] + # REQUIRED: The complete policy to be applied to the `resource`. The size of + # the policy is limited to a few 10s of KB. An empty policy is a + # valid policy but certain Cloud Platform services (such as Projects) + # might reject them. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only + # the fields in the mask will be modified. If no mask is provided, the + # following default mask is used: + # + # `paths: "bindings, etag"` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Iam::V1::Policy] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Iam::V1::Policy] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/spanner/admin/instance/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Iam::V1::SetIamPolicyRequest.new + # + # # Call the set_iam_policy method. + # result = client.set_iam_policy request + # + # # The returned object is of type Google::Iam::V1::Policy. + # p result + # + def set_iam_policy request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::SetIamPolicyRequest + + # 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 + call_metadata = @config.rpcs.set_iam_policy.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_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::Admin::Instance::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.set_iam_policy.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.set_iam_policy.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @instance_admin_stub.set_iam_policy request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets the access control policy for an instance resource. Returns an empty + # policy if an instance exists but does not have a policy set. + # + # Authorization requires `spanner.instances.getIamPolicy` on + # [resource][google.iam.v1.GetIamPolicyRequest.resource]. + # + # @overload get_iam_policy(request, options = nil) + # Pass arguments to `get_iam_policy` via a request object, either of type + # {::Google::Iam::V1::GetIamPolicyRequest} or an equivalent Hash. + # + # @param request [::Google::Iam::V1::GetIamPolicyRequest, ::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_iam_policy(resource: nil, options: nil) + # Pass arguments to `get_iam_policy` 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 resource [::String] + # REQUIRED: The resource for which the policy is being requested. + # See the operation documentation for the appropriate value for this field. + # @param options [::Google::Iam::V1::GetPolicyOptions, ::Hash] + # OPTIONAL: A `GetPolicyOptions` object for specifying options to + # `GetIamPolicy`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Iam::V1::Policy] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Iam::V1::Policy] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/spanner/admin/instance/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Iam::V1::GetIamPolicyRequest.new + # + # # Call the get_iam_policy method. + # result = client.get_iam_policy request + # + # # The returned object is of type Google::Iam::V1::Policy. + # p result + # + def get_iam_policy request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::GetIamPolicyRequest + + # 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 + call_metadata = @config.rpcs.get_iam_policy.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_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::Admin::Instance::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_iam_policy.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_iam_policy.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @instance_admin_stub.get_iam_policy request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Returns permissions that the caller has on the specified instance resource. + # + # Attempting this RPC on a non-existent Cloud Spanner instance resource will + # result in a NOT_FOUND error if the user has `spanner.instances.list` + # permission on the containing Google Cloud Project. Otherwise returns an + # empty set of permissions. + # + # @overload test_iam_permissions(request, options = nil) + # Pass arguments to `test_iam_permissions` via a request object, either of type + # {::Google::Iam::V1::TestIamPermissionsRequest} or an equivalent Hash. + # + # @param request [::Google::Iam::V1::TestIamPermissionsRequest, ::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 test_iam_permissions(resource: nil, permissions: nil) + # Pass arguments to `test_iam_permissions` 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 resource [::String] + # REQUIRED: The resource for which the policy detail is being requested. + # See the operation documentation for the appropriate value for this field. + # @param permissions [::Array<::String>] + # The set of permissions to check for the `resource`. Permissions with + # wildcards (such as '*' or 'storage.*') are not allowed. For more + # information see + # [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Iam::V1::TestIamPermissionsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Iam::V1::TestIamPermissionsResponse] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/spanner/admin/instance/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Iam::V1::TestIamPermissionsRequest.new + # + # # Call the test_iam_permissions method. + # result = client.test_iam_permissions request + # + # # The returned object is of type Google::Iam::V1::TestIamPermissionsResponse. + # p result + # + def test_iam_permissions request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::TestIamPermissionsRequest + + # 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 + call_metadata = @config.rpcs.test_iam_permissions.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_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::Admin::Instance::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.test_iam_permissions.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.test_iam_permissions.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @instance_admin_stub.test_iam_permissions request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets information about a particular instance partition. + # + # @overload get_instance_partition(request, options = nil) + # Pass arguments to `get_instance_partition` via a request object, either of type + # {::Google::Cloud::Spanner::Admin::Instance::V1::GetInstancePartitionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Spanner::Admin::Instance::V1::GetInstancePartitionRequest, ::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_instance_partition(name: nil) + # Pass arguments to `get_instance_partition` 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 requested instance partition. Values are of + # the form + # `projects/{project}/instances/{instance}/instancePartitions/{instance_partition}`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Spanner::Admin::Instance::V1::InstancePartition] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Spanner::Admin::Instance::V1::InstancePartition] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/spanner/admin/instance/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Spanner::Admin::Instance::V1::GetInstancePartitionRequest.new + # + # # Call the get_instance_partition method. + # result = client.get_instance_partition request + # + # # The returned object is of type Google::Cloud::Spanner::Admin::Instance::V1::InstancePartition. + # p result + # + def get_instance_partition request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Instance::V1::GetInstancePartitionRequest + + # 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 + call_metadata = @config.rpcs.get_instance_partition.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_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::Admin::Instance::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_instance_partition.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_instance_partition.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @instance_admin_stub.get_instance_partition request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates an instance partition and begins preparing it to be used. The + # returned long-running operation + # can be used to track the progress of preparing the new instance partition. + # The instance partition name is assigned by the caller. If the named + # instance partition already exists, `CreateInstancePartition` returns + # `ALREADY_EXISTS`. + # + # Immediately upon completion of this request: + # + # * The instance partition is readable via the API, with all requested + # attributes but no allocated resources. Its state is `CREATING`. + # + # Until completion of the returned operation: + # + # * Cancelling the operation renders the instance partition immediately + # unreadable via the API. + # * The instance partition can be deleted. + # * All other attempts to modify the instance partition are rejected. + # + # Upon completion of the returned operation: + # + # * Billing for all successfully-allocated resources begins (some types + # may have lower than the requested levels). + # * Databases can start using this instance partition. + # * The instance partition's allocated resource levels are readable via the + # API. + # * The instance partition's state becomes `READY`. + # + # The returned long-running operation will + # have a name of the format + # `/operations/` and can be used to + # track creation of the instance partition. The + # metadata field type is + # {::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstancePartitionMetadata CreateInstancePartitionMetadata}. + # The response field type is + # {::Google::Cloud::Spanner::Admin::Instance::V1::InstancePartition InstancePartition}, if + # successful. + # + # @overload create_instance_partition(request, options = nil) + # Pass arguments to `create_instance_partition` via a request object, either of type + # {::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstancePartitionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstancePartitionRequest, ::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_instance_partition(parent: nil, instance_partition_id: nil, instance_partition: nil) + # Pass arguments to `create_instance_partition` 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 parent [::String] + # Required. The name of the instance in which to create the instance + # partition. Values are of the form + # `projects//instances/`. + # @param instance_partition_id [::String] + # Required. The ID of the instance partition to create. Valid identifiers are + # of the form `[a-z][-a-z0-9]*[a-z0-9]` and must be between 2 and 64 + # characters in length. + # @param instance_partition [::Google::Cloud::Spanner::Admin::Instance::V1::InstancePartition, ::Hash] + # Required. The instance partition to create. The instance_partition.name may + # be omitted, but if specified must be + # `/instancePartitions/`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/spanner/admin/instance/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Spanner::Admin::Instance::V1::CreateInstancePartitionRequest.new + # + # # Call the create_instance_partition method. + # result = client.create_instance_partition request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def create_instance_partition request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstancePartitionRequest + + # 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 + call_metadata = @config.rpcs.create_instance_partition.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_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::Admin::Instance::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.create_instance_partition.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_instance_partition.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @instance_admin_stub.create_instance_partition request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes an existing instance partition. Requires that the + # instance partition is not used by any database or backup and is not the + # default instance partition of an instance. + # + # Authorization requires `spanner.instancePartitions.delete` permission on + # the resource + # {::Google::Cloud::Spanner::Admin::Instance::V1::InstancePartition#name name}. + # + # @overload delete_instance_partition(request, options = nil) + # Pass arguments to `delete_instance_partition` via a request object, either of type + # {::Google::Cloud::Spanner::Admin::Instance::V1::DeleteInstancePartitionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Spanner::Admin::Instance::V1::DeleteInstancePartitionRequest, ::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_instance_partition(name: nil, etag: nil) + # Pass arguments to `delete_instance_partition` 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 instance partition to be deleted. + # Values are of the form + # `projects/{project}/instances/{instance}/instancePartitions/{instance_partition}` + # @param etag [::String] + # Optional. If not empty, the API only deletes the instance partition when + # the etag provided matches the current status of the requested instance + # partition. Otherwise, deletes the instance partition without checking the + # current status of the requested instance partition. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/spanner/admin/instance/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Spanner::Admin::Instance::V1::DeleteInstancePartitionRequest.new + # + # # Call the delete_instance_partition method. + # result = client.delete_instance_partition request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_instance_partition request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Instance::V1::DeleteInstancePartitionRequest + + # 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 + call_metadata = @config.rpcs.delete_instance_partition.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_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::Admin::Instance::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.delete_instance_partition.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_instance_partition.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @instance_admin_stub.delete_instance_partition request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates an instance partition, and begins allocating or releasing resources + # as requested. The returned long-running operation can be used to track the + # progress of updating the instance partition. If the named instance + # partition does not exist, returns `NOT_FOUND`. + # + # Immediately upon completion of this request: + # + # * For resource types for which a decrease in the instance partition's + # allocation has been requested, billing is based on the newly-requested + # level. + # + # Until completion of the returned operation: + # + # * Cancelling the operation sets its metadata's + # {::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstancePartitionMetadata#cancel_time cancel_time}, + # and begins restoring resources to their pre-request values. The + # operation is guaranteed to succeed at undoing all resource changes, + # after which point it terminates with a `CANCELLED` status. + # * All other attempts to modify the instance partition are rejected. + # * Reading the instance partition via the API continues to give the + # pre-request resource levels. + # + # Upon completion of the returned operation: + # + # * Billing begins for all successfully-allocated resources (some types + # may have lower than the requested levels). + # * All newly-reserved resources are available for serving the instance + # partition's tables. + # * The instance partition's new resource levels are readable via the API. + # + # The returned long-running operation will + # have a name of the format + # `/operations/` and can be used to + # track the instance partition modification. The + # metadata field type is + # {::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstancePartitionMetadata UpdateInstancePartitionMetadata}. + # The response field type is + # {::Google::Cloud::Spanner::Admin::Instance::V1::InstancePartition InstancePartition}, if + # successful. + # + # Authorization requires `spanner.instancePartitions.update` permission on + # the resource + # {::Google::Cloud::Spanner::Admin::Instance::V1::InstancePartition#name name}. + # + # @overload update_instance_partition(request, options = nil) + # Pass arguments to `update_instance_partition` via a request object, either of type + # {::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstancePartitionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstancePartitionRequest, ::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 update_instance_partition(instance_partition: nil, field_mask: nil) + # Pass arguments to `update_instance_partition` 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 instance_partition [::Google::Cloud::Spanner::Admin::Instance::V1::InstancePartition, ::Hash] + # Required. The instance partition to update, which must always include the + # instance partition name. Otherwise, only fields mentioned in + # {::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstancePartitionRequest#field_mask field_mask} + # need be included. + # @param field_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. A mask specifying which fields in + # {::Google::Cloud::Spanner::Admin::Instance::V1::InstancePartition InstancePartition} + # should be updated. The field mask must always be specified; this prevents + # any future fields in + # {::Google::Cloud::Spanner::Admin::Instance::V1::InstancePartition InstancePartition} + # from being erased accidentally by clients that do not know about them. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/spanner/admin/instance/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstancePartitionRequest.new + # + # # Call the update_instance_partition method. + # result = client.update_instance_partition request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def update_instance_partition request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstancePartitionRequest + + # 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 + call_metadata = @config.rpcs.update_instance_partition.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_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::Admin::Instance::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.update_instance_partition.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_instance_partition.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @instance_admin_stub.update_instance_partition request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists instance partition long-running operations in the given instance. + # An instance partition operation has a name of the form + # `projects//instances//instancePartitions//operations/`. + # The long-running operation + # metadata field type + # `metadata.type_url` describes the type of the metadata. Operations returned + # include those that have completed/failed/canceled within the last 7 days, + # and pending operations. Operations returned are ordered by + # `operation.metadata.value.start_time` in descending order starting from the + # most recently started operation. + # + # Authorization requires `spanner.instancePartitionOperations.list` + # permission on the resource + # {::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionOperationsRequest#parent parent}. + # + # @overload list_instance_partition_operations(request, options = nil) + # Pass arguments to `list_instance_partition_operations` via a request object, either of type + # {::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionOperationsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionOperationsRequest, ::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_instance_partition_operations(parent: nil, filter: nil, page_size: nil, page_token: nil, instance_partition_deadline: nil) + # Pass arguments to `list_instance_partition_operations` 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 parent [::String] + # Required. The parent instance of the instance partition operations. + # Values are of the form `projects//instances/`. + # @param filter [::String] + # Optional. An expression that filters the list of returned operations. + # + # A filter expression consists of a field name, a + # comparison operator, and a value for filtering. + # The value must be a string, a number, or a boolean. The comparison operator + # must be one of: `<`, `>`, `<=`, `>=`, `!=`, `=`, or `:`. + # Colon `:` is the contains operator. Filter rules are not case sensitive. + # + # The following fields in the Operation are eligible for filtering: + # + # * `name` - The name of the long-running operation + # * `done` - False if the operation is in progress, else true. + # * `metadata.@type` - the type of metadata. For example, the type string + # for + # {::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstancePartitionMetadata CreateInstancePartitionMetadata} + # is + # `type.googleapis.com/google.spanner.admin.instance.v1.CreateInstancePartitionMetadata`. + # * `metadata.` - any field in metadata.value. + # `metadata.@type` must be specified first, if filtering on metadata + # fields. + # * `error` - Error associated with the long-running operation. + # * `response.@type` - the type of response. + # * `response.` - any field in response.value. + # + # You can combine multiple expressions by enclosing each expression in + # parentheses. By default, expressions are combined with AND logic. However, + # you can specify AND, OR, and NOT logic explicitly. + # + # Here are a few examples: + # + # * `done:true` - The operation is complete. + # * `(metadata.@type=` \ + # `type.googleapis.com/google.spanner.admin.instance.v1.CreateInstancePartitionMetadata) + # AND` \ + # `(metadata.instance_partition.name:custom-instance-partition) AND` \ + # `(metadata.start_time < \"2021-03-28T14:50:00Z\") AND` \ + # `(error:*)` - Return operations where: + # * The operation's metadata type is + # {::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstancePartitionMetadata CreateInstancePartitionMetadata}. + # * The instance partition name contains "custom-instance-partition". + # * The operation started before 2021-03-28T14:50:00Z. + # * The operation resulted in an error. + # @param page_size [::Integer] + # Optional. Number of operations to be returned in the response. If 0 or + # less, defaults to the server's maximum allowed page size. + # @param page_token [::String] + # Optional. If non-empty, `page_token` should contain a + # {::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionOperationsResponse#next_page_token next_page_token} + # from a previous + # {::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionOperationsResponse ListInstancePartitionOperationsResponse} + # to the same `parent` and with the same `filter`. + # @param instance_partition_deadline [::Google::Protobuf::Timestamp, ::Hash] + # Optional. Deadline used while retrieving metadata for instance partition + # operations. Instance partitions whose operation metadata cannot be + # retrieved within this deadline will be added to + # {::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionOperationsResponse#unreachable_instance_partitions unreachable_instance_partitions} + # in + # {::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionOperationsResponse ListInstancePartitionOperationsResponse}. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/spanner/admin/instance/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionOperationsRequest.new + # + # # Call the list_instance_partition_operations method. + # result = client.list_instance_partition_operations 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::Longrunning::Operation. + # p item + # end + # + def list_instance_partition_operations request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionOperationsRequest + + # 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 + call_metadata = @config.rpcs.list_instance_partition_operations.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_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::Admin::Instance::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_instance_partition_operations.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_instance_partition_operations.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @instance_admin_stub.list_instance_partition_operations request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @instance_admin_stub, :list_instance_partition_operations, "operations", request, result, options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Moves an instance to the target instance configuration. You can use the + # returned long-running operation to track + # the progress of moving the instance. + # + # `MoveInstance` returns `FAILED_PRECONDITION` if the instance meets any of + # the following criteria: + # + # * Is undergoing a move to a different instance configuration + # * Has backups + # * Has an ongoing update + # * Contains any CMEK-enabled databases + # * Is a free trial instance + # + # While the operation is pending: + # + # * All other attempts to modify the instance, including changes to its + # compute capacity, are rejected. + # * The following database and backup admin operations are rejected: + # + # * `DatabaseAdmin.CreateDatabase` + # * `DatabaseAdmin.UpdateDatabaseDdl` (disabled if default_leader is + # specified in the request.) + # * `DatabaseAdmin.RestoreDatabase` + # * `DatabaseAdmin.CreateBackup` + # * `DatabaseAdmin.CopyBackup` + # + # * Both the source and target instance configurations are subject to + # hourly compute and storage charges. + # * The instance might experience higher read-write latencies and a higher + # transaction abort rate. However, moving an instance doesn't cause any + # downtime. + # + # The returned long-running operation has + # a name of the format + # `/operations/` and can be used to track + # the move instance operation. The + # metadata field type is + # {::Google::Cloud::Spanner::Admin::Instance::V1::MoveInstanceMetadata MoveInstanceMetadata}. + # The response field type is + # {::Google::Cloud::Spanner::Admin::Instance::V1::Instance Instance}, + # if successful. + # Cancelling the operation sets its metadata's + # {::Google::Cloud::Spanner::Admin::Instance::V1::MoveInstanceMetadata#cancel_time cancel_time}. + # Cancellation is not immediate because it involves moving any data + # previously moved to the target instance configuration back to the original + # instance configuration. You can use this operation to track the progress of + # the cancellation. Upon successful completion of the cancellation, the + # operation terminates with `CANCELLED` status. + # + # If not cancelled, upon completion of the returned operation: + # + # * The instance successfully moves to the target instance + # configuration. + # * You are billed for compute and storage in target instance + # configuration. + # + # Authorization requires the `spanner.instances.update` permission on + # the resource {::Google::Cloud::Spanner::Admin::Instance::V1::Instance instance}. + # + # For more details, see + # [Move an instance](https://cloud.google.com/spanner/docs/move-instance). + # + # @overload move_instance(request, options = nil) + # Pass arguments to `move_instance` via a request object, either of type + # {::Google::Cloud::Spanner::Admin::Instance::V1::MoveInstanceRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Spanner::Admin::Instance::V1::MoveInstanceRequest, ::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 move_instance(name: nil, target_config: nil) + # Pass arguments to `move_instance` 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 instance to move. + # Values are of the form `projects//instances/`. + # @param target_config [::String] + # Required. The target instance configuration where to move the instance. + # Values are of the form `projects//instanceConfigs/`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/spanner/admin/instance/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Spanner::Admin::Instance::V1::MoveInstanceRequest.new + # + # # Call the move_instance method. + # result = client.move_instance request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def move_instance request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Instance::V1::MoveInstanceRequest + + # 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 + call_metadata = @config.rpcs.move_instance.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_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::Admin::Instance::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.move_instance.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.move_instance.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @instance_admin_stub.move_instance request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the InstanceAdmin REST API. + # + # This class represents the configuration for InstanceAdmin REST, + # 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::Admin::Instance::V1::InstanceAdmin::Rest::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 + # # list_instance_configs to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_instance_configs.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_instance_configs.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: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`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)) + # * (`nil`) indicating no credentials + # + # 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] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional 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.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 :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 RPC class for the InstanceAdmin 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 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 `list_instance_configs` + # @return [::Gapic::Config::Method] + # + attr_reader :list_instance_configs + ## + # RPC-specific configuration for `get_instance_config` + # @return [::Gapic::Config::Method] + # + attr_reader :get_instance_config + ## + # RPC-specific configuration for `create_instance_config` + # @return [::Gapic::Config::Method] + # + attr_reader :create_instance_config + ## + # RPC-specific configuration for `update_instance_config` + # @return [::Gapic::Config::Method] + # + attr_reader :update_instance_config + ## + # RPC-specific configuration for `delete_instance_config` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_instance_config + ## + # RPC-specific configuration for `list_instance_config_operations` + # @return [::Gapic::Config::Method] + # + attr_reader :list_instance_config_operations + ## + # RPC-specific configuration for `list_instances` + # @return [::Gapic::Config::Method] + # + attr_reader :list_instances + ## + # RPC-specific configuration for `list_instance_partitions` + # @return [::Gapic::Config::Method] + # + attr_reader :list_instance_partitions + ## + # RPC-specific configuration for `get_instance` + # @return [::Gapic::Config::Method] + # + attr_reader :get_instance + ## + # RPC-specific configuration for `create_instance` + # @return [::Gapic::Config::Method] + # + attr_reader :create_instance + ## + # RPC-specific configuration for `update_instance` + # @return [::Gapic::Config::Method] + # + attr_reader :update_instance + ## + # RPC-specific configuration for `delete_instance` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_instance + ## + # RPC-specific configuration for `set_iam_policy` + # @return [::Gapic::Config::Method] + # + attr_reader :set_iam_policy + ## + # RPC-specific configuration for `get_iam_policy` + # @return [::Gapic::Config::Method] + # + attr_reader :get_iam_policy + ## + # RPC-specific configuration for `test_iam_permissions` + # @return [::Gapic::Config::Method] + # + attr_reader :test_iam_permissions + ## + # RPC-specific configuration for `get_instance_partition` + # @return [::Gapic::Config::Method] + # + attr_reader :get_instance_partition + ## + # RPC-specific configuration for `create_instance_partition` + # @return [::Gapic::Config::Method] + # + attr_reader :create_instance_partition + ## + # RPC-specific configuration for `delete_instance_partition` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_instance_partition + ## + # RPC-specific configuration for `update_instance_partition` + # @return [::Gapic::Config::Method] + # + attr_reader :update_instance_partition + ## + # RPC-specific configuration for `list_instance_partition_operations` + # @return [::Gapic::Config::Method] + # + attr_reader :list_instance_partition_operations + ## + # RPC-specific configuration for `move_instance` + # @return [::Gapic::Config::Method] + # + attr_reader :move_instance + + # @private + def initialize parent_rpcs = nil + list_instance_configs_config = parent_rpcs.list_instance_configs if parent_rpcs.respond_to? :list_instance_configs + @list_instance_configs = ::Gapic::Config::Method.new list_instance_configs_config + get_instance_config_config = parent_rpcs.get_instance_config if parent_rpcs.respond_to? :get_instance_config + @get_instance_config = ::Gapic::Config::Method.new get_instance_config_config + create_instance_config_config = parent_rpcs.create_instance_config if parent_rpcs.respond_to? :create_instance_config + @create_instance_config = ::Gapic::Config::Method.new create_instance_config_config + update_instance_config_config = parent_rpcs.update_instance_config if parent_rpcs.respond_to? :update_instance_config + @update_instance_config = ::Gapic::Config::Method.new update_instance_config_config + delete_instance_config_config = parent_rpcs.delete_instance_config if parent_rpcs.respond_to? :delete_instance_config + @delete_instance_config = ::Gapic::Config::Method.new delete_instance_config_config + list_instance_config_operations_config = parent_rpcs.list_instance_config_operations if parent_rpcs.respond_to? :list_instance_config_operations + @list_instance_config_operations = ::Gapic::Config::Method.new list_instance_config_operations_config + list_instances_config = parent_rpcs.list_instances if parent_rpcs.respond_to? :list_instances + @list_instances = ::Gapic::Config::Method.new list_instances_config + list_instance_partitions_config = parent_rpcs.list_instance_partitions if parent_rpcs.respond_to? :list_instance_partitions + @list_instance_partitions = ::Gapic::Config::Method.new list_instance_partitions_config + get_instance_config = parent_rpcs.get_instance if parent_rpcs.respond_to? :get_instance + @get_instance = ::Gapic::Config::Method.new get_instance_config + create_instance_config = parent_rpcs.create_instance if parent_rpcs.respond_to? :create_instance + @create_instance = ::Gapic::Config::Method.new create_instance_config + update_instance_config = parent_rpcs.update_instance if parent_rpcs.respond_to? :update_instance + @update_instance = ::Gapic::Config::Method.new update_instance_config + delete_instance_config = parent_rpcs.delete_instance if parent_rpcs.respond_to? :delete_instance + @delete_instance = ::Gapic::Config::Method.new delete_instance_config + set_iam_policy_config = parent_rpcs.set_iam_policy if parent_rpcs.respond_to? :set_iam_policy + @set_iam_policy = ::Gapic::Config::Method.new set_iam_policy_config + get_iam_policy_config = parent_rpcs.get_iam_policy if parent_rpcs.respond_to? :get_iam_policy + @get_iam_policy = ::Gapic::Config::Method.new get_iam_policy_config + test_iam_permissions_config = parent_rpcs.test_iam_permissions if parent_rpcs.respond_to? :test_iam_permissions + @test_iam_permissions = ::Gapic::Config::Method.new test_iam_permissions_config + get_instance_partition_config = parent_rpcs.get_instance_partition if parent_rpcs.respond_to? :get_instance_partition + @get_instance_partition = ::Gapic::Config::Method.new get_instance_partition_config + create_instance_partition_config = parent_rpcs.create_instance_partition if parent_rpcs.respond_to? :create_instance_partition + @create_instance_partition = ::Gapic::Config::Method.new create_instance_partition_config + delete_instance_partition_config = parent_rpcs.delete_instance_partition if parent_rpcs.respond_to? :delete_instance_partition + @delete_instance_partition = ::Gapic::Config::Method.new delete_instance_partition_config + update_instance_partition_config = parent_rpcs.update_instance_partition if parent_rpcs.respond_to? :update_instance_partition + @update_instance_partition = ::Gapic::Config::Method.new update_instance_partition_config + list_instance_partition_operations_config = parent_rpcs.list_instance_partition_operations if parent_rpcs.respond_to? :list_instance_partition_operations + @list_instance_partition_operations = ::Gapic::Config::Method.new list_instance_partition_operations_config + move_instance_config = parent_rpcs.move_instance if parent_rpcs.respond_to? :move_instance + @move_instance = ::Gapic::Config::Method.new move_instance_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google/cloud/spanner/admin/instance/v1/instance_admin/rest/operations.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google/cloud/spanner/admin/instance/v1/instance_admin/rest/operations.rb new file mode 100644 index 000000000000..9c3ba878715a --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google/cloud/spanner/admin/instance/v1/instance_admin/rest/operations.rb @@ -0,0 +1,1068 @@ +# frozen_string_literal: true + +# Copyright 2025 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/operation" + +module Google + module Cloud + module Spanner + module Admin + module Instance + module V1 + module InstanceAdmin + module Rest + # Service that implements Longrunning Operations API. + class Operations + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "spanner.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :operations_stub + + ## + # Configuration for the InstanceAdmin Operations API. + # + # @yield [config] Configure the Operations client. + # @yieldparam config [Operations::Configuration] + # + # @return [Operations::Configuration] + # + def self.configure + @configure ||= Operations::Configuration.new + yield @configure if block_given? + @configure + end + + ## + # Configure the InstanceAdmin Operations 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 {Operations.configure}. + # + # @yield [config] Configure the Operations client. + # @yieldparam config [Operations::Configuration] + # + # @return [Operations::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @operations_stub.universe_domain + end + + ## + # Create a new Operations client object. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Operations::Configuration] + # + def initialize + # Create the configuration object + @config = Configuration.new Operations.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + credentials ||= Credentials.default scope: @config.scope + 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 + + @operations_stub = OperationsServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials + ) + + # Used by an LRO wrapper for some methods of this service + @operations_client = self + end + + # Service calls + + ## + # Lists operations that match the specified filter in the request. If the + # server doesn't support this method, it returns `UNIMPLEMENTED`. + # + # @overload list_operations(request, options = nil) + # Pass arguments to `list_operations` via a request object, either of type + # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::ListOperationsRequest, ::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_operations(name: nil, filter: nil, page_size: nil, page_token: nil, return_partial_success: nil) + # Pass arguments to `list_operations` 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] + # The name of the operation's parent resource. + # @param filter [::String] + # The standard list filter. + # @param page_size [::Integer] + # The standard list page size. + # @param page_token [::String] + # The standard list page token. + # @param return_partial_success [::Boolean] + # When set to `true`, operations that are reachable are returned as normal, + # and those that are unreachable are returned in the + # [ListOperationsResponse.unreachable] field. + # + # This can only be `true` when reading across collections e.g. when `parent` + # is set to `"projects/example/locations/-"`. + # + # This field is not by default supported and will result in an + # `UNIMPLEMENTED` error if set unless explicitly documented otherwise in + # service or product specific documentation. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::ListOperationsRequest.new + # + # # Call the list_operations method. + # result = client.list_operations 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::Longrunning::Operation. + # p item + # end + # + def list_operations request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::ListOperationsRequest + + # 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 + call_metadata = @config.rpcs.list_operations.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_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::Admin::Instance::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_operations.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_operations.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.list_operations request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @operations_stub, :list_operations, "operations", request, result, options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets the latest state of a long-running operation. Clients can use this + # method to poll the operation result at intervals as recommended by the API + # service. + # + # @overload get_operation(request, options = nil) + # Pass arguments to `get_operation` via a request object, either of type + # {::Google::Longrunning::GetOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::GetOperationRequest, ::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_operation(name: nil) + # Pass arguments to `get_operation` 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] + # The name of the operation resource. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::GetOperationRequest.new + # + # # Call the get_operation method. + # result = client.get_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def get_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::GetOperationRequest + + # 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 + call_metadata = @config.rpcs.get_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_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::Admin::Instance::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_operation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.get_operation request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a long-running operation. This method indicates that the client is + # no longer interested in the operation result. It does not cancel the + # operation. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # + # @overload delete_operation(request, options = nil) + # Pass arguments to `delete_operation` via a request object, either of type + # {::Google::Longrunning::DeleteOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::DeleteOperationRequest, ::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_operation(name: nil) + # Pass arguments to `delete_operation` 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] + # The name of the operation resource to be deleted. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::DeleteOperationRequest.new + # + # # Call the delete_operation method. + # result = client.delete_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::DeleteOperationRequest + + # 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 + call_metadata = @config.rpcs.delete_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_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::Admin::Instance::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.delete_operation request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Starts asynchronous cancellation on a long-running operation. The server + # makes a best effort to cancel the operation, but success is not + # guaranteed. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. Clients can use + # Operations.GetOperation or + # other methods to check whether the cancellation succeeded or whether the + # operation completed despite cancellation. On successful cancellation, + # the operation is not deleted; instead, it becomes an operation with + # an {::Google::Longrunning::Operation#error Operation.error} value with a + # {::Google::Rpc::Status#code google.rpc.Status.code} of `1`, corresponding to + # `Code.CANCELLED`. + # + # @overload cancel_operation(request, options = nil) + # Pass arguments to `cancel_operation` via a request object, either of type + # {::Google::Longrunning::CancelOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::CancelOperationRequest, ::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 cancel_operation(name: nil) + # Pass arguments to `cancel_operation` 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] + # The name of the operation resource to be cancelled. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::CancelOperationRequest.new + # + # # Call the cancel_operation method. + # result = client.cancel_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def cancel_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::CancelOperationRequest + + # 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 + call_metadata = @config.rpcs.cancel_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_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::Admin::Instance::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.cancel_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.cancel_operation request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the Operations REST API. + # + # This class represents the configuration for Operations REST, + # 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::Longrunning::Operations::Rest::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 + # # list_operations to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Longrunning::Operations::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Longrunning::Operations::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.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: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`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)) + # * (`nil`) indicating no credentials + # + # 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] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional 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.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 :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 RPC class for the Operations 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 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 `list_operations` + # @return [::Gapic::Config::Method] + # + attr_reader :list_operations + ## + # RPC-specific configuration for `get_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :get_operation + ## + # RPC-specific configuration for `delete_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_operation + ## + # RPC-specific configuration for `cancel_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :cancel_operation + + # @private + def initialize parent_rpcs = nil + list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations + @list_operations = ::Gapic::Config::Method.new list_operations_config + get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation + @get_operation = ::Gapic::Config::Method.new get_operation_config + delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation + @delete_operation = ::Gapic::Config::Method.new delete_operation_config + cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation + @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config + + yield self if block_given? + end + end + end + end + + ## + # @private + # REST service stub for the Longrunning Operations API. + # Service stub contains baseline method implementations + # including transcoding, making the REST call, and deserialing the response. + class OperationsServiceStub + def initialize endpoint:, endpoint_template:, universe_domain:, credentials: + # These require statements are intentionally placed here to initialize + # the REST modules only when it's required. + require "gapic/rest" + + @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, + endpoint_template: endpoint_template, + universe_domain: universe_domain, + credentials: credentials + end + + ## + # Baseline implementation for the list_operations REST call + # + # @param request_pb [::Google::Longrunning::ListOperationsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::ListOperationsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::ListOperationsResponse] + # A result object deserialized from the server's reply + def list_operations request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_list_operations_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "list_operations", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::ListOperationsResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the get_operation REST call + # + # @param request_pb [::Google::Longrunning::GetOperationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def get_operation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_get_operation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "get_operation", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the delete_operation REST call + # + # @param request_pb [::Google::Longrunning::DeleteOperationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # A result object deserialized from the server's reply + def delete_operation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_delete_operation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "delete_operation", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the cancel_operation REST call + # + # @param request_pb [::Google::Longrunning::CancelOperationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # A result object deserialized from the server's reply + def cancel_operation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_cancel_operation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "cancel_operation", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # @private + # + # GRPC transcoding helper method for the list_operations REST call + # + # @param request_pb [::Google::Longrunning::ListOperationsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_list_operations_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/instances/[^/]+/databases/[^/]+/operations/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/instances/[^/]+/operations/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/instances/[^/]+/backups/[^/]+/operations/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/instances/[^/]+/instancePartitions/[^/]+/operations/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/instanceConfigs/[^/]+/operations/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/instanceConfigs/[^/]+/ssdCaches/[^/]+/operations/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_operation REST call + # + # @param request_pb [::Google::Longrunning::GetOperationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_operation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/instances/[^/]+/databases/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/instances/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/instances/[^/]+/backups/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/instances/[^/]+/instancePartitions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/instanceConfigs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/instanceConfigs/[^/]+/ssdCaches/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_operation REST call + # + # @param request_pb [::Google::Longrunning::DeleteOperationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_delete_operation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/instances/[^/]+/databases/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/instances/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/instances/[^/]+/backups/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/instances/[^/]+/instancePartitions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/instanceConfigs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/instanceConfigs/[^/]+/ssdCaches/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the cancel_operation REST call + # + # @param request_pb [::Google::Longrunning::CancelOperationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_cancel_operation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/instances/[^/]+/databases/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/instances/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/instances/[^/]+/backups/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/instances/[^/]+/instancePartitions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/instanceConfigs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/instanceConfigs/[^/]+/ssdCaches/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google/cloud/spanner/admin/instance/v1/instance_admin/rest/service_stub.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google/cloud/spanner/admin/instance/v1/instance_admin/rest/service_stub.rb new file mode 100644 index 000000000000..6938a3c9105a --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google/cloud/spanner/admin/instance/v1/instance_admin/rest/service_stub.rb @@ -0,0 +1,1376 @@ +# frozen_string_literal: true + +# Copyright 2025 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/spanner/admin/instance/v1/spanner_instance_admin_pb" + +module Google + module Cloud + module Spanner + module Admin + module Instance + module V1 + module InstanceAdmin + module Rest + ## + # REST service stub for the InstanceAdmin service. + # Service stub contains baseline method implementations + # including transcoding, making the REST call, and deserialing the response. + # + class ServiceStub + # @private + def initialize endpoint:, endpoint_template:, universe_domain:, credentials:, logger: + # These require statements are intentionally placed here to initialize + # the REST modules only when it's required. + require "gapic/rest" + + @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, + endpoint_template: endpoint_template, + universe_domain: universe_domain, + credentials: credentials, + numeric_enums: true, + service_name: self.class, + raise_faraday_errors: false, + logger: logger + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @client_stub.universe_domain + end + + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger stub: false + stub ? @client_stub.stub_logger : @client_stub.logger + end + + ## + # Baseline implementation for the list_instance_configs REST call + # + # @param request_pb [::Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigsResponse] + # A result object deserialized from the server's reply + def list_instance_configs request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_instance_configs_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "list_instance_configs", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigsResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the get_instance_config REST call + # + # @param request_pb [::Google::Cloud::Spanner::Admin::Instance::V1::GetInstanceConfigRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig] + # A result object deserialized from the server's reply + def get_instance_config request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_instance_config_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "get_instance_config", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the create_instance_config REST call + # + # @param request_pb [::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstanceConfigRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def create_instance_config request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_instance_config_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "create_instance_config", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the update_instance_config REST call + # + # @param request_pb [::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstanceConfigRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def update_instance_config request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_instance_config_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "update_instance_config", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the delete_instance_config REST call + # + # @param request_pb [::Google::Cloud::Spanner::Admin::Instance::V1::DeleteInstanceConfigRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # A result object deserialized from the server's reply + def delete_instance_config request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_instance_config_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "delete_instance_config", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the list_instance_config_operations REST call + # + # @param request_pb [::Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigOperationsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigOperationsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigOperationsResponse] + # A result object deserialized from the server's reply + def list_instance_config_operations request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_instance_config_operations_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "list_instance_config_operations", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigOperationsResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the list_instances REST call + # + # @param request_pb [::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancesRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancesResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancesResponse] + # A result object deserialized from the server's reply + def list_instances request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_instances_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "list_instances", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancesResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the list_instance_partitions REST call + # + # @param request_pb [::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionsResponse] + # A result object deserialized from the server's reply + def list_instance_partitions request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_instance_partitions_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "list_instance_partitions", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionsResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the get_instance REST call + # + # @param request_pb [::Google::Cloud::Spanner::Admin::Instance::V1::GetInstanceRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Spanner::Admin::Instance::V1::Instance] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Spanner::Admin::Instance::V1::Instance] + # A result object deserialized from the server's reply + def get_instance request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_instance_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "get_instance", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Spanner::Admin::Instance::V1::Instance.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the create_instance REST call + # + # @param request_pb [::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstanceRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def create_instance request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_instance_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "create_instance", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the update_instance REST call + # + # @param request_pb [::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstanceRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def update_instance request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_instance_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "update_instance", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the delete_instance REST call + # + # @param request_pb [::Google::Cloud::Spanner::Admin::Instance::V1::DeleteInstanceRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # A result object deserialized from the server's reply + def delete_instance request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_instance_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "delete_instance", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the set_iam_policy REST call + # + # @param request_pb [::Google::Iam::V1::SetIamPolicyRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Iam::V1::Policy] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Iam::V1::Policy] + # A result object deserialized from the server's reply + def set_iam_policy request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_set_iam_policy_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "set_iam_policy", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Iam::V1::Policy.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the get_iam_policy REST call + # + # @param request_pb [::Google::Iam::V1::GetIamPolicyRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Iam::V1::Policy] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Iam::V1::Policy] + # A result object deserialized from the server's reply + def get_iam_policy request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_iam_policy_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "get_iam_policy", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Iam::V1::Policy.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the test_iam_permissions REST call + # + # @param request_pb [::Google::Iam::V1::TestIamPermissionsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Iam::V1::TestIamPermissionsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Iam::V1::TestIamPermissionsResponse] + # A result object deserialized from the server's reply + def test_iam_permissions request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_test_iam_permissions_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "test_iam_permissions", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Iam::V1::TestIamPermissionsResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the get_instance_partition REST call + # + # @param request_pb [::Google::Cloud::Spanner::Admin::Instance::V1::GetInstancePartitionRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Spanner::Admin::Instance::V1::InstancePartition] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Spanner::Admin::Instance::V1::InstancePartition] + # A result object deserialized from the server's reply + def get_instance_partition request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_instance_partition_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "get_instance_partition", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Spanner::Admin::Instance::V1::InstancePartition.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the create_instance_partition REST call + # + # @param request_pb [::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstancePartitionRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def create_instance_partition request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_instance_partition_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "create_instance_partition", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the delete_instance_partition REST call + # + # @param request_pb [::Google::Cloud::Spanner::Admin::Instance::V1::DeleteInstancePartitionRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # A result object deserialized from the server's reply + def delete_instance_partition request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_instance_partition_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "delete_instance_partition", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the update_instance_partition REST call + # + # @param request_pb [::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstancePartitionRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def update_instance_partition request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_instance_partition_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "update_instance_partition", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the list_instance_partition_operations REST call + # + # @param request_pb [::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionOperationsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionOperationsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionOperationsResponse] + # A result object deserialized from the server's reply + def list_instance_partition_operations request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_instance_partition_operations_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "list_instance_partition_operations", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionOperationsResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the move_instance REST call + # + # @param request_pb [::Google::Cloud::Spanner::Admin::Instance::V1::MoveInstanceRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def move_instance request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_move_instance_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "move_instance", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # @private + # + # GRPC transcoding helper method for the list_instance_configs REST call + # + # @param request_pb [::Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_list_instance_configs_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/instanceConfigs", + matches: [ + ["parent", %r{^projects/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_instance_config REST call + # + # @param request_pb [::Google::Cloud::Spanner::Admin::Instance::V1::GetInstanceConfigRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_instance_config_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/instanceConfigs/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_instance_config REST call + # + # @param request_pb [::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstanceConfigRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_create_instance_config_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/instanceConfigs", + body: "*", + matches: [ + ["parent", %r{^projects/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_instance_config REST call + # + # @param request_pb [::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstanceConfigRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_update_instance_config_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v1/{instance_config.name}", + body: "*", + matches: [ + ["instance_config.name", %r{^projects/[^/]+/instanceConfigs/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_instance_config REST call + # + # @param request_pb [::Google::Cloud::Spanner::Admin::Instance::V1::DeleteInstanceConfigRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_delete_instance_config_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/instanceConfigs/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_instance_config_operations REST call + # + # @param request_pb [::Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigOperationsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_list_instance_config_operations_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/instanceConfigOperations", + matches: [ + ["parent", %r{^projects/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_instances REST call + # + # @param request_pb [::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancesRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_list_instances_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/instances", + matches: [ + ["parent", %r{^projects/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_instance_partitions REST call + # + # @param request_pb [::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_list_instance_partitions_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/instancePartitions", + matches: [ + ["parent", %r{^projects/[^/]+/instances/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_instance REST call + # + # @param request_pb [::Google::Cloud::Spanner::Admin::Instance::V1::GetInstanceRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_instance_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/instances/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_instance REST call + # + # @param request_pb [::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstanceRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_create_instance_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/instances", + body: "*", + matches: [ + ["parent", %r{^projects/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_instance REST call + # + # @param request_pb [::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstanceRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_update_instance_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v1/{instance.name}", + body: "*", + matches: [ + ["instance.name", %r{^projects/[^/]+/instances/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_instance REST call + # + # @param request_pb [::Google::Cloud::Spanner::Admin::Instance::V1::DeleteInstanceRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_delete_instance_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/instances/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the set_iam_policy REST call + # + # @param request_pb [::Google::Iam::V1::SetIamPolicyRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_set_iam_policy_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{resource}:setIamPolicy", + body: "*", + matches: [ + ["resource", %r{^projects/[^/]+/instances/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_iam_policy REST call + # + # @param request_pb [::Google::Iam::V1::GetIamPolicyRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_iam_policy_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{resource}:getIamPolicy", + body: "*", + matches: [ + ["resource", %r{^projects/[^/]+/instances/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the test_iam_permissions REST call + # + # @param request_pb [::Google::Iam::V1::TestIamPermissionsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_test_iam_permissions_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{resource}:testIamPermissions", + body: "*", + matches: [ + ["resource", %r{^projects/[^/]+/instances/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_instance_partition REST call + # + # @param request_pb [::Google::Cloud::Spanner::Admin::Instance::V1::GetInstancePartitionRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_instance_partition_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/instances/[^/]+/instancePartitions/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_instance_partition REST call + # + # @param request_pb [::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstancePartitionRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_create_instance_partition_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/instancePartitions", + body: "*", + matches: [ + ["parent", %r{^projects/[^/]+/instances/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_instance_partition REST call + # + # @param request_pb [::Google::Cloud::Spanner::Admin::Instance::V1::DeleteInstancePartitionRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_delete_instance_partition_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/instances/[^/]+/instancePartitions/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_instance_partition REST call + # + # @param request_pb [::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstancePartitionRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_update_instance_partition_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v1/{instance_partition.name}", + body: "*", + matches: [ + ["instance_partition.name", %r{^projects/[^/]+/instances/[^/]+/instancePartitions/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_instance_partition_operations REST call + # + # @param request_pb [::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionOperationsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_list_instance_partition_operations_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/instancePartitionOperations", + matches: [ + ["parent", %r{^projects/[^/]+/instances/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the move_instance REST call + # + # @param request_pb [::Google::Cloud::Spanner::Admin::Instance::V1::MoveInstanceRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_move_instance_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:move", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/instances/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google/cloud/spanner/admin/instance/v1/rest.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google/cloud/spanner/admin/instance/v1/rest.rb new file mode 100644 index 000000000000..fbd7c0880ea5 --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google/cloud/spanner/admin/instance/v1/rest.rb @@ -0,0 +1,41 @@ +# frozen_string_literal: true + +# Copyright 2025 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/admin/instance/v1/instance_admin/rest" +require "google/cloud/spanner/admin/instance/v1/version" + +module Google + module Cloud + module Spanner + module Admin + module Instance + ## + # To load just the REST part of this package, including all its services, and instantiate a REST client: + # + # @example + # + # require "google/cloud/spanner/admin/instance/v1/rest" + # client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::Client.new + # + module V1 + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google/cloud/spanner/admin/instance/v1/version.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google/cloud/spanner/admin/instance/v1/version.rb new file mode 100644 index 000000000000..e72967bdfe7f --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google/cloud/spanner/admin/instance/v1/version.rb @@ -0,0 +1,32 @@ +# frozen_string_literal: true + +# Copyright 2025 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 Admin + module Instance + module V1 + VERSION = "0.0.1" + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google/spanner/admin/instance/v1/common_pb.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google/spanner/admin/instance/v1/common_pb.rb new file mode 100644 index 000000000000..ff03859f1024 --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google/spanner/admin/instance/v1/common_pb.rb @@ -0,0 +1,53 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/spanner/admin/instance/v1/common.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/protobuf/timestamp_pb' + + +descriptor_data = "\n-google/spanner/admin/instance/v1/common.proto\x12 google.spanner.admin.instance.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\x8b\x01\n\x11OperationProgress\x12\x18\n\x10progress_percent\x18\x01 \x01(\x05\x12.\n\nstart_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12,\n\x08\x65nd_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\")\n\x10ReplicaSelection\x12\x15\n\x08location\x18\x01 \x01(\tB\x03\xe0\x41\x02*w\n\x11\x46ulfillmentPeriod\x12\"\n\x1e\x46ULFILLMENT_PERIOD_UNSPECIFIED\x10\x00\x12\x1d\n\x19\x46ULFILLMENT_PERIOD_NORMAL\x10\x01\x12\x1f\n\x1b\x46ULFILLMENT_PERIOD_EXTENDED\x10\x02\x42\xfd\x01\n$com.google.spanner.admin.instance.v1B\x0b\x43ommonProtoP\x01ZFcloud.google.com/go/spanner/admin/instance/apiv1/instancepb;instancepb\xaa\x02&Google.Cloud.Spanner.Admin.Instance.V1\xca\x02&Google\\Cloud\\Spanner\\Admin\\Instance\\V1\xea\x02+Google::Cloud::Spanner::Admin::Instance::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"], + ] + 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 Admin + module Instance + module V1 + OperationProgress = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.OperationProgress").msgclass + ReplicaSelection = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.ReplicaSelection").msgclass + FulfillmentPeriod = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.FulfillmentPeriod").enummodule + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google/spanner/admin/instance/v1/spanner_instance_admin_pb.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google/spanner/admin/instance/v1/spanner_instance_admin_pb.rb new file mode 100644 index 000000000000..ec466e66d795 --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google/spanner/admin/instance/v1/spanner_instance_admin_pb.rb @@ -0,0 +1,114 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/spanner/admin/instance/v1/spanner_instance_admin.proto + +require 'google/protobuf' + +require 'google/api/annotations_pb' +require 'google/api/client_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/iam/v1/iam_policy_pb' +require 'google/iam/v1/policy_pb' +require 'google/longrunning/operations_pb' +require 'google/protobuf/empty_pb' +require 'google/protobuf/field_mask_pb' +require 'google/protobuf/timestamp_pb' +require 'google/spanner/admin/instance/v1/common_pb' + + +descriptor_data = "\n=google/spanner/admin/instance/v1/spanner_instance_admin.proto\x12 google.spanner.admin.instance.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x1egoogle/iam/v1/iam_policy.proto\x1a\x1agoogle/iam/v1/policy.proto\x1a#google/longrunning/operations.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a-google/spanner/admin/instance/v1/common.proto\"\xda\x01\n\x0bReplicaInfo\x12\x10\n\x08location\x18\x01 \x01(\t\x12G\n\x04type\x18\x02 \x01(\x0e\x32\x39.google.spanner.admin.instance.v1.ReplicaInfo.ReplicaType\x12\x1f\n\x17\x64\x65\x66\x61ult_leader_location\x18\x03 \x01(\x08\"O\n\x0bReplicaType\x12\x14\n\x10TYPE_UNSPECIFIED\x10\x00\x12\x0e\n\nREAD_WRITE\x10\x01\x12\r\n\tREAD_ONLY\x10\x02\x12\x0b\n\x07WITNESS\x10\x03\"\xc0\n\n\x0eInstanceConfig\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x14\n\x0c\x64isplay_name\x18\x02 \x01(\t\x12O\n\x0b\x63onfig_type\x18\x05 \x01(\x0e\x32\x35.google.spanner.admin.instance.v1.InstanceConfig.TypeB\x03\xe0\x41\x03\x12?\n\x08replicas\x18\x03 \x03(\x0b\x32-.google.spanner.admin.instance.v1.ReplicaInfo\x12M\n\x11optional_replicas\x18\x06 \x03(\x0b\x32-.google.spanner.admin.instance.v1.ReplicaInfoB\x03\xe0\x41\x03\x12?\n\x0b\x62\x61se_config\x18\x07 \x01(\tB*\xfa\x41\'\n%spanner.googleapis.com/InstanceConfig\x12L\n\x06labels\x18\x08 \x03(\x0b\x32<.google.spanner.admin.instance.v1.InstanceConfig.LabelsEntry\x12\x0c\n\x04\x65tag\x18\t \x01(\t\x12\x16\n\x0eleader_options\x18\x04 \x03(\t\x12\x18\n\x0breconciling\x18\n \x01(\x08\x42\x03\xe0\x41\x03\x12J\n\x05state\x18\x0b \x01(\x0e\x32\x36.google.spanner.admin.instance.v1.InstanceConfig.StateB\x03\xe0\x41\x03\x12r\n\x1a\x66ree_instance_availability\x18\x0c \x01(\x0e\x32I.google.spanner.admin.instance.v1.InstanceConfig.FreeInstanceAvailabilityB\x03\xe0\x41\x03\x12U\n\x0bquorum_type\x18\x12 \x01(\x0e\x32;.google.spanner.admin.instance.v1.InstanceConfig.QuorumTypeB\x03\xe0\x41\x03\x12.\n!storage_limit_per_processing_unit\x18\x13 \x01(\x03\x42\x03\xe0\x41\x03\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"B\n\x04Type\x12\x14\n\x10TYPE_UNSPECIFIED\x10\x00\x12\x12\n\x0eGOOGLE_MANAGED\x10\x01\x12\x10\n\x0cUSER_MANAGED\x10\x02\"7\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0c\n\x08\x43REATING\x10\x01\x12\t\n\x05READY\x10\x02\"\x88\x01\n\x18\x46reeInstanceAvailability\x12*\n&FREE_INSTANCE_AVAILABILITY_UNSPECIFIED\x10\x00\x12\r\n\tAVAILABLE\x10\x01\x12\x0f\n\x0bUNSUPPORTED\x10\x02\x12\x0c\n\x08\x44ISABLED\x10\x03\x12\x12\n\x0eQUOTA_EXCEEDED\x10\x04\"X\n\nQuorumType\x12\x1b\n\x17QUORUM_TYPE_UNSPECIFIED\x10\x00\x12\n\n\x06REGION\x10\x01\x12\x0f\n\x0b\x44UAL_REGION\x10\x02\x12\x10\n\x0cMULTI_REGION\x10\x03:\x81\x01\xea\x41~\n%spanner.googleapis.com/InstanceConfig\x12\x34projects/{project}/instanceConfigs/{instance_config}*\x0finstanceConfigs2\x0einstanceConfig\"\xb2\x01\n\x16ReplicaComputeCapacity\x12R\n\x11replica_selection\x18\x01 \x01(\x0b\x32\x32.google.spanner.admin.instance.v1.ReplicaSelectionB\x03\xe0\x41\x02\x12\x14\n\nnode_count\x18\x02 \x01(\x05H\x00\x12\x1a\n\x10processing_units\x18\x03 \x01(\x05H\x00\x42\x12\n\x10\x63ompute_capacity\"\x84\n\n\x11\x41utoscalingConfig\x12\x66\n\x12\x61utoscaling_limits\x18\x01 \x01(\x0b\x32\x45.google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimitsB\x03\xe0\x41\x02\x12h\n\x13\x61utoscaling_targets\x18\x02 \x01(\x0b\x32\x46.google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingTargetsB\x03\xe0\x41\x02\x12|\n\x1e\x61symmetric_autoscaling_options\x18\x03 \x03(\x0b\x32O.google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOptionB\x03\xe0\x41\x01\x1a\x97\x01\n\x11\x41utoscalingLimits\x12\x13\n\tmin_nodes\x18\x01 \x01(\x05H\x00\x12\x1e\n\x14min_processing_units\x18\x02 \x01(\x05H\x00\x12\x13\n\tmax_nodes\x18\x03 \x01(\x05H\x01\x12\x1e\n\x14max_processing_units\x18\x04 \x01(\x05H\x01\x42\x0b\n\tmin_limitB\x0b\n\tmax_limit\x1a\x9e\x01\n\x12\x41utoscalingTargets\x12\x32\n%high_priority_cpu_utilization_percent\x18\x01 \x01(\x05\x42\x03\xe0\x41\x01\x12*\n\x1dtotal_cpu_utilization_percent\x18\x04 \x01(\x05\x42\x03\xe0\x41\x01\x12(\n\x1bstorage_utilization_percent\x18\x02 \x01(\x05\x42\x03\xe0\x41\x02\x1a\xe3\x04\n\x1b\x41symmetricAutoscalingOption\x12R\n\x11replica_selection\x18\x01 \x01(\x0b\x32\x32.google.spanner.admin.instance.v1.ReplicaSelectionB\x03\xe0\x41\x02\x12\x82\x01\n\toverrides\x18\x02 \x01(\x0b\x32j.google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.AutoscalingConfigOverridesB\x03\xe0\x41\x01\x1a\xea\x02\n\x1a\x41utoscalingConfigOverrides\x12\x66\n\x12\x61utoscaling_limits\x18\x01 \x01(\x0b\x32\x45.google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimitsB\x03\xe0\x41\x01\x12\x45\n8autoscaling_target_high_priority_cpu_utilization_percent\x18\x02 \x01(\x05\x42\x03\xe0\x41\x01\x12=\n0autoscaling_target_total_cpu_utilization_percent\x18\x04 \x01(\x05\x42\x03\xe0\x41\x01\x12\x32\n%disable_high_priority_cpu_autoscaling\x18\x05 \x01(\x08\x42\x03\xe0\x41\x01\x12*\n\x1d\x64isable_total_cpu_autoscaling\x18\x06 \x01(\x08\x42\x03\xe0\x41\x01\"\xaa\x0b\n\x08Instance\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12=\n\x06\x63onfig\x18\x02 \x01(\tB-\xe0\x41\x02\xfa\x41\'\n%spanner.googleapis.com/InstanceConfig\x12\x19\n\x0c\x64isplay_name\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12\x12\n\nnode_count\x18\x05 \x01(\x05\x12\x18\n\x10processing_units\x18\t \x01(\x05\x12_\n\x18replica_compute_capacity\x18\x13 \x03(\x0b\x32\x38.google.spanner.admin.instance.v1.ReplicaComputeCapacityB\x03\xe0\x41\x03\x12T\n\x12\x61utoscaling_config\x18\x11 \x01(\x0b\x32\x33.google.spanner.admin.instance.v1.AutoscalingConfigB\x03\xe0\x41\x01\x12\x44\n\x05state\x18\x06 \x01(\x0e\x32\x30.google.spanner.admin.instance.v1.Instance.StateB\x03\xe0\x41\x03\x12\x46\n\x06labels\x18\x07 \x03(\x0b\x32\x36.google.spanner.admin.instance.v1.Instance.LabelsEntry\x12N\n\rinstance_type\x18\n \x01(\x0e\x32\x37.google.spanner.admin.instance.v1.Instance.InstanceType\x12\x15\n\rendpoint_uris\x18\x08 \x03(\t\x12\x34\n\x0b\x63reate_time\x18\x0b \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x0c \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12V\n\x16\x66ree_instance_metadata\x18\r \x01(\x0b\x32\x36.google.spanner.admin.instance.v1.FreeInstanceMetadata\x12H\n\x07\x65\x64ition\x18\x14 \x01(\x0e\x32\x32.google.spanner.admin.instance.v1.Instance.EditionB\x03\xe0\x41\x01\x12o\n\x1c\x64\x65\x66\x61ult_backup_schedule_type\x18\x17 \x01(\x0e\x32\x44.google.spanner.admin.instance.v1.Instance.DefaultBackupScheduleTypeB\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\"7\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0c\n\x08\x43REATING\x10\x01\x12\t\n\x05READY\x10\x02\"Q\n\x0cInstanceType\x12\x1d\n\x19INSTANCE_TYPE_UNSPECIFIED\x10\x00\x12\x0f\n\x0bPROVISIONED\x10\x01\x12\x11\n\rFREE_INSTANCE\x10\x02\"U\n\x07\x45\x64ition\x12\x17\n\x13\x45\x44ITION_UNSPECIFIED\x10\x00\x12\x0c\n\x08STANDARD\x10\x01\x12\x0e\n\nENTERPRISE\x10\x02\x12\x13\n\x0f\x45NTERPRISE_PLUS\x10\x03\"b\n\x19\x44\x65\x66\x61ultBackupScheduleType\x12,\n(DEFAULT_BACKUP_SCHEDULE_TYPE_UNSPECIFIED\x10\x00\x12\x08\n\x04NONE\x10\x01\x12\r\n\tAUTOMATIC\x10\x02:b\xea\x41_\n\x1fspanner.googleapis.com/Instance\x12\'projects/{project}/instances/{instance}*\tinstances2\x08instance\"\x88\x01\n\x1aListInstanceConfigsRequest\x12\x43\n\x06parent\x18\x01 \x01(\tB3\xe0\x41\x02\xfa\x41-\n+cloudresourcemanager.googleapis.com/Project\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\"\x82\x01\n\x1bListInstanceConfigsResponse\x12J\n\x10instance_configs\x18\x01 \x03(\x0b\x32\x30.google.spanner.admin.instance.v1.InstanceConfig\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"W\n\x18GetInstanceConfigRequest\x12;\n\x04name\x18\x01 \x01(\tB-\xe0\x41\x02\xfa\x41\'\n%spanner.googleapis.com/InstanceConfig\"\xea\x01\n\x1b\x43reateInstanceConfigRequest\x12\x43\n\x06parent\x18\x01 \x01(\tB3\xe0\x41\x02\xfa\x41-\n+cloudresourcemanager.googleapis.com/Project\x12\x1f\n\x12instance_config_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12N\n\x0finstance_config\x18\x03 \x01(\x0b\x32\x30.google.spanner.admin.instance.v1.InstanceConfigB\x03\xe0\x41\x02\x12\x15\n\rvalidate_only\x18\x04 \x01(\x08\"\xba\x01\n\x1bUpdateInstanceConfigRequest\x12N\n\x0finstance_config\x18\x01 \x01(\x0b\x32\x30.google.spanner.admin.instance.v1.InstanceConfigB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\x12\x15\n\rvalidate_only\x18\x03 \x01(\x08\"\x7f\n\x1b\x44\x65leteInstanceConfigRequest\x12;\n\x04name\x18\x01 \x01(\tB-\xe0\x41\x02\xfa\x41\'\n%spanner.googleapis.com/InstanceConfig\x12\x0c\n\x04\x65tag\x18\x02 \x01(\t\x12\x15\n\rvalidate_only\x18\x03 \x01(\x08\"\xa1\x01\n#ListInstanceConfigOperationsRequest\x12\x43\n\x06parent\x18\x01 \x01(\tB3\xe0\x41\x02\xfa\x41-\n+cloudresourcemanager.googleapis.com/Project\x12\x0e\n\x06\x66ilter\x18\x02 \x01(\t\x12\x11\n\tpage_size\x18\x03 \x01(\x05\x12\x12\n\npage_token\x18\x04 \x01(\t\"r\n$ListInstanceConfigOperationsResponse\x12\x31\n\noperations\x18\x01 \x03(\x0b\x32\x1d.google.longrunning.Operation\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"{\n\x12GetInstanceRequest\x12\x35\n\x04name\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1fspanner.googleapis.com/Instance\x12.\n\nfield_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"\xb9\x01\n\x15\x43reateInstanceRequest\x12\x43\n\x06parent\x18\x01 \x01(\tB3\xe0\x41\x02\xfa\x41-\n+cloudresourcemanager.googleapis.com/Project\x12\x18\n\x0binstance_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x41\n\x08instance\x18\x03 \x01(\x0b\x32*.google.spanner.admin.instance.v1.InstanceB\x03\xe0\x41\x02\"\xc9\x01\n\x14ListInstancesRequest\x12\x43\n\x06parent\x18\x01 \x01(\tB3\xe0\x41\x02\xfa\x41-\n+cloudresourcemanager.googleapis.com/Project\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\x12\x35\n\x11instance_deadline\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"\x84\x01\n\x15ListInstancesResponse\x12=\n\tinstances\x18\x01 \x03(\x0b\x32*.google.spanner.admin.instance.v1.Instance\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x13\n\x0bunreachable\x18\x03 \x03(\t\"\x8f\x01\n\x15UpdateInstanceRequest\x12\x41\n\x08instance\x18\x01 \x01(\x0b\x32*.google.spanner.admin.instance.v1.InstanceB\x03\xe0\x41\x02\x12\x33\n\nfield_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\"N\n\x15\x44\x65leteInstanceRequest\x12\x35\n\x04name\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1fspanner.googleapis.com/Instance\"\xbf\x02\n\x16\x43reateInstanceMetadata\x12<\n\x08instance\x18\x01 \x01(\x0b\x32*.google.spanner.admin.instance.v1.Instance\x12.\n\nstart_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12/\n\x0b\x63\x61ncel_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12,\n\x08\x65nd_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12X\n\x1b\x65xpected_fulfillment_period\x18\x05 \x01(\x0e\x32\x33.google.spanner.admin.instance.v1.FulfillmentPeriod\"\xbf\x02\n\x16UpdateInstanceMetadata\x12<\n\x08instance\x18\x01 \x01(\x0b\x32*.google.spanner.admin.instance.v1.Instance\x12.\n\nstart_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12/\n\x0b\x63\x61ncel_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12,\n\x08\x65nd_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12X\n\x1b\x65xpected_fulfillment_period\x18\x05 \x01(\x0e\x32\x33.google.spanner.admin.instance.v1.FulfillmentPeriod\"\xce\x02\n\x14\x46reeInstanceMetadata\x12\x34\n\x0b\x65xpire_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x35\n\x0cupgrade_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12^\n\x0f\x65xpire_behavior\x18\x03 \x01(\x0e\x32\x45.google.spanner.admin.instance.v1.FreeInstanceMetadata.ExpireBehavior\"i\n\x0e\x45xpireBehavior\x12\x1f\n\x1b\x45XPIRE_BEHAVIOR_UNSPECIFIED\x10\x00\x12\x17\n\x13\x46REE_TO_PROVISIONED\x10\x01\x12\x1d\n\x19REMOVE_AFTER_GRACE_PERIOD\x10\x02\"\xe1\x01\n\x1c\x43reateInstanceConfigMetadata\x12I\n\x0finstance_config\x18\x01 \x01(\x0b\x32\x30.google.spanner.admin.instance.v1.InstanceConfig\x12\x45\n\x08progress\x18\x02 \x01(\x0b\x32\x33.google.spanner.admin.instance.v1.OperationProgress\x12/\n\x0b\x63\x61ncel_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"\xe1\x01\n\x1cUpdateInstanceConfigMetadata\x12I\n\x0finstance_config\x18\x01 \x01(\x0b\x32\x30.google.spanner.admin.instance.v1.InstanceConfig\x12\x45\n\x08progress\x18\x02 \x01(\x0b\x32\x33.google.spanner.admin.instance.v1.OperationProgress\x12/\n\x0b\x63\x61ncel_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"\x8f\x06\n\x11InstancePartition\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12=\n\x06\x63onfig\x18\x02 \x01(\tB-\xe0\x41\x02\xfa\x41\'\n%spanner.googleapis.com/InstanceConfig\x12\x19\n\x0c\x64isplay_name\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12\x14\n\nnode_count\x18\x05 \x01(\x05H\x00\x12\x1a\n\x10processing_units\x18\x06 \x01(\x05H\x00\x12T\n\x12\x61utoscaling_config\x18\r \x01(\x0b\x32\x33.google.spanner.admin.instance.v1.AutoscalingConfigB\x03\xe0\x41\x01\x12M\n\x05state\x18\x07 \x01(\x0e\x32\x39.google.spanner.admin.instance.v1.InstancePartition.StateB\x03\xe0\x41\x03\x12\x34\n\x0b\x63reate_time\x18\x08 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\t \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\"\n\x15referencing_databases\x18\n \x03(\tB\x03\xe0\x41\x03\x12\"\n\x13referencing_backups\x18\x0b \x03(\tB\x05\x18\x01\xe0\x41\x03\x12\x0c\n\x04\x65tag\x18\x0c \x01(\t\"7\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0c\n\x08\x43REATING\x10\x01\x12\t\n\x05READY\x10\x02:\xa6\x01\xea\x41\xa2\x01\n(spanner.googleapis.com/InstancePartition\x12Oprojects/{project}/instances/{instance}/instancePartitions/{instance_partition}*\x12instancePartitions2\x11instancePartitionB\x12\n\x10\x63ompute_capacity\"\x81\x02\n\x1f\x43reateInstancePartitionMetadata\x12O\n\x12instance_partition\x18\x01 \x01(\x0b\x32\x33.google.spanner.admin.instance.v1.InstancePartition\x12.\n\nstart_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12/\n\x0b\x63\x61ncel_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12,\n\x08\x65nd_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"\xd3\x01\n\x1e\x43reateInstancePartitionRequest\x12\x37\n\x06parent\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1fspanner.googleapis.com/Instance\x12\"\n\x15instance_partition_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12T\n\x12instance_partition\x18\x03 \x01(\x0b\x32\x33.google.spanner.admin.instance.v1.InstancePartitionB\x03\xe0\x41\x02\"n\n\x1e\x44\x65leteInstancePartitionRequest\x12>\n\x04name\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(spanner.googleapis.com/InstancePartition\x12\x0c\n\x04\x65tag\x18\x02 \x01(\t\"]\n\x1bGetInstancePartitionRequest\x12>\n\x04name\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(spanner.googleapis.com/InstancePartition\"\xab\x01\n\x1eUpdateInstancePartitionRequest\x12T\n\x12instance_partition\x18\x01 \x01(\x0b\x32\x33.google.spanner.admin.instance.v1.InstancePartitionB\x03\xe0\x41\x02\x12\x33\n\nfield_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\"\x81\x02\n\x1fUpdateInstancePartitionMetadata\x12O\n\x12instance_partition\x18\x01 \x01(\x0b\x32\x33.google.spanner.admin.instance.v1.InstancePartition\x12.\n\nstart_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12/\n\x0b\x63\x61ncel_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12,\n\x08\x65nd_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"\xc5\x01\n\x1dListInstancePartitionsRequest\x12\x37\n\x06parent\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1fspanner.googleapis.com/Instance\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\x12\x44\n\x1binstance_partition_deadline\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x01\"\xa0\x01\n\x1eListInstancePartitionsResponse\x12P\n\x13instance_partitions\x18\x01 \x03(\x0b\x32\x33.google.spanner.admin.instance.v1.InstancePartition\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x13\n\x0bunreachable\x18\x03 \x03(\t\"\xed\x01\n&ListInstancePartitionOperationsRequest\x12\x37\n\x06parent\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1fspanner.googleapis.com/Instance\x12\x13\n\x06\x66ilter\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x16\n\tpage_size\x18\x03 \x01(\x05\x42\x03\xe0\x41\x01\x12\x17\n\npage_token\x18\x04 \x01(\tB\x03\xe0\x41\x01\x12\x44\n\x1binstance_partition_deadline\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x01\"\x9e\x01\n\'ListInstancePartitionOperationsResponse\x12\x31\n\noperations\x18\x01 \x03(\x0b\x32\x1d.google.longrunning.Operation\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\'\n\x1funreachable_instance_partitions\x18\x03 \x03(\t\"\x92\x01\n\x13MoveInstanceRequest\x12\x35\n\x04name\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1fspanner.googleapis.com/Instance\x12\x44\n\rtarget_config\x18\x02 \x01(\tB-\xe0\x41\x02\xfa\x41\'\n%spanner.googleapis.com/InstanceConfig\"\x16\n\x14MoveInstanceResponse\"\xa5\x01\n\x14MoveInstanceMetadata\x12\x15\n\rtarget_config\x18\x01 \x01(\t\x12\x45\n\x08progress\x18\x02 \x01(\x0b\x32\x33.google.spanner.admin.instance.v1.OperationProgress\x12/\n\x0b\x63\x61ncel_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp2\xda\'\n\rInstanceAdmin\x12\xcc\x01\n\x13ListInstanceConfigs\x12<.google.spanner.admin.instance.v1.ListInstanceConfigsRequest\x1a=.google.spanner.admin.instance.v1.ListInstanceConfigsResponse\"8\xda\x41\x06parent\x82\xd3\xe4\x93\x02)\x12\'/v1/{parent=projects/*}/instanceConfigs\x12\xb9\x01\n\x11GetInstanceConfig\x12:.google.spanner.admin.instance.v1.GetInstanceConfigRequest\x1a\x30.google.spanner.admin.instance.v1.InstanceConfig\"6\xda\x41\x04name\x82\xd3\xe4\x93\x02)\x12\'/v1/{name=projects/*/instanceConfigs/*}\x12\xc8\x02\n\x14\x43reateInstanceConfig\x12=.google.spanner.admin.instance.v1.CreateInstanceConfigRequest\x1a\x1d.google.longrunning.Operation\"\xd1\x01\xca\x41p\n/google.spanner.admin.instance.v1.InstanceConfig\x12=google.spanner.admin.instance.v1.CreateInstanceConfigMetadata\xda\x41)parent,instance_config,instance_config_id\x82\xd3\xe4\x93\x02,\"\'/v1/{parent=projects/*}/instanceConfigs:\x01*\x12\xca\x02\n\x14UpdateInstanceConfig\x12=.google.spanner.admin.instance.v1.UpdateInstanceConfigRequest\x1a\x1d.google.longrunning.Operation\"\xd3\x01\xca\x41p\n/google.spanner.admin.instance.v1.InstanceConfig\x12=google.spanner.admin.instance.v1.UpdateInstanceConfigMetadata\xda\x41\x1binstance_config,update_mask\x82\xd3\xe4\x93\x02<27/v1/{instance_config.name=projects/*/instanceConfigs/*}:\x01*\x12\xa5\x01\n\x14\x44\x65leteInstanceConfig\x12=.google.spanner.admin.instance.v1.DeleteInstanceConfigRequest\x1a\x16.google.protobuf.Empty\"6\xda\x41\x04name\x82\xd3\xe4\x93\x02)*\'/v1/{name=projects/*/instanceConfigs/*}\x12\xf0\x01\n\x1cListInstanceConfigOperations\x12\x45.google.spanner.admin.instance.v1.ListInstanceConfigOperationsRequest\x1a\x46.google.spanner.admin.instance.v1.ListInstanceConfigOperationsResponse\"A\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x32\x12\x30/v1/{parent=projects/*}/instanceConfigOperations\x12\xb4\x01\n\rListInstances\x12\x36.google.spanner.admin.instance.v1.ListInstancesRequest\x1a\x37.google.spanner.admin.instance.v1.ListInstancesResponse\"2\xda\x41\x06parent\x82\xd3\xe4\x93\x02#\x12!/v1/{parent=projects/*}/instances\x12\xe4\x01\n\x16ListInstancePartitions\x12?.google.spanner.admin.instance.v1.ListInstancePartitionsRequest\x1a@.google.spanner.admin.instance.v1.ListInstancePartitionsResponse\"G\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x38\x12\x36/v1/{parent=projects/*/instances/*}/instancePartitions\x12\xa1\x01\n\x0bGetInstance\x12\x34.google.spanner.admin.instance.v1.GetInstanceRequest\x1a*.google.spanner.admin.instance.v1.Instance\"0\xda\x41\x04name\x82\xd3\xe4\x93\x02#\x12!/v1/{name=projects/*/instances/*}\x12\x9c\x02\n\x0e\x43reateInstance\x12\x37.google.spanner.admin.instance.v1.CreateInstanceRequest\x1a\x1d.google.longrunning.Operation\"\xb1\x01\xca\x41\x64\n)google.spanner.admin.instance.v1.Instance\x12\x37google.spanner.admin.instance.v1.CreateInstanceMetadata\xda\x41\x1bparent,instance_id,instance\x82\xd3\xe4\x93\x02&\"!/v1/{parent=projects/*}/instances:\x01*\x12\x9d\x02\n\x0eUpdateInstance\x12\x37.google.spanner.admin.instance.v1.UpdateInstanceRequest\x1a\x1d.google.longrunning.Operation\"\xb2\x01\xca\x41\x64\n)google.spanner.admin.instance.v1.Instance\x12\x37google.spanner.admin.instance.v1.UpdateInstanceMetadata\xda\x41\x13instance,field_mask\x82\xd3\xe4\x93\x02/2*/v1/{instance.name=projects/*/instances/*}:\x01*\x12\x93\x01\n\x0e\x44\x65leteInstance\x12\x37.google.spanner.admin.instance.v1.DeleteInstanceRequest\x1a\x16.google.protobuf.Empty\"0\xda\x41\x04name\x82\xd3\xe4\x93\x02#*!/v1/{name=projects/*/instances/*}\x12\x9a\x01\n\x0cSetIamPolicy\x12\".google.iam.v1.SetIamPolicyRequest\x1a\x15.google.iam.v1.Policy\"O\xda\x41\x0fresource,policy\x82\xd3\xe4\x93\x02\x37\"2/v1/{resource=projects/*/instances/*}:setIamPolicy:\x01*\x12\x93\x01\n\x0cGetIamPolicy\x12\".google.iam.v1.GetIamPolicyRequest\x1a\x15.google.iam.v1.Policy\"H\xda\x41\x08resource\x82\xd3\xe4\x93\x02\x37\"2/v1/{resource=projects/*/instances/*}:getIamPolicy:\x01*\x12\xc5\x01\n\x12TestIamPermissions\x12(.google.iam.v1.TestIamPermissionsRequest\x1a).google.iam.v1.TestIamPermissionsResponse\"Z\xda\x41\x14resource,permissions\x82\xd3\xe4\x93\x02=\"8/v1/{resource=projects/*/instances/*}:testIamPermissions:\x01*\x12\xd1\x01\n\x14GetInstancePartition\x12=.google.spanner.admin.instance.v1.GetInstancePartitionRequest\x1a\x33.google.spanner.admin.instance.v1.InstancePartition\"E\xda\x41\x04name\x82\xd3\xe4\x93\x02\x38\x12\x36/v1/{name=projects/*/instances/*/instancePartitions/*}\x12\xe9\x02\n\x17\x43reateInstancePartition\x12@.google.spanner.admin.instance.v1.CreateInstancePartitionRequest\x1a\x1d.google.longrunning.Operation\"\xec\x01\xca\x41v\n2google.spanner.admin.instance.v1.InstancePartition\x12@google.spanner.admin.instance.v1.CreateInstancePartitionMetadata\xda\x41/parent,instance_partition,instance_partition_id\x82\xd3\xe4\x93\x02;\"6/v1/{parent=projects/*/instances/*}/instancePartitions:\x01*\x12\xba\x01\n\x17\x44\x65leteInstancePartition\x12@.google.spanner.admin.instance.v1.DeleteInstancePartitionRequest\x1a\x16.google.protobuf.Empty\"E\xda\x41\x04name\x82\xd3\xe4\x93\x02\x38*6/v1/{name=projects/*/instances/*/instancePartitions/*}\x12\xea\x02\n\x17UpdateInstancePartition\x12@.google.spanner.admin.instance.v1.UpdateInstancePartitionRequest\x1a\x1d.google.longrunning.Operation\"\xed\x01\xca\x41v\n2google.spanner.admin.instance.v1.InstancePartition\x12@google.spanner.admin.instance.v1.UpdateInstancePartitionMetadata\xda\x41\x1dinstance_partition,field_mask\x82\xd3\xe4\x93\x02N2I/v1/{instance_partition.name=projects/*/instances/*/instancePartitions/*}:\x01*\x12\x88\x02\n\x1fListInstancePartitionOperations\x12H.google.spanner.admin.instance.v1.ListInstancePartitionOperationsRequest\x1aI.google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse\"P\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x41\x12?/v1/{parent=projects/*/instances/*}/instancePartitionOperations\x12\x89\x02\n\x0cMoveInstance\x12\x35.google.spanner.admin.instance.v1.MoveInstanceRequest\x1a\x1d.google.longrunning.Operation\"\xa2\x01\xca\x41n\n5google.spanner.admin.instance.v1.MoveInstanceResponse\x12\x35google.spanner.admin.instance.v1.MoveInstanceMetadata\x82\xd3\xe4\x93\x02+\"&/v1/{name=projects/*/instances/*}:move:\x01*\x1ax\xca\x41\x16spanner.googleapis.com\xd2\x41\\https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/spanner.adminB\x8b\x02\n$com.google.spanner.admin.instance.v1B\x19SpannerInstanceAdminProtoP\x01ZFcloud.google.com/go/spanner/admin/instance/apiv1/instancepb;instancepb\xaa\x02&Google.Cloud.Spanner.Admin.Instance.V1\xca\x02&Google\\Cloud\\Spanner\\Admin\\Instance\\V1\xea\x02+Google::Cloud::Spanner::Admin::Instance::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.admin.instance.v1.ReplicaSelection", "google/spanner/admin/instance/v1/common.proto"], + ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], + ["google.protobuf.FieldMask", "google/protobuf/field_mask.proto"], + ["google.longrunning.Operation", "google/longrunning/operations.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 Admin + module Instance + module V1 + ReplicaInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.ReplicaInfo").msgclass + ReplicaInfo::ReplicaType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.ReplicaInfo.ReplicaType").enummodule + InstanceConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.InstanceConfig").msgclass + InstanceConfig::Type = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.InstanceConfig.Type").enummodule + InstanceConfig::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.InstanceConfig.State").enummodule + InstanceConfig::FreeInstanceAvailability = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.InstanceConfig.FreeInstanceAvailability").enummodule + InstanceConfig::QuorumType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.InstanceConfig.QuorumType").enummodule + ReplicaComputeCapacity = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.ReplicaComputeCapacity").msgclass + AutoscalingConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.AutoscalingConfig").msgclass + AutoscalingConfig::AutoscalingLimits = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimits").msgclass + AutoscalingConfig::AutoscalingTargets = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingTargets").msgclass + AutoscalingConfig::AsymmetricAutoscalingOption = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption").msgclass + AutoscalingConfig::AsymmetricAutoscalingOption::AutoscalingConfigOverrides = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.AutoscalingConfigOverrides").msgclass + Instance = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.Instance").msgclass + Instance::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.Instance.State").enummodule + Instance::InstanceType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.Instance.InstanceType").enummodule + Instance::Edition = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.Instance.Edition").enummodule + Instance::DefaultBackupScheduleType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.Instance.DefaultBackupScheduleType").enummodule + ListInstanceConfigsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.ListInstanceConfigsRequest").msgclass + ListInstanceConfigsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.ListInstanceConfigsResponse").msgclass + GetInstanceConfigRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.GetInstanceConfigRequest").msgclass + CreateInstanceConfigRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.CreateInstanceConfigRequest").msgclass + UpdateInstanceConfigRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.UpdateInstanceConfigRequest").msgclass + DeleteInstanceConfigRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.DeleteInstanceConfigRequest").msgclass + ListInstanceConfigOperationsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.ListInstanceConfigOperationsRequest").msgclass + ListInstanceConfigOperationsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.ListInstanceConfigOperationsResponse").msgclass + GetInstanceRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.GetInstanceRequest").msgclass + CreateInstanceRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.CreateInstanceRequest").msgclass + ListInstancesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.ListInstancesRequest").msgclass + ListInstancesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.ListInstancesResponse").msgclass + UpdateInstanceRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.UpdateInstanceRequest").msgclass + DeleteInstanceRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.DeleteInstanceRequest").msgclass + CreateInstanceMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.CreateInstanceMetadata").msgclass + UpdateInstanceMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.UpdateInstanceMetadata").msgclass + FreeInstanceMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.FreeInstanceMetadata").msgclass + FreeInstanceMetadata::ExpireBehavior = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.FreeInstanceMetadata.ExpireBehavior").enummodule + CreateInstanceConfigMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.CreateInstanceConfigMetadata").msgclass + UpdateInstanceConfigMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.UpdateInstanceConfigMetadata").msgclass + InstancePartition = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.InstancePartition").msgclass + InstancePartition::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.InstancePartition.State").enummodule + CreateInstancePartitionMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.CreateInstancePartitionMetadata").msgclass + CreateInstancePartitionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.CreateInstancePartitionRequest").msgclass + DeleteInstancePartitionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.DeleteInstancePartitionRequest").msgclass + GetInstancePartitionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.GetInstancePartitionRequest").msgclass + UpdateInstancePartitionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.UpdateInstancePartitionRequest").msgclass + UpdateInstancePartitionMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.UpdateInstancePartitionMetadata").msgclass + ListInstancePartitionsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.ListInstancePartitionsRequest").msgclass + ListInstancePartitionsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.ListInstancePartitionsResponse").msgclass + ListInstancePartitionOperationsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.ListInstancePartitionOperationsRequest").msgclass + ListInstancePartitionOperationsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse").msgclass + MoveInstanceRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.MoveInstanceRequest").msgclass + MoveInstanceResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.MoveInstanceResponse").msgclass + MoveInstanceMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.MoveInstanceMetadata").msgclass + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google/spanner/admin/instance/v1/spanner_instance_admin_services_pb.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google/spanner/admin/instance/v1/spanner_instance_admin_services_pb.rb new file mode 100644 index 000000000000..d5b8848f47b8 --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google/spanner/admin/instance/v1/spanner_instance_admin_services_pb.rb @@ -0,0 +1,463 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/spanner/admin/instance/v1/spanner_instance_admin.proto for package 'Google.Cloud.Spanner.Admin.Instance.V1' +# Original file comments: +# Copyright 2025 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 +# +# 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. +# + +require 'grpc' +require 'google/spanner/admin/instance/v1/spanner_instance_admin_pb' + +module Google + module Cloud + module Spanner + module Admin + module Instance + module V1 + module InstanceAdmin + # Cloud Spanner Instance Admin API + # + # The Cloud Spanner Instance Admin API can be used to create, delete, + # modify and list instances. Instances are dedicated Cloud Spanner serving + # and storage resources to be used by Cloud Spanner databases. + # + # Each instance has a "configuration", which dictates where the + # serving resources for the Cloud Spanner instance are located (e.g., + # US-central, Europe). Configurations are created by Google based on + # resource availability. + # + # Cloud Spanner billing is based on the instances that exist and their + # sizes. After an instance exists, there are no additional + # per-database or per-operation charges for use of the instance + # (though there may be additional network bandwidth charges). + # Instances offer isolation: problems with databases in one instance + # will not affect other instances. However, within an instance + # databases can affect each other. For example, if one database in an + # instance receives a lot of requests and consumes most of the + # instance resources, fewer resources are available for other + # databases in that instance, and their performance may suffer. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.spanner.admin.instance.v1.InstanceAdmin' + + # Lists the supported instance configurations for a given project. + # + # Returns both Google-managed configurations and user-managed + # configurations. + rpc :ListInstanceConfigs, ::Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigsRequest, ::Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigsResponse + # Gets information about a particular instance configuration. + rpc :GetInstanceConfig, ::Google::Cloud::Spanner::Admin::Instance::V1::GetInstanceConfigRequest, ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig + # Creates an instance configuration and begins preparing it to be used. The + # returned long-running operation + # can be used to track the progress of preparing the new + # instance configuration. The instance configuration name is assigned by the + # caller. If the named instance configuration already exists, + # `CreateInstanceConfig` returns `ALREADY_EXISTS`. + # + # Immediately after the request returns: + # + # * The instance configuration is readable via the API, with all requested + # attributes. The instance configuration's + # [reconciling][google.spanner.admin.instance.v1.InstanceConfig.reconciling] + # field is set to true. Its state is `CREATING`. + # + # While the operation is pending: + # + # * Cancelling the operation renders the instance configuration immediately + # unreadable via the API. + # * Except for deleting the creating resource, all other attempts to modify + # the instance configuration are rejected. + # + # Upon completion of the returned operation: + # + # * Instances can be created using the instance configuration. + # * The instance configuration's + # [reconciling][google.spanner.admin.instance.v1.InstanceConfig.reconciling] + # field becomes false. Its state becomes `READY`. + # + # The returned long-running operation will + # have a name of the format + # `/operations/` and can be used to track + # creation of the instance configuration. The + # metadata field type is + # [CreateInstanceConfigMetadata][google.spanner.admin.instance.v1.CreateInstanceConfigMetadata]. + # The response field type is + # [InstanceConfig][google.spanner.admin.instance.v1.InstanceConfig], if + # successful. + # + # Authorization requires `spanner.instanceConfigs.create` permission on + # the resource + # [parent][google.spanner.admin.instance.v1.CreateInstanceConfigRequest.parent]. + rpc :CreateInstanceConfig, ::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstanceConfigRequest, ::Google::Longrunning::Operation + # Updates an instance configuration. The returned + # long-running operation can be used to track + # the progress of updating the instance. If the named instance configuration + # does not exist, returns `NOT_FOUND`. + # + # Only user-managed configurations can be updated. + # + # Immediately after the request returns: + # + # * The instance configuration's + # [reconciling][google.spanner.admin.instance.v1.InstanceConfig.reconciling] + # field is set to true. + # + # While the operation is pending: + # + # * Cancelling the operation sets its metadata's + # [cancel_time][google.spanner.admin.instance.v1.UpdateInstanceConfigMetadata.cancel_time]. + # The operation is guaranteed to succeed at undoing all changes, after + # which point it terminates with a `CANCELLED` status. + # * All other attempts to modify the instance configuration are rejected. + # * Reading the instance configuration via the API continues to give the + # pre-request values. + # + # Upon completion of the returned operation: + # + # * Creating instances using the instance configuration uses the new + # values. + # * The new values of the instance configuration are readable via the API. + # * The instance configuration's + # [reconciling][google.spanner.admin.instance.v1.InstanceConfig.reconciling] + # field becomes false. + # + # The returned long-running operation will + # have a name of the format + # `/operations/` and can be used to track + # the instance configuration modification. The + # metadata field type is + # [UpdateInstanceConfigMetadata][google.spanner.admin.instance.v1.UpdateInstanceConfigMetadata]. + # The response field type is + # [InstanceConfig][google.spanner.admin.instance.v1.InstanceConfig], if + # successful. + # + # Authorization requires `spanner.instanceConfigs.update` permission on + # the resource [name][google.spanner.admin.instance.v1.InstanceConfig.name]. + rpc :UpdateInstanceConfig, ::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstanceConfigRequest, ::Google::Longrunning::Operation + # Deletes the instance configuration. Deletion is only allowed when no + # instances are using the configuration. If any instances are using + # the configuration, returns `FAILED_PRECONDITION`. + # + # Only user-managed configurations can be deleted. + # + # Authorization requires `spanner.instanceConfigs.delete` permission on + # the resource [name][google.spanner.admin.instance.v1.InstanceConfig.name]. + rpc :DeleteInstanceConfig, ::Google::Cloud::Spanner::Admin::Instance::V1::DeleteInstanceConfigRequest, ::Google::Protobuf::Empty + # Lists the user-managed instance configuration long-running + # operations in the given project. An instance + # configuration operation has a name of the form + # `projects//instanceConfigs//operations/`. + # The long-running operation + # metadata field type + # `metadata.type_url` describes the type of the metadata. Operations returned + # include those that have completed/failed/canceled within the last 7 days, + # and pending operations. Operations returned are ordered by + # `operation.metadata.value.start_time` in descending order starting + # from the most recently started operation. + rpc :ListInstanceConfigOperations, ::Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigOperationsRequest, ::Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigOperationsResponse + # Lists all instances in the given project. + rpc :ListInstances, ::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancesRequest, ::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancesResponse + # Lists all instance partitions for the given instance. + rpc :ListInstancePartitions, ::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionsRequest, ::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionsResponse + # Gets information about a particular instance. + rpc :GetInstance, ::Google::Cloud::Spanner::Admin::Instance::V1::GetInstanceRequest, ::Google::Cloud::Spanner::Admin::Instance::V1::Instance + # Creates an instance and begins preparing it to begin serving. The + # returned long-running operation + # can be used to track the progress of preparing the new + # instance. The instance name is assigned by the caller. If the + # named instance already exists, `CreateInstance` returns + # `ALREADY_EXISTS`. + # + # Immediately upon completion of this request: + # + # * The instance is readable via the API, with all requested attributes + # but no allocated resources. Its state is `CREATING`. + # + # Until completion of the returned operation: + # + # * Cancelling the operation renders the instance immediately unreadable + # via the API. + # * The instance can be deleted. + # * All other attempts to modify the instance are rejected. + # + # Upon completion of the returned operation: + # + # * Billing for all successfully-allocated resources begins (some types + # may have lower than the requested levels). + # * Databases can be created in the instance. + # * The instance's allocated resource levels are readable via the API. + # * The instance's state becomes `READY`. + # + # The returned long-running operation will + # have a name of the format `/operations/` and + # can be used to track creation of the instance. The + # metadata field type is + # [CreateInstanceMetadata][google.spanner.admin.instance.v1.CreateInstanceMetadata]. + # The response field type is + # [Instance][google.spanner.admin.instance.v1.Instance], if successful. + rpc :CreateInstance, ::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstanceRequest, ::Google::Longrunning::Operation + # Updates an instance, and begins allocating or releasing resources + # as requested. The returned long-running operation can be used to track the + # progress of updating the instance. If the named instance does not + # exist, returns `NOT_FOUND`. + # + # Immediately upon completion of this request: + # + # * For resource types for which a decrease in the instance's allocation + # has been requested, billing is based on the newly-requested level. + # + # Until completion of the returned operation: + # + # * Cancelling the operation sets its metadata's + # [cancel_time][google.spanner.admin.instance.v1.UpdateInstanceMetadata.cancel_time], + # and begins restoring resources to their pre-request values. The + # operation is guaranteed to succeed at undoing all resource changes, + # after which point it terminates with a `CANCELLED` status. + # * All other attempts to modify the instance are rejected. + # * Reading the instance via the API continues to give the pre-request + # resource levels. + # + # Upon completion of the returned operation: + # + # * Billing begins for all successfully-allocated resources (some types + # may have lower than the requested levels). + # * All newly-reserved resources are available for serving the instance's + # tables. + # * The instance's new resource levels are readable via the API. + # + # The returned long-running operation will + # have a name of the format `/operations/` and + # can be used to track the instance modification. The + # metadata field type is + # [UpdateInstanceMetadata][google.spanner.admin.instance.v1.UpdateInstanceMetadata]. + # The response field type is + # [Instance][google.spanner.admin.instance.v1.Instance], if successful. + # + # Authorization requires `spanner.instances.update` permission on + # the resource [name][google.spanner.admin.instance.v1.Instance.name]. + rpc :UpdateInstance, ::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstanceRequest, ::Google::Longrunning::Operation + # Deletes an instance. + # + # Immediately upon completion of the request: + # + # * Billing ceases for all of the instance's reserved resources. + # + # Soon afterward: + # + # * The instance and *all of its databases* immediately and + # irrevocably disappear from the API. All data in the databases + # is permanently deleted. + rpc :DeleteInstance, ::Google::Cloud::Spanner::Admin::Instance::V1::DeleteInstanceRequest, ::Google::Protobuf::Empty + # Sets the access control policy on an instance resource. Replaces any + # existing policy. + # + # Authorization requires `spanner.instances.setIamPolicy` on + # [resource][google.iam.v1.SetIamPolicyRequest.resource]. + rpc :SetIamPolicy, ::Google::Iam::V1::SetIamPolicyRequest, ::Google::Iam::V1::Policy + # Gets the access control policy for an instance resource. Returns an empty + # policy if an instance exists but does not have a policy set. + # + # Authorization requires `spanner.instances.getIamPolicy` on + # [resource][google.iam.v1.GetIamPolicyRequest.resource]. + rpc :GetIamPolicy, ::Google::Iam::V1::GetIamPolicyRequest, ::Google::Iam::V1::Policy + # Returns permissions that the caller has on the specified instance resource. + # + # Attempting this RPC on a non-existent Cloud Spanner instance resource will + # result in a NOT_FOUND error if the user has `spanner.instances.list` + # permission on the containing Google Cloud Project. Otherwise returns an + # empty set of permissions. + rpc :TestIamPermissions, ::Google::Iam::V1::TestIamPermissionsRequest, ::Google::Iam::V1::TestIamPermissionsResponse + # Gets information about a particular instance partition. + rpc :GetInstancePartition, ::Google::Cloud::Spanner::Admin::Instance::V1::GetInstancePartitionRequest, ::Google::Cloud::Spanner::Admin::Instance::V1::InstancePartition + # Creates an instance partition and begins preparing it to be used. The + # returned long-running operation + # can be used to track the progress of preparing the new instance partition. + # The instance partition name is assigned by the caller. If the named + # instance partition already exists, `CreateInstancePartition` returns + # `ALREADY_EXISTS`. + # + # Immediately upon completion of this request: + # + # * The instance partition is readable via the API, with all requested + # attributes but no allocated resources. Its state is `CREATING`. + # + # Until completion of the returned operation: + # + # * Cancelling the operation renders the instance partition immediately + # unreadable via the API. + # * The instance partition can be deleted. + # * All other attempts to modify the instance partition are rejected. + # + # Upon completion of the returned operation: + # + # * Billing for all successfully-allocated resources begins (some types + # may have lower than the requested levels). + # * Databases can start using this instance partition. + # * The instance partition's allocated resource levels are readable via the + # API. + # * The instance partition's state becomes `READY`. + # + # The returned long-running operation will + # have a name of the format + # `/operations/` and can be used to + # track creation of the instance partition. The + # metadata field type is + # [CreateInstancePartitionMetadata][google.spanner.admin.instance.v1.CreateInstancePartitionMetadata]. + # The response field type is + # [InstancePartition][google.spanner.admin.instance.v1.InstancePartition], if + # successful. + rpc :CreateInstancePartition, ::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstancePartitionRequest, ::Google::Longrunning::Operation + # Deletes an existing instance partition. Requires that the + # instance partition is not used by any database or backup and is not the + # default instance partition of an instance. + # + # Authorization requires `spanner.instancePartitions.delete` permission on + # the resource + # [name][google.spanner.admin.instance.v1.InstancePartition.name]. + rpc :DeleteInstancePartition, ::Google::Cloud::Spanner::Admin::Instance::V1::DeleteInstancePartitionRequest, ::Google::Protobuf::Empty + # Updates an instance partition, and begins allocating or releasing resources + # as requested. The returned long-running operation can be used to track the + # progress of updating the instance partition. If the named instance + # partition does not exist, returns `NOT_FOUND`. + # + # Immediately upon completion of this request: + # + # * For resource types for which a decrease in the instance partition's + # allocation has been requested, billing is based on the newly-requested + # level. + # + # Until completion of the returned operation: + # + # * Cancelling the operation sets its metadata's + # [cancel_time][google.spanner.admin.instance.v1.UpdateInstancePartitionMetadata.cancel_time], + # and begins restoring resources to their pre-request values. The + # operation is guaranteed to succeed at undoing all resource changes, + # after which point it terminates with a `CANCELLED` status. + # * All other attempts to modify the instance partition are rejected. + # * Reading the instance partition via the API continues to give the + # pre-request resource levels. + # + # Upon completion of the returned operation: + # + # * Billing begins for all successfully-allocated resources (some types + # may have lower than the requested levels). + # * All newly-reserved resources are available for serving the instance + # partition's tables. + # * The instance partition's new resource levels are readable via the API. + # + # The returned long-running operation will + # have a name of the format + # `/operations/` and can be used to + # track the instance partition modification. The + # metadata field type is + # [UpdateInstancePartitionMetadata][google.spanner.admin.instance.v1.UpdateInstancePartitionMetadata]. + # The response field type is + # [InstancePartition][google.spanner.admin.instance.v1.InstancePartition], if + # successful. + # + # Authorization requires `spanner.instancePartitions.update` permission on + # the resource + # [name][google.spanner.admin.instance.v1.InstancePartition.name]. + rpc :UpdateInstancePartition, ::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstancePartitionRequest, ::Google::Longrunning::Operation + # Lists instance partition long-running operations in the given instance. + # An instance partition operation has a name of the form + # `projects//instances//instancePartitions//operations/`. + # The long-running operation + # metadata field type + # `metadata.type_url` describes the type of the metadata. Operations returned + # include those that have completed/failed/canceled within the last 7 days, + # and pending operations. Operations returned are ordered by + # `operation.metadata.value.start_time` in descending order starting from the + # most recently started operation. + # + # Authorization requires `spanner.instancePartitionOperations.list` + # permission on the resource + # [parent][google.spanner.admin.instance.v1.ListInstancePartitionOperationsRequest.parent]. + rpc :ListInstancePartitionOperations, ::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionOperationsRequest, ::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionOperationsResponse + # Moves an instance to the target instance configuration. You can use the + # returned long-running operation to track + # the progress of moving the instance. + # + # `MoveInstance` returns `FAILED_PRECONDITION` if the instance meets any of + # the following criteria: + # + # * Is undergoing a move to a different instance configuration + # * Has backups + # * Has an ongoing update + # * Contains any CMEK-enabled databases + # * Is a free trial instance + # + # While the operation is pending: + # + # * All other attempts to modify the instance, including changes to its + # compute capacity, are rejected. + # * The following database and backup admin operations are rejected: + # + # * `DatabaseAdmin.CreateDatabase` + # * `DatabaseAdmin.UpdateDatabaseDdl` (disabled if default_leader is + # specified in the request.) + # * `DatabaseAdmin.RestoreDatabase` + # * `DatabaseAdmin.CreateBackup` + # * `DatabaseAdmin.CopyBackup` + # + # * Both the source and target instance configurations are subject to + # hourly compute and storage charges. + # * The instance might experience higher read-write latencies and a higher + # transaction abort rate. However, moving an instance doesn't cause any + # downtime. + # + # The returned long-running operation has + # a name of the format + # `/operations/` and can be used to track + # the move instance operation. The + # metadata field type is + # [MoveInstanceMetadata][google.spanner.admin.instance.v1.MoveInstanceMetadata]. + # The response field type is + # [Instance][google.spanner.admin.instance.v1.Instance], + # if successful. + # Cancelling the operation sets its metadata's + # [cancel_time][google.spanner.admin.instance.v1.MoveInstanceMetadata.cancel_time]. + # Cancellation is not immediate because it involves moving any data + # previously moved to the target instance configuration back to the original + # instance configuration. You can use this operation to track the progress of + # the cancellation. Upon successful completion of the cancellation, the + # operation terminates with `CANCELLED` status. + # + # If not cancelled, upon completion of the returned operation: + # + # * The instance successfully moves to the target instance + # configuration. + # * You are billed for compute and storage in target instance + # configuration. + # + # Authorization requires the `spanner.instances.update` permission on + # the resource [instance][google.spanner.admin.instance.v1.Instance]. + # + # For more details, see + # [Move an instance](https://cloud.google.com/spanner/docs/move-instance). + rpc :MoveInstance, ::Google::Cloud::Spanner::Admin::Instance::V1::MoveInstanceRequest, ::Google::Longrunning::Operation + end + + Stub = Service.rpc_stub_class + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/proto_docs/README.md b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/proto_docs/README.md new file mode 100644 index 000000000000..ff5b3befac4d --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/proto_docs/README.md @@ -0,0 +1,4 @@ +# Cloud Spanner Instance Admin 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-admin-instance-v1/proto_docs/google/api/client.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..c6b6b60729c9 --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/proto_docs/google/api/client.rb @@ -0,0 +1,473 @@ +# frozen_string_literal: true + +# Copyright 2025 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-admin-instance-v1/proto_docs/google/api/field_behavior.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/proto_docs/google/api/field_behavior.rb new file mode 100644 index 000000000000..fb9115c630af --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/proto_docs/google/api/field_behavior.rb @@ -0,0 +1,85 @@ +# frozen_string_literal: true + +# Copyright 2025 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-admin-instance-v1/proto_docs/google/api/launch_stage.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..b836bdb60b21 --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/proto_docs/google/api/launch_stage.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2025 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-admin-instance-v1/proto_docs/google/api/resource.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/proto_docs/google/api/resource.rb new file mode 100644 index 000000000000..71b994c7ef20 --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/proto_docs/google/api/resource.rb @@ -0,0 +1,227 @@ +# frozen_string_literal: true + +# Copyright 2025 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-admin-instance-v1/proto_docs/google/iam/v1/iam_policy.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/proto_docs/google/iam/v1/iam_policy.rb new file mode 100644 index 000000000000..fbee4c39d435 --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/proto_docs/google/iam/v1/iam_policy.rb @@ -0,0 +1,87 @@ +# frozen_string_literal: true + +# Copyright 2025 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 Iam + module V1 + # Request message for `SetIamPolicy` method. + # @!attribute [rw] resource + # @return [::String] + # REQUIRED: The resource for which the policy is being specified. + # See the operation documentation for the appropriate value for this field. + # @!attribute [rw] policy + # @return [::Google::Iam::V1::Policy] + # REQUIRED: The complete policy to be applied to the `resource`. The size of + # the policy is limited to a few 10s of KB. An empty policy is a + # valid policy but certain Cloud Platform services (such as Projects) + # might reject them. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only + # the fields in the mask will be modified. If no mask is provided, the + # following default mask is used: + # + # `paths: "bindings, etag"` + class SetIamPolicyRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for `GetIamPolicy` method. + # @!attribute [rw] resource + # @return [::String] + # REQUIRED: The resource for which the policy is being requested. + # See the operation documentation for the appropriate value for this field. + # @!attribute [rw] options + # @return [::Google::Iam::V1::GetPolicyOptions] + # OPTIONAL: A `GetPolicyOptions` object for specifying options to + # `GetIamPolicy`. + class GetIamPolicyRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for `TestIamPermissions` method. + # @!attribute [rw] resource + # @return [::String] + # REQUIRED: The resource for which the policy detail is being requested. + # See the operation documentation for the appropriate value for this field. + # @!attribute [rw] permissions + # @return [::Array<::String>] + # The set of permissions to check for the `resource`. Permissions with + # wildcards (such as '*' or 'storage.*') are not allowed. For more + # information see + # [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + class TestIamPermissionsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for `TestIamPermissions` method. + # @!attribute [rw] permissions + # @return [::Array<::String>] + # A subset of `TestPermissionsRequest.permissions` that the caller is + # allowed. + class TestIamPermissionsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end +end diff --git a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/proto_docs/google/iam/v1/options.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/proto_docs/google/iam/v1/options.rb new file mode 100644 index 000000000000..848f8c2f7895 --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/proto_docs/google/iam/v1/options.rb @@ -0,0 +1,50 @@ +# frozen_string_literal: true + +# Copyright 2025 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 Iam + module V1 + # Encapsulates settings provided to GetIamPolicy. + # @!attribute [rw] requested_policy_version + # @return [::Integer] + # Optional. The maximum policy version that will be used to format the + # policy. + # + # Valid values are 0, 1, and 3. Requests specifying an invalid value will be + # rejected. + # + # Requests for policies with any conditional role bindings must specify + # version 3. Policies with no conditional role bindings may specify any valid + # value or leave the field unset. + # + # The policy in the response might use the policy version that you specified, + # or it might use a lower policy version. For example, if you specify version + # 3, but the policy has no conditional role bindings, the response uses + # version 1. + # + # To learn which resources support conditions in their IAM policies, see the + # [IAM + # documentation](https://cloud.google.com/iam/help/conditions/resource-policies). + class GetPolicyOptions + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end +end diff --git a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/proto_docs/google/iam/v1/policy.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/proto_docs/google/iam/v1/policy.rb new file mode 100644 index 000000000000..79fdbd1e2eff --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/proto_docs/google/iam/v1/policy.rb @@ -0,0 +1,426 @@ +# frozen_string_literal: true + +# Copyright 2025 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 Iam + module V1 + # An Identity and Access Management (IAM) policy, which specifies access + # controls for Google Cloud resources. + # + # + # A `Policy` is a collection of `bindings`. A `binding` binds one or more + # `members`, or principals, to a single `role`. Principals can be user + # accounts, service accounts, Google groups, and domains (such as G Suite). A + # `role` is a named list of permissions; each `role` can be an IAM predefined + # role or a user-created custom role. + # + # For some types of Google Cloud resources, a `binding` can also specify a + # `condition`, which is a logical expression that allows access to a resource + # only if the expression evaluates to `true`. A condition can add constraints + # based on attributes of the request, the resource, or both. To learn which + # resources support conditions in their IAM policies, see the + # [IAM + # documentation](https://cloud.google.com/iam/help/conditions/resource-policies). + # + # **JSON example:** + # + # ``` + # { + # "bindings": [ + # { + # "role": "roles/resourcemanager.organizationAdmin", + # "members": [ + # "user:mike@example.com", + # "group:admins@example.com", + # "domain:google.com", + # "serviceAccount:my-project-id@appspot.gserviceaccount.com" + # ] + # }, + # { + # "role": "roles/resourcemanager.organizationViewer", + # "members": [ + # "user:eve@example.com" + # ], + # "condition": { + # "title": "expirable access", + # "description": "Does not grant access after Sep 2020", + # "expression": "request.time < + # timestamp('2020-10-01T00:00:00.000Z')", + # } + # } + # ], + # "etag": "BwWWja0YfJA=", + # "version": 3 + # } + # ``` + # + # **YAML example:** + # + # ``` + # bindings: + # - members: + # - user:mike@example.com + # - group:admins@example.com + # - domain:google.com + # - serviceAccount:my-project-id@appspot.gserviceaccount.com + # role: roles/resourcemanager.organizationAdmin + # - members: + # - user:eve@example.com + # role: roles/resourcemanager.organizationViewer + # condition: + # title: expirable access + # description: Does not grant access after Sep 2020 + # expression: request.time < timestamp('2020-10-01T00:00:00.000Z') + # etag: BwWWja0YfJA= + # version: 3 + # ``` + # + # For a description of IAM and its features, see the + # [IAM documentation](https://cloud.google.com/iam/docs/). + # @!attribute [rw] version + # @return [::Integer] + # Specifies the format of the policy. + # + # Valid values are `0`, `1`, and `3`. Requests that specify an invalid value + # are rejected. + # + # Any operation that affects conditional role bindings must specify version + # `3`. This requirement applies to the following operations: + # + # * Getting a policy that includes a conditional role binding + # * Adding a conditional role binding to a policy + # * Changing a conditional role binding in a policy + # * Removing any role binding, with or without a condition, from a policy + # that includes conditions + # + # **Important:** If you use IAM Conditions, you must include the `etag` field + # whenever you call `setIamPolicy`. If you omit this field, then IAM allows + # you to overwrite a version `3` policy with a version `1` policy, and all of + # the conditions in the version `3` policy are lost. + # + # If a policy does not include any conditions, operations on that policy may + # specify any valid version or leave the field unset. + # + # To learn which resources support conditions in their IAM policies, see the + # [IAM + # documentation](https://cloud.google.com/iam/help/conditions/resource-policies). + # @!attribute [rw] bindings + # @return [::Array<::Google::Iam::V1::Binding>] + # Associates a list of `members`, or principals, with a `role`. Optionally, + # may specify a `condition` that determines how and when the `bindings` are + # applied. Each of the `bindings` must contain at least one principal. + # + # The `bindings` in a `Policy` can refer to up to 1,500 principals; up to 250 + # of these principals can be Google groups. Each occurrence of a principal + # counts towards these limits. For example, if the `bindings` grant 50 + # different roles to `user:alice@example.com`, and not to any other + # principal, then you can add another 1,450 principals to the `bindings` in + # the `Policy`. + # @!attribute [rw] audit_configs + # @return [::Array<::Google::Iam::V1::AuditConfig>] + # Specifies cloud audit logging configuration for this policy. + # @!attribute [rw] etag + # @return [::String] + # `etag` is used for optimistic concurrency control as a way to help + # prevent simultaneous updates of a policy from overwriting each other. + # It is strongly suggested that systems make use of the `etag` in the + # read-modify-write cycle to perform policy updates in order to avoid race + # conditions: An `etag` is returned in the response to `getIamPolicy`, and + # systems are expected to put that etag in the request to `setIamPolicy` to + # ensure that their change will be applied to the same version of the policy. + # + # **Important:** If you use IAM Conditions, you must include the `etag` field + # whenever you call `setIamPolicy`. If you omit this field, then IAM allows + # you to overwrite a version `3` policy with a version `1` policy, and all of + # the conditions in the version `3` policy are lost. + class Policy + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Associates `members`, or principals, with a `role`. + # @!attribute [rw] role + # @return [::String] + # Role that is assigned to the list of `members`, or principals. + # For example, `roles/viewer`, `roles/editor`, or `roles/owner`. + # @!attribute [rw] members + # @return [::Array<::String>] + # Specifies the principals requesting access for a Google Cloud resource. + # `members` can have the following values: + # + # * `allUsers`: A special identifier that represents anyone who is + # on the internet; with or without a Google account. + # + # * `allAuthenticatedUsers`: A special identifier that represents anyone + # who is authenticated with a Google account or a service account. + # + # * `user:{emailid}`: An email address that represents a specific Google + # account. For example, `alice@example.com` . + # + # + # * `serviceAccount:{emailid}`: An email address that represents a service + # account. For example, `my-other-app@appspot.gserviceaccount.com`. + # + # * `group:{emailid}`: An email address that represents a Google group. + # For example, `admins@example.com`. + # + # * `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus unique + # identifier) representing a user that has been recently deleted. For + # example, `alice@example.com?uid=123456789012345678901`. If the user is + # recovered, this value reverts to `user:{emailid}` and the recovered user + # retains the role in the binding. + # + # * `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address (plus + # unique identifier) representing a service account that has been recently + # deleted. For example, + # `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`. + # If the service account is undeleted, this value reverts to + # `serviceAccount:{emailid}` and the undeleted service account retains the + # role in the binding. + # + # * `deleted:group:{emailid}?uid={uniqueid}`: An email address (plus unique + # identifier) representing a Google group that has been recently + # deleted. For example, `admins@example.com?uid=123456789012345678901`. If + # the group is recovered, this value reverts to `group:{emailid}` and the + # recovered group retains the role in the binding. + # + # + # * `domain:{domain}`: The G Suite domain (primary) that represents all the + # users of that domain. For example, `google.com` or `example.com`. + # @!attribute [rw] condition + # @return [::Google::Type::Expr] + # The condition that is associated with this binding. + # + # If the condition evaluates to `true`, then this binding applies to the + # current request. + # + # If the condition evaluates to `false`, then this binding does not apply to + # the current request. However, a different role binding might grant the same + # role to one or more of the principals in this binding. + # + # To learn which resources support conditions in their IAM policies, see the + # [IAM + # documentation](https://cloud.google.com/iam/help/conditions/resource-policies). + class Binding + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Specifies the audit configuration for a service. + # The configuration determines which permission types are logged, and what + # identities, if any, are exempted from logging. + # An AuditConfig must have one or more AuditLogConfigs. + # + # If there are AuditConfigs for both `allServices` and a specific service, + # the union of the two AuditConfigs is used for that service: the log_types + # specified in each AuditConfig are enabled, and the exempted_members in each + # AuditLogConfig are exempted. + # + # Example Policy with multiple AuditConfigs: + # + # { + # "audit_configs": [ + # { + # "service": "allServices", + # "audit_log_configs": [ + # { + # "log_type": "DATA_READ", + # "exempted_members": [ + # "user:jose@example.com" + # ] + # }, + # { + # "log_type": "DATA_WRITE" + # }, + # { + # "log_type": "ADMIN_READ" + # } + # ] + # }, + # { + # "service": "sampleservice.googleapis.com", + # "audit_log_configs": [ + # { + # "log_type": "DATA_READ" + # }, + # { + # "log_type": "DATA_WRITE", + # "exempted_members": [ + # "user:aliya@example.com" + # ] + # } + # ] + # } + # ] + # } + # + # For sampleservice, this policy enables DATA_READ, DATA_WRITE and ADMIN_READ + # logging. It also exempts `jose@example.com` from DATA_READ logging, and + # `aliya@example.com` from DATA_WRITE logging. + # @!attribute [rw] service + # @return [::String] + # Specifies a service that will be enabled for audit logging. + # For example, `storage.googleapis.com`, `cloudsql.googleapis.com`. + # `allServices` is a special value that covers all services. + # @!attribute [rw] audit_log_configs + # @return [::Array<::Google::Iam::V1::AuditLogConfig>] + # The configuration for logging of each type of permission. + class AuditConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Provides the configuration for logging a type of permissions. + # Example: + # + # { + # "audit_log_configs": [ + # { + # "log_type": "DATA_READ", + # "exempted_members": [ + # "user:jose@example.com" + # ] + # }, + # { + # "log_type": "DATA_WRITE" + # } + # ] + # } + # + # This enables 'DATA_READ' and 'DATA_WRITE' logging, while exempting + # jose@example.com from DATA_READ logging. + # @!attribute [rw] log_type + # @return [::Google::Iam::V1::AuditLogConfig::LogType] + # The log type that this config enables. + # @!attribute [rw] exempted_members + # @return [::Array<::String>] + # Specifies the identities that do not cause logging for this type of + # permission. + # Follows the same format of + # [Binding.members][google.iam.v1.Binding.members]. + class AuditLogConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The list of valid permission types for which logging can be configured. + # Admin writes are always logged, and are not configurable. + module LogType + # Default case. Should never be this. + LOG_TYPE_UNSPECIFIED = 0 + + # Admin reads. Example: CloudIAM getIamPolicy + ADMIN_READ = 1 + + # Data writes. Example: CloudSQL Users create + DATA_WRITE = 2 + + # Data reads. Example: CloudSQL Users list + DATA_READ = 3 + end + end + + # The difference delta between two policies. + # @!attribute [rw] binding_deltas + # @return [::Array<::Google::Iam::V1::BindingDelta>] + # The delta for Bindings between two policies. + # @!attribute [rw] audit_config_deltas + # @return [::Array<::Google::Iam::V1::AuditConfigDelta>] + # The delta for AuditConfigs between two policies. + class PolicyDelta + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # One delta entry for Binding. Each individual change (only one member in each + # entry) to a binding will be a separate entry. + # @!attribute [rw] action + # @return [::Google::Iam::V1::BindingDelta::Action] + # The action that was performed on a Binding. + # Required + # @!attribute [rw] role + # @return [::String] + # Role that is assigned to `members`. + # For example, `roles/viewer`, `roles/editor`, or `roles/owner`. + # Required + # @!attribute [rw] member + # @return [::String] + # A single identity requesting access for a Google Cloud resource. + # Follows the same format of Binding.members. + # Required + # @!attribute [rw] condition + # @return [::Google::Type::Expr] + # The condition that is associated with this binding. + class BindingDelta + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The type of action performed on a Binding in a policy. + module Action + # Unspecified. + ACTION_UNSPECIFIED = 0 + + # Addition of a Binding. + ADD = 1 + + # Removal of a Binding. + REMOVE = 2 + end + end + + # One delta entry for AuditConfig. Each individual change (only one + # exempted_member in each entry) to a AuditConfig will be a separate entry. + # @!attribute [rw] action + # @return [::Google::Iam::V1::AuditConfigDelta::Action] + # The action that was performed on an audit configuration in a policy. + # Required + # @!attribute [rw] service + # @return [::String] + # Specifies a service that was configured for Cloud Audit Logging. + # For example, `storage.googleapis.com`, `cloudsql.googleapis.com`. + # `allServices` is a special value that covers all services. + # Required + # @!attribute [rw] exempted_member + # @return [::String] + # A single identity that is exempted from "data access" audit + # logging for the `service` specified above. + # Follows the same format of Binding.members. + # @!attribute [rw] log_type + # @return [::String] + # Specifies the log_type that was be enabled. ADMIN_ACTIVITY is always + # enabled, and cannot be configured. + # Required + class AuditConfigDelta + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The type of action performed on an audit configuration in a policy. + module Action + # Unspecified. + ACTION_UNSPECIFIED = 0 + + # Addition of an audit configuration. + ADD = 1 + + # Removal of an audit configuration. + REMOVE = 2 + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/proto_docs/google/longrunning/operations.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/proto_docs/google/longrunning/operations.rb new file mode 100644 index 000000000000..f2d9d79d9da4 --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/proto_docs/google/longrunning/operations.rb @@ -0,0 +1,191 @@ +# frozen_string_literal: true + +# Copyright 2025 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 Longrunning + # This resource represents a long-running operation that is the result of a + # network API call. + # @!attribute [rw] name + # @return [::String] + # The server-assigned name, which is only unique within the same service that + # originally returns it. If you use the default HTTP mapping, the + # `name` should be a resource name ending with `operations/{unique_id}`. + # @!attribute [rw] metadata + # @return [::Google::Protobuf::Any] + # Service-specific metadata associated with the operation. It typically + # contains progress information and common metadata such as create time. + # Some services might not provide such metadata. Any method that returns a + # long-running operation should document the metadata type, if any. + # @!attribute [rw] done + # @return [::Boolean] + # If the value is `false`, it means the operation is still in progress. + # If `true`, the operation is completed, and either `error` or `response` is + # available. + # @!attribute [rw] error + # @return [::Google::Rpc::Status] + # The error result of the operation in case of failure or cancellation. + # + # Note: The following fields are mutually exclusive: `error`, `response`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] response + # @return [::Google::Protobuf::Any] + # The normal, successful response of the operation. If the original + # method returns no data on success, such as `Delete`, the response is + # `google.protobuf.Empty`. If the original method is standard + # `Get`/`Create`/`Update`, the response should be the resource. For other + # methods, the response should have the type `XxxResponse`, where `Xxx` + # is the original method name. For example, if the original method name + # is `TakeSnapshot()`, the inferred response type is + # `TakeSnapshotResponse`. + # + # Note: The following fields are mutually exclusive: `response`, `error`. If a field in that set is populated, all other fields in the set will automatically be cleared. + class Operation + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # Operations.GetOperation. + # @!attribute [rw] name + # @return [::String] + # The name of the operation resource. + class GetOperationRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # Operations.ListOperations. + # @!attribute [rw] name + # @return [::String] + # The name of the operation's parent resource. + # @!attribute [rw] filter + # @return [::String] + # The standard list filter. + # @!attribute [rw] page_size + # @return [::Integer] + # The standard list page size. + # @!attribute [rw] page_token + # @return [::String] + # The standard list page token. + # @!attribute [rw] return_partial_success + # @return [::Boolean] + # When set to `true`, operations that are reachable are returned as normal, + # and those that are unreachable are returned in the + # [ListOperationsResponse.unreachable] field. + # + # This can only be `true` when reading across collections e.g. when `parent` + # is set to `"projects/example/locations/-"`. + # + # This field is not by default supported and will result in an + # `UNIMPLEMENTED` error if set unless explicitly documented otherwise in + # service or product specific documentation. + class ListOperationsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The response message for + # Operations.ListOperations. + # @!attribute [rw] operations + # @return [::Array<::Google::Longrunning::Operation>] + # A list of operations that matches the specified filter in the request. + # @!attribute [rw] next_page_token + # @return [::String] + # The standard List next-page token. + # @!attribute [rw] unreachable + # @return [::Array<::String>] + # Unordered list. Unreachable resources. Populated when the request sets + # `ListOperationsRequest.return_partial_success` and reads across + # collections e.g. when attempting to list all resources across all supported + # locations. + class ListOperationsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # Operations.CancelOperation. + # @!attribute [rw] name + # @return [::String] + # The name of the operation resource to be cancelled. + class CancelOperationRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # Operations.DeleteOperation. + # @!attribute [rw] name + # @return [::String] + # The name of the operation resource to be deleted. + class DeleteOperationRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # Operations.WaitOperation. + # @!attribute [rw] name + # @return [::String] + # The name of the operation resource to wait on. + # @!attribute [rw] timeout + # @return [::Google::Protobuf::Duration] + # The maximum duration to wait before timing out. If left blank, the wait + # will be at most the time permitted by the underlying HTTP/RPC protocol. + # If RPC context deadline is also specified, the shorter one will be used. + class WaitOperationRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A message representing the message types used by a long-running operation. + # + # Example: + # + # rpc Export(ExportRequest) returns (google.longrunning.Operation) { + # option (google.longrunning.operation_info) = { + # response_type: "ExportResponse" + # metadata_type: "ExportMetadata" + # }; + # } + # @!attribute [rw] response_type + # @return [::String] + # Required. The message name of the primary return type for this + # long-running operation. + # This type will be used to deserialize the LRO's response. + # + # If the response is in a different package from the rpc, a fully-qualified + # message name must be used (e.g. `google.protobuf.Struct`). + # + # Note: Altering this value constitutes a breaking change. + # @!attribute [rw] metadata_type + # @return [::String] + # Required. The message name of the metadata type for this long-running + # operation. + # + # If the response is in a different package from the rpc, a fully-qualified + # message name must be used (e.g. `google.protobuf.Struct`). + # + # Note: Altering this value constitutes a breaking change. + class OperationInfo + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/proto_docs/google/protobuf/any.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/proto_docs/google/protobuf/any.rb new file mode 100644 index 000000000000..9e9bdbb09ea4 --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/proto_docs/google/protobuf/any.rb @@ -0,0 +1,145 @@ +# frozen_string_literal: true + +# Copyright 2025 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-admin-instance-v1/proto_docs/google/protobuf/duration.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/proto_docs/google/protobuf/duration.rb new file mode 100644 index 000000000000..341efa296c29 --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/proto_docs/google/protobuf/duration.rb @@ -0,0 +1,98 @@ +# frozen_string_literal: true + +# Copyright 2025 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-admin-instance-v1/proto_docs/google/protobuf/empty.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/proto_docs/google/protobuf/empty.rb new file mode 100644 index 000000000000..c2acab1235a9 --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/proto_docs/google/protobuf/empty.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +# Copyright 2025 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-admin-instance-v1/proto_docs/google/protobuf/field_mask.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/proto_docs/google/protobuf/field_mask.rb new file mode 100644 index 000000000000..ad3c3ad25f0f --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/proto_docs/google/protobuf/field_mask.rb @@ -0,0 +1,229 @@ +# frozen_string_literal: true + +# Copyright 2025 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 + # `FieldMask` represents a set of symbolic field paths, for example: + # + # paths: "f.a" + # paths: "f.b.d" + # + # Here `f` represents a field in some root message, `a` and `b` + # fields in the message found in `f`, and `d` a field found in the + # message in `f.b`. + # + # Field masks are used to specify a subset of fields that should be + # returned by a get operation or modified by an update operation. + # Field masks also have a custom JSON encoding (see below). + # + # # Field Masks in Projections + # + # When used in the context of a projection, a response message or + # sub-message is filtered by the API to only contain those fields as + # specified in the mask. For example, if the mask in the previous + # example is applied to a response message as follows: + # + # f { + # a : 22 + # b { + # d : 1 + # x : 2 + # } + # y : 13 + # } + # z: 8 + # + # The result will not contain specific values for fields x,y and z + # (their value will be set to the default, and omitted in proto text + # output): + # + # + # f { + # a : 22 + # b { + # d : 1 + # } + # } + # + # A repeated field is not allowed except at the last position of a + # paths string. + # + # If a FieldMask object is not present in a get operation, the + # operation applies to all fields (as if a FieldMask of all fields + # had been specified). + # + # Note that a field mask does not necessarily apply to the + # top-level response message. In case of a REST get operation, the + # field mask applies directly to the response, but in case of a REST + # list operation, the mask instead applies to each individual message + # in the returned resource list. In case of a REST custom method, + # other definitions may be used. Where the mask applies will be + # clearly documented together with its declaration in the API. In + # any case, the effect on the returned resource/resources is required + # behavior for APIs. + # + # # Field Masks in Update Operations + # + # A field mask in update operations specifies which fields of the + # targeted resource are going to be updated. The API is required + # to only change the values of the fields as specified in the mask + # and leave the others untouched. If a resource is passed in to + # describe the updated values, the API ignores the values of all + # fields not covered by the mask. + # + # If a repeated field is specified for an update operation, new values will + # be appended to the existing repeated field in the target resource. Note that + # a repeated field is only allowed in the last position of a `paths` string. + # + # If a sub-message is specified in the last position of the field mask for an + # update operation, then new value will be merged into the existing sub-message + # in the target resource. + # + # For example, given the target message: + # + # f { + # b { + # d: 1 + # x: 2 + # } + # c: [1] + # } + # + # And an update message: + # + # f { + # b { + # d: 10 + # } + # c: [2] + # } + # + # then if the field mask is: + # + # paths: ["f.b", "f.c"] + # + # then the result will be: + # + # f { + # b { + # d: 10 + # x: 2 + # } + # c: [1, 2] + # } + # + # An implementation may provide options to override this default behavior for + # repeated and message fields. + # + # In order to reset a field's value to the default, the field must + # be in the mask and set to the default value in the provided resource. + # Hence, in order to reset all fields of a resource, provide a default + # instance of the resource and set all fields in the mask, or do + # not provide a mask as described below. + # + # If a field mask is not present on update, the operation applies to + # all fields (as if a field mask of all fields has been specified). + # Note that in the presence of schema evolution, this may mean that + # fields the client does not know and has therefore not filled into + # the request will be reset to their default. If this is unwanted + # behavior, a specific service may require a client to always specify + # a field mask, producing an error if not. + # + # As with get operations, the location of the resource which + # describes the updated values in the request message depends on the + # operation kind. In any case, the effect of the field mask is + # required to be honored by the API. + # + # ## Considerations for HTTP REST + # + # The HTTP kind of an update operation which uses a field mask must + # be set to PATCH instead of PUT in order to satisfy HTTP semantics + # (PUT must only be used for full updates). + # + # # JSON Encoding of Field Masks + # + # In JSON, a field mask is encoded as a single string where paths are + # separated by a comma. Fields name in each path are converted + # to/from lower-camel naming conventions. + # + # As an example, consider the following message declarations: + # + # message Profile { + # User user = 1; + # Photo photo = 2; + # } + # message User { + # string display_name = 1; + # string address = 2; + # } + # + # In proto a field mask for `Profile` may look as such: + # + # mask { + # paths: "user.display_name" + # paths: "photo" + # } + # + # In JSON, the same mask is represented as below: + # + # { + # mask: "user.displayName,photo" + # } + # + # # Field Masks and Oneof Fields + # + # Field masks treat fields in oneofs just as regular fields. Consider the + # following message: + # + # message SampleMessage { + # oneof test_oneof { + # string name = 4; + # SubMessage sub_message = 9; + # } + # } + # + # The field mask can be: + # + # mask { + # paths: "name" + # } + # + # Or: + # + # mask { + # paths: "sub_message" + # } + # + # Note that oneof type names ("test_oneof" in this case) cannot be used in + # paths. + # + # ## Field Mask Verification + # + # The implementation of any API method which has a FieldMask type field in the + # request should verify the included field paths, and return an + # `INVALID_ARGUMENT` error if any path is unmappable. + # @!attribute [rw] paths + # @return [::Array<::String>] + # The set of field mask paths. + class FieldMask + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/proto_docs/google/protobuf/timestamp.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/proto_docs/google/protobuf/timestamp.rb new file mode 100644 index 000000000000..a005f395ccab --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/proto_docs/google/protobuf/timestamp.rb @@ -0,0 +1,127 @@ +# frozen_string_literal: true + +# Copyright 2025 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-admin-instance-v1/proto_docs/google/rpc/status.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/proto_docs/google/rpc/status.rb new file mode 100644 index 000000000000..3f61f95b2587 --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/proto_docs/google/rpc/status.rb @@ -0,0 +1,48 @@ +# frozen_string_literal: true + +# Copyright 2025 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-admin-instance-v1/proto_docs/google/spanner/admin/instance/v1/common.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/proto_docs/google/spanner/admin/instance/v1/common.rb new file mode 100644 index 000000000000..1641b005b867 --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/proto_docs/google/spanner/admin/instance/v1/common.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2025 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 Admin + module Instance + module V1 + # Encapsulates progress related information for a Cloud Spanner long + # running instance operations. + # @!attribute [rw] progress_percent + # @return [::Integer] + # Percent completion of the operation. + # Values are between 0 and 100 inclusive. + # @!attribute [rw] start_time + # @return [::Google::Protobuf::Timestamp] + # Time the request was received. + # @!attribute [rw] end_time + # @return [::Google::Protobuf::Timestamp] + # If set, the time at which this operation failed or was completed + # successfully. + class OperationProgress + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # ReplicaSelection identifies replicas with common properties. + # @!attribute [rw] location + # @return [::String] + # Required. Name of the location of the replicas (e.g., "us-central1"). + class ReplicaSelection + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Indicates the expected fulfillment period of an operation. + module FulfillmentPeriod + # Not specified. + FULFILLMENT_PERIOD_UNSPECIFIED = 0 + + # Normal fulfillment period. The operation is expected to complete within + # minutes. + FULFILLMENT_PERIOD_NORMAL = 1 + + # Extended fulfillment period. It can take up to an hour for the operation + # to complete. + FULFILLMENT_PERIOD_EXTENDED = 2 + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/proto_docs/google/spanner/admin/instance/v1/spanner_instance_admin.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/proto_docs/google/spanner/admin/instance/v1/spanner_instance_admin.rb new file mode 100644 index 000000000000..e7500c534c12 --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/proto_docs/google/spanner/admin/instance/v1/spanner_instance_admin.rb @@ -0,0 +1,1561 @@ +# frozen_string_literal: true + +# Copyright 2025 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 Admin + module Instance + module V1 + # @!attribute [rw] location + # @return [::String] + # The location of the serving resources, e.g., "us-central1". + # @!attribute [rw] type + # @return [::Google::Cloud::Spanner::Admin::Instance::V1::ReplicaInfo::ReplicaType] + # The type of replica. + # @!attribute [rw] default_leader_location + # @return [::Boolean] + # If true, this location is designated as the default leader location where + # leader replicas are placed. See the [region types + # documentation](https://cloud.google.com/spanner/docs/instances#region_types) + # for more details. + class ReplicaInfo + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Indicates the type of replica. See the [replica types + # documentation](https://cloud.google.com/spanner/docs/replication#replica_types) + # for more details. + module ReplicaType + # Not specified. + TYPE_UNSPECIFIED = 0 + + # Read-write replicas support both reads and writes. These replicas: + # + # * Maintain a full copy of your data. + # * Serve reads. + # * Can vote whether to commit a write. + # * Participate in leadership election. + # * Are eligible to become a leader. + READ_WRITE = 1 + + # Read-only replicas only support reads (not writes). Read-only replicas: + # + # * Maintain a full copy of your data. + # * Serve reads. + # * Do not participate in voting to commit writes. + # * Are not eligible to become a leader. + READ_ONLY = 2 + + # Witness replicas don't support reads but do participate in voting to + # commit writes. Witness replicas: + # + # * Do not maintain a full copy of data. + # * Do not serve reads. + # * Vote whether to commit writes. + # * Participate in leader election but are not eligible to become leader. + WITNESS = 3 + end + end + + # A possible configuration for a Cloud Spanner instance. Configurations + # define the geographic placement of nodes and their replication. + # @!attribute [rw] name + # @return [::String] + # A unique identifier for the instance configuration. Values + # are of the form + # `projects//instanceConfigs/[a-z][-a-z0-9]*`. + # + # User instance configuration must start with `custom-`. + # @!attribute [rw] display_name + # @return [::String] + # The name of this instance configuration as it appears in UIs. + # @!attribute [r] config_type + # @return [::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig::Type] + # Output only. Whether this instance configuration is a Google-managed or + # user-managed configuration. + # @!attribute [rw] replicas + # @return [::Array<::Google::Cloud::Spanner::Admin::Instance::V1::ReplicaInfo>] + # The geographic placement of nodes in this instance configuration and their + # replication properties. + # + # To create user-managed configurations, input + # `replicas` must include all replicas in `replicas` of the `base_config` + # and include one or more replicas in the `optional_replicas` of the + # `base_config`. + # @!attribute [r] optional_replicas + # @return [::Array<::Google::Cloud::Spanner::Admin::Instance::V1::ReplicaInfo>] + # Output only. The available optional replicas to choose from for + # user-managed configurations. Populated for Google-managed configurations. + # @!attribute [rw] base_config + # @return [::String] + # Base configuration name, e.g. projects//instanceConfigs/nam3, + # based on which this configuration is created. Only set for user-managed + # configurations. `base_config` must refer to a configuration of type + # `GOOGLE_MANAGED` in the same project as this configuration. + # @!attribute [rw] labels + # @return [::Google::Protobuf::Map{::String => ::String}] + # Cloud Labels are a flexible and lightweight mechanism for organizing cloud + # resources into groups that reflect a customer's organizational needs and + # deployment strategies. Cloud Labels can be used to filter collections of + # resources. They can be used to control how resource metrics are aggregated. + # And they can be used as arguments to policy management rules (e.g. route, + # firewall, load balancing, etc.). + # + # * Label keys must be between 1 and 63 characters long and must conform to + # the following regular expression: `[a-z][a-z0-9_-]{0,62}`. + # * Label values must be between 0 and 63 characters long and must conform + # to the regular expression `[a-z0-9_-]{0,63}`. + # * No more than 64 labels can be associated with a given resource. + # + # See https://goo.gl/xmQnxf for more information on and examples of labels. + # + # If you plan to use labels in your own code, please note that additional + # characters may be allowed in the future. Therefore, you are advised to use + # an internal label representation, such as JSON, which doesn't rely upon + # specific characters being disallowed. For example, representing labels + # as the string: name + "_" + value would prove problematic if we were to + # allow "_" in a future release. + # @!attribute [rw] etag + # @return [::String] + # etag is used for optimistic concurrency control as a way + # to help prevent simultaneous updates of a instance configuration from + # overwriting each other. It is strongly suggested that systems make use of + # the etag in the read-modify-write cycle to perform instance configuration + # updates in order to avoid race conditions: An etag is returned in the + # response which contains instance configurations, and systems are expected + # to put that etag in the request to update instance configuration to ensure + # that their change is applied to the same version of the instance + # configuration. If no etag is provided in the call to update the instance + # configuration, then the existing instance configuration is overwritten + # blindly. + # @!attribute [rw] leader_options + # @return [::Array<::String>] + # Allowed values of the "default_leader" schema option for databases in + # instances that use this instance configuration. + # @!attribute [r] reconciling + # @return [::Boolean] + # Output only. If true, the instance configuration is being created or + # updated. If false, there are no ongoing operations for the instance + # configuration. + # @!attribute [r] state + # @return [::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig::State] + # Output only. The current instance configuration state. Applicable only for + # `USER_MANAGED` configurations. + # @!attribute [r] free_instance_availability + # @return [::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig::FreeInstanceAvailability] + # Output only. Describes whether free instances are available to be created + # in this instance configuration. + # @!attribute [r] quorum_type + # @return [::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig::QuorumType] + # Output only. The `QuorumType` of the instance configuration. + # @!attribute [r] storage_limit_per_processing_unit + # @return [::Integer] + # Output only. The storage limit in bytes per processing unit. + class InstanceConfig + 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 + + # The type of this configuration. + module Type + # Unspecified. + TYPE_UNSPECIFIED = 0 + + # Google-managed configuration. + GOOGLE_MANAGED = 1 + + # User-managed configuration. + USER_MANAGED = 2 + end + + # Indicates the current state of the instance configuration. + module State + # Not specified. + STATE_UNSPECIFIED = 0 + + # The instance configuration is still being created. + CREATING = 1 + + # The instance configuration is fully created and ready to be used to + # create instances. + READY = 2 + end + + # Describes the availability for free instances to be created in an instance + # configuration. + module FreeInstanceAvailability + # Not specified. + FREE_INSTANCE_AVAILABILITY_UNSPECIFIED = 0 + + # Indicates that free instances are available to be created in this + # instance configuration. + AVAILABLE = 1 + + # Indicates that free instances are not supported in this instance + # configuration. + UNSUPPORTED = 2 + + # Indicates that free instances are currently not available to be created + # in this instance configuration. + DISABLED = 3 + + # Indicates that additional free instances cannot be created in this + # instance configuration because the project has reached its limit of free + # instances. + QUOTA_EXCEEDED = 4 + end + + # Indicates the quorum type of this instance configuration. + module QuorumType + # Quorum type not specified. + QUORUM_TYPE_UNSPECIFIED = 0 + + # An instance configuration tagged with `REGION` quorum type forms a write + # quorum in a single region. + REGION = 1 + + # An instance configuration tagged with the `DUAL_REGION` quorum type forms + # a write quorum with exactly two read-write regions in a multi-region + # configuration. + # + # This instance configuration requires failover in the event of + # regional failures. + DUAL_REGION = 2 + + # An instance configuration tagged with the `MULTI_REGION` quorum type + # forms a write quorum from replicas that are spread across more than one + # region in a multi-region configuration. + MULTI_REGION = 3 + end + end + + # ReplicaComputeCapacity describes the amount of server resources that are + # allocated to each replica identified by the replica selection. + # @!attribute [rw] replica_selection + # @return [::Google::Cloud::Spanner::Admin::Instance::V1::ReplicaSelection] + # Required. Identifies replicas by specified properties. + # All replicas in the selection have the same amount of compute capacity. + # @!attribute [rw] node_count + # @return [::Integer] + # The number of nodes allocated to each replica. + # + # This may be zero in API responses for instances that are not yet in + # state `READY`. + # + # Note: The following fields are mutually exclusive: `node_count`, `processing_units`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] processing_units + # @return [::Integer] + # The number of processing units allocated to each replica. + # + # This may be zero in API responses for instances that are not yet in + # state `READY`. + # + # Note: The following fields are mutually exclusive: `processing_units`, `node_count`. If a field in that set is populated, all other fields in the set will automatically be cleared. + class ReplicaComputeCapacity + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Autoscaling configuration for an instance. + # @!attribute [rw] autoscaling_limits + # @return [::Google::Cloud::Spanner::Admin::Instance::V1::AutoscalingConfig::AutoscalingLimits] + # Required. Autoscaling limits for an instance. + # @!attribute [rw] autoscaling_targets + # @return [::Google::Cloud::Spanner::Admin::Instance::V1::AutoscalingConfig::AutoscalingTargets] + # Required. The autoscaling targets for an instance. + # @!attribute [rw] asymmetric_autoscaling_options + # @return [::Array<::Google::Cloud::Spanner::Admin::Instance::V1::AutoscalingConfig::AsymmetricAutoscalingOption>] + # Optional. Optional asymmetric autoscaling options. + # Replicas matching the replica selection criteria will be autoscaled + # independently from other replicas. The autoscaler will scale the replicas + # based on the utilization of replicas identified by the replica selection. + # Replica selections should not overlap with each other. + # + # Other replicas (those do not match any replica selection) will be + # autoscaled together and will have the same compute capacity allocated to + # them. + class AutoscalingConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The autoscaling limits for the instance. Users can define the minimum and + # maximum compute capacity allocated to the instance, and the autoscaler will + # only scale within that range. Users can either use nodes or processing + # units to specify the limits, but should use the same unit to set both the + # min_limit and max_limit. + # @!attribute [rw] min_nodes + # @return [::Integer] + # Minimum number of nodes allocated to the instance. If set, this number + # should be greater than or equal to 1. + # + # Note: The following fields are mutually exclusive: `min_nodes`, `min_processing_units`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] min_processing_units + # @return [::Integer] + # Minimum number of processing units allocated to the instance. If set, + # this number should be multiples of 1000. + # + # Note: The following fields are mutually exclusive: `min_processing_units`, `min_nodes`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] max_nodes + # @return [::Integer] + # Maximum number of nodes allocated to the instance. If set, this number + # should be greater than or equal to min_nodes. + # + # Note: The following fields are mutually exclusive: `max_nodes`, `max_processing_units`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] max_processing_units + # @return [::Integer] + # Maximum number of processing units allocated to the instance. If set, + # this number should be multiples of 1000 and be greater than or equal to + # min_processing_units. + # + # Note: The following fields are mutually exclusive: `max_processing_units`, `max_nodes`. If a field in that set is populated, all other fields in the set will automatically be cleared. + class AutoscalingLimits + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The autoscaling targets for an instance. + # @!attribute [rw] high_priority_cpu_utilization_percent + # @return [::Integer] + # Optional. The target high priority cpu utilization percentage that the + # autoscaler should be trying to achieve for the instance. This number is + # on a scale from 0 (no utilization) to 100 (full utilization). The valid + # range is [10, 90] inclusive. If not specified or set to 0, the autoscaler + # skips scaling based on high priority CPU utilization. + # @!attribute [rw] total_cpu_utilization_percent + # @return [::Integer] + # Optional. The target total CPU utilization percentage that the autoscaler + # should be trying to achieve for the instance. This number is on a scale + # from 0 (no utilization) to 100 (full utilization). The valid range is + # [10, 90] inclusive. If not specified or set to 0, the autoscaler skips + # scaling based on total CPU utilization. If both + # `high_priority_cpu_utilization_percent` and + # `total_cpu_utilization_percent` are specified, the autoscaler provisions + # the larger of the two required compute capacities to satisfy both + # targets. + # @!attribute [rw] storage_utilization_percent + # @return [::Integer] + # Required. The target storage utilization percentage that the autoscaler + # should be trying to achieve for the instance. This number is on a scale + # from 0 (no utilization) to 100 (full utilization). The valid range is + # [10, 99] inclusive. + class AutoscalingTargets + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # AsymmetricAutoscalingOption specifies the scaling of replicas identified by + # the given selection. + # @!attribute [rw] replica_selection + # @return [::Google::Cloud::Spanner::Admin::Instance::V1::ReplicaSelection] + # Required. Selects the replicas to which this AsymmetricAutoscalingOption + # applies. Only read-only replicas are supported. + # @!attribute [rw] overrides + # @return [::Google::Cloud::Spanner::Admin::Instance::V1::AutoscalingConfig::AsymmetricAutoscalingOption::AutoscalingConfigOverrides] + # Optional. Overrides applied to the top-level autoscaling configuration + # for the selected replicas. + class AsymmetricAutoscalingOption + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Overrides the top-level autoscaling configuration for the replicas + # identified by `replica_selection`. All fields in this message are + # optional. Any unspecified fields will use the corresponding values from + # the top-level autoscaling configuration. + # @!attribute [rw] autoscaling_limits + # @return [::Google::Cloud::Spanner::Admin::Instance::V1::AutoscalingConfig::AutoscalingLimits] + # Optional. If specified, overrides the min/max limit in the top-level + # autoscaling configuration for the selected replicas. + # @!attribute [rw] autoscaling_target_high_priority_cpu_utilization_percent + # @return [::Integer] + # Optional. If specified, overrides the autoscaling target + # high_priority_cpu_utilization_percent in the top-level autoscaling + # configuration for the selected replicas. + # @!attribute [rw] autoscaling_target_total_cpu_utilization_percent + # @return [::Integer] + # Optional. If specified, overrides the + # autoscaling target `total_cpu_utilization_percent` + # in the top-level autoscaling configuration for the selected replicas. + # @!attribute [rw] disable_high_priority_cpu_autoscaling + # @return [::Boolean] + # Optional. If true, disables high priority CPU autoscaling for the + # selected replicas and ignores + # {::Google::Cloud::Spanner::Admin::Instance::V1::AutoscalingConfig::AutoscalingTargets#high_priority_cpu_utilization_percent high_priority_cpu_utilization_percent} + # in the top-level autoscaling configuration. + # + # When setting this field to true, setting + # {::Google::Cloud::Spanner::Admin::Instance::V1::AutoscalingConfig::AsymmetricAutoscalingOption::AutoscalingConfigOverrides#autoscaling_target_high_priority_cpu_utilization_percent autoscaling_target_high_priority_cpu_utilization_percent} + # field to a non-zero value for the same replica is not supported. + # + # If false, the + # {::Google::Cloud::Spanner::Admin::Instance::V1::AutoscalingConfig::AsymmetricAutoscalingOption::AutoscalingConfigOverrides#autoscaling_target_high_priority_cpu_utilization_percent autoscaling_target_high_priority_cpu_utilization_percent} + # field in the replica will be used if set to a non-zero value. + # Otherwise, the + # {::Google::Cloud::Spanner::Admin::Instance::V1::AutoscalingConfig::AutoscalingTargets#high_priority_cpu_utilization_percent high_priority_cpu_utilization_percent} + # field in the top-level autoscaling configuration will be used. + # + # Setting both + # {::Google::Cloud::Spanner::Admin::Instance::V1::AutoscalingConfig::AsymmetricAutoscalingOption::AutoscalingConfigOverrides#disable_high_priority_cpu_autoscaling disable_high_priority_cpu_autoscaling} + # and + # {::Google::Cloud::Spanner::Admin::Instance::V1::AutoscalingConfig::AsymmetricAutoscalingOption::AutoscalingConfigOverrides#disable_total_cpu_autoscaling disable_total_cpu_autoscaling} + # to true for the same replica is not supported. + # @!attribute [rw] disable_total_cpu_autoscaling + # @return [::Boolean] + # Optional. If true, disables total CPU autoscaling for the selected + # replicas and ignores + # {::Google::Cloud::Spanner::Admin::Instance::V1::AutoscalingConfig::AutoscalingTargets#total_cpu_utilization_percent total_cpu_utilization_percent} + # in the top-level autoscaling configuration. + # + # When setting this field to true, setting + # {::Google::Cloud::Spanner::Admin::Instance::V1::AutoscalingConfig::AsymmetricAutoscalingOption::AutoscalingConfigOverrides#autoscaling_target_total_cpu_utilization_percent autoscaling_target_total_cpu_utilization_percent} + # field to a non-zero value for the same replica is not supported. + # + # If false, the + # {::Google::Cloud::Spanner::Admin::Instance::V1::AutoscalingConfig::AsymmetricAutoscalingOption::AutoscalingConfigOverrides#autoscaling_target_total_cpu_utilization_percent autoscaling_target_total_cpu_utilization_percent} + # field in the replica will be used if set to a non-zero value. + # Otherwise, the + # {::Google::Cloud::Spanner::Admin::Instance::V1::AutoscalingConfig::AutoscalingTargets#total_cpu_utilization_percent total_cpu_utilization_percent} + # field in the top-level autoscaling configuration will be used. + # + # Setting both + # {::Google::Cloud::Spanner::Admin::Instance::V1::AutoscalingConfig::AsymmetricAutoscalingOption::AutoscalingConfigOverrides#disable_high_priority_cpu_autoscaling disable_high_priority_cpu_autoscaling} + # and + # {::Google::Cloud::Spanner::Admin::Instance::V1::AutoscalingConfig::AsymmetricAutoscalingOption::AutoscalingConfigOverrides#disable_total_cpu_autoscaling disable_total_cpu_autoscaling} + # to true for the same replica is not supported. + class AutoscalingConfigOverrides + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + + # An isolated set of Cloud Spanner resources on which databases can be hosted. + # @!attribute [rw] name + # @return [::String] + # Required. A unique identifier for the instance, which cannot be changed + # after the instance is created. Values are of the form + # `projects//instances/[a-z][-a-z0-9]*[a-z0-9]`. The final + # segment of the name must be between 2 and 64 characters in length. + # @!attribute [rw] config + # @return [::String] + # Required. The name of the instance's configuration. Values are of the form + # `projects//instanceConfigs/`. See + # also {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig InstanceConfig} and + # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#list_instance_configs ListInstanceConfigs}. + # @!attribute [rw] display_name + # @return [::String] + # Required. The descriptive name for this instance as it appears in UIs. + # Must be unique per project and between 4 and 30 characters in length. + # @!attribute [rw] node_count + # @return [::Integer] + # The number of nodes allocated to this instance. At most, one of either + # `node_count` or `processing_units` should be present in the message. + # + # Users can set the `node_count` field to specify the target number of nodes + # allocated to the instance. + # + # If autoscaling is enabled, `node_count` is treated as an `OUTPUT_ONLY` + # field and reflects the current number of nodes allocated to the instance. + # + # This might be zero in API responses for instances that are not yet in the + # `READY` state. + # + # + # For more information, see + # [Compute capacity, nodes, and processing + # units](https://cloud.google.com/spanner/docs/compute-capacity). + # @!attribute [rw] processing_units + # @return [::Integer] + # The number of processing units allocated to this instance. At most, one of + # either `processing_units` or `node_count` should be present in the message. + # + # Users can set the `processing_units` field to specify the target number of + # processing units allocated to the instance. + # + # If autoscaling is enabled, `processing_units` is treated as an + # `OUTPUT_ONLY` field and reflects the current number of processing units + # allocated to the instance. + # + # This might be zero in API responses for instances that are not yet in the + # `READY` state. + # + # + # For more information, see + # [Compute capacity, nodes and processing + # units](https://cloud.google.com/spanner/docs/compute-capacity). + # @!attribute [r] replica_compute_capacity + # @return [::Array<::Google::Cloud::Spanner::Admin::Instance::V1::ReplicaComputeCapacity>] + # Output only. Lists the compute capacity per ReplicaSelection. A replica + # selection identifies a set of replicas with common properties. Replicas + # identified by a ReplicaSelection are scaled with the same compute capacity. + # @!attribute [rw] autoscaling_config + # @return [::Google::Cloud::Spanner::Admin::Instance::V1::AutoscalingConfig] + # Optional. The autoscaling configuration. Autoscaling is enabled if this + # field is set. When autoscaling is enabled, node_count and processing_units + # are treated as OUTPUT_ONLY fields and reflect the current compute capacity + # allocated to the instance. + # @!attribute [r] state + # @return [::Google::Cloud::Spanner::Admin::Instance::V1::Instance::State] + # Output only. The current instance state. For + # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#create_instance CreateInstance}, + # the state must be either omitted or set to `CREATING`. For + # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#update_instance UpdateInstance}, + # the state must be either omitted or set to `READY`. + # @!attribute [rw] labels + # @return [::Google::Protobuf::Map{::String => ::String}] + # Cloud Labels are a flexible and lightweight mechanism for organizing cloud + # resources into groups that reflect a customer's organizational needs and + # deployment strategies. Cloud Labels can be used to filter collections of + # resources. They can be used to control how resource metrics are aggregated. + # And they can be used as arguments to policy management rules (e.g. route, + # firewall, load balancing, etc.). + # + # * Label keys must be between 1 and 63 characters long and must conform to + # the following regular expression: `[a-z][a-z0-9_-]{0,62}`. + # * Label values must be between 0 and 63 characters long and must conform + # to the regular expression `[a-z0-9_-]{0,63}`. + # * No more than 64 labels can be associated with a given resource. + # + # See https://goo.gl/xmQnxf for more information on and examples of labels. + # + # If you plan to use labels in your own code, please note that additional + # characters may be allowed in the future. And so you are advised to use an + # internal label representation, such as JSON, which doesn't rely upon + # specific characters being disallowed. For example, representing labels + # as the string: name + "_" + value would prove problematic if we were to + # allow "_" in a future release. + # @!attribute [rw] instance_type + # @return [::Google::Cloud::Spanner::Admin::Instance::V1::Instance::InstanceType] + # The `InstanceType` of the current instance. + # @!attribute [rw] endpoint_uris + # @return [::Array<::String>] + # Deprecated. This field is not populated. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time at which the instance was created. + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time at which the instance was most recently updated. + # @!attribute [rw] free_instance_metadata + # @return [::Google::Cloud::Spanner::Admin::Instance::V1::FreeInstanceMetadata] + # Free instance metadata. Only populated for free instances. + # @!attribute [rw] edition + # @return [::Google::Cloud::Spanner::Admin::Instance::V1::Instance::Edition] + # Optional. The `Edition` of the current instance. + # @!attribute [rw] default_backup_schedule_type + # @return [::Google::Cloud::Spanner::Admin::Instance::V1::Instance::DefaultBackupScheduleType] + # Optional. Controls the default backup schedule behavior for new databases + # within the instance. By default, a backup schedule is created automatically + # when a new database is created in a new instance. + # + # Note that the `AUTOMATIC` value isn't permitted for free instances, + # as backups and backup schedules aren't supported for free instances. + # + # In the `GetInstance` or `ListInstances` response, if the value of + # `default_backup_schedule_type` isn't set, or set to `NONE`, Spanner doesn't + # create a default backup schedule for new databases in the instance. + class Instance + 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 + + # Indicates the current state of the instance. + module State + # Not specified. + STATE_UNSPECIFIED = 0 + + # The instance is still being created. Resources may not be + # available yet, and operations such as database creation may not + # work. + CREATING = 1 + + # The instance is fully created and ready to do work such as + # creating databases. + READY = 2 + end + + # The type of this instance. The type can be used to distinguish product + # variants, that can affect aspects like: usage restrictions, quotas and + # billing. Currently this is used to distinguish FREE_INSTANCE vs PROVISIONED + # instances. + module InstanceType + # Not specified. + INSTANCE_TYPE_UNSPECIFIED = 0 + + # Provisioned instances have dedicated resources, standard usage limits and + # support. + PROVISIONED = 1 + + # Free instances provide no guarantee for dedicated resources, + # [node_count, processing_units] should be 0. They come + # with stricter usage limits and limited support. + FREE_INSTANCE = 2 + end + + # The edition selected for this instance. Different editions provide + # different capabilities at different price points. + module Edition + # Edition not specified. + EDITION_UNSPECIFIED = 0 + + # Standard edition. + STANDARD = 1 + + # Enterprise edition. + ENTERPRISE = 2 + + # Enterprise Plus edition. + ENTERPRISE_PLUS = 3 + end + + # Indicates the + # [default backup + # schedule](https://cloud.google.com/spanner/docs/backup#default-backup-schedules) + # behavior for new databases within the instance. + module DefaultBackupScheduleType + # Not specified. + DEFAULT_BACKUP_SCHEDULE_TYPE_UNSPECIFIED = 0 + + # A default backup schedule isn't created automatically when a new database + # is created in the instance. + NONE = 1 + + # A default backup schedule is created automatically when a new database + # is created in the instance. The default backup schedule creates a full + # backup every 24 hours. These full backups are retained for 7 days. + # You can edit or delete the default backup schedule once it's created. + AUTOMATIC = 2 + end + end + + # The request for + # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#list_instance_configs ListInstanceConfigs}. + # @!attribute [rw] parent + # @return [::String] + # Required. The name of the project for which a list of supported instance + # configurations is requested. Values are of the form + # `projects/`. + # @!attribute [rw] page_size + # @return [::Integer] + # Number of instance configurations 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::Admin::Instance::V1::ListInstanceConfigsResponse#next_page_token next_page_token} + # from a previous + # {::Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigsResponse ListInstanceConfigsResponse}. + class ListInstanceConfigsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The response for + # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#list_instance_configs ListInstanceConfigs}. + # @!attribute [rw] instance_configs + # @return [::Array<::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig>] + # The list of requested instance configurations. + # @!attribute [rw] next_page_token + # @return [::String] + # `next_page_token` can be sent in a subsequent + # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#list_instance_configs ListInstanceConfigs} + # call to fetch more of the matching instance configurations. + class ListInstanceConfigsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request for + # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#get_instance_config GetInstanceConfigRequest}. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the requested instance configuration. Values are of + # the form `projects//instanceConfigs/`. + class GetInstanceConfigRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request for + # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#create_instance_config CreateInstanceConfig}. + # @!attribute [rw] parent + # @return [::String] + # Required. The name of the project in which to create the instance + # configuration. Values are of the form `projects/`. + # @!attribute [rw] instance_config_id + # @return [::String] + # Required. The ID of the instance configuration to create. Valid identifiers + # are of the form `custom-[-a-z0-9]*[a-z0-9]` and must be between 2 and 64 + # characters in length. The `custom-` prefix is required to avoid name + # conflicts with Google-managed configurations. + # @!attribute [rw] instance_config + # @return [::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig] + # Required. The `InstanceConfig` proto of the configuration to create. + # `instance_config.name` must be + # `/instanceConfigs/`. + # `instance_config.base_config` must be a Google-managed configuration name, + # e.g. /instanceConfigs/us-east1, /instanceConfigs/nam3. + # @!attribute [rw] validate_only + # @return [::Boolean] + # An option to validate, but not actually execute, a request, + # and provide the same response. + class CreateInstanceConfigRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request for + # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#update_instance_config UpdateInstanceConfig}. + # @!attribute [rw] instance_config + # @return [::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig] + # Required. The user instance configuration to update, which must always + # include the instance configuration name. Otherwise, only fields mentioned + # in + # {::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstanceConfigRequest#update_mask update_mask} + # need be included. To prevent conflicts of concurrent updates, + # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig#reconciling etag} can + # be used. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Required. A mask specifying which fields in + # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig InstanceConfig} should be + # updated. The field mask must always be specified; this prevents any future + # fields in {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig InstanceConfig} + # from being erased accidentally by clients that do not know about them. Only + # display_name and labels can be updated. + # @!attribute [rw] validate_only + # @return [::Boolean] + # An option to validate, but not actually execute, a request, + # and provide the same response. + class UpdateInstanceConfigRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request for + # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#delete_instance_config DeleteInstanceConfig}. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the instance configuration to be deleted. + # Values are of the form + # `projects//instanceConfigs/` + # @!attribute [rw] etag + # @return [::String] + # Used for optimistic concurrency control as a way to help prevent + # simultaneous deletes of an instance configuration from overwriting each + # other. If not empty, the API + # only deletes the instance configuration when the etag provided matches the + # current status of the requested instance configuration. Otherwise, deletes + # the instance configuration without checking the current status of the + # requested instance configuration. + # @!attribute [rw] validate_only + # @return [::Boolean] + # An option to validate, but not actually execute, a request, + # and provide the same response. + class DeleteInstanceConfigRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request for + # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#list_instance_config_operations ListInstanceConfigOperations}. + # @!attribute [rw] parent + # @return [::String] + # Required. The project of the instance configuration operations. + # Values are of the form `projects/`. + # @!attribute [rw] filter + # @return [::String] + # An expression that filters the list of returned operations. + # + # A filter expression consists of a field name, a + # comparison operator, and a value for filtering. + # The value must be a string, a number, or a boolean. The comparison operator + # must be one of: `<`, `>`, `<=`, `>=`, `!=`, `=`, or `:`. + # Colon `:` is the contains operator. Filter rules are not case sensitive. + # + # The following fields in the Operation are eligible for filtering: + # + # * `name` - The name of the long-running operation + # * `done` - False if the operation is in progress, else true. + # * `metadata.@type` - the type of metadata. For example, the type string + # for + # {::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstanceConfigMetadata CreateInstanceConfigMetadata} + # is + # `type.googleapis.com/google.spanner.admin.instance.v1.CreateInstanceConfigMetadata`. + # * `metadata.` - any field in metadata.value. + # `metadata.@type` must be specified first, if filtering on metadata + # fields. + # * `error` - Error associated with the long-running operation. + # * `response.@type` - the type of response. + # * `response.` - any field in response.value. + # + # You can combine multiple expressions by enclosing each expression in + # parentheses. By default, expressions are combined with AND logic. However, + # you can specify AND, OR, and NOT logic explicitly. + # + # Here are a few examples: + # + # * `done:true` - The operation is complete. + # * `(metadata.@type=` \ + # `type.googleapis.com/google.spanner.admin.instance.v1.CreateInstanceConfigMetadata) + # AND` \ + # `(metadata.instance_config.name:custom-config) AND` \ + # `(metadata.progress.start_time < \"2021-03-28T14:50:00Z\") AND` \ + # `(error:*)` - Return operations where: + # * The operation's metadata type is + # {::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstanceConfigMetadata CreateInstanceConfigMetadata}. + # * The instance configuration name contains "custom-config". + # * The operation started before 2021-03-28T14:50:00Z. + # * The operation resulted in an error. + # @!attribute [rw] page_size + # @return [::Integer] + # Number of operations 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::Admin::Instance::V1::ListInstanceConfigOperationsResponse#next_page_token next_page_token} + # from a previous + # {::Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigOperationsResponse ListInstanceConfigOperationsResponse} + # to the same `parent` and with the same `filter`. + class ListInstanceConfigOperationsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The response for + # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#list_instance_config_operations ListInstanceConfigOperations}. + # @!attribute [rw] operations + # @return [::Array<::Google::Longrunning::Operation>] + # The list of matching instance configuration long-running operations. Each + # operation's name will be + # prefixed by the name of the instance configuration. The operation's + # metadata field type + # `metadata.type_url` describes the type of the metadata. + # @!attribute [rw] next_page_token + # @return [::String] + # `next_page_token` can be sent in a subsequent + # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#list_instance_config_operations ListInstanceConfigOperations} + # call to fetch more of the matching metadata. + class ListInstanceConfigOperationsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request for + # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#get_instance GetInstance}. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the requested instance. Values are of the form + # `projects//instances/`. + # @!attribute [rw] field_mask + # @return [::Google::Protobuf::FieldMask] + # If field_mask is present, specifies the subset of + # {::Google::Cloud::Spanner::Admin::Instance::V1::Instance Instance} fields that should be + # returned. If absent, all + # {::Google::Cloud::Spanner::Admin::Instance::V1::Instance Instance} fields are returned. + class GetInstanceRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request for + # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#create_instance CreateInstance}. + # @!attribute [rw] parent + # @return [::String] + # Required. The name of the project in which to create the instance. Values + # are of the form `projects/`. + # @!attribute [rw] instance_id + # @return [::String] + # Required. The ID of the instance to create. Valid identifiers are of the + # form `[a-z][-a-z0-9]*[a-z0-9]` and must be between 2 and 64 characters in + # length. + # @!attribute [rw] instance + # @return [::Google::Cloud::Spanner::Admin::Instance::V1::Instance] + # Required. The instance to create. The name may be omitted, but if + # specified must be `/instances/`. + class CreateInstanceRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request for + # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#list_instances ListInstances}. + # @!attribute [rw] parent + # @return [::String] + # Required. The name of the project for which a list of instances is + # requested. Values are of the form `projects/`. + # @!attribute [rw] page_size + # @return [::Integer] + # Number of instances 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::Admin::Instance::V1::ListInstancesResponse#next_page_token next_page_token} + # from a previous + # {::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancesResponse ListInstancesResponse}. + # @!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: + # + # * `name` + # * `display_name` + # * `labels.key` where key is the name of a label + # + # Some examples of using filters are: + # + # * `name:*` --> The instance has a name. + # * `name:Howl` --> The instance's name contains the string "howl". + # * `name:HOWL` --> Equivalent to above. + # * `NAME:howl` --> Equivalent to above. + # * `labels.env:*` --> The instance has the label "env". + # * `labels.env:dev` --> The instance has the label "env" and the value of + # the label contains the string "dev". + # * `name:howl labels.env:dev` --> The instance's name contains "howl" and + # it has the label "env" with its value + # containing "dev". + # @!attribute [rw] instance_deadline + # @return [::Google::Protobuf::Timestamp] + # Deadline used while retrieving metadata for instances. + # Instances whose metadata cannot be retrieved within this deadline will be + # added to + # {::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancesResponse#unreachable unreachable} + # in + # {::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancesResponse ListInstancesResponse}. + class ListInstancesRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The response for + # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#list_instances ListInstances}. + # @!attribute [rw] instances + # @return [::Array<::Google::Cloud::Spanner::Admin::Instance::V1::Instance>] + # The list of requested instances. + # @!attribute [rw] next_page_token + # @return [::String] + # `next_page_token` can be sent in a subsequent + # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#list_instances ListInstances} + # call to fetch more of the matching instances. + # @!attribute [rw] unreachable + # @return [::Array<::String>] + # The list of unreachable instances. + # It includes the names of instances whose metadata could not be retrieved + # within + # {::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancesRequest#instance_deadline instance_deadline}. + class ListInstancesResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request for + # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#update_instance UpdateInstance}. + # @!attribute [rw] instance + # @return [::Google::Cloud::Spanner::Admin::Instance::V1::Instance] + # Required. The instance to update, which must always include the instance + # name. Otherwise, only fields mentioned in + # {::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstanceRequest#field_mask field_mask} + # need be included. + # @!attribute [rw] field_mask + # @return [::Google::Protobuf::FieldMask] + # Required. A mask specifying which fields in + # {::Google::Cloud::Spanner::Admin::Instance::V1::Instance Instance} should be updated. + # The field mask must always be specified; this prevents any future fields in + # {::Google::Cloud::Spanner::Admin::Instance::V1::Instance Instance} from being erased + # accidentally by clients that do not know about them. + class UpdateInstanceRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request for + # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#delete_instance DeleteInstance}. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the instance to be deleted. Values are of the form + # `projects//instances/` + class DeleteInstanceRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Metadata type for the operation returned by + # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#create_instance CreateInstance}. + # @!attribute [rw] instance + # @return [::Google::Cloud::Spanner::Admin::Instance::V1::Instance] + # The instance being created. + # @!attribute [rw] start_time + # @return [::Google::Protobuf::Timestamp] + # The time at which the + # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#create_instance CreateInstance} + # request was received. + # @!attribute [rw] cancel_time + # @return [::Google::Protobuf::Timestamp] + # The time at which this operation was cancelled. If set, this operation is + # in the process of undoing itself (which is guaranteed to succeed) and + # cannot be cancelled again. + # @!attribute [rw] end_time + # @return [::Google::Protobuf::Timestamp] + # The time at which this operation failed or was completed successfully. + # @!attribute [rw] expected_fulfillment_period + # @return [::Google::Cloud::Spanner::Admin::Instance::V1::FulfillmentPeriod] + # The expected fulfillment period of this create operation. + class CreateInstanceMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Metadata type for the operation returned by + # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#update_instance UpdateInstance}. + # @!attribute [rw] instance + # @return [::Google::Cloud::Spanner::Admin::Instance::V1::Instance] + # The desired end state of the update. + # @!attribute [rw] start_time + # @return [::Google::Protobuf::Timestamp] + # The time at which + # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#update_instance UpdateInstance} + # request was received. + # @!attribute [rw] cancel_time + # @return [::Google::Protobuf::Timestamp] + # The time at which this operation was cancelled. If set, this operation is + # in the process of undoing itself (which is guaranteed to succeed) and + # cannot be cancelled again. + # @!attribute [rw] end_time + # @return [::Google::Protobuf::Timestamp] + # The time at which this operation failed or was completed successfully. + # @!attribute [rw] expected_fulfillment_period + # @return [::Google::Cloud::Spanner::Admin::Instance::V1::FulfillmentPeriod] + # The expected fulfillment period of this update operation. + class UpdateInstanceMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Free instance specific metadata that is kept even after an instance has been + # upgraded for tracking purposes. + # @!attribute [r] expire_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Timestamp after which the instance will either be upgraded or + # scheduled for deletion after a grace period. ExpireBehavior is used to + # choose between upgrading or scheduling the free instance for deletion. This + # timestamp is set during the creation of a free instance. + # @!attribute [r] upgrade_time + # @return [::Google::Protobuf::Timestamp] + # Output only. If present, the timestamp at which the free instance was + # upgraded to a provisioned instance. + # @!attribute [rw] expire_behavior + # @return [::Google::Cloud::Spanner::Admin::Instance::V1::FreeInstanceMetadata::ExpireBehavior] + # Specifies the expiration behavior of a free instance. The default of + # ExpireBehavior is `REMOVE_AFTER_GRACE_PERIOD`. This can be modified during + # or after creation, and before expiration. + class FreeInstanceMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Allows users to change behavior when a free instance expires. + module ExpireBehavior + # Not specified. + EXPIRE_BEHAVIOR_UNSPECIFIED = 0 + + # When the free instance expires, upgrade the instance to a provisioned + # instance. + FREE_TO_PROVISIONED = 1 + + # When the free instance expires, disable the instance, and delete it + # after the grace period passes if it has not been upgraded. + REMOVE_AFTER_GRACE_PERIOD = 2 + end + end + + # Metadata type for the operation returned by + # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#create_instance_config CreateInstanceConfig}. + # @!attribute [rw] instance_config + # @return [::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig] + # The target instance configuration end state. + # @!attribute [rw] progress + # @return [::Google::Cloud::Spanner::Admin::Instance::V1::OperationProgress] + # The progress of the + # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#create_instance_config CreateInstanceConfig} + # operation. + # @!attribute [rw] cancel_time + # @return [::Google::Protobuf::Timestamp] + # The time at which this operation was cancelled. + class CreateInstanceConfigMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Metadata type for the operation returned by + # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#update_instance_config UpdateInstanceConfig}. + # @!attribute [rw] instance_config + # @return [::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig] + # The desired instance configuration after updating. + # @!attribute [rw] progress + # @return [::Google::Cloud::Spanner::Admin::Instance::V1::OperationProgress] + # The progress of the + # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#update_instance_config UpdateInstanceConfig} + # operation. + # @!attribute [rw] cancel_time + # @return [::Google::Protobuf::Timestamp] + # The time at which this operation was cancelled. + class UpdateInstanceConfigMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # An isolated set of Cloud Spanner resources that databases can define + # placements on. + # @!attribute [rw] name + # @return [::String] + # Required. A unique identifier for the instance partition. Values are of the + # form + # `projects//instances//instancePartitions/[a-z][-a-z0-9]*[a-z0-9]`. + # The final segment of the name must be between 2 and 64 characters in + # length. An instance partition's name cannot be changed after the instance + # partition is created. + # @!attribute [rw] config + # @return [::String] + # Required. The name of the instance partition's configuration. Values are of + # the form `projects//instanceConfigs/`. See also + # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig InstanceConfig} and + # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#list_instance_configs ListInstanceConfigs}. + # @!attribute [rw] display_name + # @return [::String] + # Required. The descriptive name for this instance partition as it appears in + # UIs. Must be unique per project and between 4 and 30 characters in length. + # @!attribute [rw] node_count + # @return [::Integer] + # The number of nodes allocated to this instance partition. + # + # Users can set the `node_count` field to specify the target number of + # nodes allocated to the instance partition. + # + # This may be zero in API responses for instance partitions that are not + # yet in state `READY`. + # + # Note: The following fields are mutually exclusive: `node_count`, `processing_units`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] processing_units + # @return [::Integer] + # The number of processing units allocated to this instance partition. + # + # Users can set the `processing_units` field to specify the target number + # of processing units allocated to the instance partition. + # + # This might be zero in API responses for instance partitions that are not + # yet in the `READY` state. + # + # Note: The following fields are mutually exclusive: `processing_units`, `node_count`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] autoscaling_config + # @return [::Google::Cloud::Spanner::Admin::Instance::V1::AutoscalingConfig] + # Optional. The autoscaling configuration. Autoscaling is enabled if this + # field is set. When autoscaling is enabled, fields in compute_capacity are + # treated as OUTPUT_ONLY fields and reflect the current compute capacity + # allocated to the instance partition. + # @!attribute [r] state + # @return [::Google::Cloud::Spanner::Admin::Instance::V1::InstancePartition::State] + # Output only. The current instance partition state. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time at which the instance partition was created. + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time at which the instance partition was most recently + # updated. + # @!attribute [r] referencing_databases + # @return [::Array<::String>] + # Output only. The names of the databases that reference this + # instance partition. Referencing databases should share the parent instance. + # The existence of any referencing database prevents the instance partition + # from being deleted. + # @!attribute [r] referencing_backups + # @deprecated This field is deprecated and may be removed in the next major version update. + # @return [::Array<::String>] + # Output only. Deprecated: This field is not populated. + # Output only. The names of the backups that reference this instance + # partition. Referencing backups should share the parent instance. The + # existence of any referencing backup prevents the instance partition from + # being deleted. + # @!attribute [rw] etag + # @return [::String] + # Used for optimistic concurrency control as a way + # to help prevent simultaneous updates of a instance partition from + # overwriting each other. It is strongly suggested that systems make use of + # the etag in the read-modify-write cycle to perform instance partition + # updates in order to avoid race conditions: An etag is returned in the + # response which contains instance partitions, and systems are expected to + # put that etag in the request to update instance partitions to ensure that + # their change will be applied to the same version of the instance partition. + # If no etag is provided in the call to update instance partition, then the + # existing instance partition is overwritten blindly. + class InstancePartition + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Indicates the current state of the instance partition. + module State + # Not specified. + STATE_UNSPECIFIED = 0 + + # The instance partition is still being created. Resources may not be + # available yet, and operations such as creating placements using this + # instance partition may not work. + CREATING = 1 + + # The instance partition is fully created and ready to do work such as + # creating placements and using in databases. + READY = 2 + end + end + + # Metadata type for the operation returned by + # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#create_instance_partition CreateInstancePartition}. + # @!attribute [rw] instance_partition + # @return [::Google::Cloud::Spanner::Admin::Instance::V1::InstancePartition] + # The instance partition being created. + # @!attribute [rw] start_time + # @return [::Google::Protobuf::Timestamp] + # The time at which the + # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#create_instance_partition CreateInstancePartition} + # request was received. + # @!attribute [rw] cancel_time + # @return [::Google::Protobuf::Timestamp] + # The time at which this operation was cancelled. If set, this operation is + # in the process of undoing itself (which is guaranteed to succeed) and + # cannot be cancelled again. + # @!attribute [rw] end_time + # @return [::Google::Protobuf::Timestamp] + # The time at which this operation failed or was completed successfully. + class CreateInstancePartitionMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request for + # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#create_instance_partition CreateInstancePartition}. + # @!attribute [rw] parent + # @return [::String] + # Required. The name of the instance in which to create the instance + # partition. Values are of the form + # `projects//instances/`. + # @!attribute [rw] instance_partition_id + # @return [::String] + # Required. The ID of the instance partition to create. Valid identifiers are + # of the form `[a-z][-a-z0-9]*[a-z0-9]` and must be between 2 and 64 + # characters in length. + # @!attribute [rw] instance_partition + # @return [::Google::Cloud::Spanner::Admin::Instance::V1::InstancePartition] + # Required. The instance partition to create. The instance_partition.name may + # be omitted, but if specified must be + # `/instancePartitions/`. + class CreateInstancePartitionRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request for + # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#delete_instance_partition DeleteInstancePartition}. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the instance partition to be deleted. + # Values are of the form + # `projects/{project}/instances/{instance}/instancePartitions/{instance_partition}` + # @!attribute [rw] etag + # @return [::String] + # Optional. If not empty, the API only deletes the instance partition when + # the etag provided matches the current status of the requested instance + # partition. Otherwise, deletes the instance partition without checking the + # current status of the requested instance partition. + class DeleteInstancePartitionRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request for + # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#get_instance_partition GetInstancePartition}. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the requested instance partition. Values are of + # the form + # `projects/{project}/instances/{instance}/instancePartitions/{instance_partition}`. + class GetInstancePartitionRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request for + # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#update_instance_partition UpdateInstancePartition}. + # @!attribute [rw] instance_partition + # @return [::Google::Cloud::Spanner::Admin::Instance::V1::InstancePartition] + # Required. The instance partition to update, which must always include the + # instance partition name. Otherwise, only fields mentioned in + # {::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstancePartitionRequest#field_mask field_mask} + # need be included. + # @!attribute [rw] field_mask + # @return [::Google::Protobuf::FieldMask] + # Required. A mask specifying which fields in + # {::Google::Cloud::Spanner::Admin::Instance::V1::InstancePartition InstancePartition} + # should be updated. The field mask must always be specified; this prevents + # any future fields in + # {::Google::Cloud::Spanner::Admin::Instance::V1::InstancePartition InstancePartition} + # from being erased accidentally by clients that do not know about them. + class UpdateInstancePartitionRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Metadata type for the operation returned by + # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#update_instance_partition UpdateInstancePartition}. + # @!attribute [rw] instance_partition + # @return [::Google::Cloud::Spanner::Admin::Instance::V1::InstancePartition] + # The desired end state of the update. + # @!attribute [rw] start_time + # @return [::Google::Protobuf::Timestamp] + # The time at which + # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#update_instance_partition UpdateInstancePartition} + # request was received. + # @!attribute [rw] cancel_time + # @return [::Google::Protobuf::Timestamp] + # The time at which this operation was cancelled. If set, this operation is + # in the process of undoing itself (which is guaranteed to succeed) and + # cannot be cancelled again. + # @!attribute [rw] end_time + # @return [::Google::Protobuf::Timestamp] + # The time at which this operation failed or was completed successfully. + class UpdateInstancePartitionMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request for + # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#list_instance_partitions ListInstancePartitions}. + # @!attribute [rw] parent + # @return [::String] + # Required. The instance whose instance partitions should be listed. Values + # are of the form `projects//instances/`. Use `{instance} + # = '-'` to list instance partitions for all Instances in a project, e.g., + # `projects/myproject/instances/-`. + # @!attribute [rw] page_size + # @return [::Integer] + # Number of instance partitions 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::Admin::Instance::V1::ListInstancePartitionsResponse#next_page_token next_page_token} + # from a previous + # {::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionsResponse ListInstancePartitionsResponse}. + # @!attribute [rw] instance_partition_deadline + # @return [::Google::Protobuf::Timestamp] + # Optional. Deadline used while retrieving metadata for instance partitions. + # Instance partitions whose metadata cannot be retrieved within this deadline + # will be added to + # {::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionsResponse#unreachable unreachable} + # in + # {::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionsResponse ListInstancePartitionsResponse}. + class ListInstancePartitionsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The response for + # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#list_instance_partitions ListInstancePartitions}. + # @!attribute [rw] instance_partitions + # @return [::Array<::Google::Cloud::Spanner::Admin::Instance::V1::InstancePartition>] + # The list of requested instancePartitions. + # @!attribute [rw] next_page_token + # @return [::String] + # `next_page_token` can be sent in a subsequent + # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#list_instance_partitions ListInstancePartitions} + # call to fetch more of the matching instance partitions. + # @!attribute [rw] unreachable + # @return [::Array<::String>] + # The list of unreachable instances or instance partitions. + # It includes the names of instances or instance partitions whose metadata + # could not be retrieved within + # {::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionsRequest#instance_partition_deadline instance_partition_deadline}. + class ListInstancePartitionsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request for + # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#list_instance_partition_operations ListInstancePartitionOperations}. + # @!attribute [rw] parent + # @return [::String] + # Required. The parent instance of the instance partition operations. + # Values are of the form `projects//instances/`. + # @!attribute [rw] filter + # @return [::String] + # Optional. An expression that filters the list of returned operations. + # + # A filter expression consists of a field name, a + # comparison operator, and a value for filtering. + # The value must be a string, a number, or a boolean. The comparison operator + # must be one of: `<`, `>`, `<=`, `>=`, `!=`, `=`, or `:`. + # Colon `:` is the contains operator. Filter rules are not case sensitive. + # + # The following fields in the Operation are eligible for filtering: + # + # * `name` - The name of the long-running operation + # * `done` - False if the operation is in progress, else true. + # * `metadata.@type` - the type of metadata. For example, the type string + # for + # {::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstancePartitionMetadata CreateInstancePartitionMetadata} + # is + # `type.googleapis.com/google.spanner.admin.instance.v1.CreateInstancePartitionMetadata`. + # * `metadata.` - any field in metadata.value. + # `metadata.@type` must be specified first, if filtering on metadata + # fields. + # * `error` - Error associated with the long-running operation. + # * `response.@type` - the type of response. + # * `response.` - any field in response.value. + # + # You can combine multiple expressions by enclosing each expression in + # parentheses. By default, expressions are combined with AND logic. However, + # you can specify AND, OR, and NOT logic explicitly. + # + # Here are a few examples: + # + # * `done:true` - The operation is complete. + # * `(metadata.@type=` \ + # `type.googleapis.com/google.spanner.admin.instance.v1.CreateInstancePartitionMetadata) + # AND` \ + # `(metadata.instance_partition.name:custom-instance-partition) AND` \ + # `(metadata.start_time < \"2021-03-28T14:50:00Z\") AND` \ + # `(error:*)` - Return operations where: + # * The operation's metadata type is + # {::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstancePartitionMetadata CreateInstancePartitionMetadata}. + # * The instance partition name contains "custom-instance-partition". + # * The operation started before 2021-03-28T14:50:00Z. + # * The operation resulted in an error. + # @!attribute [rw] page_size + # @return [::Integer] + # Optional. Number of operations 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] + # Optional. If non-empty, `page_token` should contain a + # {::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionOperationsResponse#next_page_token next_page_token} + # from a previous + # {::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionOperationsResponse ListInstancePartitionOperationsResponse} + # to the same `parent` and with the same `filter`. + # @!attribute [rw] instance_partition_deadline + # @return [::Google::Protobuf::Timestamp] + # Optional. Deadline used while retrieving metadata for instance partition + # operations. Instance partitions whose operation metadata cannot be + # retrieved within this deadline will be added to + # {::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionOperationsResponse#unreachable_instance_partitions unreachable_instance_partitions} + # in + # {::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionOperationsResponse ListInstancePartitionOperationsResponse}. + class ListInstancePartitionOperationsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The response for + # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#list_instance_partition_operations ListInstancePartitionOperations}. + # @!attribute [rw] operations + # @return [::Array<::Google::Longrunning::Operation>] + # The list of matching instance partition long-running operations. Each + # operation's name will be + # prefixed by the instance partition's name. The operation's + # metadata field type + # `metadata.type_url` describes the type of the metadata. + # @!attribute [rw] next_page_token + # @return [::String] + # `next_page_token` can be sent in a subsequent + # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#list_instance_partition_operations ListInstancePartitionOperations} + # call to fetch more of the matching metadata. + # @!attribute [rw] unreachable_instance_partitions + # @return [::Array<::String>] + # The list of unreachable instance partitions. + # It includes the names of instance partitions whose operation metadata could + # not be retrieved within + # {::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionOperationsRequest#instance_partition_deadline instance_partition_deadline}. + class ListInstancePartitionOperationsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request for + # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#move_instance MoveInstance}. + # @!attribute [rw] name + # @return [::String] + # Required. The instance to move. + # Values are of the form `projects//instances/`. + # @!attribute [rw] target_config + # @return [::String] + # Required. The target instance configuration where to move the instance. + # Values are of the form `projects//instanceConfigs/`. + class MoveInstanceRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The response for + # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#move_instance MoveInstance}. + class MoveInstanceResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Metadata type for the operation returned by + # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#move_instance MoveInstance}. + # @!attribute [rw] target_config + # @return [::String] + # The target instance configuration where to move the instance. + # Values are of the form `projects//instanceConfigs/`. + # @!attribute [rw] progress + # @return [::Google::Cloud::Spanner::Admin::Instance::V1::OperationProgress] + # The progress of the + # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#move_instance MoveInstance} + # operation. + # {::Google::Cloud::Spanner::Admin::Instance::V1::OperationProgress#progress_percent progress_percent} + # is reset when cancellation is requested. + # @!attribute [rw] cancel_time + # @return [::Google::Protobuf::Timestamp] + # The time at which this operation was cancelled. + class MoveInstanceMetadata + 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-admin-instance-v1/proto_docs/google/type/expr.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/proto_docs/google/type/expr.rb new file mode 100644 index 000000000000..9505eeb8657e --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/proto_docs/google/type/expr.rb @@ -0,0 +1,75 @@ +# frozen_string_literal: true + +# Copyright 2025 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 Type + # Represents a textual expression in the Common Expression Language (CEL) + # syntax. CEL is a C-like expression language. The syntax and semantics of CEL + # are documented at https://github.com/google/cel-spec. + # + # Example (Comparison): + # + # title: "Summary size limit" + # description: "Determines if a summary is less than 100 chars" + # expression: "document.summary.size() < 100" + # + # Example (Equality): + # + # title: "Requestor is owner" + # description: "Determines if requestor is the document owner" + # expression: "document.owner == request.auth.claims.email" + # + # Example (Logic): + # + # title: "Public documents" + # description: "Determine whether the document should be publicly visible" + # expression: "document.type != 'private' && document.type != 'internal'" + # + # Example (Data Manipulation): + # + # title: "Notification string" + # description: "Create a notification string with a timestamp." + # expression: "'New message received at ' + string(document.create_time)" + # + # The exact variables and functions that may be referenced within an expression + # are determined by the service that evaluates it. See the service + # documentation for additional information. + # @!attribute [rw] expression + # @return [::String] + # Textual representation of an expression in Common Expression Language + # syntax. + # @!attribute [rw] title + # @return [::String] + # Optional. Title for the expression, i.e. a short string describing + # its purpose. This can be used e.g. in UIs which allow to enter the + # expression. + # @!attribute [rw] description + # @return [::String] + # Optional. Description of the expression. This is a longer text which + # describes the expression, e.g. when hovered over it in a UI. + # @!attribute [rw] location + # @return [::String] + # Optional. String indicating the location of the expression for error + # reporting, e.g. a file name and a position in the file. + class Expr + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/Gemfile b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/Gemfile new file mode 100644 index 000000000000..84bfa1a1fb23 --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/Gemfile @@ -0,0 +1,32 @@ +# frozen_string_literal: true + +# Copyright 2025 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-admin-instance-v1", path: "../" +else + gem "google-cloud-spanner-admin-instance-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-admin-instance-v1/snippets/instance_admin/create_instance.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/create_instance.rb new file mode 100644 index 000000000000..3a98c906707a --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/create_instance.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2025 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_InstanceAdmin_CreateInstance_sync] +require "google/cloud/spanner/admin/instance/v1" + +## +# Snippet for the create_instance call in the InstanceAdmin 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::Admin::Instance::V1::InstanceAdmin::Client#create_instance. +# +def create_instance + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Spanner::Admin::Instance::V1::CreateInstanceRequest.new + + # Call the create_instance method. + result = client.create_instance request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END spanner_v1_generated_InstanceAdmin_CreateInstance_sync] diff --git a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/create_instance_config.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/create_instance_config.rb new file mode 100644 index 000000000000..d35298c9192a --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/create_instance_config.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2025 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_InstanceAdmin_CreateInstanceConfig_sync] +require "google/cloud/spanner/admin/instance/v1" + +## +# Snippet for the create_instance_config call in the InstanceAdmin 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::Admin::Instance::V1::InstanceAdmin::Client#create_instance_config. +# +def create_instance_config + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Spanner::Admin::Instance::V1::CreateInstanceConfigRequest.new + + # Call the create_instance_config method. + result = client.create_instance_config request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END spanner_v1_generated_InstanceAdmin_CreateInstanceConfig_sync] diff --git a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/create_instance_partition.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/create_instance_partition.rb new file mode 100644 index 000000000000..f27f995ceb98 --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/create_instance_partition.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2025 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_InstanceAdmin_CreateInstancePartition_sync] +require "google/cloud/spanner/admin/instance/v1" + +## +# Snippet for the create_instance_partition call in the InstanceAdmin 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::Admin::Instance::V1::InstanceAdmin::Client#create_instance_partition. +# +def create_instance_partition + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Spanner::Admin::Instance::V1::CreateInstancePartitionRequest.new + + # Call the create_instance_partition method. + result = client.create_instance_partition request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END spanner_v1_generated_InstanceAdmin_CreateInstancePartition_sync] diff --git a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/delete_instance.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/delete_instance.rb new file mode 100644 index 000000000000..23b3d83cd532 --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/delete_instance.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2025 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_InstanceAdmin_DeleteInstance_sync] +require "google/cloud/spanner/admin/instance/v1" + +## +# Snippet for the delete_instance call in the InstanceAdmin 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::Admin::Instance::V1::InstanceAdmin::Client#delete_instance. +# +def delete_instance + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Spanner::Admin::Instance::V1::DeleteInstanceRequest.new + + # Call the delete_instance method. + result = client.delete_instance request + + # The returned object is of type Google::Protobuf::Empty. + p result +end +# [END spanner_v1_generated_InstanceAdmin_DeleteInstance_sync] diff --git a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/delete_instance_config.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/delete_instance_config.rb new file mode 100644 index 000000000000..3accbd00c975 --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/delete_instance_config.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2025 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_InstanceAdmin_DeleteInstanceConfig_sync] +require "google/cloud/spanner/admin/instance/v1" + +## +# Snippet for the delete_instance_config call in the InstanceAdmin 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::Admin::Instance::V1::InstanceAdmin::Client#delete_instance_config. +# +def delete_instance_config + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Spanner::Admin::Instance::V1::DeleteInstanceConfigRequest.new + + # Call the delete_instance_config method. + result = client.delete_instance_config request + + # The returned object is of type Google::Protobuf::Empty. + p result +end +# [END spanner_v1_generated_InstanceAdmin_DeleteInstanceConfig_sync] diff --git a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/delete_instance_partition.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/delete_instance_partition.rb new file mode 100644 index 000000000000..c214d4b15c0d --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/delete_instance_partition.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2025 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_InstanceAdmin_DeleteInstancePartition_sync] +require "google/cloud/spanner/admin/instance/v1" + +## +# Snippet for the delete_instance_partition call in the InstanceAdmin 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::Admin::Instance::V1::InstanceAdmin::Client#delete_instance_partition. +# +def delete_instance_partition + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Spanner::Admin::Instance::V1::DeleteInstancePartitionRequest.new + + # Call the delete_instance_partition method. + result = client.delete_instance_partition request + + # The returned object is of type Google::Protobuf::Empty. + p result +end +# [END spanner_v1_generated_InstanceAdmin_DeleteInstancePartition_sync] diff --git a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/get_iam_policy.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/get_iam_policy.rb new file mode 100644 index 000000000000..42f2002a544d --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/get_iam_policy.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2025 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_InstanceAdmin_GetIamPolicy_sync] +require "google/cloud/spanner/admin/instance/v1" + +## +# Snippet for the get_iam_policy call in the InstanceAdmin 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::Admin::Instance::V1::InstanceAdmin::Client#get_iam_policy. +# +def get_iam_policy + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V1::GetIamPolicyRequest.new + + # Call the get_iam_policy method. + result = client.get_iam_policy request + + # The returned object is of type Google::Iam::V1::Policy. + p result +end +# [END spanner_v1_generated_InstanceAdmin_GetIamPolicy_sync] diff --git a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/get_instance.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/get_instance.rb new file mode 100644 index 000000000000..c1b513d28fb7 --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/get_instance.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2025 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_InstanceAdmin_GetInstance_sync] +require "google/cloud/spanner/admin/instance/v1" + +## +# Snippet for the get_instance call in the InstanceAdmin 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::Admin::Instance::V1::InstanceAdmin::Client#get_instance. +# +def get_instance + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Spanner::Admin::Instance::V1::GetInstanceRequest.new + + # Call the get_instance method. + result = client.get_instance request + + # The returned object is of type Google::Cloud::Spanner::Admin::Instance::V1::Instance. + p result +end +# [END spanner_v1_generated_InstanceAdmin_GetInstance_sync] diff --git a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/get_instance_config.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/get_instance_config.rb new file mode 100644 index 000000000000..79ead90a98f7 --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/get_instance_config.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2025 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_InstanceAdmin_GetInstanceConfig_sync] +require "google/cloud/spanner/admin/instance/v1" + +## +# Snippet for the get_instance_config call in the InstanceAdmin 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::Admin::Instance::V1::InstanceAdmin::Client#get_instance_config. +# +def get_instance_config + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Spanner::Admin::Instance::V1::GetInstanceConfigRequest.new + + # Call the get_instance_config method. + result = client.get_instance_config request + + # The returned object is of type Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig. + p result +end +# [END spanner_v1_generated_InstanceAdmin_GetInstanceConfig_sync] diff --git a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/get_instance_partition.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/get_instance_partition.rb new file mode 100644 index 000000000000..52670156a1fb --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/get_instance_partition.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2025 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_InstanceAdmin_GetInstancePartition_sync] +require "google/cloud/spanner/admin/instance/v1" + +## +# Snippet for the get_instance_partition call in the InstanceAdmin 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::Admin::Instance::V1::InstanceAdmin::Client#get_instance_partition. +# +def get_instance_partition + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Spanner::Admin::Instance::V1::GetInstancePartitionRequest.new + + # Call the get_instance_partition method. + result = client.get_instance_partition request + + # The returned object is of type Google::Cloud::Spanner::Admin::Instance::V1::InstancePartition. + p result +end +# [END spanner_v1_generated_InstanceAdmin_GetInstancePartition_sync] diff --git a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/list_instance_config_operations.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/list_instance_config_operations.rb new file mode 100644 index 000000000000..299cfbef445e --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/list_instance_config_operations.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2025 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_InstanceAdmin_ListInstanceConfigOperations_sync] +require "google/cloud/spanner/admin/instance/v1" + +## +# Snippet for the list_instance_config_operations call in the InstanceAdmin 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::Admin::Instance::V1::InstanceAdmin::Client#list_instance_config_operations. +# +def list_instance_config_operations + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigOperationsRequest.new + + # Call the list_instance_config_operations method. + result = client.list_instance_config_operations 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::Longrunning::Operation. + p item + end +end +# [END spanner_v1_generated_InstanceAdmin_ListInstanceConfigOperations_sync] diff --git a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/list_instance_configs.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/list_instance_configs.rb new file mode 100644 index 000000000000..3f952eac6ecc --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/list_instance_configs.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2025 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_InstanceAdmin_ListInstanceConfigs_sync] +require "google/cloud/spanner/admin/instance/v1" + +## +# Snippet for the list_instance_configs call in the InstanceAdmin 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::Admin::Instance::V1::InstanceAdmin::Client#list_instance_configs. +# +def list_instance_configs + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigsRequest.new + + # Call the list_instance_configs method. + result = client.list_instance_configs 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::Admin::Instance::V1::InstanceConfig. + p item + end +end +# [END spanner_v1_generated_InstanceAdmin_ListInstanceConfigs_sync] diff --git a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/list_instance_partition_operations.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/list_instance_partition_operations.rb new file mode 100644 index 000000000000..fa87412bfdcb --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/list_instance_partition_operations.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2025 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_InstanceAdmin_ListInstancePartitionOperations_sync] +require "google/cloud/spanner/admin/instance/v1" + +## +# Snippet for the list_instance_partition_operations call in the InstanceAdmin 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::Admin::Instance::V1::InstanceAdmin::Client#list_instance_partition_operations. +# +def list_instance_partition_operations + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionOperationsRequest.new + + # Call the list_instance_partition_operations method. + result = client.list_instance_partition_operations 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::Longrunning::Operation. + p item + end +end +# [END spanner_v1_generated_InstanceAdmin_ListInstancePartitionOperations_sync] diff --git a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/list_instance_partitions.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/list_instance_partitions.rb new file mode 100644 index 000000000000..eb2fdce229d2 --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/list_instance_partitions.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2025 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_InstanceAdmin_ListInstancePartitions_sync] +require "google/cloud/spanner/admin/instance/v1" + +## +# Snippet for the list_instance_partitions call in the InstanceAdmin 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::Admin::Instance::V1::InstanceAdmin::Client#list_instance_partitions. +# +def list_instance_partitions + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionsRequest.new + + # Call the list_instance_partitions method. + result = client.list_instance_partitions 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::Admin::Instance::V1::InstancePartition. + p item + end +end +# [END spanner_v1_generated_InstanceAdmin_ListInstancePartitions_sync] diff --git a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/list_instances.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/list_instances.rb new file mode 100644 index 000000000000..362f27d203ac --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/list_instances.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2025 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_InstanceAdmin_ListInstances_sync] +require "google/cloud/spanner/admin/instance/v1" + +## +# Snippet for the list_instances call in the InstanceAdmin 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::Admin::Instance::V1::InstanceAdmin::Client#list_instances. +# +def list_instances + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Spanner::Admin::Instance::V1::ListInstancesRequest.new + + # Call the list_instances method. + result = client.list_instances 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::Admin::Instance::V1::Instance. + p item + end +end +# [END spanner_v1_generated_InstanceAdmin_ListInstances_sync] diff --git a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/move_instance.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/move_instance.rb new file mode 100644 index 000000000000..2a6e743ba785 --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/move_instance.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2025 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_InstanceAdmin_MoveInstance_sync] +require "google/cloud/spanner/admin/instance/v1" + +## +# Snippet for the move_instance call in the InstanceAdmin 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::Admin::Instance::V1::InstanceAdmin::Client#move_instance. +# +def move_instance + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Spanner::Admin::Instance::V1::MoveInstanceRequest.new + + # Call the move_instance method. + result = client.move_instance request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END spanner_v1_generated_InstanceAdmin_MoveInstance_sync] diff --git a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/set_iam_policy.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/set_iam_policy.rb new file mode 100644 index 000000000000..f7b9a08b4dc0 --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/set_iam_policy.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2025 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_InstanceAdmin_SetIamPolicy_sync] +require "google/cloud/spanner/admin/instance/v1" + +## +# Snippet for the set_iam_policy call in the InstanceAdmin 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::Admin::Instance::V1::InstanceAdmin::Client#set_iam_policy. +# +def set_iam_policy + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V1::SetIamPolicyRequest.new + + # Call the set_iam_policy method. + result = client.set_iam_policy request + + # The returned object is of type Google::Iam::V1::Policy. + p result +end +# [END spanner_v1_generated_InstanceAdmin_SetIamPolicy_sync] diff --git a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/test_iam_permissions.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/test_iam_permissions.rb new file mode 100644 index 000000000000..45bf9761b29c --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/test_iam_permissions.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2025 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_InstanceAdmin_TestIamPermissions_sync] +require "google/cloud/spanner/admin/instance/v1" + +## +# Snippet for the test_iam_permissions call in the InstanceAdmin 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::Admin::Instance::V1::InstanceAdmin::Client#test_iam_permissions. +# +def test_iam_permissions + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V1::TestIamPermissionsRequest.new + + # Call the test_iam_permissions method. + result = client.test_iam_permissions request + + # The returned object is of type Google::Iam::V1::TestIamPermissionsResponse. + p result +end +# [END spanner_v1_generated_InstanceAdmin_TestIamPermissions_sync] diff --git a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/update_instance.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/update_instance.rb new file mode 100644 index 000000000000..b7682504ebc1 --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/update_instance.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2025 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_InstanceAdmin_UpdateInstance_sync] +require "google/cloud/spanner/admin/instance/v1" + +## +# Snippet for the update_instance call in the InstanceAdmin 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::Admin::Instance::V1::InstanceAdmin::Client#update_instance. +# +def update_instance + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstanceRequest.new + + # Call the update_instance method. + result = client.update_instance request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END spanner_v1_generated_InstanceAdmin_UpdateInstance_sync] diff --git a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/update_instance_config.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/update_instance_config.rb new file mode 100644 index 000000000000..5483412c7a53 --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/update_instance_config.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2025 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_InstanceAdmin_UpdateInstanceConfig_sync] +require "google/cloud/spanner/admin/instance/v1" + +## +# Snippet for the update_instance_config call in the InstanceAdmin 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::Admin::Instance::V1::InstanceAdmin::Client#update_instance_config. +# +def update_instance_config + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstanceConfigRequest.new + + # Call the update_instance_config method. + result = client.update_instance_config request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END spanner_v1_generated_InstanceAdmin_UpdateInstanceConfig_sync] diff --git a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/update_instance_partition.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/update_instance_partition.rb new file mode 100644 index 000000000000..551be2fdd53f --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/update_instance_partition.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2025 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_InstanceAdmin_UpdateInstancePartition_sync] +require "google/cloud/spanner/admin/instance/v1" + +## +# Snippet for the update_instance_partition call in the InstanceAdmin 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::Admin::Instance::V1::InstanceAdmin::Client#update_instance_partition. +# +def update_instance_partition + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstancePartitionRequest.new + + # Call the update_instance_partition method. + result = client.update_instance_partition request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END spanner_v1_generated_InstanceAdmin_UpdateInstancePartition_sync] diff --git a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/snippet_metadata_google.spanner.admin.instance.v1.json b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/snippet_metadata_google.spanner.admin.instance.v1.json new file mode 100644 index 000000000000..d91b8bef1312 --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/snippet_metadata_google.spanner.admin.instance.v1.json @@ -0,0 +1,855 @@ +{ + "client_library": { + "name": "google-cloud-spanner-admin-instance-v1", + "version": "", + "language": "RUBY", + "apis": [ + { + "id": "google.spanner.admin.instance.v1", + "version": "v1" + } + ] + }, + "snippets": [ + { + "region_tag": "spanner_v1_generated_InstanceAdmin_ListInstanceConfigs_sync", + "title": "Snippet for the list_instance_configs call in the InstanceAdmin service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#list_instance_configs.", + "file": "instance_admin/list_instance_configs.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_instance_configs", + "full_name": "::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#list_instance_configs", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigsResponse", + "client": { + "short_name": "InstanceAdmin::Client", + "full_name": "::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client" + }, + "method": { + "short_name": "ListInstanceConfigs", + "full_name": "google.spanner.admin.instance.v1.InstanceAdmin.ListInstanceConfigs", + "service": { + "short_name": "InstanceAdmin", + "full_name": "google.spanner.admin.instance.v1.InstanceAdmin" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "spanner_v1_generated_InstanceAdmin_GetInstanceConfig_sync", + "title": "Snippet for the get_instance_config call in the InstanceAdmin service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#get_instance_config.", + "file": "instance_admin/get_instance_config.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_instance_config", + "full_name": "::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#get_instance_config", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Spanner::Admin::Instance::V1::GetInstanceConfigRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig", + "client": { + "short_name": "InstanceAdmin::Client", + "full_name": "::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client" + }, + "method": { + "short_name": "GetInstanceConfig", + "full_name": "google.spanner.admin.instance.v1.InstanceAdmin.GetInstanceConfig", + "service": { + "short_name": "InstanceAdmin", + "full_name": "google.spanner.admin.instance.v1.InstanceAdmin" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "spanner_v1_generated_InstanceAdmin_CreateInstanceConfig_sync", + "title": "Snippet for the create_instance_config call in the InstanceAdmin service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#create_instance_config.", + "file": "instance_admin/create_instance_config.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_instance_config", + "full_name": "::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#create_instance_config", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstanceConfigRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "InstanceAdmin::Client", + "full_name": "::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client" + }, + "method": { + "short_name": "CreateInstanceConfig", + "full_name": "google.spanner.admin.instance.v1.InstanceAdmin.CreateInstanceConfig", + "service": { + "short_name": "InstanceAdmin", + "full_name": "google.spanner.admin.instance.v1.InstanceAdmin" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "spanner_v1_generated_InstanceAdmin_UpdateInstanceConfig_sync", + "title": "Snippet for the update_instance_config call in the InstanceAdmin service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#update_instance_config.", + "file": "instance_admin/update_instance_config.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_instance_config", + "full_name": "::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#update_instance_config", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstanceConfigRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "InstanceAdmin::Client", + "full_name": "::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client" + }, + "method": { + "short_name": "UpdateInstanceConfig", + "full_name": "google.spanner.admin.instance.v1.InstanceAdmin.UpdateInstanceConfig", + "service": { + "short_name": "InstanceAdmin", + "full_name": "google.spanner.admin.instance.v1.InstanceAdmin" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "spanner_v1_generated_InstanceAdmin_DeleteInstanceConfig_sync", + "title": "Snippet for the delete_instance_config call in the InstanceAdmin service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#delete_instance_config.", + "file": "instance_admin/delete_instance_config.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_instance_config", + "full_name": "::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#delete_instance_config", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Spanner::Admin::Instance::V1::DeleteInstanceConfigRequest", + "name": "request" + } + ], + "result_type": "::Google::Protobuf::Empty", + "client": { + "short_name": "InstanceAdmin::Client", + "full_name": "::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client" + }, + "method": { + "short_name": "DeleteInstanceConfig", + "full_name": "google.spanner.admin.instance.v1.InstanceAdmin.DeleteInstanceConfig", + "service": { + "short_name": "InstanceAdmin", + "full_name": "google.spanner.admin.instance.v1.InstanceAdmin" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "spanner_v1_generated_InstanceAdmin_ListInstanceConfigOperations_sync", + "title": "Snippet for the list_instance_config_operations call in the InstanceAdmin service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#list_instance_config_operations.", + "file": "instance_admin/list_instance_config_operations.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_instance_config_operations", + "full_name": "::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#list_instance_config_operations", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigOperationsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigOperationsResponse", + "client": { + "short_name": "InstanceAdmin::Client", + "full_name": "::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client" + }, + "method": { + "short_name": "ListInstanceConfigOperations", + "full_name": "google.spanner.admin.instance.v1.InstanceAdmin.ListInstanceConfigOperations", + "service": { + "short_name": "InstanceAdmin", + "full_name": "google.spanner.admin.instance.v1.InstanceAdmin" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "spanner_v1_generated_InstanceAdmin_ListInstances_sync", + "title": "Snippet for the list_instances call in the InstanceAdmin service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#list_instances.", + "file": "instance_admin/list_instances.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_instances", + "full_name": "::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#list_instances", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancesRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancesResponse", + "client": { + "short_name": "InstanceAdmin::Client", + "full_name": "::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client" + }, + "method": { + "short_name": "ListInstances", + "full_name": "google.spanner.admin.instance.v1.InstanceAdmin.ListInstances", + "service": { + "short_name": "InstanceAdmin", + "full_name": "google.spanner.admin.instance.v1.InstanceAdmin" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "spanner_v1_generated_InstanceAdmin_ListInstancePartitions_sync", + "title": "Snippet for the list_instance_partitions call in the InstanceAdmin service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#list_instance_partitions.", + "file": "instance_admin/list_instance_partitions.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_instance_partitions", + "full_name": "::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#list_instance_partitions", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionsResponse", + "client": { + "short_name": "InstanceAdmin::Client", + "full_name": "::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client" + }, + "method": { + "short_name": "ListInstancePartitions", + "full_name": "google.spanner.admin.instance.v1.InstanceAdmin.ListInstancePartitions", + "service": { + "short_name": "InstanceAdmin", + "full_name": "google.spanner.admin.instance.v1.InstanceAdmin" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "spanner_v1_generated_InstanceAdmin_GetInstance_sync", + "title": "Snippet for the get_instance call in the InstanceAdmin service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#get_instance.", + "file": "instance_admin/get_instance.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_instance", + "full_name": "::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#get_instance", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Spanner::Admin::Instance::V1::GetInstanceRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Spanner::Admin::Instance::V1::Instance", + "client": { + "short_name": "InstanceAdmin::Client", + "full_name": "::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client" + }, + "method": { + "short_name": "GetInstance", + "full_name": "google.spanner.admin.instance.v1.InstanceAdmin.GetInstance", + "service": { + "short_name": "InstanceAdmin", + "full_name": "google.spanner.admin.instance.v1.InstanceAdmin" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "spanner_v1_generated_InstanceAdmin_CreateInstance_sync", + "title": "Snippet for the create_instance call in the InstanceAdmin service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#create_instance.", + "file": "instance_admin/create_instance.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_instance", + "full_name": "::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#create_instance", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstanceRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "InstanceAdmin::Client", + "full_name": "::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client" + }, + "method": { + "short_name": "CreateInstance", + "full_name": "google.spanner.admin.instance.v1.InstanceAdmin.CreateInstance", + "service": { + "short_name": "InstanceAdmin", + "full_name": "google.spanner.admin.instance.v1.InstanceAdmin" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "spanner_v1_generated_InstanceAdmin_UpdateInstance_sync", + "title": "Snippet for the update_instance call in the InstanceAdmin service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#update_instance.", + "file": "instance_admin/update_instance.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_instance", + "full_name": "::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#update_instance", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstanceRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "InstanceAdmin::Client", + "full_name": "::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client" + }, + "method": { + "short_name": "UpdateInstance", + "full_name": "google.spanner.admin.instance.v1.InstanceAdmin.UpdateInstance", + "service": { + "short_name": "InstanceAdmin", + "full_name": "google.spanner.admin.instance.v1.InstanceAdmin" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "spanner_v1_generated_InstanceAdmin_DeleteInstance_sync", + "title": "Snippet for the delete_instance call in the InstanceAdmin service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#delete_instance.", + "file": "instance_admin/delete_instance.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_instance", + "full_name": "::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#delete_instance", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Spanner::Admin::Instance::V1::DeleteInstanceRequest", + "name": "request" + } + ], + "result_type": "::Google::Protobuf::Empty", + "client": { + "short_name": "InstanceAdmin::Client", + "full_name": "::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client" + }, + "method": { + "short_name": "DeleteInstance", + "full_name": "google.spanner.admin.instance.v1.InstanceAdmin.DeleteInstance", + "service": { + "short_name": "InstanceAdmin", + "full_name": "google.spanner.admin.instance.v1.InstanceAdmin" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "spanner_v1_generated_InstanceAdmin_SetIamPolicy_sync", + "title": "Snippet for the set_iam_policy call in the InstanceAdmin service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#set_iam_policy.", + "file": "instance_admin/set_iam_policy.rb", + "language": "RUBY", + "client_method": { + "short_name": "set_iam_policy", + "full_name": "::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#set_iam_policy", + "async": false, + "parameters": [ + { + "type": "::Google::Iam::V1::SetIamPolicyRequest", + "name": "request" + } + ], + "result_type": "::Google::Iam::V1::Policy", + "client": { + "short_name": "InstanceAdmin::Client", + "full_name": "::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client" + }, + "method": { + "short_name": "SetIamPolicy", + "full_name": "google.spanner.admin.instance.v1.InstanceAdmin.SetIamPolicy", + "service": { + "short_name": "InstanceAdmin", + "full_name": "google.spanner.admin.instance.v1.InstanceAdmin" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "spanner_v1_generated_InstanceAdmin_GetIamPolicy_sync", + "title": "Snippet for the get_iam_policy call in the InstanceAdmin service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#get_iam_policy.", + "file": "instance_admin/get_iam_policy.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_iam_policy", + "full_name": "::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#get_iam_policy", + "async": false, + "parameters": [ + { + "type": "::Google::Iam::V1::GetIamPolicyRequest", + "name": "request" + } + ], + "result_type": "::Google::Iam::V1::Policy", + "client": { + "short_name": "InstanceAdmin::Client", + "full_name": "::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client" + }, + "method": { + "short_name": "GetIamPolicy", + "full_name": "google.spanner.admin.instance.v1.InstanceAdmin.GetIamPolicy", + "service": { + "short_name": "InstanceAdmin", + "full_name": "google.spanner.admin.instance.v1.InstanceAdmin" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "spanner_v1_generated_InstanceAdmin_TestIamPermissions_sync", + "title": "Snippet for the test_iam_permissions call in the InstanceAdmin service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#test_iam_permissions.", + "file": "instance_admin/test_iam_permissions.rb", + "language": "RUBY", + "client_method": { + "short_name": "test_iam_permissions", + "full_name": "::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#test_iam_permissions", + "async": false, + "parameters": [ + { + "type": "::Google::Iam::V1::TestIamPermissionsRequest", + "name": "request" + } + ], + "result_type": "::Google::Iam::V1::TestIamPermissionsResponse", + "client": { + "short_name": "InstanceAdmin::Client", + "full_name": "::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client" + }, + "method": { + "short_name": "TestIamPermissions", + "full_name": "google.spanner.admin.instance.v1.InstanceAdmin.TestIamPermissions", + "service": { + "short_name": "InstanceAdmin", + "full_name": "google.spanner.admin.instance.v1.InstanceAdmin" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "spanner_v1_generated_InstanceAdmin_GetInstancePartition_sync", + "title": "Snippet for the get_instance_partition call in the InstanceAdmin service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#get_instance_partition.", + "file": "instance_admin/get_instance_partition.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_instance_partition", + "full_name": "::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#get_instance_partition", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Spanner::Admin::Instance::V1::GetInstancePartitionRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Spanner::Admin::Instance::V1::InstancePartition", + "client": { + "short_name": "InstanceAdmin::Client", + "full_name": "::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client" + }, + "method": { + "short_name": "GetInstancePartition", + "full_name": "google.spanner.admin.instance.v1.InstanceAdmin.GetInstancePartition", + "service": { + "short_name": "InstanceAdmin", + "full_name": "google.spanner.admin.instance.v1.InstanceAdmin" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "spanner_v1_generated_InstanceAdmin_CreateInstancePartition_sync", + "title": "Snippet for the create_instance_partition call in the InstanceAdmin service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#create_instance_partition.", + "file": "instance_admin/create_instance_partition.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_instance_partition", + "full_name": "::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#create_instance_partition", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstancePartitionRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "InstanceAdmin::Client", + "full_name": "::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client" + }, + "method": { + "short_name": "CreateInstancePartition", + "full_name": "google.spanner.admin.instance.v1.InstanceAdmin.CreateInstancePartition", + "service": { + "short_name": "InstanceAdmin", + "full_name": "google.spanner.admin.instance.v1.InstanceAdmin" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "spanner_v1_generated_InstanceAdmin_DeleteInstancePartition_sync", + "title": "Snippet for the delete_instance_partition call in the InstanceAdmin service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#delete_instance_partition.", + "file": "instance_admin/delete_instance_partition.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_instance_partition", + "full_name": "::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#delete_instance_partition", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Spanner::Admin::Instance::V1::DeleteInstancePartitionRequest", + "name": "request" + } + ], + "result_type": "::Google::Protobuf::Empty", + "client": { + "short_name": "InstanceAdmin::Client", + "full_name": "::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client" + }, + "method": { + "short_name": "DeleteInstancePartition", + "full_name": "google.spanner.admin.instance.v1.InstanceAdmin.DeleteInstancePartition", + "service": { + "short_name": "InstanceAdmin", + "full_name": "google.spanner.admin.instance.v1.InstanceAdmin" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "spanner_v1_generated_InstanceAdmin_UpdateInstancePartition_sync", + "title": "Snippet for the update_instance_partition call in the InstanceAdmin service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#update_instance_partition.", + "file": "instance_admin/update_instance_partition.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_instance_partition", + "full_name": "::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#update_instance_partition", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstancePartitionRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "InstanceAdmin::Client", + "full_name": "::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client" + }, + "method": { + "short_name": "UpdateInstancePartition", + "full_name": "google.spanner.admin.instance.v1.InstanceAdmin.UpdateInstancePartition", + "service": { + "short_name": "InstanceAdmin", + "full_name": "google.spanner.admin.instance.v1.InstanceAdmin" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "spanner_v1_generated_InstanceAdmin_ListInstancePartitionOperations_sync", + "title": "Snippet for the list_instance_partition_operations call in the InstanceAdmin service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#list_instance_partition_operations.", + "file": "instance_admin/list_instance_partition_operations.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_instance_partition_operations", + "full_name": "::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#list_instance_partition_operations", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionOperationsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionOperationsResponse", + "client": { + "short_name": "InstanceAdmin::Client", + "full_name": "::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client" + }, + "method": { + "short_name": "ListInstancePartitionOperations", + "full_name": "google.spanner.admin.instance.v1.InstanceAdmin.ListInstancePartitionOperations", + "service": { + "short_name": "InstanceAdmin", + "full_name": "google.spanner.admin.instance.v1.InstanceAdmin" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "spanner_v1_generated_InstanceAdmin_MoveInstance_sync", + "title": "Snippet for the move_instance call in the InstanceAdmin service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#move_instance.", + "file": "instance_admin/move_instance.rb", + "language": "RUBY", + "client_method": { + "short_name": "move_instance", + "full_name": "::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#move_instance", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Spanner::Admin::Instance::V1::MoveInstanceRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "InstanceAdmin::Client", + "full_name": "::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client" + }, + "method": { + "short_name": "MoveInstance", + "full_name": "google.spanner.admin.instance.v1.InstanceAdmin.MoveInstance", + "service": { + "short_name": "InstanceAdmin", + "full_name": "google.spanner.admin.instance.v1.InstanceAdmin" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + } + ] +} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/test/google/cloud/spanner/admin/instance/v1/instance_admin_operations_test.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/test/google/cloud/spanner/admin/instance/v1/instance_admin_operations_test.rb new file mode 100644 index 000000000000..faf591bc6e13 --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/test/google/cloud/spanner/admin/instance/v1/instance_admin_operations_test.rb @@ -0,0 +1,400 @@ +# frozen_string_literal: true + +# Copyright 2025 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/admin/instance/v1/spanner_instance_admin_pb" +require "google/spanner/admin/instance/v1/spanner_instance_admin_services_pb" +require "google/cloud/spanner/admin/instance/v1/instance_admin" + +class ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::OperationsTest < 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_list_operations + # Create GRPC objects. + grpc_response = ::Google::Longrunning::ListOperationsResponse.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" + filter = "hello world" + page_size = 42 + page_token = "hello world" + return_partial_success = true + + list_operations_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_operations, name + assert_kind_of ::Google::Longrunning::ListOperationsRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["filter"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + assert_equal true, request["return_partial_success"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_operations_client_stub do + # Create client + client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success }) 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_operations name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success 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_operations ::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success) 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_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success }, 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_operations(::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success), 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_operations_client_stub.call_rpc_count + end + end + + def test_get_operation + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.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_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_operation, name + assert_kind_of ::Google::Longrunning::GetOperationRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_operation_client_stub do + # Create client + client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_operation({ name: name }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_operation name: name do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_operation ::Google::Longrunning::GetOperationRequest.new(name: name) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_operation({ name: name }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_operation(::Google::Longrunning::GetOperationRequest.new(name: name), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_operation_client_stub.call_rpc_count + end + end + + def test_delete_operation + # 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_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_operation, name + assert_kind_of ::Google::Longrunning::DeleteOperationRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_operation_client_stub do + # Create client + client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_operation({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_operation name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_operation ::Google::Longrunning::DeleteOperationRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_operation({ 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_operation(::Google::Longrunning::DeleteOperationRequest.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_operation_client_stub.call_rpc_count + end + end + + def test_cancel_operation + # 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" + + cancel_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :cancel_operation, name + assert_kind_of ::Google::Longrunning::CancelOperationRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, cancel_operation_client_stub do + # Create client + client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.cancel_operation({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.cancel_operation name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.cancel_operation ::Google::Longrunning::CancelOperationRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.cancel_operation({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.cancel_operation(::Google::Longrunning::CancelOperationRequest.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, cancel_operation_client_stub.call_rpc_count + end + end + + def test_wait_operation + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.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" + timeout = {} + + wait_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :wait_operation, name + assert_kind_of ::Google::Longrunning::WaitOperationRequest, request + assert_equal "hello world", request["name"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Duration), request["timeout"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, wait_operation_client_stub do + # Create client + client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.wait_operation({ name: name, timeout: timeout }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.wait_operation name: name, timeout: timeout do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.wait_operation ::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.wait_operation({ name: name, timeout: timeout }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.wait_operation(::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, wait_operation_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::Admin::Instance::V1::InstanceAdmin::Operations.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::Admin::Instance::V1::InstanceAdmin::Operations::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/test/google/cloud/spanner/admin/instance/v1/instance_admin_paths_test.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/test/google/cloud/spanner/admin/instance/v1/instance_admin_paths_test.rb new file mode 100644 index 000000000000..b1cfcaafa442 --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/test/google/cloud/spanner/admin/instance/v1/instance_admin_paths_test.rb @@ -0,0 +1,91 @@ +# frozen_string_literal: true + +# Copyright 2025 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/admin/instance/v1/instance_admin" + +class ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::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_instance_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::Admin::Instance::V1::InstanceAdmin::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.instance_path project: "value0", instance: "value1" + assert_equal "projects/value0/instances/value1", path + end + end + + def test_instance_config_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::Admin::Instance::V1::InstanceAdmin::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.instance_config_path project: "value0", instance_config: "value1" + assert_equal "projects/value0/instanceConfigs/value1", path + end + end + + def test_instance_partition_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::Admin::Instance::V1::InstanceAdmin::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.instance_partition_path project: "value0", instance: "value1", instance_partition: "value2" + assert_equal "projects/value0/instances/value1/instancePartitions/value2", path + end + end + + def test_project_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::Admin::Instance::V1::InstanceAdmin::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.project_path project: "value0" + assert_equal "projects/value0", path + end + end +end diff --git a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/test/google/cloud/spanner/admin/instance/v1/instance_admin_rest_test.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/test/google/cloud/spanner/admin/instance/v1/instance_admin_rest_test.rb new file mode 100644 index 000000000000..faaff8aaf29e --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/test/google/cloud/spanner/admin/instance/v1/instance_admin_rest_test.rb @@ -0,0 +1,1269 @@ +# frozen_string_literal: true + +# Copyright 2025 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/rest" +require "google/spanner/admin/instance/v1/spanner_instance_admin_pb" +require "google/cloud/spanner/admin/instance/v1/instance_admin/rest" + + +class ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::ClientTest < Minitest::Test + class ClientStub + attr_accessor :call_count, :requests + + def initialize response, &block + @response = response + @block = block + @call_count = 0 + @requests = [] + end + + def make_get_request uri:, params: {}, options: {}, method_name: nil + make_http_request :get, uri: uri, body: nil, params: params, options: options, method_name: method_name + end + + def make_delete_request uri:, params: {}, options: {}, method_name: nil + make_http_request :delete, uri: uri, body: nil, params: params, options: options, method_name: method_name + end + + def make_post_request uri:, body: nil, params: {}, options: {}, method_name: nil + make_http_request :post, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_patch_request uri:, body:, params: {}, options: {}, method_name: nil + make_http_request :patch, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_put_request uri:, body:, params: {}, options: {}, method_name: nil + make_http_request :put, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_http_request *args, **kwargs + @call_count += 1 + + @requests << @block&.call(*args, **kwargs) + + @response + 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_list_instance_configs + # Create test objects. + client_result = ::Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigsResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + page_size = 42 + page_token = "hello world" + + list_instance_configs_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::ServiceStub.stub :transcode_list_instance_configs_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_instance_configs_client_stub do + # Create client + client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_instance_configs({ parent: parent, page_size: page_size, page_token: page_token }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.list_instance_configs parent: parent, page_size: page_size, page_token: page_token do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.list_instance_configs ::Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigsRequest.new(parent: parent, page_size: page_size, page_token: page_token) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.list_instance_configs({ parent: parent, page_size: page_size, page_token: page_token }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.list_instance_configs(::Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigsRequest.new(parent: parent, page_size: page_size, page_token: page_token), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, list_instance_configs_client_stub.call_count + end + end + end + + def test_get_instance_config + # Create test objects. + client_result = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_instance_config_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::ServiceStub.stub :transcode_get_instance_config_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_instance_config_client_stub do + # Create client + client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_instance_config({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_instance_config name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_instance_config ::Google::Cloud::Spanner::Admin::Instance::V1::GetInstanceConfigRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_instance_config({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_instance_config(::Google::Cloud::Spanner::Admin::Instance::V1::GetInstanceConfigRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_instance_config_client_stub.call_count + end + end + end + + def test_create_instance_config + # Create test objects. + client_result = ::Google::Longrunning::Operation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + instance_config_id = "hello world" + instance_config = {} + validate_only = true + + create_instance_config_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::ServiceStub.stub :transcode_create_instance_config_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_instance_config_client_stub do + # Create client + client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_instance_config({ parent: parent, instance_config_id: instance_config_id, instance_config: instance_config, validate_only: validate_only }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_instance_config parent: parent, instance_config_id: instance_config_id, instance_config: instance_config, validate_only: validate_only do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_instance_config ::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstanceConfigRequest.new(parent: parent, instance_config_id: instance_config_id, instance_config: instance_config, validate_only: validate_only) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_instance_config({ parent: parent, instance_config_id: instance_config_id, instance_config: instance_config, validate_only: validate_only }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_instance_config(::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstanceConfigRequest.new(parent: parent, instance_config_id: instance_config_id, instance_config: instance_config, validate_only: validate_only), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_instance_config_client_stub.call_count + end + end + end + + def test_update_instance_config + # Create test objects. + client_result = ::Google::Longrunning::Operation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + instance_config = {} + update_mask = {} + validate_only = true + + update_instance_config_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::ServiceStub.stub :transcode_update_instance_config_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_instance_config_client_stub do + # Create client + client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_instance_config({ instance_config: instance_config, update_mask: update_mask, validate_only: validate_only }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_instance_config instance_config: instance_config, update_mask: update_mask, validate_only: validate_only do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_instance_config ::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstanceConfigRequest.new(instance_config: instance_config, update_mask: update_mask, validate_only: validate_only) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_instance_config({ instance_config: instance_config, update_mask: update_mask, validate_only: validate_only }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_instance_config(::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstanceConfigRequest.new(instance_config: instance_config, update_mask: update_mask, validate_only: validate_only), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_instance_config_client_stub.call_count + end + end + end + + def test_delete_instance_config + # Create test objects. + client_result = ::Google::Protobuf::Empty.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + etag = "hello world" + validate_only = true + + delete_instance_config_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::ServiceStub.stub :transcode_delete_instance_config_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_instance_config_client_stub do + # Create client + client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_instance_config({ name: name, etag: etag, validate_only: validate_only }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_instance_config name: name, etag: etag, validate_only: validate_only do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_instance_config ::Google::Cloud::Spanner::Admin::Instance::V1::DeleteInstanceConfigRequest.new(name: name, etag: etag, validate_only: validate_only) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_instance_config({ name: name, etag: etag, validate_only: validate_only }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_instance_config(::Google::Cloud::Spanner::Admin::Instance::V1::DeleteInstanceConfigRequest.new(name: name, etag: etag, validate_only: validate_only), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_instance_config_client_stub.call_count + end + end + end + + def test_list_instance_config_operations + # Create test objects. + client_result = ::Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigOperationsResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + filter = "hello world" + page_size = 42 + page_token = "hello world" + + list_instance_config_operations_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::ServiceStub.stub :transcode_list_instance_config_operations_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_instance_config_operations_client_stub do + # Create client + client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_instance_config_operations({ parent: parent, filter: filter, page_size: page_size, page_token: page_token }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.list_instance_config_operations parent: parent, filter: filter, page_size: page_size, page_token: page_token do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.list_instance_config_operations ::Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigOperationsRequest.new(parent: parent, filter: filter, page_size: page_size, page_token: page_token) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.list_instance_config_operations({ parent: parent, filter: filter, page_size: page_size, page_token: page_token }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.list_instance_config_operations(::Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigOperationsRequest.new(parent: parent, filter: filter, page_size: page_size, page_token: page_token), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, list_instance_config_operations_client_stub.call_count + end + end + end + + def test_list_instances + # Create test objects. + client_result = ::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancesResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + page_size = 42 + page_token = "hello world" + filter = "hello world" + instance_deadline = {} + + list_instances_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::ServiceStub.stub :transcode_list_instances_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_instances_client_stub do + # Create client + client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_instances({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, instance_deadline: instance_deadline }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.list_instances parent: parent, page_size: page_size, page_token: page_token, filter: filter, instance_deadline: instance_deadline do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.list_instances ::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancesRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, instance_deadline: instance_deadline) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.list_instances({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, instance_deadline: instance_deadline }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.list_instances(::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancesRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, instance_deadline: instance_deadline), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, list_instances_client_stub.call_count + end + end + end + + def test_list_instance_partitions + # Create test objects. + client_result = ::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionsResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + page_size = 42 + page_token = "hello world" + instance_partition_deadline = {} + + list_instance_partitions_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::ServiceStub.stub :transcode_list_instance_partitions_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_instance_partitions_client_stub do + # Create client + client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_instance_partitions({ parent: parent, page_size: page_size, page_token: page_token, instance_partition_deadline: instance_partition_deadline }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.list_instance_partitions parent: parent, page_size: page_size, page_token: page_token, instance_partition_deadline: instance_partition_deadline do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.list_instance_partitions ::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionsRequest.new(parent: parent, page_size: page_size, page_token: page_token, instance_partition_deadline: instance_partition_deadline) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.list_instance_partitions({ parent: parent, page_size: page_size, page_token: page_token, instance_partition_deadline: instance_partition_deadline }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.list_instance_partitions(::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionsRequest.new(parent: parent, page_size: page_size, page_token: page_token, instance_partition_deadline: instance_partition_deadline), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, list_instance_partitions_client_stub.call_count + end + end + end + + def test_get_instance + # Create test objects. + client_result = ::Google::Cloud::Spanner::Admin::Instance::V1::Instance.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + field_mask = {} + + get_instance_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::ServiceStub.stub :transcode_get_instance_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_instance_client_stub do + # Create client + client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_instance({ name: name, field_mask: field_mask }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_instance name: name, field_mask: field_mask do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_instance ::Google::Cloud::Spanner::Admin::Instance::V1::GetInstanceRequest.new(name: name, field_mask: field_mask) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_instance({ name: name, field_mask: field_mask }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_instance(::Google::Cloud::Spanner::Admin::Instance::V1::GetInstanceRequest.new(name: name, field_mask: field_mask), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_instance_client_stub.call_count + end + end + end + + def test_create_instance + # Create test objects. + client_result = ::Google::Longrunning::Operation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + instance_id = "hello world" + instance = {} + + create_instance_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::ServiceStub.stub :transcode_create_instance_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_instance_client_stub do + # Create client + client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_instance({ parent: parent, instance_id: instance_id, instance: instance }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_instance parent: parent, instance_id: instance_id, instance: instance do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_instance ::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstanceRequest.new(parent: parent, instance_id: instance_id, instance: instance) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_instance({ parent: parent, instance_id: instance_id, instance: instance }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_instance(::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstanceRequest.new(parent: parent, instance_id: instance_id, instance: instance), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_instance_client_stub.call_count + end + end + end + + def test_update_instance + # Create test objects. + client_result = ::Google::Longrunning::Operation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + instance = {} + field_mask = {} + + update_instance_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::ServiceStub.stub :transcode_update_instance_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_instance_client_stub do + # Create client + client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_instance({ instance: instance, field_mask: field_mask }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_instance instance: instance, field_mask: field_mask do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_instance ::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstanceRequest.new(instance: instance, field_mask: field_mask) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_instance({ instance: instance, field_mask: field_mask }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_instance(::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstanceRequest.new(instance: instance, field_mask: field_mask), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_instance_client_stub.call_count + end + end + end + + def test_delete_instance + # Create test objects. + client_result = ::Google::Protobuf::Empty.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + delete_instance_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::ServiceStub.stub :transcode_delete_instance_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_instance_client_stub do + # Create client + client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_instance({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_instance name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_instance ::Google::Cloud::Spanner::Admin::Instance::V1::DeleteInstanceRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_instance({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_instance(::Google::Cloud::Spanner::Admin::Instance::V1::DeleteInstanceRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_instance_client_stub.call_count + end + end + end + + def test_set_iam_policy + # Create test objects. + client_result = ::Google::Iam::V1::Policy.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + resource = "hello world" + policy = {} + update_mask = {} + + set_iam_policy_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::ServiceStub.stub :transcode_set_iam_policy_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, set_iam_policy_client_stub do + # Create client + client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.set_iam_policy({ resource: resource, policy: policy, update_mask: update_mask }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.set_iam_policy resource: resource, policy: policy, update_mask: update_mask do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.set_iam_policy ::Google::Iam::V1::SetIamPolicyRequest.new(resource: resource, policy: policy, update_mask: update_mask) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.set_iam_policy({ resource: resource, policy: policy, update_mask: update_mask }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.set_iam_policy(::Google::Iam::V1::SetIamPolicyRequest.new(resource: resource, policy: policy, update_mask: update_mask), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, set_iam_policy_client_stub.call_count + end + end + end + + def test_get_iam_policy + # Create test objects. + client_result = ::Google::Iam::V1::Policy.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + resource = "hello world" + options = {} + + get_iam_policy_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::ServiceStub.stub :transcode_get_iam_policy_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_iam_policy_client_stub do + # Create client + client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_iam_policy({ resource: resource, options: options }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_iam_policy resource: resource, options: options do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_iam_policy ::Google::Iam::V1::GetIamPolicyRequest.new(resource: resource, options: options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_iam_policy({ resource: resource, options: options }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_iam_policy(::Google::Iam::V1::GetIamPolicyRequest.new(resource: resource, options: options), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_iam_policy_client_stub.call_count + end + end + end + + def test_test_iam_permissions + # Create test objects. + client_result = ::Google::Iam::V1::TestIamPermissionsResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + resource = "hello world" + permissions = ["hello world"] + + test_iam_permissions_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::ServiceStub.stub :transcode_test_iam_permissions_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, test_iam_permissions_client_stub do + # Create client + client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.test_iam_permissions({ resource: resource, permissions: permissions }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.test_iam_permissions resource: resource, permissions: permissions do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.test_iam_permissions ::Google::Iam::V1::TestIamPermissionsRequest.new(resource: resource, permissions: permissions) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.test_iam_permissions({ resource: resource, permissions: permissions }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.test_iam_permissions(::Google::Iam::V1::TestIamPermissionsRequest.new(resource: resource, permissions: permissions), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, test_iam_permissions_client_stub.call_count + end + end + end + + def test_get_instance_partition + # Create test objects. + client_result = ::Google::Cloud::Spanner::Admin::Instance::V1::InstancePartition.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_instance_partition_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::ServiceStub.stub :transcode_get_instance_partition_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_instance_partition_client_stub do + # Create client + client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_instance_partition({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_instance_partition name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_instance_partition ::Google::Cloud::Spanner::Admin::Instance::V1::GetInstancePartitionRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_instance_partition({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_instance_partition(::Google::Cloud::Spanner::Admin::Instance::V1::GetInstancePartitionRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_instance_partition_client_stub.call_count + end + end + end + + def test_create_instance_partition + # Create test objects. + client_result = ::Google::Longrunning::Operation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + instance_partition_id = "hello world" + instance_partition = {} + + create_instance_partition_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::ServiceStub.stub :transcode_create_instance_partition_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_instance_partition_client_stub do + # Create client + client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_instance_partition({ parent: parent, instance_partition_id: instance_partition_id, instance_partition: instance_partition }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_instance_partition parent: parent, instance_partition_id: instance_partition_id, instance_partition: instance_partition do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_instance_partition ::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstancePartitionRequest.new(parent: parent, instance_partition_id: instance_partition_id, instance_partition: instance_partition) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_instance_partition({ parent: parent, instance_partition_id: instance_partition_id, instance_partition: instance_partition }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_instance_partition(::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstancePartitionRequest.new(parent: parent, instance_partition_id: instance_partition_id, instance_partition: instance_partition), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_instance_partition_client_stub.call_count + end + end + end + + def test_delete_instance_partition + # Create test objects. + client_result = ::Google::Protobuf::Empty.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + etag = "hello world" + + delete_instance_partition_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::ServiceStub.stub :transcode_delete_instance_partition_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_instance_partition_client_stub do + # Create client + client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_instance_partition({ name: name, etag: etag }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_instance_partition name: name, etag: etag do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_instance_partition ::Google::Cloud::Spanner::Admin::Instance::V1::DeleteInstancePartitionRequest.new(name: name, etag: etag) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_instance_partition({ name: name, etag: etag }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_instance_partition(::Google::Cloud::Spanner::Admin::Instance::V1::DeleteInstancePartitionRequest.new(name: name, etag: etag), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_instance_partition_client_stub.call_count + end + end + end + + def test_update_instance_partition + # Create test objects. + client_result = ::Google::Longrunning::Operation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + instance_partition = {} + field_mask = {} + + update_instance_partition_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::ServiceStub.stub :transcode_update_instance_partition_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_instance_partition_client_stub do + # Create client + client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_instance_partition({ instance_partition: instance_partition, field_mask: field_mask }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_instance_partition instance_partition: instance_partition, field_mask: field_mask do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_instance_partition ::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstancePartitionRequest.new(instance_partition: instance_partition, field_mask: field_mask) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_instance_partition({ instance_partition: instance_partition, field_mask: field_mask }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_instance_partition(::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstancePartitionRequest.new(instance_partition: instance_partition, field_mask: field_mask), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_instance_partition_client_stub.call_count + end + end + end + + def test_list_instance_partition_operations + # Create test objects. + client_result = ::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionOperationsResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + filter = "hello world" + page_size = 42 + page_token = "hello world" + instance_partition_deadline = {} + + list_instance_partition_operations_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::ServiceStub.stub :transcode_list_instance_partition_operations_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_instance_partition_operations_client_stub do + # Create client + client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_instance_partition_operations({ parent: parent, filter: filter, page_size: page_size, page_token: page_token, instance_partition_deadline: instance_partition_deadline }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.list_instance_partition_operations parent: parent, filter: filter, page_size: page_size, page_token: page_token, instance_partition_deadline: instance_partition_deadline do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.list_instance_partition_operations ::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionOperationsRequest.new(parent: parent, filter: filter, page_size: page_size, page_token: page_token, instance_partition_deadline: instance_partition_deadline) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.list_instance_partition_operations({ parent: parent, filter: filter, page_size: page_size, page_token: page_token, instance_partition_deadline: instance_partition_deadline }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.list_instance_partition_operations(::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionOperationsRequest.new(parent: parent, filter: filter, page_size: page_size, page_token: page_token, instance_partition_deadline: instance_partition_deadline), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, list_instance_partition_operations_client_stub.call_count + end + end + end + + def test_move_instance + # Create test objects. + client_result = ::Google::Longrunning::Operation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + target_config = "hello world" + + move_instance_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::ServiceStub.stub :transcode_move_instance_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, move_instance_client_stub do + # Create client + client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.move_instance({ name: name, target_config: target_config }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.move_instance name: name, target_config: target_config do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.move_instance ::Google::Cloud::Spanner::Admin::Instance::V1::MoveInstanceRequest.new(name: name, target_config: target_config) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.move_instance({ name: name, target_config: target_config }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.move_instance(::Google::Cloud::Spanner::Admin::Instance::V1::MoveInstanceRequest.new(name: name, target_config: target_config), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, move_instance_client_stub.call_count + end + end + end + + def test_configure + credentials_token = :dummy_value + + client = block_config = config = nil + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do + client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::Client.new do |config| + config.credentials = credentials_token + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/test/google/cloud/spanner/admin/instance/v1/instance_admin_test.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/test/google/cloud/spanner/admin/instance/v1/instance_admin_test.rb new file mode 100644 index 000000000000..7667c086ab44 --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/test/google/cloud/spanner/admin/instance/v1/instance_admin_test.rb @@ -0,0 +1,1468 @@ +# frozen_string_literal: true + +# Copyright 2025 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/admin/instance/v1/spanner_instance_admin_pb" +require "google/cloud/spanner/admin/instance/v1/instance_admin" + +class ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::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_list_instance_configs + # Create GRPC objects. + grpc_response = ::Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigsResponse.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. + parent = "hello world" + page_size = 42 + page_token = "hello world" + + list_instance_configs_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_instance_configs, name + assert_kind_of ::Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigsRequest, request + assert_equal "hello world", request["parent"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_instance_configs_client_stub do + # Create client + client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_instance_configs({ parent: parent, page_size: page_size, page_token: page_token }) 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_instance_configs parent: parent, page_size: page_size, page_token: page_token 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_instance_configs ::Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigsRequest.new(parent: parent, page_size: page_size, page_token: page_token) 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_instance_configs({ parent: parent, page_size: page_size, page_token: page_token }, 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_instance_configs(::Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigsRequest.new(parent: parent, page_size: page_size, page_token: page_token), 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_instance_configs_client_stub.call_rpc_count + end + end + + def test_get_instance_config + # Create GRPC objects. + grpc_response = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig.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_instance_config_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_instance_config, name + assert_kind_of ::Google::Cloud::Spanner::Admin::Instance::V1::GetInstanceConfigRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_instance_config_client_stub do + # Create client + client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_instance_config({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_instance_config name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_instance_config ::Google::Cloud::Spanner::Admin::Instance::V1::GetInstanceConfigRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_instance_config({ 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_instance_config(::Google::Cloud::Spanner::Admin::Instance::V1::GetInstanceConfigRequest.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_instance_config_client_stub.call_rpc_count + end + end + + def test_create_instance_config + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.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. + parent = "hello world" + instance_config_id = "hello world" + instance_config = {} + validate_only = true + + create_instance_config_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_instance_config, name + assert_kind_of ::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstanceConfigRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["instance_config_id"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig), request["instance_config"] + assert_equal true, request["validate_only"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_instance_config_client_stub do + # Create client + client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_instance_config({ parent: parent, instance_config_id: instance_config_id, instance_config: instance_config, validate_only: validate_only }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.create_instance_config parent: parent, instance_config_id: instance_config_id, instance_config: instance_config, validate_only: validate_only do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.create_instance_config ::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstanceConfigRequest.new(parent: parent, instance_config_id: instance_config_id, instance_config: instance_config, validate_only: validate_only) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.create_instance_config({ parent: parent, instance_config_id: instance_config_id, instance_config: instance_config, validate_only: validate_only }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.create_instance_config(::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstanceConfigRequest.new(parent: parent, instance_config_id: instance_config_id, instance_config: instance_config, validate_only: validate_only), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, create_instance_config_client_stub.call_rpc_count + end + end + + def test_update_instance_config + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.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. + instance_config = {} + update_mask = {} + validate_only = true + + update_instance_config_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_instance_config, name + assert_kind_of ::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstanceConfigRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig), request["instance_config"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + assert_equal true, request["validate_only"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_instance_config_client_stub do + # Create client + client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_instance_config({ instance_config: instance_config, update_mask: update_mask, validate_only: validate_only }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.update_instance_config instance_config: instance_config, update_mask: update_mask, validate_only: validate_only do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.update_instance_config ::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstanceConfigRequest.new(instance_config: instance_config, update_mask: update_mask, validate_only: validate_only) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.update_instance_config({ instance_config: instance_config, update_mask: update_mask, validate_only: validate_only }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.update_instance_config(::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstanceConfigRequest.new(instance_config: instance_config, update_mask: update_mask, validate_only: validate_only), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, update_instance_config_client_stub.call_rpc_count + end + end + + def test_delete_instance_config + # 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" + etag = "hello world" + validate_only = true + + delete_instance_config_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_instance_config, name + assert_kind_of ::Google::Cloud::Spanner::Admin::Instance::V1::DeleteInstanceConfigRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["etag"] + assert_equal true, request["validate_only"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_instance_config_client_stub do + # Create client + client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_instance_config({ name: name, etag: etag, validate_only: validate_only }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_instance_config name: name, etag: etag, validate_only: validate_only do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_instance_config ::Google::Cloud::Spanner::Admin::Instance::V1::DeleteInstanceConfigRequest.new(name: name, etag: etag, validate_only: validate_only) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_instance_config({ name: name, etag: etag, validate_only: validate_only }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.delete_instance_config(::Google::Cloud::Spanner::Admin::Instance::V1::DeleteInstanceConfigRequest.new(name: name, etag: etag, validate_only: validate_only), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, delete_instance_config_client_stub.call_rpc_count + end + end + + def test_list_instance_config_operations + # Create GRPC objects. + grpc_response = ::Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigOperationsResponse.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. + parent = "hello world" + filter = "hello world" + page_size = 42 + page_token = "hello world" + + list_instance_config_operations_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_instance_config_operations, name + assert_kind_of ::Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigOperationsRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["filter"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_instance_config_operations_client_stub do + # Create client + client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_instance_config_operations({ parent: parent, filter: filter, page_size: page_size, page_token: page_token }) 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_instance_config_operations parent: parent, filter: filter, page_size: page_size, page_token: page_token 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_instance_config_operations ::Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigOperationsRequest.new(parent: parent, filter: filter, page_size: page_size, page_token: page_token) 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_instance_config_operations({ parent: parent, filter: filter, page_size: page_size, page_token: page_token }, 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_instance_config_operations(::Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigOperationsRequest.new(parent: parent, filter: filter, page_size: page_size, page_token: page_token), 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_instance_config_operations_client_stub.call_rpc_count + end + end + + def test_list_instances + # Create GRPC objects. + grpc_response = ::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancesResponse.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. + parent = "hello world" + page_size = 42 + page_token = "hello world" + filter = "hello world" + instance_deadline = {} + + list_instances_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_instances, name + assert_kind_of ::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancesRequest, request + assert_equal "hello world", request["parent"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + assert_equal "hello world", request["filter"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Timestamp), request["instance_deadline"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_instances_client_stub do + # Create client + client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_instances({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, instance_deadline: instance_deadline }) 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_instances parent: parent, page_size: page_size, page_token: page_token, filter: filter, instance_deadline: instance_deadline 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_instances ::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancesRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, instance_deadline: instance_deadline) 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_instances({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, instance_deadline: instance_deadline }, 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_instances(::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancesRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, instance_deadline: instance_deadline), 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_instances_client_stub.call_rpc_count + end + end + + def test_list_instance_partitions + # Create GRPC objects. + grpc_response = ::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionsResponse.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. + parent = "hello world" + page_size = 42 + page_token = "hello world" + instance_partition_deadline = {} + + list_instance_partitions_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_instance_partitions, name + assert_kind_of ::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionsRequest, request + assert_equal "hello world", request["parent"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Timestamp), request["instance_partition_deadline"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_instance_partitions_client_stub do + # Create client + client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_instance_partitions({ parent: parent, page_size: page_size, page_token: page_token, instance_partition_deadline: instance_partition_deadline }) 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_instance_partitions parent: parent, page_size: page_size, page_token: page_token, instance_partition_deadline: instance_partition_deadline 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_instance_partitions ::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionsRequest.new(parent: parent, page_size: page_size, page_token: page_token, instance_partition_deadline: instance_partition_deadline) 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_instance_partitions({ parent: parent, page_size: page_size, page_token: page_token, instance_partition_deadline: instance_partition_deadline }, 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_instance_partitions(::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionsRequest.new(parent: parent, page_size: page_size, page_token: page_token, instance_partition_deadline: instance_partition_deadline), 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_instance_partitions_client_stub.call_rpc_count + end + end + + def test_get_instance + # Create GRPC objects. + grpc_response = ::Google::Cloud::Spanner::Admin::Instance::V1::Instance.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" + field_mask = {} + + get_instance_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_instance, name + assert_kind_of ::Google::Cloud::Spanner::Admin::Instance::V1::GetInstanceRequest, request + assert_equal "hello world", request["name"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["field_mask"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_instance_client_stub do + # Create client + client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_instance({ name: name, field_mask: field_mask }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_instance name: name, field_mask: field_mask do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_instance ::Google::Cloud::Spanner::Admin::Instance::V1::GetInstanceRequest.new(name: name, field_mask: field_mask) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_instance({ name: name, field_mask: field_mask }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_instance(::Google::Cloud::Spanner::Admin::Instance::V1::GetInstanceRequest.new(name: name, field_mask: field_mask), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_instance_client_stub.call_rpc_count + end + end + + def test_create_instance + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.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. + parent = "hello world" + instance_id = "hello world" + instance = {} + + create_instance_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_instance, name + assert_kind_of ::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstanceRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["instance_id"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Spanner::Admin::Instance::V1::Instance), request["instance"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_instance_client_stub do + # Create client + client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_instance({ parent: parent, instance_id: instance_id, instance: instance }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.create_instance parent: parent, instance_id: instance_id, instance: instance do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.create_instance ::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstanceRequest.new(parent: parent, instance_id: instance_id, instance: instance) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.create_instance({ parent: parent, instance_id: instance_id, instance: instance }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.create_instance(::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstanceRequest.new(parent: parent, instance_id: instance_id, instance: instance), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, create_instance_client_stub.call_rpc_count + end + end + + def test_update_instance + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.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. + instance = {} + field_mask = {} + + update_instance_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_instance, name + assert_kind_of ::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstanceRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Spanner::Admin::Instance::V1::Instance), request["instance"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["field_mask"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_instance_client_stub do + # Create client + client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_instance({ instance: instance, field_mask: field_mask }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.update_instance instance: instance, field_mask: field_mask do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.update_instance ::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstanceRequest.new(instance: instance, field_mask: field_mask) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.update_instance({ instance: instance, field_mask: field_mask }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.update_instance(::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstanceRequest.new(instance: instance, field_mask: field_mask), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, update_instance_client_stub.call_rpc_count + end + end + + def test_delete_instance + # 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_instance_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_instance, name + assert_kind_of ::Google::Cloud::Spanner::Admin::Instance::V1::DeleteInstanceRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_instance_client_stub do + # Create client + client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_instance({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_instance name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_instance ::Google::Cloud::Spanner::Admin::Instance::V1::DeleteInstanceRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_instance({ 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_instance(::Google::Cloud::Spanner::Admin::Instance::V1::DeleteInstanceRequest.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_instance_client_stub.call_rpc_count + end + end + + def test_set_iam_policy + # Create GRPC objects. + grpc_response = ::Google::Iam::V1::Policy.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. + resource = "hello world" + policy = {} + update_mask = {} + + set_iam_policy_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :set_iam_policy, name + assert_kind_of ::Google::Iam::V1::SetIamPolicyRequest, request + assert_equal "hello world", request["resource"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Iam::V1::Policy), request["policy"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, set_iam_policy_client_stub do + # Create client + client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.set_iam_policy({ resource: resource, policy: policy, update_mask: update_mask }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.set_iam_policy resource: resource, policy: policy, update_mask: update_mask do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.set_iam_policy ::Google::Iam::V1::SetIamPolicyRequest.new(resource: resource, policy: policy, update_mask: update_mask) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.set_iam_policy({ resource: resource, policy: policy, update_mask: update_mask }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.set_iam_policy(::Google::Iam::V1::SetIamPolicyRequest.new(resource: resource, policy: policy, update_mask: update_mask), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, set_iam_policy_client_stub.call_rpc_count + end + end + + def test_get_iam_policy + # Create GRPC objects. + grpc_response = ::Google::Iam::V1::Policy.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. + resource = "hello world" + options = {} + + get_iam_policy_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_iam_policy, name + assert_kind_of ::Google::Iam::V1::GetIamPolicyRequest, request + assert_equal "hello world", request["resource"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Iam::V1::GetPolicyOptions), request["options"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_iam_policy_client_stub do + # Create client + client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_iam_policy({ resource: resource, options: options }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_iam_policy resource: resource, options: options do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_iam_policy ::Google::Iam::V1::GetIamPolicyRequest.new(resource: resource, options: options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_iam_policy({ resource: resource, options: options }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_iam_policy(::Google::Iam::V1::GetIamPolicyRequest.new(resource: resource, options: options), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_iam_policy_client_stub.call_rpc_count + end + end + + def test_test_iam_permissions + # Create GRPC objects. + grpc_response = ::Google::Iam::V1::TestIamPermissionsResponse.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. + resource = "hello world" + permissions = ["hello world"] + + test_iam_permissions_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :test_iam_permissions, name + assert_kind_of ::Google::Iam::V1::TestIamPermissionsRequest, request + assert_equal "hello world", request["resource"] + assert_equal ["hello world"], request["permissions"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, test_iam_permissions_client_stub do + # Create client + client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.test_iam_permissions({ resource: resource, permissions: permissions }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.test_iam_permissions resource: resource, permissions: permissions do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.test_iam_permissions ::Google::Iam::V1::TestIamPermissionsRequest.new(resource: resource, permissions: permissions) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.test_iam_permissions({ resource: resource, permissions: permissions }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.test_iam_permissions(::Google::Iam::V1::TestIamPermissionsRequest.new(resource: resource, permissions: permissions), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, test_iam_permissions_client_stub.call_rpc_count + end + end + + def test_get_instance_partition + # Create GRPC objects. + grpc_response = ::Google::Cloud::Spanner::Admin::Instance::V1::InstancePartition.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_instance_partition_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_instance_partition, name + assert_kind_of ::Google::Cloud::Spanner::Admin::Instance::V1::GetInstancePartitionRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_instance_partition_client_stub do + # Create client + client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_instance_partition({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_instance_partition name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_instance_partition ::Google::Cloud::Spanner::Admin::Instance::V1::GetInstancePartitionRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_instance_partition({ 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_instance_partition(::Google::Cloud::Spanner::Admin::Instance::V1::GetInstancePartitionRequest.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_instance_partition_client_stub.call_rpc_count + end + end + + def test_create_instance_partition + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.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. + parent = "hello world" + instance_partition_id = "hello world" + instance_partition = {} + + create_instance_partition_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_instance_partition, name + assert_kind_of ::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstancePartitionRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["instance_partition_id"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Spanner::Admin::Instance::V1::InstancePartition), request["instance_partition"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_instance_partition_client_stub do + # Create client + client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_instance_partition({ parent: parent, instance_partition_id: instance_partition_id, instance_partition: instance_partition }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.create_instance_partition parent: parent, instance_partition_id: instance_partition_id, instance_partition: instance_partition do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.create_instance_partition ::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstancePartitionRequest.new(parent: parent, instance_partition_id: instance_partition_id, instance_partition: instance_partition) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.create_instance_partition({ parent: parent, instance_partition_id: instance_partition_id, instance_partition: instance_partition }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.create_instance_partition(::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstancePartitionRequest.new(parent: parent, instance_partition_id: instance_partition_id, instance_partition: instance_partition), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, create_instance_partition_client_stub.call_rpc_count + end + end + + def test_delete_instance_partition + # 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" + etag = "hello world" + + delete_instance_partition_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_instance_partition, name + assert_kind_of ::Google::Cloud::Spanner::Admin::Instance::V1::DeleteInstancePartitionRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["etag"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_instance_partition_client_stub do + # Create client + client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_instance_partition({ name: name, etag: etag }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_instance_partition name: name, etag: etag do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_instance_partition ::Google::Cloud::Spanner::Admin::Instance::V1::DeleteInstancePartitionRequest.new(name: name, etag: etag) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_instance_partition({ name: name, etag: etag }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.delete_instance_partition(::Google::Cloud::Spanner::Admin::Instance::V1::DeleteInstancePartitionRequest.new(name: name, etag: etag), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, delete_instance_partition_client_stub.call_rpc_count + end + end + + def test_update_instance_partition + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.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. + instance_partition = {} + field_mask = {} + + update_instance_partition_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_instance_partition, name + assert_kind_of ::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstancePartitionRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Spanner::Admin::Instance::V1::InstancePartition), request["instance_partition"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["field_mask"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_instance_partition_client_stub do + # Create client + client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_instance_partition({ instance_partition: instance_partition, field_mask: field_mask }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.update_instance_partition instance_partition: instance_partition, field_mask: field_mask do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.update_instance_partition ::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstancePartitionRequest.new(instance_partition: instance_partition, field_mask: field_mask) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.update_instance_partition({ instance_partition: instance_partition, field_mask: field_mask }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.update_instance_partition(::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstancePartitionRequest.new(instance_partition: instance_partition, field_mask: field_mask), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, update_instance_partition_client_stub.call_rpc_count + end + end + + def test_list_instance_partition_operations + # Create GRPC objects. + grpc_response = ::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionOperationsResponse.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. + parent = "hello world" + filter = "hello world" + page_size = 42 + page_token = "hello world" + instance_partition_deadline = {} + + list_instance_partition_operations_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_instance_partition_operations, name + assert_kind_of ::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionOperationsRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["filter"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Timestamp), request["instance_partition_deadline"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_instance_partition_operations_client_stub do + # Create client + client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_instance_partition_operations({ parent: parent, filter: filter, page_size: page_size, page_token: page_token, instance_partition_deadline: instance_partition_deadline }) 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_instance_partition_operations parent: parent, filter: filter, page_size: page_size, page_token: page_token, instance_partition_deadline: instance_partition_deadline 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_instance_partition_operations ::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionOperationsRequest.new(parent: parent, filter: filter, page_size: page_size, page_token: page_token, instance_partition_deadline: instance_partition_deadline) 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_instance_partition_operations({ parent: parent, filter: filter, page_size: page_size, page_token: page_token, instance_partition_deadline: instance_partition_deadline }, 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_instance_partition_operations(::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionOperationsRequest.new(parent: parent, filter: filter, page_size: page_size, page_token: page_token, instance_partition_deadline: instance_partition_deadline), 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_instance_partition_operations_client_stub.call_rpc_count + end + end + + def test_move_instance + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.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" + target_config = "hello world" + + move_instance_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :move_instance, name + assert_kind_of ::Google::Cloud::Spanner::Admin::Instance::V1::MoveInstanceRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["target_config"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, move_instance_client_stub do + # Create client + client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.move_instance({ name: name, target_config: target_config }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.move_instance name: name, target_config: target_config do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.move_instance ::Google::Cloud::Spanner::Admin::Instance::V1::MoveInstanceRequest.new(name: name, target_config: target_config) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.move_instance({ name: name, target_config: target_config }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.move_instance(::Google::Cloud::Spanner::Admin::Instance::V1::MoveInstanceRequest.new(name: name, target_config: target_config), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, move_instance_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::Admin::Instance::V1::InstanceAdmin::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::Admin::Instance::V1::InstanceAdmin::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::Admin::Instance::V1::InstanceAdmin::Client.new do |config| + config.credentials = creds + end + assert_kind_of ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client, client + assert_equal creds, client.configure.credentials + end + end + + def test_operations_client + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = nil + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new do |config| + config.credentials = grpc_channel + end + end + + assert_kind_of ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Operations, client.operations_client + end +end diff --git a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/test/helper.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/test/helper.rb new file mode 100644 index 000000000000..968201e8049d --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/test/helper.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true + +# Copyright 2025 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 4632a0766c33025b9b49ea9502c316fc4effdd49 Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Wed, 17 Dec 2025 21:21:58 +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 --- .../instance/v1/spanner_instance_admin_pb.rb | 2 +- .../instance/v1/spanner_instance_admin.rb | 67 +- .../.gitignore | 22 - .../.repo-metadata.json | 18 - .../.rubocop.yml | 33 - .../.toys.rb | 28 - .../.yardopts | 12 - .../AUTHENTICATION.md | 122 - .../CHANGELOG.md | 2 - .../Gemfile | 11 - .../LICENSE.md | 201 -- .../README.md | 153 - .../Rakefile | 169 - .../gapic_metadata.json | 123 - ...le-cloud-spanner-admin-instance-v1.gemspec | 29 - .../google-cloud-spanner-admin-instance-v1.rb | 21 - .../google/cloud/spanner/admin/instance/v1.rb | 49 - .../admin/instance/v1/instance_admin.rb | 80 - .../instance/v1/instance_admin/client.rb | 3140 ----------------- .../instance/v1/instance_admin/credentials.rb | 56 - .../instance/v1/instance_admin/operations.rb | 845 ----- .../admin/instance/v1/instance_admin/paths.rb | 104 - .../admin/instance/v1/instance_admin/rest.rb | 77 - .../instance/v1/instance_admin/rest/client.rb | 2948 ---------------- .../v1/instance_admin/rest/operations.rb | 1068 ------ .../v1/instance_admin/rest/service_stub.rb | 1376 -------- .../cloud/spanner/admin/instance/v1/rest.rb | 41 - .../spanner/admin/instance/v1/version.rb | 32 - .../spanner/admin/instance/v1/common_pb.rb | 53 - .../instance/v1/spanner_instance_admin_pb.rb | 114 - .../v1/spanner_instance_admin_services_pb.rb | 463 --- .../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/iam/v1/iam_policy.rb | 87 - .../proto_docs/google/iam/v1/options.rb | 50 - .../proto_docs/google/iam/v1/policy.rb | 426 --- .../google/longrunning/operations.rb | 191 - .../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/field_mask.rb | 229 -- .../proto_docs/google/protobuf/timestamp.rb | 127 - .../proto_docs/google/rpc/status.rb | 48 - .../spanner/admin/instance/v1/common.rb | 71 - .../instance/v1/spanner_instance_admin.rb | 1561 -------- .../proto_docs/google/type/expr.rb | 75 - .../snippets/Gemfile | 32 - .../instance_admin/create_instance.rb | 54 - .../instance_admin/create_instance_config.rb | 54 - .../create_instance_partition.rb | 54 - .../instance_admin/delete_instance.rb | 47 - .../instance_admin/delete_instance_config.rb | 47 - .../delete_instance_partition.rb | 47 - .../snippets/instance_admin/get_iam_policy.rb | 47 - .../snippets/instance_admin/get_instance.rb | 47 - .../instance_admin/get_instance_config.rb | 47 - .../instance_admin/get_instance_partition.rb | 47 - .../list_instance_config_operations.rb | 51 - .../instance_admin/list_instance_configs.rb | 51 - .../list_instance_partition_operations.rb | 51 - .../list_instance_partitions.rb | 51 - .../snippets/instance_admin/list_instances.rb | 51 - .../snippets/instance_admin/move_instance.rb | 54 - .../snippets/instance_admin/set_iam_policy.rb | 47 - .../instance_admin/test_iam_permissions.rb | 47 - .../instance_admin/update_instance.rb | 54 - .../instance_admin/update_instance_config.rb | 54 - .../update_instance_partition.rb | 54 - ...data_google.spanner.admin.instance.v1.json | 855 ----- .../v1/instance_admin_operations_test.rb | 400 --- .../instance/v1/instance_admin_paths_test.rb | 91 - .../instance/v1/instance_admin_rest_test.rb | 1269 ------- .../admin/instance/v1/instance_admin_test.rb | 1468 -------- .../test/helper.rb | 25 - 77 files changed, 66 insertions(+), 20591 deletions(-) delete mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/.gitignore delete mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/.repo-metadata.json delete mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/.rubocop.yml delete mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/.toys.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/.yardopts delete mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/AUTHENTICATION.md delete mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/CHANGELOG.md delete mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/Gemfile delete mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/LICENSE.md delete mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/README.md delete mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/Rakefile delete mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/gapic_metadata.json delete mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/google-cloud-spanner-admin-instance-v1.gemspec delete mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google-cloud-spanner-admin-instance-v1.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google/cloud/spanner/admin/instance/v1.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google/cloud/spanner/admin/instance/v1/instance_admin.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google/cloud/spanner/admin/instance/v1/instance_admin/client.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google/cloud/spanner/admin/instance/v1/instance_admin/credentials.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google/cloud/spanner/admin/instance/v1/instance_admin/operations.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google/cloud/spanner/admin/instance/v1/instance_admin/paths.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google/cloud/spanner/admin/instance/v1/instance_admin/rest.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google/cloud/spanner/admin/instance/v1/instance_admin/rest/client.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google/cloud/spanner/admin/instance/v1/instance_admin/rest/operations.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google/cloud/spanner/admin/instance/v1/instance_admin/rest/service_stub.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google/cloud/spanner/admin/instance/v1/rest.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google/cloud/spanner/admin/instance/v1/version.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google/spanner/admin/instance/v1/common_pb.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google/spanner/admin/instance/v1/spanner_instance_admin_pb.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google/spanner/admin/instance/v1/spanner_instance_admin_services_pb.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/proto_docs/README.md delete mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/proto_docs/google/api/client.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/proto_docs/google/api/field_behavior.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/proto_docs/google/api/launch_stage.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/proto_docs/google/api/resource.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/proto_docs/google/iam/v1/iam_policy.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/proto_docs/google/iam/v1/options.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/proto_docs/google/iam/v1/policy.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/proto_docs/google/longrunning/operations.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/proto_docs/google/protobuf/any.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/proto_docs/google/protobuf/duration.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/proto_docs/google/protobuf/empty.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/proto_docs/google/protobuf/field_mask.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/proto_docs/google/protobuf/timestamp.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/proto_docs/google/rpc/status.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/proto_docs/google/spanner/admin/instance/v1/common.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/proto_docs/google/spanner/admin/instance/v1/spanner_instance_admin.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/proto_docs/google/type/expr.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/Gemfile delete mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/create_instance.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/create_instance_config.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/create_instance_partition.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/delete_instance.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/delete_instance_config.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/delete_instance_partition.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/get_iam_policy.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/get_instance.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/get_instance_config.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/get_instance_partition.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/list_instance_config_operations.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/list_instance_configs.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/list_instance_partition_operations.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/list_instance_partitions.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/list_instances.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/move_instance.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/set_iam_policy.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/test_iam_permissions.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/update_instance.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/update_instance_config.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/update_instance_partition.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/snippet_metadata_google.spanner.admin.instance.v1.json delete mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/test/google/cloud/spanner/admin/instance/v1/instance_admin_operations_test.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/test/google/cloud/spanner/admin/instance/v1/instance_admin_paths_test.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/test/google/cloud/spanner/admin/instance/v1/instance_admin_rest_test.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/test/google/cloud/spanner/admin/instance/v1/instance_admin_test.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/test/helper.rb diff --git a/google-cloud-spanner-admin-instance-v1/lib/google/spanner/admin/instance/v1/spanner_instance_admin_pb.rb b/google-cloud-spanner-admin-instance-v1/lib/google/spanner/admin/instance/v1/spanner_instance_admin_pb.rb index 0283b6d94a29..ec466e66d795 100644 --- a/google-cloud-spanner-admin-instance-v1/lib/google/spanner/admin/instance/v1/spanner_instance_admin_pb.rb +++ b/google-cloud-spanner-admin-instance-v1/lib/google/spanner/admin/instance/v1/spanner_instance_admin_pb.rb @@ -17,7 +17,7 @@ require 'google/spanner/admin/instance/v1/common_pb' -descriptor_data = "\n=google/spanner/admin/instance/v1/spanner_instance_admin.proto\x12 google.spanner.admin.instance.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x1egoogle/iam/v1/iam_policy.proto\x1a\x1agoogle/iam/v1/policy.proto\x1a#google/longrunning/operations.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a-google/spanner/admin/instance/v1/common.proto\"\xda\x01\n\x0bReplicaInfo\x12\x10\n\x08location\x18\x01 \x01(\t\x12G\n\x04type\x18\x02 \x01(\x0e\x32\x39.google.spanner.admin.instance.v1.ReplicaInfo.ReplicaType\x12\x1f\n\x17\x64\x65\x66\x61ult_leader_location\x18\x03 \x01(\x08\"O\n\x0bReplicaType\x12\x14\n\x10TYPE_UNSPECIFIED\x10\x00\x12\x0e\n\nREAD_WRITE\x10\x01\x12\r\n\tREAD_ONLY\x10\x02\x12\x0b\n\x07WITNESS\x10\x03\"\xc0\n\n\x0eInstanceConfig\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x14\n\x0c\x64isplay_name\x18\x02 \x01(\t\x12O\n\x0b\x63onfig_type\x18\x05 \x01(\x0e\x32\x35.google.spanner.admin.instance.v1.InstanceConfig.TypeB\x03\xe0\x41\x03\x12?\n\x08replicas\x18\x03 \x03(\x0b\x32-.google.spanner.admin.instance.v1.ReplicaInfo\x12M\n\x11optional_replicas\x18\x06 \x03(\x0b\x32-.google.spanner.admin.instance.v1.ReplicaInfoB\x03\xe0\x41\x03\x12?\n\x0b\x62\x61se_config\x18\x07 \x01(\tB*\xfa\x41\'\n%spanner.googleapis.com/InstanceConfig\x12L\n\x06labels\x18\x08 \x03(\x0b\x32<.google.spanner.admin.instance.v1.InstanceConfig.LabelsEntry\x12\x0c\n\x04\x65tag\x18\t \x01(\t\x12\x16\n\x0eleader_options\x18\x04 \x03(\t\x12\x18\n\x0breconciling\x18\n \x01(\x08\x42\x03\xe0\x41\x03\x12J\n\x05state\x18\x0b \x01(\x0e\x32\x36.google.spanner.admin.instance.v1.InstanceConfig.StateB\x03\xe0\x41\x03\x12r\n\x1a\x66ree_instance_availability\x18\x0c \x01(\x0e\x32I.google.spanner.admin.instance.v1.InstanceConfig.FreeInstanceAvailabilityB\x03\xe0\x41\x03\x12U\n\x0bquorum_type\x18\x12 \x01(\x0e\x32;.google.spanner.admin.instance.v1.InstanceConfig.QuorumTypeB\x03\xe0\x41\x03\x12.\n!storage_limit_per_processing_unit\x18\x13 \x01(\x03\x42\x03\xe0\x41\x03\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"B\n\x04Type\x12\x14\n\x10TYPE_UNSPECIFIED\x10\x00\x12\x12\n\x0eGOOGLE_MANAGED\x10\x01\x12\x10\n\x0cUSER_MANAGED\x10\x02\"7\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0c\n\x08\x43REATING\x10\x01\x12\t\n\x05READY\x10\x02\"\x88\x01\n\x18\x46reeInstanceAvailability\x12*\n&FREE_INSTANCE_AVAILABILITY_UNSPECIFIED\x10\x00\x12\r\n\tAVAILABLE\x10\x01\x12\x0f\n\x0bUNSUPPORTED\x10\x02\x12\x0c\n\x08\x44ISABLED\x10\x03\x12\x12\n\x0eQUOTA_EXCEEDED\x10\x04\"X\n\nQuorumType\x12\x1b\n\x17QUORUM_TYPE_UNSPECIFIED\x10\x00\x12\n\n\x06REGION\x10\x01\x12\x0f\n\x0b\x44UAL_REGION\x10\x02\x12\x10\n\x0cMULTI_REGION\x10\x03:\x81\x01\xea\x41~\n%spanner.googleapis.com/InstanceConfig\x12\x34projects/{project}/instanceConfigs/{instance_config}*\x0finstanceConfigs2\x0einstanceConfig\"\xb2\x01\n\x16ReplicaComputeCapacity\x12R\n\x11replica_selection\x18\x01 \x01(\x0b\x32\x32.google.spanner.admin.instance.v1.ReplicaSelectionB\x03\xe0\x41\x02\x12\x14\n\nnode_count\x18\x02 \x01(\x05H\x00\x12\x1a\n\x10processing_units\x18\x03 \x01(\x05H\x00\x42\x12\n\x10\x63ompute_capacity\"\xb8\x08\n\x11\x41utoscalingConfig\x12\x66\n\x12\x61utoscaling_limits\x18\x01 \x01(\x0b\x32\x45.google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimitsB\x03\xe0\x41\x02\x12h\n\x13\x61utoscaling_targets\x18\x02 \x01(\x0b\x32\x46.google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingTargetsB\x03\xe0\x41\x02\x12|\n\x1e\x61symmetric_autoscaling_options\x18\x03 \x03(\x0b\x32O.google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOptionB\x03\xe0\x41\x01\x1a\x97\x01\n\x11\x41utoscalingLimits\x12\x13\n\tmin_nodes\x18\x01 \x01(\x05H\x00\x12\x1e\n\x14min_processing_units\x18\x02 \x01(\x05H\x00\x12\x13\n\tmax_nodes\x18\x03 \x01(\x05H\x01\x12\x1e\n\x14max_processing_units\x18\x04 \x01(\x05H\x01\x42\x0b\n\tmin_limitB\x0b\n\tmax_limit\x1ar\n\x12\x41utoscalingTargets\x12\x32\n%high_priority_cpu_utilization_percent\x18\x01 \x01(\x05\x42\x03\xe0\x41\x02\x12(\n\x1bstorage_utilization_percent\x18\x02 \x01(\x05\x42\x03\xe0\x41\x02\x1a\xc4\x03\n\x1b\x41symmetricAutoscalingOption\x12R\n\x11replica_selection\x18\x01 \x01(\x0b\x32\x32.google.spanner.admin.instance.v1.ReplicaSelectionB\x03\xe0\x41\x02\x12\x82\x01\n\toverrides\x18\x02 \x01(\x0b\x32j.google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.AutoscalingConfigOverridesB\x03\xe0\x41\x01\x1a\xcb\x01\n\x1a\x41utoscalingConfigOverrides\x12\x66\n\x12\x61utoscaling_limits\x18\x01 \x01(\x0b\x32\x45.google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimitsB\x03\xe0\x41\x01\x12\x45\n8autoscaling_target_high_priority_cpu_utilization_percent\x18\x02 \x01(\x05\x42\x03\xe0\x41\x01\"\xaa\x0b\n\x08Instance\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12=\n\x06\x63onfig\x18\x02 \x01(\tB-\xe0\x41\x02\xfa\x41\'\n%spanner.googleapis.com/InstanceConfig\x12\x19\n\x0c\x64isplay_name\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12\x12\n\nnode_count\x18\x05 \x01(\x05\x12\x18\n\x10processing_units\x18\t \x01(\x05\x12_\n\x18replica_compute_capacity\x18\x13 \x03(\x0b\x32\x38.google.spanner.admin.instance.v1.ReplicaComputeCapacityB\x03\xe0\x41\x03\x12T\n\x12\x61utoscaling_config\x18\x11 \x01(\x0b\x32\x33.google.spanner.admin.instance.v1.AutoscalingConfigB\x03\xe0\x41\x01\x12\x44\n\x05state\x18\x06 \x01(\x0e\x32\x30.google.spanner.admin.instance.v1.Instance.StateB\x03\xe0\x41\x03\x12\x46\n\x06labels\x18\x07 \x03(\x0b\x32\x36.google.spanner.admin.instance.v1.Instance.LabelsEntry\x12N\n\rinstance_type\x18\n \x01(\x0e\x32\x37.google.spanner.admin.instance.v1.Instance.InstanceType\x12\x15\n\rendpoint_uris\x18\x08 \x03(\t\x12\x34\n\x0b\x63reate_time\x18\x0b \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x0c \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12V\n\x16\x66ree_instance_metadata\x18\r \x01(\x0b\x32\x36.google.spanner.admin.instance.v1.FreeInstanceMetadata\x12H\n\x07\x65\x64ition\x18\x14 \x01(\x0e\x32\x32.google.spanner.admin.instance.v1.Instance.EditionB\x03\xe0\x41\x01\x12o\n\x1c\x64\x65\x66\x61ult_backup_schedule_type\x18\x17 \x01(\x0e\x32\x44.google.spanner.admin.instance.v1.Instance.DefaultBackupScheduleTypeB\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\"7\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0c\n\x08\x43REATING\x10\x01\x12\t\n\x05READY\x10\x02\"Q\n\x0cInstanceType\x12\x1d\n\x19INSTANCE_TYPE_UNSPECIFIED\x10\x00\x12\x0f\n\x0bPROVISIONED\x10\x01\x12\x11\n\rFREE_INSTANCE\x10\x02\"U\n\x07\x45\x64ition\x12\x17\n\x13\x45\x44ITION_UNSPECIFIED\x10\x00\x12\x0c\n\x08STANDARD\x10\x01\x12\x0e\n\nENTERPRISE\x10\x02\x12\x13\n\x0f\x45NTERPRISE_PLUS\x10\x03\"b\n\x19\x44\x65\x66\x61ultBackupScheduleType\x12,\n(DEFAULT_BACKUP_SCHEDULE_TYPE_UNSPECIFIED\x10\x00\x12\x08\n\x04NONE\x10\x01\x12\r\n\tAUTOMATIC\x10\x02:b\xea\x41_\n\x1fspanner.googleapis.com/Instance\x12\'projects/{project}/instances/{instance}*\tinstances2\x08instance\"\x88\x01\n\x1aListInstanceConfigsRequest\x12\x43\n\x06parent\x18\x01 \x01(\tB3\xe0\x41\x02\xfa\x41-\n+cloudresourcemanager.googleapis.com/Project\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\"\x82\x01\n\x1bListInstanceConfigsResponse\x12J\n\x10instance_configs\x18\x01 \x03(\x0b\x32\x30.google.spanner.admin.instance.v1.InstanceConfig\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"W\n\x18GetInstanceConfigRequest\x12;\n\x04name\x18\x01 \x01(\tB-\xe0\x41\x02\xfa\x41\'\n%spanner.googleapis.com/InstanceConfig\"\xea\x01\n\x1b\x43reateInstanceConfigRequest\x12\x43\n\x06parent\x18\x01 \x01(\tB3\xe0\x41\x02\xfa\x41-\n+cloudresourcemanager.googleapis.com/Project\x12\x1f\n\x12instance_config_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12N\n\x0finstance_config\x18\x03 \x01(\x0b\x32\x30.google.spanner.admin.instance.v1.InstanceConfigB\x03\xe0\x41\x02\x12\x15\n\rvalidate_only\x18\x04 \x01(\x08\"\xba\x01\n\x1bUpdateInstanceConfigRequest\x12N\n\x0finstance_config\x18\x01 \x01(\x0b\x32\x30.google.spanner.admin.instance.v1.InstanceConfigB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\x12\x15\n\rvalidate_only\x18\x03 \x01(\x08\"\x7f\n\x1b\x44\x65leteInstanceConfigRequest\x12;\n\x04name\x18\x01 \x01(\tB-\xe0\x41\x02\xfa\x41\'\n%spanner.googleapis.com/InstanceConfig\x12\x0c\n\x04\x65tag\x18\x02 \x01(\t\x12\x15\n\rvalidate_only\x18\x03 \x01(\x08\"\xa1\x01\n#ListInstanceConfigOperationsRequest\x12\x43\n\x06parent\x18\x01 \x01(\tB3\xe0\x41\x02\xfa\x41-\n+cloudresourcemanager.googleapis.com/Project\x12\x0e\n\x06\x66ilter\x18\x02 \x01(\t\x12\x11\n\tpage_size\x18\x03 \x01(\x05\x12\x12\n\npage_token\x18\x04 \x01(\t\"r\n$ListInstanceConfigOperationsResponse\x12\x31\n\noperations\x18\x01 \x03(\x0b\x32\x1d.google.longrunning.Operation\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"{\n\x12GetInstanceRequest\x12\x35\n\x04name\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1fspanner.googleapis.com/Instance\x12.\n\nfield_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"\xb9\x01\n\x15\x43reateInstanceRequest\x12\x43\n\x06parent\x18\x01 \x01(\tB3\xe0\x41\x02\xfa\x41-\n+cloudresourcemanager.googleapis.com/Project\x12\x18\n\x0binstance_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x41\n\x08instance\x18\x03 \x01(\x0b\x32*.google.spanner.admin.instance.v1.InstanceB\x03\xe0\x41\x02\"\xc9\x01\n\x14ListInstancesRequest\x12\x43\n\x06parent\x18\x01 \x01(\tB3\xe0\x41\x02\xfa\x41-\n+cloudresourcemanager.googleapis.com/Project\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\x12\x35\n\x11instance_deadline\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"\x84\x01\n\x15ListInstancesResponse\x12=\n\tinstances\x18\x01 \x03(\x0b\x32*.google.spanner.admin.instance.v1.Instance\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x13\n\x0bunreachable\x18\x03 \x03(\t\"\x8f\x01\n\x15UpdateInstanceRequest\x12\x41\n\x08instance\x18\x01 \x01(\x0b\x32*.google.spanner.admin.instance.v1.InstanceB\x03\xe0\x41\x02\x12\x33\n\nfield_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\"N\n\x15\x44\x65leteInstanceRequest\x12\x35\n\x04name\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1fspanner.googleapis.com/Instance\"\xbf\x02\n\x16\x43reateInstanceMetadata\x12<\n\x08instance\x18\x01 \x01(\x0b\x32*.google.spanner.admin.instance.v1.Instance\x12.\n\nstart_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12/\n\x0b\x63\x61ncel_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12,\n\x08\x65nd_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12X\n\x1b\x65xpected_fulfillment_period\x18\x05 \x01(\x0e\x32\x33.google.spanner.admin.instance.v1.FulfillmentPeriod\"\xbf\x02\n\x16UpdateInstanceMetadata\x12<\n\x08instance\x18\x01 \x01(\x0b\x32*.google.spanner.admin.instance.v1.Instance\x12.\n\nstart_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12/\n\x0b\x63\x61ncel_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12,\n\x08\x65nd_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12X\n\x1b\x65xpected_fulfillment_period\x18\x05 \x01(\x0e\x32\x33.google.spanner.admin.instance.v1.FulfillmentPeriod\"\xce\x02\n\x14\x46reeInstanceMetadata\x12\x34\n\x0b\x65xpire_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x35\n\x0cupgrade_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12^\n\x0f\x65xpire_behavior\x18\x03 \x01(\x0e\x32\x45.google.spanner.admin.instance.v1.FreeInstanceMetadata.ExpireBehavior\"i\n\x0e\x45xpireBehavior\x12\x1f\n\x1b\x45XPIRE_BEHAVIOR_UNSPECIFIED\x10\x00\x12\x17\n\x13\x46REE_TO_PROVISIONED\x10\x01\x12\x1d\n\x19REMOVE_AFTER_GRACE_PERIOD\x10\x02\"\xe1\x01\n\x1c\x43reateInstanceConfigMetadata\x12I\n\x0finstance_config\x18\x01 \x01(\x0b\x32\x30.google.spanner.admin.instance.v1.InstanceConfig\x12\x45\n\x08progress\x18\x02 \x01(\x0b\x32\x33.google.spanner.admin.instance.v1.OperationProgress\x12/\n\x0b\x63\x61ncel_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"\xe1\x01\n\x1cUpdateInstanceConfigMetadata\x12I\n\x0finstance_config\x18\x01 \x01(\x0b\x32\x30.google.spanner.admin.instance.v1.InstanceConfig\x12\x45\n\x08progress\x18\x02 \x01(\x0b\x32\x33.google.spanner.admin.instance.v1.OperationProgress\x12/\n\x0b\x63\x61ncel_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"\x8f\x06\n\x11InstancePartition\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12=\n\x06\x63onfig\x18\x02 \x01(\tB-\xe0\x41\x02\xfa\x41\'\n%spanner.googleapis.com/InstanceConfig\x12\x19\n\x0c\x64isplay_name\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12\x14\n\nnode_count\x18\x05 \x01(\x05H\x00\x12\x1a\n\x10processing_units\x18\x06 \x01(\x05H\x00\x12T\n\x12\x61utoscaling_config\x18\r \x01(\x0b\x32\x33.google.spanner.admin.instance.v1.AutoscalingConfigB\x03\xe0\x41\x01\x12M\n\x05state\x18\x07 \x01(\x0e\x32\x39.google.spanner.admin.instance.v1.InstancePartition.StateB\x03\xe0\x41\x03\x12\x34\n\x0b\x63reate_time\x18\x08 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\t \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\"\n\x15referencing_databases\x18\n \x03(\tB\x03\xe0\x41\x03\x12\"\n\x13referencing_backups\x18\x0b \x03(\tB\x05\x18\x01\xe0\x41\x03\x12\x0c\n\x04\x65tag\x18\x0c \x01(\t\"7\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0c\n\x08\x43REATING\x10\x01\x12\t\n\x05READY\x10\x02:\xa6\x01\xea\x41\xa2\x01\n(spanner.googleapis.com/InstancePartition\x12Oprojects/{project}/instances/{instance}/instancePartitions/{instance_partition}*\x12instancePartitions2\x11instancePartitionB\x12\n\x10\x63ompute_capacity\"\x81\x02\n\x1f\x43reateInstancePartitionMetadata\x12O\n\x12instance_partition\x18\x01 \x01(\x0b\x32\x33.google.spanner.admin.instance.v1.InstancePartition\x12.\n\nstart_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12/\n\x0b\x63\x61ncel_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12,\n\x08\x65nd_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"\xd3\x01\n\x1e\x43reateInstancePartitionRequest\x12\x37\n\x06parent\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1fspanner.googleapis.com/Instance\x12\"\n\x15instance_partition_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12T\n\x12instance_partition\x18\x03 \x01(\x0b\x32\x33.google.spanner.admin.instance.v1.InstancePartitionB\x03\xe0\x41\x02\"n\n\x1e\x44\x65leteInstancePartitionRequest\x12>\n\x04name\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(spanner.googleapis.com/InstancePartition\x12\x0c\n\x04\x65tag\x18\x02 \x01(\t\"]\n\x1bGetInstancePartitionRequest\x12>\n\x04name\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(spanner.googleapis.com/InstancePartition\"\xab\x01\n\x1eUpdateInstancePartitionRequest\x12T\n\x12instance_partition\x18\x01 \x01(\x0b\x32\x33.google.spanner.admin.instance.v1.InstancePartitionB\x03\xe0\x41\x02\x12\x33\n\nfield_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\"\x81\x02\n\x1fUpdateInstancePartitionMetadata\x12O\n\x12instance_partition\x18\x01 \x01(\x0b\x32\x33.google.spanner.admin.instance.v1.InstancePartition\x12.\n\nstart_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12/\n\x0b\x63\x61ncel_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12,\n\x08\x65nd_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"\xc5\x01\n\x1dListInstancePartitionsRequest\x12\x37\n\x06parent\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1fspanner.googleapis.com/Instance\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\x12\x44\n\x1binstance_partition_deadline\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x01\"\xa0\x01\n\x1eListInstancePartitionsResponse\x12P\n\x13instance_partitions\x18\x01 \x03(\x0b\x32\x33.google.spanner.admin.instance.v1.InstancePartition\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x13\n\x0bunreachable\x18\x03 \x03(\t\"\xed\x01\n&ListInstancePartitionOperationsRequest\x12\x37\n\x06parent\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1fspanner.googleapis.com/Instance\x12\x13\n\x06\x66ilter\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x16\n\tpage_size\x18\x03 \x01(\x05\x42\x03\xe0\x41\x01\x12\x17\n\npage_token\x18\x04 \x01(\tB\x03\xe0\x41\x01\x12\x44\n\x1binstance_partition_deadline\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x01\"\x9e\x01\n\'ListInstancePartitionOperationsResponse\x12\x31\n\noperations\x18\x01 \x03(\x0b\x32\x1d.google.longrunning.Operation\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\'\n\x1funreachable_instance_partitions\x18\x03 \x03(\t\"\x92\x01\n\x13MoveInstanceRequest\x12\x35\n\x04name\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1fspanner.googleapis.com/Instance\x12\x44\n\rtarget_config\x18\x02 \x01(\tB-\xe0\x41\x02\xfa\x41\'\n%spanner.googleapis.com/InstanceConfig\"\x16\n\x14MoveInstanceResponse\"\xa5\x01\n\x14MoveInstanceMetadata\x12\x15\n\rtarget_config\x18\x01 \x01(\t\x12\x45\n\x08progress\x18\x02 \x01(\x0b\x32\x33.google.spanner.admin.instance.v1.OperationProgress\x12/\n\x0b\x63\x61ncel_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp2\xda\'\n\rInstanceAdmin\x12\xcc\x01\n\x13ListInstanceConfigs\x12<.google.spanner.admin.instance.v1.ListInstanceConfigsRequest\x1a=.google.spanner.admin.instance.v1.ListInstanceConfigsResponse\"8\xda\x41\x06parent\x82\xd3\xe4\x93\x02)\x12\'/v1/{parent=projects/*}/instanceConfigs\x12\xb9\x01\n\x11GetInstanceConfig\x12:.google.spanner.admin.instance.v1.GetInstanceConfigRequest\x1a\x30.google.spanner.admin.instance.v1.InstanceConfig\"6\xda\x41\x04name\x82\xd3\xe4\x93\x02)\x12\'/v1/{name=projects/*/instanceConfigs/*}\x12\xc8\x02\n\x14\x43reateInstanceConfig\x12=.google.spanner.admin.instance.v1.CreateInstanceConfigRequest\x1a\x1d.google.longrunning.Operation\"\xd1\x01\xca\x41p\n/google.spanner.admin.instance.v1.InstanceConfig\x12=google.spanner.admin.instance.v1.CreateInstanceConfigMetadata\xda\x41)parent,instance_config,instance_config_id\x82\xd3\xe4\x93\x02,\"\'/v1/{parent=projects/*}/instanceConfigs:\x01*\x12\xca\x02\n\x14UpdateInstanceConfig\x12=.google.spanner.admin.instance.v1.UpdateInstanceConfigRequest\x1a\x1d.google.longrunning.Operation\"\xd3\x01\xca\x41p\n/google.spanner.admin.instance.v1.InstanceConfig\x12=google.spanner.admin.instance.v1.UpdateInstanceConfigMetadata\xda\x41\x1binstance_config,update_mask\x82\xd3\xe4\x93\x02<27/v1/{instance_config.name=projects/*/instanceConfigs/*}:\x01*\x12\xa5\x01\n\x14\x44\x65leteInstanceConfig\x12=.google.spanner.admin.instance.v1.DeleteInstanceConfigRequest\x1a\x16.google.protobuf.Empty\"6\xda\x41\x04name\x82\xd3\xe4\x93\x02)*\'/v1/{name=projects/*/instanceConfigs/*}\x12\xf0\x01\n\x1cListInstanceConfigOperations\x12\x45.google.spanner.admin.instance.v1.ListInstanceConfigOperationsRequest\x1a\x46.google.spanner.admin.instance.v1.ListInstanceConfigOperationsResponse\"A\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x32\x12\x30/v1/{parent=projects/*}/instanceConfigOperations\x12\xb4\x01\n\rListInstances\x12\x36.google.spanner.admin.instance.v1.ListInstancesRequest\x1a\x37.google.spanner.admin.instance.v1.ListInstancesResponse\"2\xda\x41\x06parent\x82\xd3\xe4\x93\x02#\x12!/v1/{parent=projects/*}/instances\x12\xe4\x01\n\x16ListInstancePartitions\x12?.google.spanner.admin.instance.v1.ListInstancePartitionsRequest\x1a@.google.spanner.admin.instance.v1.ListInstancePartitionsResponse\"G\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x38\x12\x36/v1/{parent=projects/*/instances/*}/instancePartitions\x12\xa1\x01\n\x0bGetInstance\x12\x34.google.spanner.admin.instance.v1.GetInstanceRequest\x1a*.google.spanner.admin.instance.v1.Instance\"0\xda\x41\x04name\x82\xd3\xe4\x93\x02#\x12!/v1/{name=projects/*/instances/*}\x12\x9c\x02\n\x0e\x43reateInstance\x12\x37.google.spanner.admin.instance.v1.CreateInstanceRequest\x1a\x1d.google.longrunning.Operation\"\xb1\x01\xca\x41\x64\n)google.spanner.admin.instance.v1.Instance\x12\x37google.spanner.admin.instance.v1.CreateInstanceMetadata\xda\x41\x1bparent,instance_id,instance\x82\xd3\xe4\x93\x02&\"!/v1/{parent=projects/*}/instances:\x01*\x12\x9d\x02\n\x0eUpdateInstance\x12\x37.google.spanner.admin.instance.v1.UpdateInstanceRequest\x1a\x1d.google.longrunning.Operation\"\xb2\x01\xca\x41\x64\n)google.spanner.admin.instance.v1.Instance\x12\x37google.spanner.admin.instance.v1.UpdateInstanceMetadata\xda\x41\x13instance,field_mask\x82\xd3\xe4\x93\x02/2*/v1/{instance.name=projects/*/instances/*}:\x01*\x12\x93\x01\n\x0e\x44\x65leteInstance\x12\x37.google.spanner.admin.instance.v1.DeleteInstanceRequest\x1a\x16.google.protobuf.Empty\"0\xda\x41\x04name\x82\xd3\xe4\x93\x02#*!/v1/{name=projects/*/instances/*}\x12\x9a\x01\n\x0cSetIamPolicy\x12\".google.iam.v1.SetIamPolicyRequest\x1a\x15.google.iam.v1.Policy\"O\xda\x41\x0fresource,policy\x82\xd3\xe4\x93\x02\x37\"2/v1/{resource=projects/*/instances/*}:setIamPolicy:\x01*\x12\x93\x01\n\x0cGetIamPolicy\x12\".google.iam.v1.GetIamPolicyRequest\x1a\x15.google.iam.v1.Policy\"H\xda\x41\x08resource\x82\xd3\xe4\x93\x02\x37\"2/v1/{resource=projects/*/instances/*}:getIamPolicy:\x01*\x12\xc5\x01\n\x12TestIamPermissions\x12(.google.iam.v1.TestIamPermissionsRequest\x1a).google.iam.v1.TestIamPermissionsResponse\"Z\xda\x41\x14resource,permissions\x82\xd3\xe4\x93\x02=\"8/v1/{resource=projects/*/instances/*}:testIamPermissions:\x01*\x12\xd1\x01\n\x14GetInstancePartition\x12=.google.spanner.admin.instance.v1.GetInstancePartitionRequest\x1a\x33.google.spanner.admin.instance.v1.InstancePartition\"E\xda\x41\x04name\x82\xd3\xe4\x93\x02\x38\x12\x36/v1/{name=projects/*/instances/*/instancePartitions/*}\x12\xe9\x02\n\x17\x43reateInstancePartition\x12@.google.spanner.admin.instance.v1.CreateInstancePartitionRequest\x1a\x1d.google.longrunning.Operation\"\xec\x01\xca\x41v\n2google.spanner.admin.instance.v1.InstancePartition\x12@google.spanner.admin.instance.v1.CreateInstancePartitionMetadata\xda\x41/parent,instance_partition,instance_partition_id\x82\xd3\xe4\x93\x02;\"6/v1/{parent=projects/*/instances/*}/instancePartitions:\x01*\x12\xba\x01\n\x17\x44\x65leteInstancePartition\x12@.google.spanner.admin.instance.v1.DeleteInstancePartitionRequest\x1a\x16.google.protobuf.Empty\"E\xda\x41\x04name\x82\xd3\xe4\x93\x02\x38*6/v1/{name=projects/*/instances/*/instancePartitions/*}\x12\xea\x02\n\x17UpdateInstancePartition\x12@.google.spanner.admin.instance.v1.UpdateInstancePartitionRequest\x1a\x1d.google.longrunning.Operation\"\xed\x01\xca\x41v\n2google.spanner.admin.instance.v1.InstancePartition\x12@google.spanner.admin.instance.v1.UpdateInstancePartitionMetadata\xda\x41\x1dinstance_partition,field_mask\x82\xd3\xe4\x93\x02N2I/v1/{instance_partition.name=projects/*/instances/*/instancePartitions/*}:\x01*\x12\x88\x02\n\x1fListInstancePartitionOperations\x12H.google.spanner.admin.instance.v1.ListInstancePartitionOperationsRequest\x1aI.google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse\"P\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x41\x12?/v1/{parent=projects/*/instances/*}/instancePartitionOperations\x12\x89\x02\n\x0cMoveInstance\x12\x35.google.spanner.admin.instance.v1.MoveInstanceRequest\x1a\x1d.google.longrunning.Operation\"\xa2\x01\xca\x41n\n5google.spanner.admin.instance.v1.MoveInstanceResponse\x12\x35google.spanner.admin.instance.v1.MoveInstanceMetadata\x82\xd3\xe4\x93\x02+\"&/v1/{name=projects/*/instances/*}:move:\x01*\x1ax\xca\x41\x16spanner.googleapis.com\xd2\x41\\https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/spanner.adminB\x8b\x02\n$com.google.spanner.admin.instance.v1B\x19SpannerInstanceAdminProtoP\x01ZFcloud.google.com/go/spanner/admin/instance/apiv1/instancepb;instancepb\xaa\x02&Google.Cloud.Spanner.Admin.Instance.V1\xca\x02&Google\\Cloud\\Spanner\\Admin\\Instance\\V1\xea\x02+Google::Cloud::Spanner::Admin::Instance::V1b\x06proto3" +descriptor_data = "\n=google/spanner/admin/instance/v1/spanner_instance_admin.proto\x12 google.spanner.admin.instance.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x1egoogle/iam/v1/iam_policy.proto\x1a\x1agoogle/iam/v1/policy.proto\x1a#google/longrunning/operations.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a-google/spanner/admin/instance/v1/common.proto\"\xda\x01\n\x0bReplicaInfo\x12\x10\n\x08location\x18\x01 \x01(\t\x12G\n\x04type\x18\x02 \x01(\x0e\x32\x39.google.spanner.admin.instance.v1.ReplicaInfo.ReplicaType\x12\x1f\n\x17\x64\x65\x66\x61ult_leader_location\x18\x03 \x01(\x08\"O\n\x0bReplicaType\x12\x14\n\x10TYPE_UNSPECIFIED\x10\x00\x12\x0e\n\nREAD_WRITE\x10\x01\x12\r\n\tREAD_ONLY\x10\x02\x12\x0b\n\x07WITNESS\x10\x03\"\xc0\n\n\x0eInstanceConfig\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x14\n\x0c\x64isplay_name\x18\x02 \x01(\t\x12O\n\x0b\x63onfig_type\x18\x05 \x01(\x0e\x32\x35.google.spanner.admin.instance.v1.InstanceConfig.TypeB\x03\xe0\x41\x03\x12?\n\x08replicas\x18\x03 \x03(\x0b\x32-.google.spanner.admin.instance.v1.ReplicaInfo\x12M\n\x11optional_replicas\x18\x06 \x03(\x0b\x32-.google.spanner.admin.instance.v1.ReplicaInfoB\x03\xe0\x41\x03\x12?\n\x0b\x62\x61se_config\x18\x07 \x01(\tB*\xfa\x41\'\n%spanner.googleapis.com/InstanceConfig\x12L\n\x06labels\x18\x08 \x03(\x0b\x32<.google.spanner.admin.instance.v1.InstanceConfig.LabelsEntry\x12\x0c\n\x04\x65tag\x18\t \x01(\t\x12\x16\n\x0eleader_options\x18\x04 \x03(\t\x12\x18\n\x0breconciling\x18\n \x01(\x08\x42\x03\xe0\x41\x03\x12J\n\x05state\x18\x0b \x01(\x0e\x32\x36.google.spanner.admin.instance.v1.InstanceConfig.StateB\x03\xe0\x41\x03\x12r\n\x1a\x66ree_instance_availability\x18\x0c \x01(\x0e\x32I.google.spanner.admin.instance.v1.InstanceConfig.FreeInstanceAvailabilityB\x03\xe0\x41\x03\x12U\n\x0bquorum_type\x18\x12 \x01(\x0e\x32;.google.spanner.admin.instance.v1.InstanceConfig.QuorumTypeB\x03\xe0\x41\x03\x12.\n!storage_limit_per_processing_unit\x18\x13 \x01(\x03\x42\x03\xe0\x41\x03\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"B\n\x04Type\x12\x14\n\x10TYPE_UNSPECIFIED\x10\x00\x12\x12\n\x0eGOOGLE_MANAGED\x10\x01\x12\x10\n\x0cUSER_MANAGED\x10\x02\"7\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0c\n\x08\x43REATING\x10\x01\x12\t\n\x05READY\x10\x02\"\x88\x01\n\x18\x46reeInstanceAvailability\x12*\n&FREE_INSTANCE_AVAILABILITY_UNSPECIFIED\x10\x00\x12\r\n\tAVAILABLE\x10\x01\x12\x0f\n\x0bUNSUPPORTED\x10\x02\x12\x0c\n\x08\x44ISABLED\x10\x03\x12\x12\n\x0eQUOTA_EXCEEDED\x10\x04\"X\n\nQuorumType\x12\x1b\n\x17QUORUM_TYPE_UNSPECIFIED\x10\x00\x12\n\n\x06REGION\x10\x01\x12\x0f\n\x0b\x44UAL_REGION\x10\x02\x12\x10\n\x0cMULTI_REGION\x10\x03:\x81\x01\xea\x41~\n%spanner.googleapis.com/InstanceConfig\x12\x34projects/{project}/instanceConfigs/{instance_config}*\x0finstanceConfigs2\x0einstanceConfig\"\xb2\x01\n\x16ReplicaComputeCapacity\x12R\n\x11replica_selection\x18\x01 \x01(\x0b\x32\x32.google.spanner.admin.instance.v1.ReplicaSelectionB\x03\xe0\x41\x02\x12\x14\n\nnode_count\x18\x02 \x01(\x05H\x00\x12\x1a\n\x10processing_units\x18\x03 \x01(\x05H\x00\x42\x12\n\x10\x63ompute_capacity\"\x84\n\n\x11\x41utoscalingConfig\x12\x66\n\x12\x61utoscaling_limits\x18\x01 \x01(\x0b\x32\x45.google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimitsB\x03\xe0\x41\x02\x12h\n\x13\x61utoscaling_targets\x18\x02 \x01(\x0b\x32\x46.google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingTargetsB\x03\xe0\x41\x02\x12|\n\x1e\x61symmetric_autoscaling_options\x18\x03 \x03(\x0b\x32O.google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOptionB\x03\xe0\x41\x01\x1a\x97\x01\n\x11\x41utoscalingLimits\x12\x13\n\tmin_nodes\x18\x01 \x01(\x05H\x00\x12\x1e\n\x14min_processing_units\x18\x02 \x01(\x05H\x00\x12\x13\n\tmax_nodes\x18\x03 \x01(\x05H\x01\x12\x1e\n\x14max_processing_units\x18\x04 \x01(\x05H\x01\x42\x0b\n\tmin_limitB\x0b\n\tmax_limit\x1a\x9e\x01\n\x12\x41utoscalingTargets\x12\x32\n%high_priority_cpu_utilization_percent\x18\x01 \x01(\x05\x42\x03\xe0\x41\x01\x12*\n\x1dtotal_cpu_utilization_percent\x18\x04 \x01(\x05\x42\x03\xe0\x41\x01\x12(\n\x1bstorage_utilization_percent\x18\x02 \x01(\x05\x42\x03\xe0\x41\x02\x1a\xe3\x04\n\x1b\x41symmetricAutoscalingOption\x12R\n\x11replica_selection\x18\x01 \x01(\x0b\x32\x32.google.spanner.admin.instance.v1.ReplicaSelectionB\x03\xe0\x41\x02\x12\x82\x01\n\toverrides\x18\x02 \x01(\x0b\x32j.google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.AutoscalingConfigOverridesB\x03\xe0\x41\x01\x1a\xea\x02\n\x1a\x41utoscalingConfigOverrides\x12\x66\n\x12\x61utoscaling_limits\x18\x01 \x01(\x0b\x32\x45.google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimitsB\x03\xe0\x41\x01\x12\x45\n8autoscaling_target_high_priority_cpu_utilization_percent\x18\x02 \x01(\x05\x42\x03\xe0\x41\x01\x12=\n0autoscaling_target_total_cpu_utilization_percent\x18\x04 \x01(\x05\x42\x03\xe0\x41\x01\x12\x32\n%disable_high_priority_cpu_autoscaling\x18\x05 \x01(\x08\x42\x03\xe0\x41\x01\x12*\n\x1d\x64isable_total_cpu_autoscaling\x18\x06 \x01(\x08\x42\x03\xe0\x41\x01\"\xaa\x0b\n\x08Instance\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12=\n\x06\x63onfig\x18\x02 \x01(\tB-\xe0\x41\x02\xfa\x41\'\n%spanner.googleapis.com/InstanceConfig\x12\x19\n\x0c\x64isplay_name\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12\x12\n\nnode_count\x18\x05 \x01(\x05\x12\x18\n\x10processing_units\x18\t \x01(\x05\x12_\n\x18replica_compute_capacity\x18\x13 \x03(\x0b\x32\x38.google.spanner.admin.instance.v1.ReplicaComputeCapacityB\x03\xe0\x41\x03\x12T\n\x12\x61utoscaling_config\x18\x11 \x01(\x0b\x32\x33.google.spanner.admin.instance.v1.AutoscalingConfigB\x03\xe0\x41\x01\x12\x44\n\x05state\x18\x06 \x01(\x0e\x32\x30.google.spanner.admin.instance.v1.Instance.StateB\x03\xe0\x41\x03\x12\x46\n\x06labels\x18\x07 \x03(\x0b\x32\x36.google.spanner.admin.instance.v1.Instance.LabelsEntry\x12N\n\rinstance_type\x18\n \x01(\x0e\x32\x37.google.spanner.admin.instance.v1.Instance.InstanceType\x12\x15\n\rendpoint_uris\x18\x08 \x03(\t\x12\x34\n\x0b\x63reate_time\x18\x0b \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x0c \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12V\n\x16\x66ree_instance_metadata\x18\r \x01(\x0b\x32\x36.google.spanner.admin.instance.v1.FreeInstanceMetadata\x12H\n\x07\x65\x64ition\x18\x14 \x01(\x0e\x32\x32.google.spanner.admin.instance.v1.Instance.EditionB\x03\xe0\x41\x01\x12o\n\x1c\x64\x65\x66\x61ult_backup_schedule_type\x18\x17 \x01(\x0e\x32\x44.google.spanner.admin.instance.v1.Instance.DefaultBackupScheduleTypeB\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\"7\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0c\n\x08\x43REATING\x10\x01\x12\t\n\x05READY\x10\x02\"Q\n\x0cInstanceType\x12\x1d\n\x19INSTANCE_TYPE_UNSPECIFIED\x10\x00\x12\x0f\n\x0bPROVISIONED\x10\x01\x12\x11\n\rFREE_INSTANCE\x10\x02\"U\n\x07\x45\x64ition\x12\x17\n\x13\x45\x44ITION_UNSPECIFIED\x10\x00\x12\x0c\n\x08STANDARD\x10\x01\x12\x0e\n\nENTERPRISE\x10\x02\x12\x13\n\x0f\x45NTERPRISE_PLUS\x10\x03\"b\n\x19\x44\x65\x66\x61ultBackupScheduleType\x12,\n(DEFAULT_BACKUP_SCHEDULE_TYPE_UNSPECIFIED\x10\x00\x12\x08\n\x04NONE\x10\x01\x12\r\n\tAUTOMATIC\x10\x02:b\xea\x41_\n\x1fspanner.googleapis.com/Instance\x12\'projects/{project}/instances/{instance}*\tinstances2\x08instance\"\x88\x01\n\x1aListInstanceConfigsRequest\x12\x43\n\x06parent\x18\x01 \x01(\tB3\xe0\x41\x02\xfa\x41-\n+cloudresourcemanager.googleapis.com/Project\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\"\x82\x01\n\x1bListInstanceConfigsResponse\x12J\n\x10instance_configs\x18\x01 \x03(\x0b\x32\x30.google.spanner.admin.instance.v1.InstanceConfig\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"W\n\x18GetInstanceConfigRequest\x12;\n\x04name\x18\x01 \x01(\tB-\xe0\x41\x02\xfa\x41\'\n%spanner.googleapis.com/InstanceConfig\"\xea\x01\n\x1b\x43reateInstanceConfigRequest\x12\x43\n\x06parent\x18\x01 \x01(\tB3\xe0\x41\x02\xfa\x41-\n+cloudresourcemanager.googleapis.com/Project\x12\x1f\n\x12instance_config_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12N\n\x0finstance_config\x18\x03 \x01(\x0b\x32\x30.google.spanner.admin.instance.v1.InstanceConfigB\x03\xe0\x41\x02\x12\x15\n\rvalidate_only\x18\x04 \x01(\x08\"\xba\x01\n\x1bUpdateInstanceConfigRequest\x12N\n\x0finstance_config\x18\x01 \x01(\x0b\x32\x30.google.spanner.admin.instance.v1.InstanceConfigB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\x12\x15\n\rvalidate_only\x18\x03 \x01(\x08\"\x7f\n\x1b\x44\x65leteInstanceConfigRequest\x12;\n\x04name\x18\x01 \x01(\tB-\xe0\x41\x02\xfa\x41\'\n%spanner.googleapis.com/InstanceConfig\x12\x0c\n\x04\x65tag\x18\x02 \x01(\t\x12\x15\n\rvalidate_only\x18\x03 \x01(\x08\"\xa1\x01\n#ListInstanceConfigOperationsRequest\x12\x43\n\x06parent\x18\x01 \x01(\tB3\xe0\x41\x02\xfa\x41-\n+cloudresourcemanager.googleapis.com/Project\x12\x0e\n\x06\x66ilter\x18\x02 \x01(\t\x12\x11\n\tpage_size\x18\x03 \x01(\x05\x12\x12\n\npage_token\x18\x04 \x01(\t\"r\n$ListInstanceConfigOperationsResponse\x12\x31\n\noperations\x18\x01 \x03(\x0b\x32\x1d.google.longrunning.Operation\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"{\n\x12GetInstanceRequest\x12\x35\n\x04name\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1fspanner.googleapis.com/Instance\x12.\n\nfield_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"\xb9\x01\n\x15\x43reateInstanceRequest\x12\x43\n\x06parent\x18\x01 \x01(\tB3\xe0\x41\x02\xfa\x41-\n+cloudresourcemanager.googleapis.com/Project\x12\x18\n\x0binstance_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x41\n\x08instance\x18\x03 \x01(\x0b\x32*.google.spanner.admin.instance.v1.InstanceB\x03\xe0\x41\x02\"\xc9\x01\n\x14ListInstancesRequest\x12\x43\n\x06parent\x18\x01 \x01(\tB3\xe0\x41\x02\xfa\x41-\n+cloudresourcemanager.googleapis.com/Project\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\x12\x35\n\x11instance_deadline\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"\x84\x01\n\x15ListInstancesResponse\x12=\n\tinstances\x18\x01 \x03(\x0b\x32*.google.spanner.admin.instance.v1.Instance\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x13\n\x0bunreachable\x18\x03 \x03(\t\"\x8f\x01\n\x15UpdateInstanceRequest\x12\x41\n\x08instance\x18\x01 \x01(\x0b\x32*.google.spanner.admin.instance.v1.InstanceB\x03\xe0\x41\x02\x12\x33\n\nfield_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\"N\n\x15\x44\x65leteInstanceRequest\x12\x35\n\x04name\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1fspanner.googleapis.com/Instance\"\xbf\x02\n\x16\x43reateInstanceMetadata\x12<\n\x08instance\x18\x01 \x01(\x0b\x32*.google.spanner.admin.instance.v1.Instance\x12.\n\nstart_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12/\n\x0b\x63\x61ncel_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12,\n\x08\x65nd_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12X\n\x1b\x65xpected_fulfillment_period\x18\x05 \x01(\x0e\x32\x33.google.spanner.admin.instance.v1.FulfillmentPeriod\"\xbf\x02\n\x16UpdateInstanceMetadata\x12<\n\x08instance\x18\x01 \x01(\x0b\x32*.google.spanner.admin.instance.v1.Instance\x12.\n\nstart_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12/\n\x0b\x63\x61ncel_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12,\n\x08\x65nd_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12X\n\x1b\x65xpected_fulfillment_period\x18\x05 \x01(\x0e\x32\x33.google.spanner.admin.instance.v1.FulfillmentPeriod\"\xce\x02\n\x14\x46reeInstanceMetadata\x12\x34\n\x0b\x65xpire_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x35\n\x0cupgrade_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12^\n\x0f\x65xpire_behavior\x18\x03 \x01(\x0e\x32\x45.google.spanner.admin.instance.v1.FreeInstanceMetadata.ExpireBehavior\"i\n\x0e\x45xpireBehavior\x12\x1f\n\x1b\x45XPIRE_BEHAVIOR_UNSPECIFIED\x10\x00\x12\x17\n\x13\x46REE_TO_PROVISIONED\x10\x01\x12\x1d\n\x19REMOVE_AFTER_GRACE_PERIOD\x10\x02\"\xe1\x01\n\x1c\x43reateInstanceConfigMetadata\x12I\n\x0finstance_config\x18\x01 \x01(\x0b\x32\x30.google.spanner.admin.instance.v1.InstanceConfig\x12\x45\n\x08progress\x18\x02 \x01(\x0b\x32\x33.google.spanner.admin.instance.v1.OperationProgress\x12/\n\x0b\x63\x61ncel_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"\xe1\x01\n\x1cUpdateInstanceConfigMetadata\x12I\n\x0finstance_config\x18\x01 \x01(\x0b\x32\x30.google.spanner.admin.instance.v1.InstanceConfig\x12\x45\n\x08progress\x18\x02 \x01(\x0b\x32\x33.google.spanner.admin.instance.v1.OperationProgress\x12/\n\x0b\x63\x61ncel_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"\x8f\x06\n\x11InstancePartition\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12=\n\x06\x63onfig\x18\x02 \x01(\tB-\xe0\x41\x02\xfa\x41\'\n%spanner.googleapis.com/InstanceConfig\x12\x19\n\x0c\x64isplay_name\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12\x14\n\nnode_count\x18\x05 \x01(\x05H\x00\x12\x1a\n\x10processing_units\x18\x06 \x01(\x05H\x00\x12T\n\x12\x61utoscaling_config\x18\r \x01(\x0b\x32\x33.google.spanner.admin.instance.v1.AutoscalingConfigB\x03\xe0\x41\x01\x12M\n\x05state\x18\x07 \x01(\x0e\x32\x39.google.spanner.admin.instance.v1.InstancePartition.StateB\x03\xe0\x41\x03\x12\x34\n\x0b\x63reate_time\x18\x08 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\t \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\"\n\x15referencing_databases\x18\n \x03(\tB\x03\xe0\x41\x03\x12\"\n\x13referencing_backups\x18\x0b \x03(\tB\x05\x18\x01\xe0\x41\x03\x12\x0c\n\x04\x65tag\x18\x0c \x01(\t\"7\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0c\n\x08\x43REATING\x10\x01\x12\t\n\x05READY\x10\x02:\xa6\x01\xea\x41\xa2\x01\n(spanner.googleapis.com/InstancePartition\x12Oprojects/{project}/instances/{instance}/instancePartitions/{instance_partition}*\x12instancePartitions2\x11instancePartitionB\x12\n\x10\x63ompute_capacity\"\x81\x02\n\x1f\x43reateInstancePartitionMetadata\x12O\n\x12instance_partition\x18\x01 \x01(\x0b\x32\x33.google.spanner.admin.instance.v1.InstancePartition\x12.\n\nstart_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12/\n\x0b\x63\x61ncel_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12,\n\x08\x65nd_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"\xd3\x01\n\x1e\x43reateInstancePartitionRequest\x12\x37\n\x06parent\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1fspanner.googleapis.com/Instance\x12\"\n\x15instance_partition_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12T\n\x12instance_partition\x18\x03 \x01(\x0b\x32\x33.google.spanner.admin.instance.v1.InstancePartitionB\x03\xe0\x41\x02\"n\n\x1e\x44\x65leteInstancePartitionRequest\x12>\n\x04name\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(spanner.googleapis.com/InstancePartition\x12\x0c\n\x04\x65tag\x18\x02 \x01(\t\"]\n\x1bGetInstancePartitionRequest\x12>\n\x04name\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(spanner.googleapis.com/InstancePartition\"\xab\x01\n\x1eUpdateInstancePartitionRequest\x12T\n\x12instance_partition\x18\x01 \x01(\x0b\x32\x33.google.spanner.admin.instance.v1.InstancePartitionB\x03\xe0\x41\x02\x12\x33\n\nfield_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\"\x81\x02\n\x1fUpdateInstancePartitionMetadata\x12O\n\x12instance_partition\x18\x01 \x01(\x0b\x32\x33.google.spanner.admin.instance.v1.InstancePartition\x12.\n\nstart_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12/\n\x0b\x63\x61ncel_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12,\n\x08\x65nd_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"\xc5\x01\n\x1dListInstancePartitionsRequest\x12\x37\n\x06parent\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1fspanner.googleapis.com/Instance\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\x12\x44\n\x1binstance_partition_deadline\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x01\"\xa0\x01\n\x1eListInstancePartitionsResponse\x12P\n\x13instance_partitions\x18\x01 \x03(\x0b\x32\x33.google.spanner.admin.instance.v1.InstancePartition\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x13\n\x0bunreachable\x18\x03 \x03(\t\"\xed\x01\n&ListInstancePartitionOperationsRequest\x12\x37\n\x06parent\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1fspanner.googleapis.com/Instance\x12\x13\n\x06\x66ilter\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x16\n\tpage_size\x18\x03 \x01(\x05\x42\x03\xe0\x41\x01\x12\x17\n\npage_token\x18\x04 \x01(\tB\x03\xe0\x41\x01\x12\x44\n\x1binstance_partition_deadline\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x01\"\x9e\x01\n\'ListInstancePartitionOperationsResponse\x12\x31\n\noperations\x18\x01 \x03(\x0b\x32\x1d.google.longrunning.Operation\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\'\n\x1funreachable_instance_partitions\x18\x03 \x03(\t\"\x92\x01\n\x13MoveInstanceRequest\x12\x35\n\x04name\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1fspanner.googleapis.com/Instance\x12\x44\n\rtarget_config\x18\x02 \x01(\tB-\xe0\x41\x02\xfa\x41\'\n%spanner.googleapis.com/InstanceConfig\"\x16\n\x14MoveInstanceResponse\"\xa5\x01\n\x14MoveInstanceMetadata\x12\x15\n\rtarget_config\x18\x01 \x01(\t\x12\x45\n\x08progress\x18\x02 \x01(\x0b\x32\x33.google.spanner.admin.instance.v1.OperationProgress\x12/\n\x0b\x63\x61ncel_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp2\xda\'\n\rInstanceAdmin\x12\xcc\x01\n\x13ListInstanceConfigs\x12<.google.spanner.admin.instance.v1.ListInstanceConfigsRequest\x1a=.google.spanner.admin.instance.v1.ListInstanceConfigsResponse\"8\xda\x41\x06parent\x82\xd3\xe4\x93\x02)\x12\'/v1/{parent=projects/*}/instanceConfigs\x12\xb9\x01\n\x11GetInstanceConfig\x12:.google.spanner.admin.instance.v1.GetInstanceConfigRequest\x1a\x30.google.spanner.admin.instance.v1.InstanceConfig\"6\xda\x41\x04name\x82\xd3\xe4\x93\x02)\x12\'/v1/{name=projects/*/instanceConfigs/*}\x12\xc8\x02\n\x14\x43reateInstanceConfig\x12=.google.spanner.admin.instance.v1.CreateInstanceConfigRequest\x1a\x1d.google.longrunning.Operation\"\xd1\x01\xca\x41p\n/google.spanner.admin.instance.v1.InstanceConfig\x12=google.spanner.admin.instance.v1.CreateInstanceConfigMetadata\xda\x41)parent,instance_config,instance_config_id\x82\xd3\xe4\x93\x02,\"\'/v1/{parent=projects/*}/instanceConfigs:\x01*\x12\xca\x02\n\x14UpdateInstanceConfig\x12=.google.spanner.admin.instance.v1.UpdateInstanceConfigRequest\x1a\x1d.google.longrunning.Operation\"\xd3\x01\xca\x41p\n/google.spanner.admin.instance.v1.InstanceConfig\x12=google.spanner.admin.instance.v1.UpdateInstanceConfigMetadata\xda\x41\x1binstance_config,update_mask\x82\xd3\xe4\x93\x02<27/v1/{instance_config.name=projects/*/instanceConfigs/*}:\x01*\x12\xa5\x01\n\x14\x44\x65leteInstanceConfig\x12=.google.spanner.admin.instance.v1.DeleteInstanceConfigRequest\x1a\x16.google.protobuf.Empty\"6\xda\x41\x04name\x82\xd3\xe4\x93\x02)*\'/v1/{name=projects/*/instanceConfigs/*}\x12\xf0\x01\n\x1cListInstanceConfigOperations\x12\x45.google.spanner.admin.instance.v1.ListInstanceConfigOperationsRequest\x1a\x46.google.spanner.admin.instance.v1.ListInstanceConfigOperationsResponse\"A\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x32\x12\x30/v1/{parent=projects/*}/instanceConfigOperations\x12\xb4\x01\n\rListInstances\x12\x36.google.spanner.admin.instance.v1.ListInstancesRequest\x1a\x37.google.spanner.admin.instance.v1.ListInstancesResponse\"2\xda\x41\x06parent\x82\xd3\xe4\x93\x02#\x12!/v1/{parent=projects/*}/instances\x12\xe4\x01\n\x16ListInstancePartitions\x12?.google.spanner.admin.instance.v1.ListInstancePartitionsRequest\x1a@.google.spanner.admin.instance.v1.ListInstancePartitionsResponse\"G\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x38\x12\x36/v1/{parent=projects/*/instances/*}/instancePartitions\x12\xa1\x01\n\x0bGetInstance\x12\x34.google.spanner.admin.instance.v1.GetInstanceRequest\x1a*.google.spanner.admin.instance.v1.Instance\"0\xda\x41\x04name\x82\xd3\xe4\x93\x02#\x12!/v1/{name=projects/*/instances/*}\x12\x9c\x02\n\x0e\x43reateInstance\x12\x37.google.spanner.admin.instance.v1.CreateInstanceRequest\x1a\x1d.google.longrunning.Operation\"\xb1\x01\xca\x41\x64\n)google.spanner.admin.instance.v1.Instance\x12\x37google.spanner.admin.instance.v1.CreateInstanceMetadata\xda\x41\x1bparent,instance_id,instance\x82\xd3\xe4\x93\x02&\"!/v1/{parent=projects/*}/instances:\x01*\x12\x9d\x02\n\x0eUpdateInstance\x12\x37.google.spanner.admin.instance.v1.UpdateInstanceRequest\x1a\x1d.google.longrunning.Operation\"\xb2\x01\xca\x41\x64\n)google.spanner.admin.instance.v1.Instance\x12\x37google.spanner.admin.instance.v1.UpdateInstanceMetadata\xda\x41\x13instance,field_mask\x82\xd3\xe4\x93\x02/2*/v1/{instance.name=projects/*/instances/*}:\x01*\x12\x93\x01\n\x0e\x44\x65leteInstance\x12\x37.google.spanner.admin.instance.v1.DeleteInstanceRequest\x1a\x16.google.protobuf.Empty\"0\xda\x41\x04name\x82\xd3\xe4\x93\x02#*!/v1/{name=projects/*/instances/*}\x12\x9a\x01\n\x0cSetIamPolicy\x12\".google.iam.v1.SetIamPolicyRequest\x1a\x15.google.iam.v1.Policy\"O\xda\x41\x0fresource,policy\x82\xd3\xe4\x93\x02\x37\"2/v1/{resource=projects/*/instances/*}:setIamPolicy:\x01*\x12\x93\x01\n\x0cGetIamPolicy\x12\".google.iam.v1.GetIamPolicyRequest\x1a\x15.google.iam.v1.Policy\"H\xda\x41\x08resource\x82\xd3\xe4\x93\x02\x37\"2/v1/{resource=projects/*/instances/*}:getIamPolicy:\x01*\x12\xc5\x01\n\x12TestIamPermissions\x12(.google.iam.v1.TestIamPermissionsRequest\x1a).google.iam.v1.TestIamPermissionsResponse\"Z\xda\x41\x14resource,permissions\x82\xd3\xe4\x93\x02=\"8/v1/{resource=projects/*/instances/*}:testIamPermissions:\x01*\x12\xd1\x01\n\x14GetInstancePartition\x12=.google.spanner.admin.instance.v1.GetInstancePartitionRequest\x1a\x33.google.spanner.admin.instance.v1.InstancePartition\"E\xda\x41\x04name\x82\xd3\xe4\x93\x02\x38\x12\x36/v1/{name=projects/*/instances/*/instancePartitions/*}\x12\xe9\x02\n\x17\x43reateInstancePartition\x12@.google.spanner.admin.instance.v1.CreateInstancePartitionRequest\x1a\x1d.google.longrunning.Operation\"\xec\x01\xca\x41v\n2google.spanner.admin.instance.v1.InstancePartition\x12@google.spanner.admin.instance.v1.CreateInstancePartitionMetadata\xda\x41/parent,instance_partition,instance_partition_id\x82\xd3\xe4\x93\x02;\"6/v1/{parent=projects/*/instances/*}/instancePartitions:\x01*\x12\xba\x01\n\x17\x44\x65leteInstancePartition\x12@.google.spanner.admin.instance.v1.DeleteInstancePartitionRequest\x1a\x16.google.protobuf.Empty\"E\xda\x41\x04name\x82\xd3\xe4\x93\x02\x38*6/v1/{name=projects/*/instances/*/instancePartitions/*}\x12\xea\x02\n\x17UpdateInstancePartition\x12@.google.spanner.admin.instance.v1.UpdateInstancePartitionRequest\x1a\x1d.google.longrunning.Operation\"\xed\x01\xca\x41v\n2google.spanner.admin.instance.v1.InstancePartition\x12@google.spanner.admin.instance.v1.UpdateInstancePartitionMetadata\xda\x41\x1dinstance_partition,field_mask\x82\xd3\xe4\x93\x02N2I/v1/{instance_partition.name=projects/*/instances/*/instancePartitions/*}:\x01*\x12\x88\x02\n\x1fListInstancePartitionOperations\x12H.google.spanner.admin.instance.v1.ListInstancePartitionOperationsRequest\x1aI.google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse\"P\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x41\x12?/v1/{parent=projects/*/instances/*}/instancePartitionOperations\x12\x89\x02\n\x0cMoveInstance\x12\x35.google.spanner.admin.instance.v1.MoveInstanceRequest\x1a\x1d.google.longrunning.Operation\"\xa2\x01\xca\x41n\n5google.spanner.admin.instance.v1.MoveInstanceResponse\x12\x35google.spanner.admin.instance.v1.MoveInstanceMetadata\x82\xd3\xe4\x93\x02+\"&/v1/{name=projects/*/instances/*}:move:\x01*\x1ax\xca\x41\x16spanner.googleapis.com\xd2\x41\\https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/spanner.adminB\x8b\x02\n$com.google.spanner.admin.instance.v1B\x19SpannerInstanceAdminProtoP\x01ZFcloud.google.com/go/spanner/admin/instance/apiv1/instancepb;instancepb\xaa\x02&Google.Cloud.Spanner.Admin.Instance.V1\xca\x02&Google\\Cloud\\Spanner\\Admin\\Instance\\V1\xea\x02+Google::Cloud::Spanner::Admin::Instance::V1b\x06proto3" pool = Google::Protobuf::DescriptorPool.generated_pool diff --git a/google-cloud-spanner-admin-instance-v1/proto_docs/google/spanner/admin/instance/v1/spanner_instance_admin.rb b/google-cloud-spanner-admin-instance-v1/proto_docs/google/spanner/admin/instance/v1/spanner_instance_admin.rb index d8d67243fd3d..5e0ba915a36d 100644 --- a/google-cloud-spanner-admin-instance-v1/proto_docs/google/spanner/admin/instance/v1/spanner_instance_admin.rb +++ b/google-cloud-spanner-admin-instance-v1/proto_docs/google/spanner/admin/instance/v1/spanner_instance_admin.rb @@ -341,10 +341,22 @@ class AutoscalingLimits # The autoscaling targets for an instance. # @!attribute [rw] high_priority_cpu_utilization_percent # @return [::Integer] - # Required. The target high priority cpu utilization percentage that the + # Optional. The target high priority cpu utilization percentage that the # autoscaler should be trying to achieve for the instance. This number is # on a scale from 0 (no utilization) to 100 (full utilization). The valid - # range is [10, 90] inclusive. + # range is [10, 90] inclusive. If not specified or set to 0, the autoscaler + # skips scaling based on high priority CPU utilization. + # @!attribute [rw] total_cpu_utilization_percent + # @return [::Integer] + # Optional. The target total CPU utilization percentage that the autoscaler + # should be trying to achieve for the instance. This number is on a scale + # from 0 (no utilization) to 100 (full utilization). The valid range is + # [10, 90] inclusive. If not specified or set to 0, the autoscaler skips + # scaling based on total CPU utilization. If both + # `high_priority_cpu_utilization_percent` and + # `total_cpu_utilization_percent` are specified, the autoscaler provisions + # the larger of the two required compute capacities to satisfy both + # targets. # @!attribute [rw] storage_utilization_percent # @return [::Integer] # Required. The target storage utilization percentage that the autoscaler @@ -383,6 +395,57 @@ class AsymmetricAutoscalingOption # Optional. If specified, overrides the autoscaling target # high_priority_cpu_utilization_percent in the top-level autoscaling # configuration for the selected replicas. + # @!attribute [rw] autoscaling_target_total_cpu_utilization_percent + # @return [::Integer] + # Optional. If specified, overrides the + # autoscaling target `total_cpu_utilization_percent` + # in the top-level autoscaling configuration for the selected replicas. + # @!attribute [rw] disable_high_priority_cpu_autoscaling + # @return [::Boolean] + # Optional. If true, disables high priority CPU autoscaling for the + # selected replicas and ignores + # {::Google::Cloud::Spanner::Admin::Instance::V1::AutoscalingConfig::AutoscalingTargets#high_priority_cpu_utilization_percent high_priority_cpu_utilization_percent} + # in the top-level autoscaling configuration. + # + # When setting this field to true, setting + # {::Google::Cloud::Spanner::Admin::Instance::V1::AutoscalingConfig::AsymmetricAutoscalingOption::AutoscalingConfigOverrides#autoscaling_target_high_priority_cpu_utilization_percent autoscaling_target_high_priority_cpu_utilization_percent} + # field to a non-zero value for the same replica is not supported. + # + # If false, the + # {::Google::Cloud::Spanner::Admin::Instance::V1::AutoscalingConfig::AsymmetricAutoscalingOption::AutoscalingConfigOverrides#autoscaling_target_high_priority_cpu_utilization_percent autoscaling_target_high_priority_cpu_utilization_percent} + # field in the replica will be used if set to a non-zero value. + # Otherwise, the + # {::Google::Cloud::Spanner::Admin::Instance::V1::AutoscalingConfig::AutoscalingTargets#high_priority_cpu_utilization_percent high_priority_cpu_utilization_percent} + # field in the top-level autoscaling configuration will be used. + # + # Setting both + # {::Google::Cloud::Spanner::Admin::Instance::V1::AutoscalingConfig::AsymmetricAutoscalingOption::AutoscalingConfigOverrides#disable_high_priority_cpu_autoscaling disable_high_priority_cpu_autoscaling} + # and + # {::Google::Cloud::Spanner::Admin::Instance::V1::AutoscalingConfig::AsymmetricAutoscalingOption::AutoscalingConfigOverrides#disable_total_cpu_autoscaling disable_total_cpu_autoscaling} + # to true for the same replica is not supported. + # @!attribute [rw] disable_total_cpu_autoscaling + # @return [::Boolean] + # Optional. If true, disables total CPU autoscaling for the selected + # replicas and ignores + # {::Google::Cloud::Spanner::Admin::Instance::V1::AutoscalingConfig::AutoscalingTargets#total_cpu_utilization_percent total_cpu_utilization_percent} + # in the top-level autoscaling configuration. + # + # When setting this field to true, setting + # {::Google::Cloud::Spanner::Admin::Instance::V1::AutoscalingConfig::AsymmetricAutoscalingOption::AutoscalingConfigOverrides#autoscaling_target_total_cpu_utilization_percent autoscaling_target_total_cpu_utilization_percent} + # field to a non-zero value for the same replica is not supported. + # + # If false, the + # {::Google::Cloud::Spanner::Admin::Instance::V1::AutoscalingConfig::AsymmetricAutoscalingOption::AutoscalingConfigOverrides#autoscaling_target_total_cpu_utilization_percent autoscaling_target_total_cpu_utilization_percent} + # field in the replica will be used if set to a non-zero value. + # Otherwise, the + # {::Google::Cloud::Spanner::Admin::Instance::V1::AutoscalingConfig::AutoscalingTargets#total_cpu_utilization_percent total_cpu_utilization_percent} + # field in the top-level autoscaling configuration will be used. + # + # Setting both + # {::Google::Cloud::Spanner::Admin::Instance::V1::AutoscalingConfig::AsymmetricAutoscalingOption::AutoscalingConfigOverrides#disable_high_priority_cpu_autoscaling disable_high_priority_cpu_autoscaling} + # and + # {::Google::Cloud::Spanner::Admin::Instance::V1::AutoscalingConfig::AsymmetricAutoscalingOption::AutoscalingConfigOverrides#disable_total_cpu_autoscaling disable_total_cpu_autoscaling} + # to true for the same replica is not supported. class AutoscalingConfigOverrides include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods diff --git a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/.gitignore b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/.gitignore deleted file mode 100644 index 0135b6bc6cfc..000000000000 --- a/owl-bot-staging/google-cloud-spanner-admin-instance-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-admin-instance-v1/.repo-metadata.json b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/.repo-metadata.json deleted file mode 100644 index f5020bbedc04..000000000000 --- a/owl-bot-staging/google-cloud-spanner-admin-instance-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-admin-instance-v1/latest", - "distribution_name": "google-cloud-spanner-admin-instance-v1", - "is_cloud": true, - "language": "ruby", - "name": "spanner", - "name_pretty": "Cloud Spanner Instance Admin 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-admin-instance-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-admin-instance-v1/.rubocop.yml b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/.rubocop.yml deleted file mode 100644 index d1a683d9ac76..000000000000 --- a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/.rubocop.yml +++ /dev/null @@ -1,33 +0,0 @@ -inherit_gem: - google-style: google-style.yml - -AllCops: - Exclude: - - "google-cloud-spanner-admin-instance-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-admin-instance-v1.rb" diff --git a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/.toys.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/.toys.rb deleted file mode 100644 index 9a210f1427c7..000000000000 --- a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/.toys.rb +++ /dev/null @@ -1,28 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 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-admin-instance-v1/.yardopts b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/.yardopts deleted file mode 100644 index 5a169a006a69..000000000000 --- a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/.yardopts +++ /dev/null @@ -1,12 +0,0 @@ ---no-private ---title="Cloud Spanner Instance Admin 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-admin-instance-v1/AUTHENTICATION.md b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/AUTHENTICATION.md deleted file mode 100644 index cfb0ca7fb54f..000000000000 --- a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/AUTHENTICATION.md +++ /dev/null @@ -1,122 +0,0 @@ -# Authentication - -The recommended way to authenticate to the google-cloud-spanner-admin-instance-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-admin-instance-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/admin/instance/v1" - -client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::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/admin/instance/v1" - -::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.configure do |config| - config.credentials = "path/to/credentialfile.json" -end - -client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::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-admin-instance-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/admin/instance/v1" - -ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" - -client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::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-admin-instance-v1/CHANGELOG.md b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/CHANGELOG.md deleted file mode 100644 index f88957a62ba2..000000000000 --- a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/CHANGELOG.md +++ /dev/null @@ -1,2 +0,0 @@ -# Release History - diff --git a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/Gemfile b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/Gemfile deleted file mode 100644 index 6442df18fa2f..000000000000 --- a/owl-bot-staging/google-cloud-spanner-admin-instance-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-admin-instance-v1/LICENSE.md b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/LICENSE.md deleted file mode 100644 index c261857ba6ad..000000000000 --- a/owl-bot-staging/google-cloud-spanner-admin-instance-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-admin-instance-v1/README.md b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/README.md deleted file mode 100644 index b579b9d0f741..000000000000 --- a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/README.md +++ /dev/null @@ -1,153 +0,0 @@ -# Ruby Client for the Cloud Spanner Instance Admin 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 Instance Admin 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-admin-instance-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/admin/instance/v1" - -client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new -request = ::Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigsRequest.new # (request fields as keyword arguments...) -response = client.list_instance_configs request -``` - -View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-spanner-admin-instance-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/admin/instance/v1" -require "logger" - -client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::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-admin-instance-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-admin-instance-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-admin-instance-v1/Rakefile b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/Rakefile deleted file mode 100644 index 2f4393f5525a..000000000000 --- a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/Rakefile +++ /dev/null @@ -1,169 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 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-admin-instance-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/admin/instance/v1/instance_admin/credentials" - ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::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-admin-instance-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-admin-instance-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-admin-instance-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-admin-instance-v1 gem does not have doctest tests." -end - -desc "Run the CI build" -task :ci do - header "BUILDING google-cloud-spanner-admin-instance-v1" - header "google-cloud-spanner-admin-instance-v1 rubocop", "*" - Rake::Task[:rubocop].invoke - header "google-cloud-spanner-admin-instance-v1 yard", "*" - Rake::Task[:yard].invoke - header "google-cloud-spanner-admin-instance-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-admin-instance-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-admin-instance-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-admin-instance-v1/gapic_metadata.json b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/gapic_metadata.json deleted file mode 100644 index 2e44d0f21e72..000000000000 --- a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/gapic_metadata.json +++ /dev/null @@ -1,123 +0,0 @@ -{ - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", - "language": "ruby", - "protoPackage": "google.spanner.admin.instance.v1", - "libraryPackage": "::Google::Cloud::Spanner::Admin::Instance::V1", - "services": { - "InstanceAdmin": { - "clients": { - "grpc": { - "libraryClient": "::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client", - "rpcs": { - "ListInstanceConfigs": { - "methods": [ - "list_instance_configs" - ] - }, - "GetInstanceConfig": { - "methods": [ - "get_instance_config" - ] - }, - "CreateInstanceConfig": { - "methods": [ - "create_instance_config" - ] - }, - "UpdateInstanceConfig": { - "methods": [ - "update_instance_config" - ] - }, - "DeleteInstanceConfig": { - "methods": [ - "delete_instance_config" - ] - }, - "ListInstanceConfigOperations": { - "methods": [ - "list_instance_config_operations" - ] - }, - "ListInstances": { - "methods": [ - "list_instances" - ] - }, - "ListInstancePartitions": { - "methods": [ - "list_instance_partitions" - ] - }, - "GetInstance": { - "methods": [ - "get_instance" - ] - }, - "CreateInstance": { - "methods": [ - "create_instance" - ] - }, - "UpdateInstance": { - "methods": [ - "update_instance" - ] - }, - "DeleteInstance": { - "methods": [ - "delete_instance" - ] - }, - "SetIamPolicy": { - "methods": [ - "set_iam_policy" - ] - }, - "GetIamPolicy": { - "methods": [ - "get_iam_policy" - ] - }, - "TestIamPermissions": { - "methods": [ - "test_iam_permissions" - ] - }, - "GetInstancePartition": { - "methods": [ - "get_instance_partition" - ] - }, - "CreateInstancePartition": { - "methods": [ - "create_instance_partition" - ] - }, - "DeleteInstancePartition": { - "methods": [ - "delete_instance_partition" - ] - }, - "UpdateInstancePartition": { - "methods": [ - "update_instance_partition" - ] - }, - "ListInstancePartitionOperations": { - "methods": [ - "list_instance_partition_operations" - ] - }, - "MoveInstance": { - "methods": [ - "move_instance" - ] - } - } - } - } - } - } -} diff --git a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/google-cloud-spanner-admin-instance-v1.gemspec b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/google-cloud-spanner-admin-instance-v1.gemspec deleted file mode 100644 index cf8cdfdcad2d..000000000000 --- a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/google-cloud-spanner-admin-instance-v1.gemspec +++ /dev/null @@ -1,29 +0,0 @@ -# -*- ruby -*- -# encoding: utf-8 - -require File.expand_path("lib/google/cloud/spanner/admin/instance/v1/version", __dir__) - -Gem::Specification.new do |gem| - gem.name = "google-cloud-spanner-admin-instance-v1" - gem.version = Google::Cloud::Spanner::Admin::Instance::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-admin-instance-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" - gem.add_dependency "grpc-google-iam-v1", "~> 1.11" -end diff --git a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google-cloud-spanner-admin-instance-v1.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google-cloud-spanner-admin-instance-v1.rb deleted file mode 100644 index ea7eae68d97a..000000000000 --- a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google-cloud-spanner-admin-instance-v1.rb +++ /dev/null @@ -1,21 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 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/admin/instance/v1" diff --git a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google/cloud/spanner/admin/instance/v1.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google/cloud/spanner/admin/instance/v1.rb deleted file mode 100644 index 200b087804f7..000000000000 --- a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google/cloud/spanner/admin/instance/v1.rb +++ /dev/null @@ -1,49 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 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/admin/instance/v1/instance_admin" -require "google/cloud/spanner/admin/instance/v1/version" - -module Google - module Cloud - module Spanner - module Admin - module Instance - ## - # API client module. - # - # @example Load this package, including all its services, and instantiate a gRPC client - # - # require "google/cloud/spanner/admin/instance/v1" - # client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new - # - # @example Load this package, including all its services, and instantiate a REST client - # - # require "google/cloud/spanner/admin/instance/v1" - # client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::Client.new - # - module V1 - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "v1", "_helpers.rb" -require "google/cloud/spanner/admin/instance/v1/_helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google/cloud/spanner/admin/instance/v1/instance_admin.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google/cloud/spanner/admin/instance/v1/instance_admin.rb deleted file mode 100644 index 65ae6790d4a4..000000000000 --- a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google/cloud/spanner/admin/instance/v1/instance_admin.rb +++ /dev/null @@ -1,80 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 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/admin/instance/v1/version" - -require "google/cloud/spanner/admin/instance/v1/instance_admin/credentials" -require "google/cloud/spanner/admin/instance/v1/instance_admin/paths" -require "google/cloud/spanner/admin/instance/v1/instance_admin/operations" -require "google/cloud/spanner/admin/instance/v1/instance_admin/client" -require "google/cloud/spanner/admin/instance/v1/instance_admin/rest" - -module Google - module Cloud - module Spanner - module Admin - module Instance - module V1 - ## - # Cloud Spanner Instance Admin API - # - # The Cloud Spanner Instance Admin API can be used to create, delete, - # modify and list instances. Instances are dedicated Cloud Spanner serving - # and storage resources to be used by Cloud Spanner databases. - # - # Each instance has a "configuration", which dictates where the - # serving resources for the Cloud Spanner instance are located (e.g., - # US-central, Europe). Configurations are created by Google based on - # resource availability. - # - # Cloud Spanner billing is based on the instances that exist and their - # sizes. After an instance exists, there are no additional - # per-database or per-operation charges for use of the instance - # (though there may be additional network bandwidth charges). - # Instances offer isolation: problems with databases in one instance - # will not affect other instances. However, within an instance - # databases can affect each other. For example, if one database in an - # instance receives a lot of requests and consumes most of the - # instance resources, fewer resources are available for other - # databases in that instance, and their performance may suffer. - # - # @example Load this service and instantiate a gRPC client - # - # require "google/cloud/spanner/admin/instance/v1/instance_admin" - # client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new - # - # @example Load this service and instantiate a REST client - # - # require "google/cloud/spanner/admin/instance/v1/instance_admin/rest" - # client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::Client.new - # - module InstanceAdmin - end - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "instance_admin", "helpers.rb" -require "google/cloud/spanner/admin/instance/v1/instance_admin/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google/cloud/spanner/admin/instance/v1/instance_admin/client.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google/cloud/spanner/admin/instance/v1/instance_admin/client.rb deleted file mode 100644 index eced27ed0014..000000000000 --- a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google/cloud/spanner/admin/instance/v1/instance_admin/client.rb +++ /dev/null @@ -1,3140 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 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/admin/instance/v1/spanner_instance_admin_pb" - -module Google - module Cloud - module Spanner - module Admin - module Instance - module V1 - module InstanceAdmin - ## - # Client for the InstanceAdmin service. - # - # Cloud Spanner Instance Admin API - # - # The Cloud Spanner Instance Admin API can be used to create, delete, - # modify and list instances. Instances are dedicated Cloud Spanner serving - # and storage resources to be used by Cloud Spanner databases. - # - # Each instance has a "configuration", which dictates where the - # serving resources for the Cloud Spanner instance are located (e.g., - # US-central, Europe). Configurations are created by Google based on - # resource availability. - # - # Cloud Spanner billing is based on the instances that exist and their - # sizes. After an instance exists, there are no additional - # per-database or per-operation charges for use of the instance - # (though there may be additional network bandwidth charges). - # Instances offer isolation: problems with databases in one instance - # will not affect other instances. However, within an instance - # databases can affect each other. For example, if one database in an - # instance receives a lot of requests and consumes most of the - # instance resources, fewer resources are available for other - # databases in that instance, and their performance may suffer. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "spanner.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :instance_admin_stub - - ## - # Configure the InstanceAdmin Client class. - # - # See {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all InstanceAdmin clients - # ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::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", "Admin", "Instance", "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.list_instance_configs.timeout = 3600.0 - default_config.rpcs.list_instance_configs.retry_policy = { - initial_delay: 1.0, max_delay: 32.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.get_instance_config.timeout = 3600.0 - default_config.rpcs.get_instance_config.retry_policy = { - initial_delay: 1.0, max_delay: 32.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.list_instances.timeout = 3600.0 - default_config.rpcs.list_instances.retry_policy = { - initial_delay: 1.0, max_delay: 32.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.get_instance.timeout = 3600.0 - default_config.rpcs.get_instance.retry_policy = { - initial_delay: 1.0, max_delay: 32.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.create_instance.timeout = 3600.0 - - default_config.rpcs.update_instance.timeout = 3600.0 - - default_config.rpcs.delete_instance.timeout = 3600.0 - default_config.rpcs.delete_instance.retry_policy = { - initial_delay: 1.0, max_delay: 32.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.set_iam_policy.timeout = 30.0 - - default_config.rpcs.get_iam_policy.timeout = 30.0 - default_config.rpcs.get_iam_policy.retry_policy = { - initial_delay: 1.0, max_delay: 32.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.test_iam_permissions.timeout = 30.0 - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the InstanceAdmin 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::Admin::Instance::V1::InstanceAdmin::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 - @instance_admin_stub.universe_domain - end - - ## - # Create a new InstanceAdmin client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the InstanceAdmin 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/admin/instance/v1/spanner_instance_admin_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 - - @operations_client = Operations.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - - @instance_admin_stub = ::Gapic::ServiceStub.new( - ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::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 - ) - - @instance_admin_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 - - ## - # Get the associated client for long-running operations. - # - # @return [::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Operations] - # - attr_reader :operations_client - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @instance_admin_stub.logger - end - - # Service calls - - ## - # Lists the supported instance configurations for a given project. - # - # Returns both Google-managed configurations and user-managed - # configurations. - # - # @overload list_instance_configs(request, options = nil) - # Pass arguments to `list_instance_configs` via a request object, either of type - # {::Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigsRequest, ::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_instance_configs(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_instance_configs` 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 parent [::String] - # Required. The name of the project for which a list of supported instance - # configurations is requested. Values are of the form - # `projects/`. - # @param page_size [::Integer] - # Number of instance configurations 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::Admin::Instance::V1::ListInstanceConfigsResponse#next_page_token next_page_token} - # from a previous - # {::Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigsResponse ListInstanceConfigsResponse}. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/spanner/admin/instance/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigsRequest.new - # - # # Call the list_instance_configs method. - # result = client.list_instance_configs 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::Admin::Instance::V1::InstanceConfig. - # p item - # end - # - def list_instance_configs request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigsRequest - - # 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_instance_configs.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::Admin::Instance::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.parent - header_params["parent"] = request.parent - 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_instance_configs.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_instance_configs.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @instance_admin_stub.call_rpc :list_instance_configs, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @instance_admin_stub, :list_instance_configs, 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 - - ## - # Gets information about a particular instance configuration. - # - # @overload get_instance_config(request, options = nil) - # Pass arguments to `get_instance_config` via a request object, either of type - # {::Google::Cloud::Spanner::Admin::Instance::V1::GetInstanceConfigRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Spanner::Admin::Instance::V1::GetInstanceConfigRequest, ::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_instance_config(name: nil) - # Pass arguments to `get_instance_config` 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 requested instance configuration. Values are of - # the form `projects//instanceConfigs/`. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/spanner/admin/instance/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Spanner::Admin::Instance::V1::GetInstanceConfigRequest.new - # - # # Call the get_instance_config method. - # result = client.get_instance_config request - # - # # The returned object is of type Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig. - # p result - # - def get_instance_config request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Instance::V1::GetInstanceConfigRequest - - # 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_instance_config.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::Admin::Instance::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_instance_config.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_instance_config.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @instance_admin_stub.call_rpc :get_instance_config, 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 an instance configuration and begins preparing it to be used. The - # returned long-running operation - # can be used to track the progress of preparing the new - # instance configuration. The instance configuration name is assigned by the - # caller. If the named instance configuration already exists, - # `CreateInstanceConfig` returns `ALREADY_EXISTS`. - # - # Immediately after the request returns: - # - # * The instance configuration is readable via the API, with all requested - # attributes. The instance configuration's - # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig#reconciling reconciling} - # field is set to true. Its state is `CREATING`. - # - # While the operation is pending: - # - # * Cancelling the operation renders the instance configuration immediately - # unreadable via the API. - # * Except for deleting the creating resource, all other attempts to modify - # the instance configuration are rejected. - # - # Upon completion of the returned operation: - # - # * Instances can be created using the instance configuration. - # * The instance configuration's - # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig#reconciling reconciling} - # field becomes false. Its state becomes `READY`. - # - # The returned long-running operation will - # have a name of the format - # `/operations/` and can be used to track - # creation of the instance configuration. The - # metadata field type is - # {::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstanceConfigMetadata CreateInstanceConfigMetadata}. - # The response field type is - # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig InstanceConfig}, if - # successful. - # - # Authorization requires `spanner.instanceConfigs.create` permission on - # the resource - # {::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstanceConfigRequest#parent parent}. - # - # @overload create_instance_config(request, options = nil) - # Pass arguments to `create_instance_config` via a request object, either of type - # {::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstanceConfigRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstanceConfigRequest, ::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_instance_config(parent: nil, instance_config_id: nil, instance_config: nil, validate_only: nil) - # Pass arguments to `create_instance_config` 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 parent [::String] - # Required. The name of the project in which to create the instance - # configuration. Values are of the form `projects/`. - # @param instance_config_id [::String] - # Required. The ID of the instance configuration to create. Valid identifiers - # are of the form `custom-[-a-z0-9]*[a-z0-9]` and must be between 2 and 64 - # characters in length. The `custom-` prefix is required to avoid name - # conflicts with Google-managed configurations. - # @param instance_config [::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig, ::Hash] - # Required. The `InstanceConfig` proto of the configuration to create. - # `instance_config.name` must be - # `/instanceConfigs/`. - # `instance_config.base_config` must be a Google-managed configuration name, - # e.g. /instanceConfigs/us-east1, /instanceConfigs/nam3. - # @param validate_only [::Boolean] - # An option to validate, but not actually execute, a request, - # and provide the same response. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/spanner/admin/instance/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Spanner::Admin::Instance::V1::CreateInstanceConfigRequest.new - # - # # Call the create_instance_config method. - # result = client.create_instance_config request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def create_instance_config request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstanceConfigRequest - - # 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_instance_config.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::Admin::Instance::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.parent - header_params["parent"] = request.parent - 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_instance_config.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_instance_config.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @instance_admin_stub.call_rpc :create_instance_config, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Updates an instance configuration. The returned - # long-running operation can be used to track - # the progress of updating the instance. If the named instance configuration - # does not exist, returns `NOT_FOUND`. - # - # Only user-managed configurations can be updated. - # - # Immediately after the request returns: - # - # * The instance configuration's - # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig#reconciling reconciling} - # field is set to true. - # - # While the operation is pending: - # - # * Cancelling the operation sets its metadata's - # {::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstanceConfigMetadata#cancel_time cancel_time}. - # The operation is guaranteed to succeed at undoing all changes, after - # which point it terminates with a `CANCELLED` status. - # * All other attempts to modify the instance configuration are rejected. - # * Reading the instance configuration via the API continues to give the - # pre-request values. - # - # Upon completion of the returned operation: - # - # * Creating instances using the instance configuration uses the new - # values. - # * The new values of the instance configuration are readable via the API. - # * The instance configuration's - # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig#reconciling reconciling} - # field becomes false. - # - # The returned long-running operation will - # have a name of the format - # `/operations/` and can be used to track - # the instance configuration modification. The - # metadata field type is - # {::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstanceConfigMetadata UpdateInstanceConfigMetadata}. - # The response field type is - # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig InstanceConfig}, if - # successful. - # - # Authorization requires `spanner.instanceConfigs.update` permission on - # the resource {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig#name name}. - # - # @overload update_instance_config(request, options = nil) - # Pass arguments to `update_instance_config` via a request object, either of type - # {::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstanceConfigRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstanceConfigRequest, ::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 update_instance_config(instance_config: nil, update_mask: nil, validate_only: nil) - # Pass arguments to `update_instance_config` 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 instance_config [::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig, ::Hash] - # Required. The user instance configuration to update, which must always - # include the instance configuration name. Otherwise, only fields mentioned - # in - # {::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstanceConfigRequest#update_mask update_mask} - # need be included. To prevent conflicts of concurrent updates, - # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig#reconciling etag} can - # be used. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Required. A mask specifying which fields in - # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig InstanceConfig} should be - # updated. The field mask must always be specified; this prevents any future - # fields in {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig InstanceConfig} - # from being erased accidentally by clients that do not know about them. Only - # display_name and labels can be updated. - # @param validate_only [::Boolean] - # An option to validate, but not actually execute, a request, - # and provide the same response. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/spanner/admin/instance/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstanceConfigRequest.new - # - # # Call the update_instance_config method. - # result = client.update_instance_config request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def update_instance_config request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstanceConfigRequest - - # 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.update_instance_config.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::Admin::Instance::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.instance_config&.name - header_params["instance_config.name"] = request.instance_config.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.update_instance_config.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_instance_config.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @instance_admin_stub.call_rpc :update_instance_config, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes the instance configuration. Deletion is only allowed when no - # instances are using the configuration. If any instances are using - # the configuration, returns `FAILED_PRECONDITION`. - # - # Only user-managed configurations can be deleted. - # - # Authorization requires `spanner.instanceConfigs.delete` permission on - # the resource {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig#name name}. - # - # @overload delete_instance_config(request, options = nil) - # Pass arguments to `delete_instance_config` via a request object, either of type - # {::Google::Cloud::Spanner::Admin::Instance::V1::DeleteInstanceConfigRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Spanner::Admin::Instance::V1::DeleteInstanceConfigRequest, ::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_instance_config(name: nil, etag: nil, validate_only: nil) - # Pass arguments to `delete_instance_config` 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 instance configuration to be deleted. - # Values are of the form - # `projects//instanceConfigs/` - # @param etag [::String] - # Used for optimistic concurrency control as a way to help prevent - # simultaneous deletes of an instance configuration from overwriting each - # other. If not empty, the API - # only deletes the instance configuration when the etag provided matches the - # current status of the requested instance configuration. Otherwise, deletes - # the instance configuration without checking the current status of the - # requested instance configuration. - # @param validate_only [::Boolean] - # An option to validate, but not actually execute, a request, - # and provide the same response. - # - # @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/admin/instance/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Spanner::Admin::Instance::V1::DeleteInstanceConfigRequest.new - # - # # Call the delete_instance_config method. - # result = client.delete_instance_config request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_instance_config request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Instance::V1::DeleteInstanceConfigRequest - - # 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_instance_config.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::Admin::Instance::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_instance_config.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_instance_config.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @instance_admin_stub.call_rpc :delete_instance_config, 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 the user-managed instance configuration long-running - # operations in the given project. An instance - # configuration operation has a name of the form - # `projects//instanceConfigs//operations/`. - # The long-running operation - # metadata field type - # `metadata.type_url` describes the type of the metadata. Operations returned - # include those that have completed/failed/canceled within the last 7 days, - # and pending operations. Operations returned are ordered by - # `operation.metadata.value.start_time` in descending order starting - # from the most recently started operation. - # - # @overload list_instance_config_operations(request, options = nil) - # Pass arguments to `list_instance_config_operations` via a request object, either of type - # {::Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigOperationsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigOperationsRequest, ::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_instance_config_operations(parent: nil, filter: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_instance_config_operations` 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 parent [::String] - # Required. The project of the instance configuration operations. - # Values are of the form `projects/`. - # @param filter [::String] - # An expression that filters the list of returned operations. - # - # A filter expression consists of a field name, a - # comparison operator, and a value for filtering. - # The value must be a string, a number, or a boolean. The comparison operator - # must be one of: `<`, `>`, `<=`, `>=`, `!=`, `=`, or `:`. - # Colon `:` is the contains operator. Filter rules are not case sensitive. - # - # The following fields in the Operation are eligible for filtering: - # - # * `name` - The name of the long-running operation - # * `done` - False if the operation is in progress, else true. - # * `metadata.@type` - the type of metadata. For example, the type string - # for - # {::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstanceConfigMetadata CreateInstanceConfigMetadata} - # is - # `type.googleapis.com/google.spanner.admin.instance.v1.CreateInstanceConfigMetadata`. - # * `metadata.` - any field in metadata.value. - # `metadata.@type` must be specified first, if filtering on metadata - # fields. - # * `error` - Error associated with the long-running operation. - # * `response.@type` - the type of response. - # * `response.` - any field in response.value. - # - # You can combine multiple expressions by enclosing each expression in - # parentheses. By default, expressions are combined with AND logic. However, - # you can specify AND, OR, and NOT logic explicitly. - # - # Here are a few examples: - # - # * `done:true` - The operation is complete. - # * `(metadata.@type=` \ - # `type.googleapis.com/google.spanner.admin.instance.v1.CreateInstanceConfigMetadata) - # AND` \ - # `(metadata.instance_config.name:custom-config) AND` \ - # `(metadata.progress.start_time < \"2021-03-28T14:50:00Z\") AND` \ - # `(error:*)` - Return operations where: - # * The operation's metadata type is - # {::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstanceConfigMetadata CreateInstanceConfigMetadata}. - # * The instance configuration name contains "custom-config". - # * The operation started before 2021-03-28T14:50:00Z. - # * The operation resulted in an error. - # @param page_size [::Integer] - # Number of operations 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::Admin::Instance::V1::ListInstanceConfigOperationsResponse#next_page_token next_page_token} - # from a previous - # {::Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigOperationsResponse ListInstanceConfigOperationsResponse} - # to the same `parent` and with the same `filter`. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Gapic::Operation>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Gapic::Operation>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/spanner/admin/instance/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigOperationsRequest.new - # - # # Call the list_instance_config_operations method. - # result = client.list_instance_config_operations 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::Longrunning::Operation. - # p item - # end - # - def list_instance_config_operations request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigOperationsRequest - - # 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_instance_config_operations.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::Admin::Instance::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.parent - header_params["parent"] = request.parent - 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_instance_config_operations.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_instance_config_operations.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @instance_admin_stub.call_rpc :list_instance_config_operations, request, options: options do |response, operation| - wrap_lro_operation = ->(op_response) { ::Gapic::Operation.new op_response, @operations_client } - response = ::Gapic::PagedEnumerable.new @instance_admin_stub, :list_instance_config_operations, request, response, operation, options, format_resource: wrap_lro_operation - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Lists all instances in the given project. - # - # @overload list_instances(request, options = nil) - # Pass arguments to `list_instances` via a request object, either of type - # {::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancesRequest, ::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_instances(parent: nil, page_size: nil, page_token: nil, filter: nil, instance_deadline: nil) - # Pass arguments to `list_instances` 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 parent [::String] - # Required. The name of the project for which a list of instances is - # requested. Values are of the form `projects/`. - # @param page_size [::Integer] - # Number of instances 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::Admin::Instance::V1::ListInstancesResponse#next_page_token next_page_token} - # from a previous - # {::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancesResponse ListInstancesResponse}. - # @param filter [::String] - # An expression for filtering the results of the request. Filter rules are - # case insensitive. The fields eligible for filtering are: - # - # * `name` - # * `display_name` - # * `labels.key` where key is the name of a label - # - # Some examples of using filters are: - # - # * `name:*` --> The instance has a name. - # * `name:Howl` --> The instance's name contains the string "howl". - # * `name:HOWL` --> Equivalent to above. - # * `NAME:howl` --> Equivalent to above. - # * `labels.env:*` --> The instance has the label "env". - # * `labels.env:dev` --> The instance has the label "env" and the value of - # the label contains the string "dev". - # * `name:howl labels.env:dev` --> The instance's name contains "howl" and - # it has the label "env" with its value - # containing "dev". - # @param instance_deadline [::Google::Protobuf::Timestamp, ::Hash] - # Deadline used while retrieving metadata for instances. - # Instances whose metadata cannot be retrieved within this deadline will be - # added to - # {::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancesResponse#unreachable unreachable} - # in - # {::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancesResponse ListInstancesResponse}. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Spanner::Admin::Instance::V1::Instance>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::Spanner::Admin::Instance::V1::Instance>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/spanner/admin/instance/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Spanner::Admin::Instance::V1::ListInstancesRequest.new - # - # # Call the list_instances method. - # result = client.list_instances 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::Admin::Instance::V1::Instance. - # p item - # end - # - def list_instances request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancesRequest - - # 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_instances.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::Admin::Instance::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.parent - header_params["parent"] = request.parent - 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_instances.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_instances.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @instance_admin_stub.call_rpc :list_instances, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @instance_admin_stub, :list_instances, 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 - - ## - # Lists all instance partitions for the given instance. - # - # @overload list_instance_partitions(request, options = nil) - # Pass arguments to `list_instance_partitions` via a request object, either of type - # {::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionsRequest, ::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_instance_partitions(parent: nil, page_size: nil, page_token: nil, instance_partition_deadline: nil) - # Pass arguments to `list_instance_partitions` 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 parent [::String] - # Required. The instance whose instance partitions should be listed. Values - # are of the form `projects//instances/`. Use `{instance} - # = '-'` to list instance partitions for all Instances in a project, e.g., - # `projects/myproject/instances/-`. - # @param page_size [::Integer] - # Number of instance partitions 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::Admin::Instance::V1::ListInstancePartitionsResponse#next_page_token next_page_token} - # from a previous - # {::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionsResponse ListInstancePartitionsResponse}. - # @param instance_partition_deadline [::Google::Protobuf::Timestamp, ::Hash] - # Optional. Deadline used while retrieving metadata for instance partitions. - # Instance partitions whose metadata cannot be retrieved within this deadline - # will be added to - # {::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionsResponse#unreachable unreachable} - # in - # {::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionsResponse ListInstancePartitionsResponse}. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Spanner::Admin::Instance::V1::InstancePartition>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::Spanner::Admin::Instance::V1::InstancePartition>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/spanner/admin/instance/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionsRequest.new - # - # # Call the list_instance_partitions method. - # result = client.list_instance_partitions 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::Admin::Instance::V1::InstancePartition. - # p item - # end - # - def list_instance_partitions request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionsRequest - - # 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_instance_partitions.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::Admin::Instance::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.parent - header_params["parent"] = request.parent - 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_instance_partitions.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_instance_partitions.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @instance_admin_stub.call_rpc :list_instance_partitions, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @instance_admin_stub, :list_instance_partitions, 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 - - ## - # Gets information about a particular instance. - # - # @overload get_instance(request, options = nil) - # Pass arguments to `get_instance` via a request object, either of type - # {::Google::Cloud::Spanner::Admin::Instance::V1::GetInstanceRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Spanner::Admin::Instance::V1::GetInstanceRequest, ::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_instance(name: nil, field_mask: nil) - # Pass arguments to `get_instance` 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 requested instance. Values are of the form - # `projects//instances/`. - # @param field_mask [::Google::Protobuf::FieldMask, ::Hash] - # If field_mask is present, specifies the subset of - # {::Google::Cloud::Spanner::Admin::Instance::V1::Instance Instance} fields that should be - # returned. If absent, all - # {::Google::Cloud::Spanner::Admin::Instance::V1::Instance Instance} fields are returned. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Spanner::Admin::Instance::V1::Instance] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Spanner::Admin::Instance::V1::Instance] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/spanner/admin/instance/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Spanner::Admin::Instance::V1::GetInstanceRequest.new - # - # # Call the get_instance method. - # result = client.get_instance request - # - # # The returned object is of type Google::Cloud::Spanner::Admin::Instance::V1::Instance. - # p result - # - def get_instance request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Instance::V1::GetInstanceRequest - - # 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_instance.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::Admin::Instance::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_instance.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_instance.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @instance_admin_stub.call_rpc :get_instance, 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 an instance and begins preparing it to begin serving. The - # returned long-running operation - # can be used to track the progress of preparing the new - # instance. The instance name is assigned by the caller. If the - # named instance already exists, `CreateInstance` returns - # `ALREADY_EXISTS`. - # - # Immediately upon completion of this request: - # - # * The instance is readable via the API, with all requested attributes - # but no allocated resources. Its state is `CREATING`. - # - # Until completion of the returned operation: - # - # * Cancelling the operation renders the instance immediately unreadable - # via the API. - # * The instance can be deleted. - # * All other attempts to modify the instance are rejected. - # - # Upon completion of the returned operation: - # - # * Billing for all successfully-allocated resources begins (some types - # may have lower than the requested levels). - # * Databases can be created in the instance. - # * The instance's allocated resource levels are readable via the API. - # * The instance's state becomes `READY`. - # - # The returned long-running operation will - # have a name of the format `/operations/` and - # can be used to track creation of the instance. The - # metadata field type is - # {::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstanceMetadata CreateInstanceMetadata}. - # The response field type is - # {::Google::Cloud::Spanner::Admin::Instance::V1::Instance Instance}, if successful. - # - # @overload create_instance(request, options = nil) - # Pass arguments to `create_instance` via a request object, either of type - # {::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstanceRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstanceRequest, ::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_instance(parent: nil, instance_id: nil, instance: nil) - # Pass arguments to `create_instance` 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 parent [::String] - # Required. The name of the project in which to create the instance. Values - # are of the form `projects/`. - # @param instance_id [::String] - # Required. The ID of the instance to create. Valid identifiers are of the - # form `[a-z][-a-z0-9]*[a-z0-9]` and must be between 2 and 64 characters in - # length. - # @param instance [::Google::Cloud::Spanner::Admin::Instance::V1::Instance, ::Hash] - # Required. The instance to create. The name may be omitted, but if - # specified must be `/instances/`. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/spanner/admin/instance/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Spanner::Admin::Instance::V1::CreateInstanceRequest.new - # - # # Call the create_instance method. - # result = client.create_instance request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def create_instance request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstanceRequest - - # 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_instance.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::Admin::Instance::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.parent - header_params["parent"] = request.parent - 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_instance.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_instance.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @instance_admin_stub.call_rpc :create_instance, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Updates an instance, and begins allocating or releasing resources - # as requested. The returned long-running operation can be used to track the - # progress of updating the instance. If the named instance does not - # exist, returns `NOT_FOUND`. - # - # Immediately upon completion of this request: - # - # * For resource types for which a decrease in the instance's allocation - # has been requested, billing is based on the newly-requested level. - # - # Until completion of the returned operation: - # - # * Cancelling the operation sets its metadata's - # {::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstanceMetadata#cancel_time cancel_time}, - # and begins restoring resources to their pre-request values. The - # operation is guaranteed to succeed at undoing all resource changes, - # after which point it terminates with a `CANCELLED` status. - # * All other attempts to modify the instance are rejected. - # * Reading the instance via the API continues to give the pre-request - # resource levels. - # - # Upon completion of the returned operation: - # - # * Billing begins for all successfully-allocated resources (some types - # may have lower than the requested levels). - # * All newly-reserved resources are available for serving the instance's - # tables. - # * The instance's new resource levels are readable via the API. - # - # The returned long-running operation will - # have a name of the format `/operations/` and - # can be used to track the instance modification. The - # metadata field type is - # {::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstanceMetadata UpdateInstanceMetadata}. - # The response field type is - # {::Google::Cloud::Spanner::Admin::Instance::V1::Instance Instance}, if successful. - # - # Authorization requires `spanner.instances.update` permission on - # the resource {::Google::Cloud::Spanner::Admin::Instance::V1::Instance#name name}. - # - # @overload update_instance(request, options = nil) - # Pass arguments to `update_instance` via a request object, either of type - # {::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstanceRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstanceRequest, ::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 update_instance(instance: nil, field_mask: nil) - # Pass arguments to `update_instance` 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 instance [::Google::Cloud::Spanner::Admin::Instance::V1::Instance, ::Hash] - # Required. The instance to update, which must always include the instance - # name. Otherwise, only fields mentioned in - # {::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstanceRequest#field_mask field_mask} - # need be included. - # @param field_mask [::Google::Protobuf::FieldMask, ::Hash] - # Required. A mask specifying which fields in - # {::Google::Cloud::Spanner::Admin::Instance::V1::Instance Instance} should be updated. - # The field mask must always be specified; this prevents any future fields in - # {::Google::Cloud::Spanner::Admin::Instance::V1::Instance Instance} from being erased - # accidentally by clients that do not know about them. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/spanner/admin/instance/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstanceRequest.new - # - # # Call the update_instance method. - # result = client.update_instance request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def update_instance request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstanceRequest - - # 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.update_instance.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::Admin::Instance::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.instance&.name - header_params["instance.name"] = request.instance.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.update_instance.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_instance.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @instance_admin_stub.call_rpc :update_instance, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes an instance. - # - # Immediately upon completion of the request: - # - # * Billing ceases for all of the instance's reserved resources. - # - # Soon afterward: - # - # * The instance and *all of its databases* immediately and - # irrevocably disappear from the API. All data in the databases - # is permanently deleted. - # - # @overload delete_instance(request, options = nil) - # Pass arguments to `delete_instance` via a request object, either of type - # {::Google::Cloud::Spanner::Admin::Instance::V1::DeleteInstanceRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Spanner::Admin::Instance::V1::DeleteInstanceRequest, ::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_instance(name: nil) - # Pass arguments to `delete_instance` 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 instance to be deleted. Values are of the form - # `projects//instances/` - # - # @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/admin/instance/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Spanner::Admin::Instance::V1::DeleteInstanceRequest.new - # - # # Call the delete_instance method. - # result = client.delete_instance request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_instance request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Instance::V1::DeleteInstanceRequest - - # 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_instance.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::Admin::Instance::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_instance.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_instance.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @instance_admin_stub.call_rpc :delete_instance, 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 - - ## - # Sets the access control policy on an instance resource. Replaces any - # existing policy. - # - # Authorization requires `spanner.instances.setIamPolicy` on - # [resource][google.iam.v1.SetIamPolicyRequest.resource]. - # - # @overload set_iam_policy(request, options = nil) - # Pass arguments to `set_iam_policy` via a request object, either of type - # {::Google::Iam::V1::SetIamPolicyRequest} or an equivalent Hash. - # - # @param request [::Google::Iam::V1::SetIamPolicyRequest, ::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 set_iam_policy(resource: nil, policy: nil, update_mask: nil) - # Pass arguments to `set_iam_policy` 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 resource [::String] - # REQUIRED: The resource for which the policy is being specified. - # See the operation documentation for the appropriate value for this field. - # @param policy [::Google::Iam::V1::Policy, ::Hash] - # REQUIRED: The complete policy to be applied to the `resource`. The size of - # the policy is limited to a few 10s of KB. An empty policy is a - # valid policy but certain Cloud Platform services (such as Projects) - # might reject them. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only - # the fields in the mask will be modified. If no mask is provided, the - # following default mask is used: - # - # `paths: "bindings, etag"` - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Iam::V1::Policy] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Iam::V1::Policy] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/spanner/admin/instance/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Iam::V1::SetIamPolicyRequest.new - # - # # Call the set_iam_policy method. - # result = client.set_iam_policy request - # - # # The returned object is of type Google::Iam::V1::Policy. - # p result - # - def set_iam_policy request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::SetIamPolicyRequest - - # 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.set_iam_policy.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::Admin::Instance::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.resource - header_params["resource"] = request.resource - 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.set_iam_policy.timeout, - metadata: metadata, - retry_policy: @config.rpcs.set_iam_policy.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @instance_admin_stub.call_rpc :set_iam_policy, 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 the access control policy for an instance resource. Returns an empty - # policy if an instance exists but does not have a policy set. - # - # Authorization requires `spanner.instances.getIamPolicy` on - # [resource][google.iam.v1.GetIamPolicyRequest.resource]. - # - # @overload get_iam_policy(request, options = nil) - # Pass arguments to `get_iam_policy` via a request object, either of type - # {::Google::Iam::V1::GetIamPolicyRequest} or an equivalent Hash. - # - # @param request [::Google::Iam::V1::GetIamPolicyRequest, ::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_iam_policy(resource: nil, options: nil) - # Pass arguments to `get_iam_policy` 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 resource [::String] - # REQUIRED: The resource for which the policy is being requested. - # See the operation documentation for the appropriate value for this field. - # @param options [::Google::Iam::V1::GetPolicyOptions, ::Hash] - # OPTIONAL: A `GetPolicyOptions` object for specifying options to - # `GetIamPolicy`. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Iam::V1::Policy] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Iam::V1::Policy] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/spanner/admin/instance/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Iam::V1::GetIamPolicyRequest.new - # - # # Call the get_iam_policy method. - # result = client.get_iam_policy request - # - # # The returned object is of type Google::Iam::V1::Policy. - # p result - # - def get_iam_policy request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::GetIamPolicyRequest - - # 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_iam_policy.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::Admin::Instance::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.resource - header_params["resource"] = request.resource - 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_iam_policy.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_iam_policy.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @instance_admin_stub.call_rpc :get_iam_policy, 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 - - ## - # Returns permissions that the caller has on the specified instance resource. - # - # Attempting this RPC on a non-existent Cloud Spanner instance resource will - # result in a NOT_FOUND error if the user has `spanner.instances.list` - # permission on the containing Google Cloud Project. Otherwise returns an - # empty set of permissions. - # - # @overload test_iam_permissions(request, options = nil) - # Pass arguments to `test_iam_permissions` via a request object, either of type - # {::Google::Iam::V1::TestIamPermissionsRequest} or an equivalent Hash. - # - # @param request [::Google::Iam::V1::TestIamPermissionsRequest, ::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 test_iam_permissions(resource: nil, permissions: nil) - # Pass arguments to `test_iam_permissions` 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 resource [::String] - # REQUIRED: The resource for which the policy detail is being requested. - # See the operation documentation for the appropriate value for this field. - # @param permissions [::Array<::String>] - # The set of permissions to check for the `resource`. Permissions with - # wildcards (such as '*' or 'storage.*') are not allowed. For more - # information see - # [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Iam::V1::TestIamPermissionsResponse] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Iam::V1::TestIamPermissionsResponse] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/spanner/admin/instance/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Iam::V1::TestIamPermissionsRequest.new - # - # # Call the test_iam_permissions method. - # result = client.test_iam_permissions request - # - # # The returned object is of type Google::Iam::V1::TestIamPermissionsResponse. - # p result - # - def test_iam_permissions request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::TestIamPermissionsRequest - - # 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.test_iam_permissions.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::Admin::Instance::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.resource - header_params["resource"] = request.resource - 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.test_iam_permissions.timeout, - metadata: metadata, - retry_policy: @config.rpcs.test_iam_permissions.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @instance_admin_stub.call_rpc :test_iam_permissions, 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 information about a particular instance partition. - # - # @overload get_instance_partition(request, options = nil) - # Pass arguments to `get_instance_partition` via a request object, either of type - # {::Google::Cloud::Spanner::Admin::Instance::V1::GetInstancePartitionRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Spanner::Admin::Instance::V1::GetInstancePartitionRequest, ::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_instance_partition(name: nil) - # Pass arguments to `get_instance_partition` 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 requested instance partition. Values are of - # the form - # `projects/{project}/instances/{instance}/instancePartitions/{instance_partition}`. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Spanner::Admin::Instance::V1::InstancePartition] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Spanner::Admin::Instance::V1::InstancePartition] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/spanner/admin/instance/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Spanner::Admin::Instance::V1::GetInstancePartitionRequest.new - # - # # Call the get_instance_partition method. - # result = client.get_instance_partition request - # - # # The returned object is of type Google::Cloud::Spanner::Admin::Instance::V1::InstancePartition. - # p result - # - def get_instance_partition request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Instance::V1::GetInstancePartitionRequest - - # 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_instance_partition.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::Admin::Instance::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_instance_partition.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_instance_partition.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @instance_admin_stub.call_rpc :get_instance_partition, 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 an instance partition and begins preparing it to be used. The - # returned long-running operation - # can be used to track the progress of preparing the new instance partition. - # The instance partition name is assigned by the caller. If the named - # instance partition already exists, `CreateInstancePartition` returns - # `ALREADY_EXISTS`. - # - # Immediately upon completion of this request: - # - # * The instance partition is readable via the API, with all requested - # attributes but no allocated resources. Its state is `CREATING`. - # - # Until completion of the returned operation: - # - # * Cancelling the operation renders the instance partition immediately - # unreadable via the API. - # * The instance partition can be deleted. - # * All other attempts to modify the instance partition are rejected. - # - # Upon completion of the returned operation: - # - # * Billing for all successfully-allocated resources begins (some types - # may have lower than the requested levels). - # * Databases can start using this instance partition. - # * The instance partition's allocated resource levels are readable via the - # API. - # * The instance partition's state becomes `READY`. - # - # The returned long-running operation will - # have a name of the format - # `/operations/` and can be used to - # track creation of the instance partition. The - # metadata field type is - # {::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstancePartitionMetadata CreateInstancePartitionMetadata}. - # The response field type is - # {::Google::Cloud::Spanner::Admin::Instance::V1::InstancePartition InstancePartition}, if - # successful. - # - # @overload create_instance_partition(request, options = nil) - # Pass arguments to `create_instance_partition` via a request object, either of type - # {::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstancePartitionRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstancePartitionRequest, ::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_instance_partition(parent: nil, instance_partition_id: nil, instance_partition: nil) - # Pass arguments to `create_instance_partition` 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 parent [::String] - # Required. The name of the instance in which to create the instance - # partition. Values are of the form - # `projects//instances/`. - # @param instance_partition_id [::String] - # Required. The ID of the instance partition to create. Valid identifiers are - # of the form `[a-z][-a-z0-9]*[a-z0-9]` and must be between 2 and 64 - # characters in length. - # @param instance_partition [::Google::Cloud::Spanner::Admin::Instance::V1::InstancePartition, ::Hash] - # Required. The instance partition to create. The instance_partition.name may - # be omitted, but if specified must be - # `/instancePartitions/`. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/spanner/admin/instance/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Spanner::Admin::Instance::V1::CreateInstancePartitionRequest.new - # - # # Call the create_instance_partition method. - # result = client.create_instance_partition request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def create_instance_partition request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstancePartitionRequest - - # 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_instance_partition.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::Admin::Instance::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.parent - header_params["parent"] = request.parent - 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_instance_partition.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_instance_partition.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @instance_admin_stub.call_rpc :create_instance_partition, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes an existing instance partition. Requires that the - # instance partition is not used by any database or backup and is not the - # default instance partition of an instance. - # - # Authorization requires `spanner.instancePartitions.delete` permission on - # the resource - # {::Google::Cloud::Spanner::Admin::Instance::V1::InstancePartition#name name}. - # - # @overload delete_instance_partition(request, options = nil) - # Pass arguments to `delete_instance_partition` via a request object, either of type - # {::Google::Cloud::Spanner::Admin::Instance::V1::DeleteInstancePartitionRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Spanner::Admin::Instance::V1::DeleteInstancePartitionRequest, ::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_instance_partition(name: nil, etag: nil) - # Pass arguments to `delete_instance_partition` 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 instance partition to be deleted. - # Values are of the form - # `projects/{project}/instances/{instance}/instancePartitions/{instance_partition}` - # @param etag [::String] - # Optional. If not empty, the API only deletes the instance partition when - # the etag provided matches the current status of the requested instance - # partition. Otherwise, deletes the instance partition without checking the - # current status of the requested instance partition. - # - # @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/admin/instance/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Spanner::Admin::Instance::V1::DeleteInstancePartitionRequest.new - # - # # Call the delete_instance_partition method. - # result = client.delete_instance_partition request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_instance_partition request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Instance::V1::DeleteInstancePartitionRequest - - # 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_instance_partition.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::Admin::Instance::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_instance_partition.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_instance_partition.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @instance_admin_stub.call_rpc :delete_instance_partition, 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 - - ## - # Updates an instance partition, and begins allocating or releasing resources - # as requested. The returned long-running operation can be used to track the - # progress of updating the instance partition. If the named instance - # partition does not exist, returns `NOT_FOUND`. - # - # Immediately upon completion of this request: - # - # * For resource types for which a decrease in the instance partition's - # allocation has been requested, billing is based on the newly-requested - # level. - # - # Until completion of the returned operation: - # - # * Cancelling the operation sets its metadata's - # {::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstancePartitionMetadata#cancel_time cancel_time}, - # and begins restoring resources to their pre-request values. The - # operation is guaranteed to succeed at undoing all resource changes, - # after which point it terminates with a `CANCELLED` status. - # * All other attempts to modify the instance partition are rejected. - # * Reading the instance partition via the API continues to give the - # pre-request resource levels. - # - # Upon completion of the returned operation: - # - # * Billing begins for all successfully-allocated resources (some types - # may have lower than the requested levels). - # * All newly-reserved resources are available for serving the instance - # partition's tables. - # * The instance partition's new resource levels are readable via the API. - # - # The returned long-running operation will - # have a name of the format - # `/operations/` and can be used to - # track the instance partition modification. The - # metadata field type is - # {::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstancePartitionMetadata UpdateInstancePartitionMetadata}. - # The response field type is - # {::Google::Cloud::Spanner::Admin::Instance::V1::InstancePartition InstancePartition}, if - # successful. - # - # Authorization requires `spanner.instancePartitions.update` permission on - # the resource - # {::Google::Cloud::Spanner::Admin::Instance::V1::InstancePartition#name name}. - # - # @overload update_instance_partition(request, options = nil) - # Pass arguments to `update_instance_partition` via a request object, either of type - # {::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstancePartitionRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstancePartitionRequest, ::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 update_instance_partition(instance_partition: nil, field_mask: nil) - # Pass arguments to `update_instance_partition` 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 instance_partition [::Google::Cloud::Spanner::Admin::Instance::V1::InstancePartition, ::Hash] - # Required. The instance partition to update, which must always include the - # instance partition name. Otherwise, only fields mentioned in - # {::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstancePartitionRequest#field_mask field_mask} - # need be included. - # @param field_mask [::Google::Protobuf::FieldMask, ::Hash] - # Required. A mask specifying which fields in - # {::Google::Cloud::Spanner::Admin::Instance::V1::InstancePartition InstancePartition} - # should be updated. The field mask must always be specified; this prevents - # any future fields in - # {::Google::Cloud::Spanner::Admin::Instance::V1::InstancePartition InstancePartition} - # from being erased accidentally by clients that do not know about them. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/spanner/admin/instance/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstancePartitionRequest.new - # - # # Call the update_instance_partition method. - # result = client.update_instance_partition request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def update_instance_partition request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstancePartitionRequest - - # 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.update_instance_partition.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::Admin::Instance::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.instance_partition&.name - header_params["instance_partition.name"] = request.instance_partition.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.update_instance_partition.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_instance_partition.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @instance_admin_stub.call_rpc :update_instance_partition, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Lists instance partition long-running operations in the given instance. - # An instance partition operation has a name of the form - # `projects//instances//instancePartitions//operations/`. - # The long-running operation - # metadata field type - # `metadata.type_url` describes the type of the metadata. Operations returned - # include those that have completed/failed/canceled within the last 7 days, - # and pending operations. Operations returned are ordered by - # `operation.metadata.value.start_time` in descending order starting from the - # most recently started operation. - # - # Authorization requires `spanner.instancePartitionOperations.list` - # permission on the resource - # {::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionOperationsRequest#parent parent}. - # - # @overload list_instance_partition_operations(request, options = nil) - # Pass arguments to `list_instance_partition_operations` via a request object, either of type - # {::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionOperationsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionOperationsRequest, ::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_instance_partition_operations(parent: nil, filter: nil, page_size: nil, page_token: nil, instance_partition_deadline: nil) - # Pass arguments to `list_instance_partition_operations` 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 parent [::String] - # Required. The parent instance of the instance partition operations. - # Values are of the form `projects//instances/`. - # @param filter [::String] - # Optional. An expression that filters the list of returned operations. - # - # A filter expression consists of a field name, a - # comparison operator, and a value for filtering. - # The value must be a string, a number, or a boolean. The comparison operator - # must be one of: `<`, `>`, `<=`, `>=`, `!=`, `=`, or `:`. - # Colon `:` is the contains operator. Filter rules are not case sensitive. - # - # The following fields in the Operation are eligible for filtering: - # - # * `name` - The name of the long-running operation - # * `done` - False if the operation is in progress, else true. - # * `metadata.@type` - the type of metadata. For example, the type string - # for - # {::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstancePartitionMetadata CreateInstancePartitionMetadata} - # is - # `type.googleapis.com/google.spanner.admin.instance.v1.CreateInstancePartitionMetadata`. - # * `metadata.` - any field in metadata.value. - # `metadata.@type` must be specified first, if filtering on metadata - # fields. - # * `error` - Error associated with the long-running operation. - # * `response.@type` - the type of response. - # * `response.` - any field in response.value. - # - # You can combine multiple expressions by enclosing each expression in - # parentheses. By default, expressions are combined with AND logic. However, - # you can specify AND, OR, and NOT logic explicitly. - # - # Here are a few examples: - # - # * `done:true` - The operation is complete. - # * `(metadata.@type=` \ - # `type.googleapis.com/google.spanner.admin.instance.v1.CreateInstancePartitionMetadata) - # AND` \ - # `(metadata.instance_partition.name:custom-instance-partition) AND` \ - # `(metadata.start_time < \"2021-03-28T14:50:00Z\") AND` \ - # `(error:*)` - Return operations where: - # * The operation's metadata type is - # {::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstancePartitionMetadata CreateInstancePartitionMetadata}. - # * The instance partition name contains "custom-instance-partition". - # * The operation started before 2021-03-28T14:50:00Z. - # * The operation resulted in an error. - # @param page_size [::Integer] - # Optional. Number of operations to be returned in the response. If 0 or - # less, defaults to the server's maximum allowed page size. - # @param page_token [::String] - # Optional. If non-empty, `page_token` should contain a - # {::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionOperationsResponse#next_page_token next_page_token} - # from a previous - # {::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionOperationsResponse ListInstancePartitionOperationsResponse} - # to the same `parent` and with the same `filter`. - # @param instance_partition_deadline [::Google::Protobuf::Timestamp, ::Hash] - # Optional. Deadline used while retrieving metadata for instance partition - # operations. Instance partitions whose operation metadata cannot be - # retrieved within this deadline will be added to - # {::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionOperationsResponse#unreachable_instance_partitions unreachable_instance_partitions} - # in - # {::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionOperationsResponse ListInstancePartitionOperationsResponse}. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Gapic::Operation>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Gapic::Operation>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/spanner/admin/instance/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionOperationsRequest.new - # - # # Call the list_instance_partition_operations method. - # result = client.list_instance_partition_operations 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::Longrunning::Operation. - # p item - # end - # - def list_instance_partition_operations request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionOperationsRequest - - # 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_instance_partition_operations.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::Admin::Instance::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.parent - header_params["parent"] = request.parent - 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_instance_partition_operations.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_instance_partition_operations.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @instance_admin_stub.call_rpc :list_instance_partition_operations, request, options: options do |response, operation| - wrap_lro_operation = ->(op_response) { ::Gapic::Operation.new op_response, @operations_client } - response = ::Gapic::PagedEnumerable.new @instance_admin_stub, :list_instance_partition_operations, request, response, operation, options, format_resource: wrap_lro_operation - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Moves an instance to the target instance configuration. You can use the - # returned long-running operation to track - # the progress of moving the instance. - # - # `MoveInstance` returns `FAILED_PRECONDITION` if the instance meets any of - # the following criteria: - # - # * Is undergoing a move to a different instance configuration - # * Has backups - # * Has an ongoing update - # * Contains any CMEK-enabled databases - # * Is a free trial instance - # - # While the operation is pending: - # - # * All other attempts to modify the instance, including changes to its - # compute capacity, are rejected. - # * The following database and backup admin operations are rejected: - # - # * `DatabaseAdmin.CreateDatabase` - # * `DatabaseAdmin.UpdateDatabaseDdl` (disabled if default_leader is - # specified in the request.) - # * `DatabaseAdmin.RestoreDatabase` - # * `DatabaseAdmin.CreateBackup` - # * `DatabaseAdmin.CopyBackup` - # - # * Both the source and target instance configurations are subject to - # hourly compute and storage charges. - # * The instance might experience higher read-write latencies and a higher - # transaction abort rate. However, moving an instance doesn't cause any - # downtime. - # - # The returned long-running operation has - # a name of the format - # `/operations/` and can be used to track - # the move instance operation. The - # metadata field type is - # {::Google::Cloud::Spanner::Admin::Instance::V1::MoveInstanceMetadata MoveInstanceMetadata}. - # The response field type is - # {::Google::Cloud::Spanner::Admin::Instance::V1::Instance Instance}, - # if successful. - # Cancelling the operation sets its metadata's - # {::Google::Cloud::Spanner::Admin::Instance::V1::MoveInstanceMetadata#cancel_time cancel_time}. - # Cancellation is not immediate because it involves moving any data - # previously moved to the target instance configuration back to the original - # instance configuration. You can use this operation to track the progress of - # the cancellation. Upon successful completion of the cancellation, the - # operation terminates with `CANCELLED` status. - # - # If not cancelled, upon completion of the returned operation: - # - # * The instance successfully moves to the target instance - # configuration. - # * You are billed for compute and storage in target instance - # configuration. - # - # Authorization requires the `spanner.instances.update` permission on - # the resource {::Google::Cloud::Spanner::Admin::Instance::V1::Instance instance}. - # - # For more details, see - # [Move an instance](https://cloud.google.com/spanner/docs/move-instance). - # - # @overload move_instance(request, options = nil) - # Pass arguments to `move_instance` via a request object, either of type - # {::Google::Cloud::Spanner::Admin::Instance::V1::MoveInstanceRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Spanner::Admin::Instance::V1::MoveInstanceRequest, ::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 move_instance(name: nil, target_config: nil) - # Pass arguments to `move_instance` 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 instance to move. - # Values are of the form `projects//instances/`. - # @param target_config [::String] - # Required. The target instance configuration where to move the instance. - # Values are of the form `projects//instanceConfigs/`. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/spanner/admin/instance/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Spanner::Admin::Instance::V1::MoveInstanceRequest.new - # - # # Call the move_instance method. - # result = client.move_instance request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def move_instance request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Instance::V1::MoveInstanceRequest - - # 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.move_instance.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::Admin::Instance::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.move_instance.timeout, - metadata: metadata, - retry_policy: @config.rpcs.move_instance.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @instance_admin_stub.call_rpc :move_instance, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the InstanceAdmin API. - # - # This class represents the configuration for InstanceAdmin, - # 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::Admin::Instance::V1::InstanceAdmin::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 - # # list_instance_configs to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_instance_configs.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_instance_configs.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::Admin::Instance::V1::InstanceAdmin::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 InstanceAdmin 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 `list_instance_configs` - # @return [::Gapic::Config::Method] - # - attr_reader :list_instance_configs - ## - # RPC-specific configuration for `get_instance_config` - # @return [::Gapic::Config::Method] - # - attr_reader :get_instance_config - ## - # RPC-specific configuration for `create_instance_config` - # @return [::Gapic::Config::Method] - # - attr_reader :create_instance_config - ## - # RPC-specific configuration for `update_instance_config` - # @return [::Gapic::Config::Method] - # - attr_reader :update_instance_config - ## - # RPC-specific configuration for `delete_instance_config` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_instance_config - ## - # RPC-specific configuration for `list_instance_config_operations` - # @return [::Gapic::Config::Method] - # - attr_reader :list_instance_config_operations - ## - # RPC-specific configuration for `list_instances` - # @return [::Gapic::Config::Method] - # - attr_reader :list_instances - ## - # RPC-specific configuration for `list_instance_partitions` - # @return [::Gapic::Config::Method] - # - attr_reader :list_instance_partitions - ## - # RPC-specific configuration for `get_instance` - # @return [::Gapic::Config::Method] - # - attr_reader :get_instance - ## - # RPC-specific configuration for `create_instance` - # @return [::Gapic::Config::Method] - # - attr_reader :create_instance - ## - # RPC-specific configuration for `update_instance` - # @return [::Gapic::Config::Method] - # - attr_reader :update_instance - ## - # RPC-specific configuration for `delete_instance` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_instance - ## - # RPC-specific configuration for `set_iam_policy` - # @return [::Gapic::Config::Method] - # - attr_reader :set_iam_policy - ## - # RPC-specific configuration for `get_iam_policy` - # @return [::Gapic::Config::Method] - # - attr_reader :get_iam_policy - ## - # RPC-specific configuration for `test_iam_permissions` - # @return [::Gapic::Config::Method] - # - attr_reader :test_iam_permissions - ## - # RPC-specific configuration for `get_instance_partition` - # @return [::Gapic::Config::Method] - # - attr_reader :get_instance_partition - ## - # RPC-specific configuration for `create_instance_partition` - # @return [::Gapic::Config::Method] - # - attr_reader :create_instance_partition - ## - # RPC-specific configuration for `delete_instance_partition` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_instance_partition - ## - # RPC-specific configuration for `update_instance_partition` - # @return [::Gapic::Config::Method] - # - attr_reader :update_instance_partition - ## - # RPC-specific configuration for `list_instance_partition_operations` - # @return [::Gapic::Config::Method] - # - attr_reader :list_instance_partition_operations - ## - # RPC-specific configuration for `move_instance` - # @return [::Gapic::Config::Method] - # - attr_reader :move_instance - - # @private - def initialize parent_rpcs = nil - list_instance_configs_config = parent_rpcs.list_instance_configs if parent_rpcs.respond_to? :list_instance_configs - @list_instance_configs = ::Gapic::Config::Method.new list_instance_configs_config - get_instance_config_config = parent_rpcs.get_instance_config if parent_rpcs.respond_to? :get_instance_config - @get_instance_config = ::Gapic::Config::Method.new get_instance_config_config - create_instance_config_config = parent_rpcs.create_instance_config if parent_rpcs.respond_to? :create_instance_config - @create_instance_config = ::Gapic::Config::Method.new create_instance_config_config - update_instance_config_config = parent_rpcs.update_instance_config if parent_rpcs.respond_to? :update_instance_config - @update_instance_config = ::Gapic::Config::Method.new update_instance_config_config - delete_instance_config_config = parent_rpcs.delete_instance_config if parent_rpcs.respond_to? :delete_instance_config - @delete_instance_config = ::Gapic::Config::Method.new delete_instance_config_config - list_instance_config_operations_config = parent_rpcs.list_instance_config_operations if parent_rpcs.respond_to? :list_instance_config_operations - @list_instance_config_operations = ::Gapic::Config::Method.new list_instance_config_operations_config - list_instances_config = parent_rpcs.list_instances if parent_rpcs.respond_to? :list_instances - @list_instances = ::Gapic::Config::Method.new list_instances_config - list_instance_partitions_config = parent_rpcs.list_instance_partitions if parent_rpcs.respond_to? :list_instance_partitions - @list_instance_partitions = ::Gapic::Config::Method.new list_instance_partitions_config - get_instance_config = parent_rpcs.get_instance if parent_rpcs.respond_to? :get_instance - @get_instance = ::Gapic::Config::Method.new get_instance_config - create_instance_config = parent_rpcs.create_instance if parent_rpcs.respond_to? :create_instance - @create_instance = ::Gapic::Config::Method.new create_instance_config - update_instance_config = parent_rpcs.update_instance if parent_rpcs.respond_to? :update_instance - @update_instance = ::Gapic::Config::Method.new update_instance_config - delete_instance_config = parent_rpcs.delete_instance if parent_rpcs.respond_to? :delete_instance - @delete_instance = ::Gapic::Config::Method.new delete_instance_config - set_iam_policy_config = parent_rpcs.set_iam_policy if parent_rpcs.respond_to? :set_iam_policy - @set_iam_policy = ::Gapic::Config::Method.new set_iam_policy_config - get_iam_policy_config = parent_rpcs.get_iam_policy if parent_rpcs.respond_to? :get_iam_policy - @get_iam_policy = ::Gapic::Config::Method.new get_iam_policy_config - test_iam_permissions_config = parent_rpcs.test_iam_permissions if parent_rpcs.respond_to? :test_iam_permissions - @test_iam_permissions = ::Gapic::Config::Method.new test_iam_permissions_config - get_instance_partition_config = parent_rpcs.get_instance_partition if parent_rpcs.respond_to? :get_instance_partition - @get_instance_partition = ::Gapic::Config::Method.new get_instance_partition_config - create_instance_partition_config = parent_rpcs.create_instance_partition if parent_rpcs.respond_to? :create_instance_partition - @create_instance_partition = ::Gapic::Config::Method.new create_instance_partition_config - delete_instance_partition_config = parent_rpcs.delete_instance_partition if parent_rpcs.respond_to? :delete_instance_partition - @delete_instance_partition = ::Gapic::Config::Method.new delete_instance_partition_config - update_instance_partition_config = parent_rpcs.update_instance_partition if parent_rpcs.respond_to? :update_instance_partition - @update_instance_partition = ::Gapic::Config::Method.new update_instance_partition_config - list_instance_partition_operations_config = parent_rpcs.list_instance_partition_operations if parent_rpcs.respond_to? :list_instance_partition_operations - @list_instance_partition_operations = ::Gapic::Config::Method.new list_instance_partition_operations_config - move_instance_config = parent_rpcs.move_instance if parent_rpcs.respond_to? :move_instance - @move_instance = ::Gapic::Config::Method.new move_instance_config - - yield self if block_given? - end - end - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google/cloud/spanner/admin/instance/v1/instance_admin/credentials.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google/cloud/spanner/admin/instance/v1/instance_admin/credentials.rb deleted file mode 100644 index 612f72034300..000000000000 --- a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google/cloud/spanner/admin/instance/v1/instance_admin/credentials.rb +++ /dev/null @@ -1,56 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 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 Admin - module Instance - module V1 - module InstanceAdmin - # Credentials for the InstanceAdmin API. - class Credentials < ::Google::Auth::Credentials - self.scope = [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/spanner.admin" - ] - 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 - end -end diff --git a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google/cloud/spanner/admin/instance/v1/instance_admin/operations.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google/cloud/spanner/admin/instance/v1/instance_admin/operations.rb deleted file mode 100644 index 77ebf3d5a0cd..000000000000 --- a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google/cloud/spanner/admin/instance/v1/instance_admin/operations.rb +++ /dev/null @@ -1,845 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 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/operation" -require "google/longrunning/operations_pb" - -module Google - module Cloud - module Spanner - module Admin - module Instance - module V1 - module InstanceAdmin - # Service that implements Longrunning Operations API. - class Operations - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "spanner.$UNIVERSE_DOMAIN$" - - # @private - attr_reader :operations_stub - - ## - # Configuration for the InstanceAdmin Operations API. - # - # @yield [config] Configure the Operations client. - # @yieldparam config [Operations::Configuration] - # - # @return [Operations::Configuration] - # - def self.configure - @configure ||= Operations::Configuration.new - yield @configure if block_given? - @configure - end - - ## - # Configure the InstanceAdmin Operations 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 {Operations.configure}. - # - # @yield [config] Configure the Operations client. - # @yieldparam config [Operations::Configuration] - # - # @return [Operations::Configuration] - # - def configure - yield @config if block_given? - @config - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @operations_stub.universe_domain - end - - ## - # Create a new Operations client object. - # - # @yield [config] Configure the Client client. - # @yieldparam config [Operations::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/longrunning/operations_services_pb" - - # Create the configuration object - @config = Configuration.new Operations.configure - - # Yield the configuration if needed - yield @config if block_given? - - # Create credentials - credentials = @config.credentials - credentials ||= Credentials.default scope: @config.scope - 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 - - @operations_stub = ::Gapic::ServiceStub.new( - ::Google::Longrunning::Operations::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 - ) - - # Used by an LRO wrapper for some methods of this service - @operations_client = self - end - - # Service calls - - ## - # Lists operations that match the specified filter in the request. If the - # server doesn't support this method, it returns `UNIMPLEMENTED`. - # - # @overload list_operations(request, options = nil) - # Pass arguments to `list_operations` via a request object, either of type - # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::ListOperationsRequest, ::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_operations(name: nil, filter: nil, page_size: nil, page_token: nil, return_partial_success: nil) - # Pass arguments to `list_operations` 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] - # The name of the operation's parent resource. - # @param filter [::String] - # The standard list filter. - # @param page_size [::Integer] - # The standard list page size. - # @param page_token [::String] - # The standard list page token. - # @param return_partial_success [::Boolean] - # When set to `true`, operations that are reachable are returned as normal, - # and those that are unreachable are returned in the - # [ListOperationsResponse.unreachable] field. - # - # This can only be `true` when reading across collections e.g. when `parent` - # is set to `"projects/example/locations/-"`. - # - # This field is not by default supported and will result in an - # `UNIMPLEMENTED` error if set unless explicitly documented otherwise in - # service or product specific documentation. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Gapic::Operation>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Gapic::Operation>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::ListOperationsRequest.new - # - # # Call the list_operations method. - # result = client.list_operations 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::Longrunning::Operation. - # p item - # end - # - def list_operations request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::ListOperationsRequest - - # 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_operations.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::Admin::Instance::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.list_operations.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_operations.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :list_operations, request, options: options do |response, operation| - wrap_lro_operation = ->(op_response) { ::Gapic::Operation.new op_response, @operations_client } - response = ::Gapic::PagedEnumerable.new @operations_stub, :list_operations, request, response, operation, options, format_resource: wrap_lro_operation - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets the latest state of a long-running operation. Clients can use this - # method to poll the operation result at intervals as recommended by the API - # service. - # - # @overload get_operation(request, options = nil) - # Pass arguments to `get_operation` via a request object, either of type - # {::Google::Longrunning::GetOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::GetOperationRequest, ::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_operation(name: nil) - # Pass arguments to `get_operation` 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] - # The name of the operation resource. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::GetOperationRequest.new - # - # # Call the get_operation method. - # result = client.get_operation request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def get_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::GetOperationRequest - - # 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_operation.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::Admin::Instance::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_operation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :get_operation, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes a long-running operation. This method indicates that the client is - # no longer interested in the operation result. It does not cancel the - # operation. If the server doesn't support this method, it returns - # `google.rpc.Code.UNIMPLEMENTED`. - # - # @overload delete_operation(request, options = nil) - # Pass arguments to `delete_operation` via a request object, either of type - # {::Google::Longrunning::DeleteOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::DeleteOperationRequest, ::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_operation(name: nil) - # Pass arguments to `delete_operation` 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] - # The name of the operation resource to be deleted. - # - # @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/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::DeleteOperationRequest.new - # - # # Call the delete_operation method. - # result = client.delete_operation request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::DeleteOperationRequest - - # 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_operation.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::Admin::Instance::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_operation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :delete_operation, 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 - - ## - # Starts asynchronous cancellation on a long-running operation. The server - # makes a best effort to cancel the operation, but success is not - # guaranteed. If the server doesn't support this method, it returns - # `google.rpc.Code.UNIMPLEMENTED`. Clients can use - # Operations.GetOperation or - # other methods to check whether the cancellation succeeded or whether the - # operation completed despite cancellation. On successful cancellation, - # the operation is not deleted; instead, it becomes an operation with - # an {::Google::Longrunning::Operation#error Operation.error} value with a - # {::Google::Rpc::Status#code google.rpc.Status.code} of `1`, corresponding to - # `Code.CANCELLED`. - # - # @overload cancel_operation(request, options = nil) - # Pass arguments to `cancel_operation` via a request object, either of type - # {::Google::Longrunning::CancelOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::CancelOperationRequest, ::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 cancel_operation(name: nil) - # Pass arguments to `cancel_operation` 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] - # The name of the operation resource to be cancelled. - # - # @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/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::CancelOperationRequest.new - # - # # Call the cancel_operation method. - # result = client.cancel_operation request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def cancel_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::CancelOperationRequest - - # 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.cancel_operation.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::Admin::Instance::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.cancel_operation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.cancel_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :cancel_operation, 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 - - ## - # Waits until the specified long-running operation is done or reaches at most - # a specified timeout, returning the latest state. If the operation is - # already done, the latest state is immediately returned. If the timeout - # specified is greater than the default HTTP/RPC timeout, the HTTP/RPC - # timeout is used. If the server does not support this method, it returns - # `google.rpc.Code.UNIMPLEMENTED`. - # Note that this method is on a best-effort basis. It may return the latest - # state before the specified timeout (including immediately), meaning even an - # immediate response is no guarantee that the operation is done. - # - # @overload wait_operation(request, options = nil) - # Pass arguments to `wait_operation` via a request object, either of type - # {::Google::Longrunning::WaitOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::WaitOperationRequest, ::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 wait_operation(name: nil, timeout: nil) - # Pass arguments to `wait_operation` 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] - # The name of the operation resource to wait on. - # @param timeout [::Google::Protobuf::Duration, ::Hash] - # The maximum duration to wait before timing out. If left blank, the wait - # will be at most the time permitted by the underlying HTTP/RPC protocol. - # If RPC context deadline is also specified, the shorter one will be used. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::WaitOperationRequest.new - # - # # Call the wait_operation method. - # result = client.wait_operation request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def wait_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::WaitOperationRequest - - # 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.wait_operation.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::Admin::Instance::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 - - options.apply_defaults timeout: @config.rpcs.wait_operation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.wait_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :wait_operation, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the Operations API. - # - # This class represents the configuration for Operations, - # 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::Longrunning::Operations::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 - # # list_operations to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Longrunning::Operations::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_operations.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Longrunning::Operations::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_operations.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::Longrunning::Operations::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 Operations 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 `list_operations` - # @return [::Gapic::Config::Method] - # - attr_reader :list_operations - ## - # RPC-specific configuration for `get_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :get_operation - ## - # RPC-specific configuration for `delete_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_operation - ## - # RPC-specific configuration for `cancel_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :cancel_operation - ## - # RPC-specific configuration for `wait_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :wait_operation - - # @private - def initialize parent_rpcs = nil - list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations - @list_operations = ::Gapic::Config::Method.new list_operations_config - get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation - @get_operation = ::Gapic::Config::Method.new get_operation_config - delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation - @delete_operation = ::Gapic::Config::Method.new delete_operation_config - cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation - @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config - wait_operation_config = parent_rpcs.wait_operation if parent_rpcs.respond_to? :wait_operation - @wait_operation = ::Gapic::Config::Method.new wait_operation_config - - yield self if block_given? - end - end - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google/cloud/spanner/admin/instance/v1/instance_admin/paths.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google/cloud/spanner/admin/instance/v1/instance_admin/paths.rb deleted file mode 100644 index bc0b43688e93..000000000000 --- a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google/cloud/spanner/admin/instance/v1/instance_admin/paths.rb +++ /dev/null @@ -1,104 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 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 Admin - module Instance - module V1 - module InstanceAdmin - # Path helper methods for the InstanceAdmin API. - module Paths - ## - # Create a fully-qualified Instance resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/instances/{instance}` - # - # @param project [String] - # @param instance [String] - # - # @return [::String] - def instance_path project:, instance: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - - "projects/#{project}/instances/#{instance}" - end - - ## - # Create a fully-qualified InstanceConfig resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/instanceConfigs/{instance_config}` - # - # @param project [String] - # @param instance_config [String] - # - # @return [::String] - def instance_config_path project:, instance_config: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - - "projects/#{project}/instanceConfigs/#{instance_config}" - end - - ## - # Create a fully-qualified InstancePartition resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/instances/{instance}/instancePartitions/{instance_partition}` - # - # @param project [String] - # @param instance [String] - # @param instance_partition [String] - # - # @return [::String] - def instance_partition_path project:, instance:, instance_partition: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "instance cannot contain /" if instance.to_s.include? "/" - - "projects/#{project}/instances/#{instance}/instancePartitions/#{instance_partition}" - end - - ## - # Create a fully-qualified Project resource string. - # - # The resource will be in the following format: - # - # `projects/{project}` - # - # @param project [String] - # - # @return [::String] - def project_path project: - "projects/#{project}" - end - - extend self - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google/cloud/spanner/admin/instance/v1/instance_admin/rest.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google/cloud/spanner/admin/instance/v1/instance_admin/rest.rb deleted file mode 100644 index cd77a4203fb8..000000000000 --- a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google/cloud/spanner/admin/instance/v1/instance_admin/rest.rb +++ /dev/null @@ -1,77 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 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/rest" -require "gapic/config" -require "gapic/config/method" - -require "google/cloud/spanner/admin/instance/v1/version" - -require "google/cloud/spanner/admin/instance/v1/instance_admin/credentials" -require "google/cloud/spanner/admin/instance/v1/instance_admin/paths" -require "google/cloud/spanner/admin/instance/v1/instance_admin/rest/operations" -require "google/cloud/spanner/admin/instance/v1/instance_admin/rest/client" - -module Google - module Cloud - module Spanner - module Admin - module Instance - module V1 - ## - # Cloud Spanner Instance Admin API - # - # The Cloud Spanner Instance Admin API can be used to create, delete, - # modify and list instances. Instances are dedicated Cloud Spanner serving - # and storage resources to be used by Cloud Spanner databases. - # - # Each instance has a "configuration", which dictates where the - # serving resources for the Cloud Spanner instance are located (e.g., - # US-central, Europe). Configurations are created by Google based on - # resource availability. - # - # Cloud Spanner billing is based on the instances that exist and their - # sizes. After an instance exists, there are no additional - # per-database or per-operation charges for use of the instance - # (though there may be additional network bandwidth charges). - # Instances offer isolation: problems with databases in one instance - # will not affect other instances. However, within an instance - # databases can affect each other. For example, if one database in an - # instance receives a lot of requests and consumes most of the - # instance resources, fewer resources are available for other - # databases in that instance, and their performance may suffer. - # - # To load this service and instantiate a REST client: - # - # require "google/cloud/spanner/admin/instance/v1/instance_admin/rest" - # client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::Client.new - # - module InstanceAdmin - # Client for the REST transport - module Rest - end - end - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "rest", "helpers.rb" -require "google/cloud/spanner/admin/instance/v1/instance_admin/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google/cloud/spanner/admin/instance/v1/instance_admin/rest/client.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google/cloud/spanner/admin/instance/v1/instance_admin/rest/client.rb deleted file mode 100644 index 13352411f4fa..000000000000 --- a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google/cloud/spanner/admin/instance/v1/instance_admin/rest/client.rb +++ /dev/null @@ -1,2948 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 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/admin/instance/v1/spanner_instance_admin_pb" -require "google/cloud/spanner/admin/instance/v1/instance_admin/rest/service_stub" - -module Google - module Cloud - module Spanner - module Admin - module Instance - module V1 - module InstanceAdmin - module Rest - ## - # REST client for the InstanceAdmin service. - # - # Cloud Spanner Instance Admin API - # - # The Cloud Spanner Instance Admin API can be used to create, delete, - # modify and list instances. Instances are dedicated Cloud Spanner serving - # and storage resources to be used by Cloud Spanner databases. - # - # Each instance has a "configuration", which dictates where the - # serving resources for the Cloud Spanner instance are located (e.g., - # US-central, Europe). Configurations are created by Google based on - # resource availability. - # - # Cloud Spanner billing is based on the instances that exist and their - # sizes. After an instance exists, there are no additional - # per-database or per-operation charges for use of the instance - # (though there may be additional network bandwidth charges). - # Instances offer isolation: problems with databases in one instance - # will not affect other instances. However, within an instance - # databases can affect each other. For example, if one database in an - # instance receives a lot of requests and consumes most of the - # instance resources, fewer resources are available for other - # databases in that instance, and their performance may suffer. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "spanner.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :instance_admin_stub - - ## - # Configure the InstanceAdmin Client class. - # - # See {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all InstanceAdmin clients - # ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::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", "Admin", "Instance", "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.list_instance_configs.timeout = 3600.0 - default_config.rpcs.list_instance_configs.retry_policy = { - initial_delay: 1.0, max_delay: 32.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.get_instance_config.timeout = 3600.0 - default_config.rpcs.get_instance_config.retry_policy = { - initial_delay: 1.0, max_delay: 32.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.list_instances.timeout = 3600.0 - default_config.rpcs.list_instances.retry_policy = { - initial_delay: 1.0, max_delay: 32.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.get_instance.timeout = 3600.0 - default_config.rpcs.get_instance.retry_policy = { - initial_delay: 1.0, max_delay: 32.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.create_instance.timeout = 3600.0 - - default_config.rpcs.update_instance.timeout = 3600.0 - - default_config.rpcs.delete_instance.timeout = 3600.0 - default_config.rpcs.delete_instance.retry_policy = { - initial_delay: 1.0, max_delay: 32.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.set_iam_policy.timeout = 30.0 - - default_config.rpcs.get_iam_policy.timeout = 30.0 - default_config.rpcs.get_iam_policy.retry_policy = { - initial_delay: 1.0, max_delay: 32.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.test_iam_permissions.timeout = 30.0 - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the InstanceAdmin 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::Admin::Instance::V1::InstanceAdmin::Rest::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 - @instance_admin_stub.universe_domain - end - - ## - # Create a new InstanceAdmin REST client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the InstanceAdmin client. - # @yieldparam config [Client::Configuration] - # - def initialize - # 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 - - @operations_client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::Operations.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - - @instance_admin_stub = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials, - logger: @config.logger - ) - - @instance_admin_stub.logger(stub: true)&.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 - - ## - # Get the associated client for long-running operations. - # - # @return [::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::Operations] - # - attr_reader :operations_client - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @instance_admin_stub.logger - end - - # Service calls - - ## - # Lists the supported instance configurations for a given project. - # - # Returns both Google-managed configurations and user-managed - # configurations. - # - # @overload list_instance_configs(request, options = nil) - # Pass arguments to `list_instance_configs` via a request object, either of type - # {::Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigsRequest, ::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_instance_configs(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_instance_configs` 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 parent [::String] - # Required. The name of the project for which a list of supported instance - # configurations is requested. Values are of the form - # `projects/`. - # @param page_size [::Integer] - # Number of instance configurations 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::Admin::Instance::V1::ListInstanceConfigsResponse#next_page_token next_page_token} - # from a previous - # {::Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigsResponse ListInstanceConfigsResponse}. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/spanner/admin/instance/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigsRequest.new - # - # # Call the list_instance_configs method. - # result = client.list_instance_configs 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::Admin::Instance::V1::InstanceConfig. - # p item - # end - # - def list_instance_configs request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigsRequest - - # 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 - call_metadata = @config.rpcs.list_instance_configs.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_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::Admin::Instance::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.list_instance_configs.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_instance_configs.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @instance_admin_stub.list_instance_configs request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @instance_admin_stub, :list_instance_configs, "instance_configs", request, result, options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets information about a particular instance configuration. - # - # @overload get_instance_config(request, options = nil) - # Pass arguments to `get_instance_config` via a request object, either of type - # {::Google::Cloud::Spanner::Admin::Instance::V1::GetInstanceConfigRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Spanner::Admin::Instance::V1::GetInstanceConfigRequest, ::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_instance_config(name: nil) - # Pass arguments to `get_instance_config` 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 requested instance configuration. Values are of - # the form `projects//instanceConfigs/`. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/spanner/admin/instance/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Spanner::Admin::Instance::V1::GetInstanceConfigRequest.new - # - # # Call the get_instance_config method. - # result = client.get_instance_config request - # - # # The returned object is of type Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig. - # p result - # - def get_instance_config request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Instance::V1::GetInstanceConfigRequest - - # 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 - call_metadata = @config.rpcs.get_instance_config.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_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::Admin::Instance::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_instance_config.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_instance_config.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @instance_admin_stub.get_instance_config request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Creates an instance configuration and begins preparing it to be used. The - # returned long-running operation - # can be used to track the progress of preparing the new - # instance configuration. The instance configuration name is assigned by the - # caller. If the named instance configuration already exists, - # `CreateInstanceConfig` returns `ALREADY_EXISTS`. - # - # Immediately after the request returns: - # - # * The instance configuration is readable via the API, with all requested - # attributes. The instance configuration's - # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig#reconciling reconciling} - # field is set to true. Its state is `CREATING`. - # - # While the operation is pending: - # - # * Cancelling the operation renders the instance configuration immediately - # unreadable via the API. - # * Except for deleting the creating resource, all other attempts to modify - # the instance configuration are rejected. - # - # Upon completion of the returned operation: - # - # * Instances can be created using the instance configuration. - # * The instance configuration's - # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig#reconciling reconciling} - # field becomes false. Its state becomes `READY`. - # - # The returned long-running operation will - # have a name of the format - # `/operations/` and can be used to track - # creation of the instance configuration. The - # metadata field type is - # {::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstanceConfigMetadata CreateInstanceConfigMetadata}. - # The response field type is - # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig InstanceConfig}, if - # successful. - # - # Authorization requires `spanner.instanceConfigs.create` permission on - # the resource - # {::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstanceConfigRequest#parent parent}. - # - # @overload create_instance_config(request, options = nil) - # Pass arguments to `create_instance_config` via a request object, either of type - # {::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstanceConfigRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstanceConfigRequest, ::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_instance_config(parent: nil, instance_config_id: nil, instance_config: nil, validate_only: nil) - # Pass arguments to `create_instance_config` 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 parent [::String] - # Required. The name of the project in which to create the instance - # configuration. Values are of the form `projects/`. - # @param instance_config_id [::String] - # Required. The ID of the instance configuration to create. Valid identifiers - # are of the form `custom-[-a-z0-9]*[a-z0-9]` and must be between 2 and 64 - # characters in length. The `custom-` prefix is required to avoid name - # conflicts with Google-managed configurations. - # @param instance_config [::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig, ::Hash] - # Required. The `InstanceConfig` proto of the configuration to create. - # `instance_config.name` must be - # `/instanceConfigs/`. - # `instance_config.base_config` must be a Google-managed configuration name, - # e.g. /instanceConfigs/us-east1, /instanceConfigs/nam3. - # @param validate_only [::Boolean] - # An option to validate, but not actually execute, a request, - # and provide the same response. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/spanner/admin/instance/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Spanner::Admin::Instance::V1::CreateInstanceConfigRequest.new - # - # # Call the create_instance_config method. - # result = client.create_instance_config request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def create_instance_config request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstanceConfigRequest - - # 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 - call_metadata = @config.rpcs.create_instance_config.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_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::Admin::Instance::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.create_instance_config.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_instance_config.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @instance_admin_stub.create_instance_config request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Updates an instance configuration. The returned - # long-running operation can be used to track - # the progress of updating the instance. If the named instance configuration - # does not exist, returns `NOT_FOUND`. - # - # Only user-managed configurations can be updated. - # - # Immediately after the request returns: - # - # * The instance configuration's - # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig#reconciling reconciling} - # field is set to true. - # - # While the operation is pending: - # - # * Cancelling the operation sets its metadata's - # {::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstanceConfigMetadata#cancel_time cancel_time}. - # The operation is guaranteed to succeed at undoing all changes, after - # which point it terminates with a `CANCELLED` status. - # * All other attempts to modify the instance configuration are rejected. - # * Reading the instance configuration via the API continues to give the - # pre-request values. - # - # Upon completion of the returned operation: - # - # * Creating instances using the instance configuration uses the new - # values. - # * The new values of the instance configuration are readable via the API. - # * The instance configuration's - # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig#reconciling reconciling} - # field becomes false. - # - # The returned long-running operation will - # have a name of the format - # `/operations/` and can be used to track - # the instance configuration modification. The - # metadata field type is - # {::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstanceConfigMetadata UpdateInstanceConfigMetadata}. - # The response field type is - # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig InstanceConfig}, if - # successful. - # - # Authorization requires `spanner.instanceConfigs.update` permission on - # the resource {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig#name name}. - # - # @overload update_instance_config(request, options = nil) - # Pass arguments to `update_instance_config` via a request object, either of type - # {::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstanceConfigRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstanceConfigRequest, ::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 update_instance_config(instance_config: nil, update_mask: nil, validate_only: nil) - # Pass arguments to `update_instance_config` 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 instance_config [::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig, ::Hash] - # Required. The user instance configuration to update, which must always - # include the instance configuration name. Otherwise, only fields mentioned - # in - # {::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstanceConfigRequest#update_mask update_mask} - # need be included. To prevent conflicts of concurrent updates, - # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig#reconciling etag} can - # be used. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Required. A mask specifying which fields in - # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig InstanceConfig} should be - # updated. The field mask must always be specified; this prevents any future - # fields in {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig InstanceConfig} - # from being erased accidentally by clients that do not know about them. Only - # display_name and labels can be updated. - # @param validate_only [::Boolean] - # An option to validate, but not actually execute, a request, - # and provide the same response. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/spanner/admin/instance/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstanceConfigRequest.new - # - # # Call the update_instance_config method. - # result = client.update_instance_config request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def update_instance_config request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstanceConfigRequest - - # 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 - call_metadata = @config.rpcs.update_instance_config.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_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::Admin::Instance::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.update_instance_config.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_instance_config.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @instance_admin_stub.update_instance_config request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes the instance configuration. Deletion is only allowed when no - # instances are using the configuration. If any instances are using - # the configuration, returns `FAILED_PRECONDITION`. - # - # Only user-managed configurations can be deleted. - # - # Authorization requires `spanner.instanceConfigs.delete` permission on - # the resource {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig#name name}. - # - # @overload delete_instance_config(request, options = nil) - # Pass arguments to `delete_instance_config` via a request object, either of type - # {::Google::Cloud::Spanner::Admin::Instance::V1::DeleteInstanceConfigRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Spanner::Admin::Instance::V1::DeleteInstanceConfigRequest, ::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_instance_config(name: nil, etag: nil, validate_only: nil) - # Pass arguments to `delete_instance_config` 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 instance configuration to be deleted. - # Values are of the form - # `projects//instanceConfigs/` - # @param etag [::String] - # Used for optimistic concurrency control as a way to help prevent - # simultaneous deletes of an instance configuration from overwriting each - # other. If not empty, the API - # only deletes the instance configuration when the etag provided matches the - # current status of the requested instance configuration. Otherwise, deletes - # the instance configuration without checking the current status of the - # requested instance configuration. - # @param validate_only [::Boolean] - # An option to validate, but not actually execute, a request, - # and provide the same response. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/spanner/admin/instance/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Spanner::Admin::Instance::V1::DeleteInstanceConfigRequest.new - # - # # Call the delete_instance_config method. - # result = client.delete_instance_config request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_instance_config request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Instance::V1::DeleteInstanceConfigRequest - - # 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 - call_metadata = @config.rpcs.delete_instance_config.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_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::Admin::Instance::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.delete_instance_config.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_instance_config.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @instance_admin_stub.delete_instance_config request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Lists the user-managed instance configuration long-running - # operations in the given project. An instance - # configuration operation has a name of the form - # `projects//instanceConfigs//operations/`. - # The long-running operation - # metadata field type - # `metadata.type_url` describes the type of the metadata. Operations returned - # include those that have completed/failed/canceled within the last 7 days, - # and pending operations. Operations returned are ordered by - # `operation.metadata.value.start_time` in descending order starting - # from the most recently started operation. - # - # @overload list_instance_config_operations(request, options = nil) - # Pass arguments to `list_instance_config_operations` via a request object, either of type - # {::Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigOperationsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigOperationsRequest, ::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_instance_config_operations(parent: nil, filter: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_instance_config_operations` 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 parent [::String] - # Required. The project of the instance configuration operations. - # Values are of the form `projects/`. - # @param filter [::String] - # An expression that filters the list of returned operations. - # - # A filter expression consists of a field name, a - # comparison operator, and a value for filtering. - # The value must be a string, a number, or a boolean. The comparison operator - # must be one of: `<`, `>`, `<=`, `>=`, `!=`, `=`, or `:`. - # Colon `:` is the contains operator. Filter rules are not case sensitive. - # - # The following fields in the Operation are eligible for filtering: - # - # * `name` - The name of the long-running operation - # * `done` - False if the operation is in progress, else true. - # * `metadata.@type` - the type of metadata. For example, the type string - # for - # {::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstanceConfigMetadata CreateInstanceConfigMetadata} - # is - # `type.googleapis.com/google.spanner.admin.instance.v1.CreateInstanceConfigMetadata`. - # * `metadata.` - any field in metadata.value. - # `metadata.@type` must be specified first, if filtering on metadata - # fields. - # * `error` - Error associated with the long-running operation. - # * `response.@type` - the type of response. - # * `response.` - any field in response.value. - # - # You can combine multiple expressions by enclosing each expression in - # parentheses. By default, expressions are combined with AND logic. However, - # you can specify AND, OR, and NOT logic explicitly. - # - # Here are a few examples: - # - # * `done:true` - The operation is complete. - # * `(metadata.@type=` \ - # `type.googleapis.com/google.spanner.admin.instance.v1.CreateInstanceConfigMetadata) - # AND` \ - # `(metadata.instance_config.name:custom-config) AND` \ - # `(metadata.progress.start_time < \"2021-03-28T14:50:00Z\") AND` \ - # `(error:*)` - Return operations where: - # * The operation's metadata type is - # {::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstanceConfigMetadata CreateInstanceConfigMetadata}. - # * The instance configuration name contains "custom-config". - # * The operation started before 2021-03-28T14:50:00Z. - # * The operation resulted in an error. - # @param page_size [::Integer] - # Number of operations 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::Admin::Instance::V1::ListInstanceConfigOperationsResponse#next_page_token next_page_token} - # from a previous - # {::Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigOperationsResponse ListInstanceConfigOperationsResponse} - # to the same `parent` and with the same `filter`. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/spanner/admin/instance/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigOperationsRequest.new - # - # # Call the list_instance_config_operations method. - # result = client.list_instance_config_operations 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::Longrunning::Operation. - # p item - # end - # - def list_instance_config_operations request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigOperationsRequest - - # 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 - call_metadata = @config.rpcs.list_instance_config_operations.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_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::Admin::Instance::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.list_instance_config_operations.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_instance_config_operations.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @instance_admin_stub.list_instance_config_operations request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @instance_admin_stub, :list_instance_config_operations, "operations", request, result, options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Lists all instances in the given project. - # - # @overload list_instances(request, options = nil) - # Pass arguments to `list_instances` via a request object, either of type - # {::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancesRequest, ::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_instances(parent: nil, page_size: nil, page_token: nil, filter: nil, instance_deadline: nil) - # Pass arguments to `list_instances` 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 parent [::String] - # Required. The name of the project for which a list of instances is - # requested. Values are of the form `projects/`. - # @param page_size [::Integer] - # Number of instances 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::Admin::Instance::V1::ListInstancesResponse#next_page_token next_page_token} - # from a previous - # {::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancesResponse ListInstancesResponse}. - # @param filter [::String] - # An expression for filtering the results of the request. Filter rules are - # case insensitive. The fields eligible for filtering are: - # - # * `name` - # * `display_name` - # * `labels.key` where key is the name of a label - # - # Some examples of using filters are: - # - # * `name:*` --> The instance has a name. - # * `name:Howl` --> The instance's name contains the string "howl". - # * `name:HOWL` --> Equivalent to above. - # * `NAME:howl` --> Equivalent to above. - # * `labels.env:*` --> The instance has the label "env". - # * `labels.env:dev` --> The instance has the label "env" and the value of - # the label contains the string "dev". - # * `name:howl labels.env:dev` --> The instance's name contains "howl" and - # it has the label "env" with its value - # containing "dev". - # @param instance_deadline [::Google::Protobuf::Timestamp, ::Hash] - # Deadline used while retrieving metadata for instances. - # Instances whose metadata cannot be retrieved within this deadline will be - # added to - # {::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancesResponse#unreachable unreachable} - # in - # {::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancesResponse ListInstancesResponse}. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Spanner::Admin::Instance::V1::Instance>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Spanner::Admin::Instance::V1::Instance>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/spanner/admin/instance/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Spanner::Admin::Instance::V1::ListInstancesRequest.new - # - # # Call the list_instances method. - # result = client.list_instances 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::Admin::Instance::V1::Instance. - # p item - # end - # - def list_instances request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancesRequest - - # 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 - call_metadata = @config.rpcs.list_instances.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_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::Admin::Instance::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.list_instances.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_instances.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @instance_admin_stub.list_instances request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @instance_admin_stub, :list_instances, "instances", request, result, options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Lists all instance partitions for the given instance. - # - # @overload list_instance_partitions(request, options = nil) - # Pass arguments to `list_instance_partitions` via a request object, either of type - # {::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionsRequest, ::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_instance_partitions(parent: nil, page_size: nil, page_token: nil, instance_partition_deadline: nil) - # Pass arguments to `list_instance_partitions` 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 parent [::String] - # Required. The instance whose instance partitions should be listed. Values - # are of the form `projects//instances/`. Use `{instance} - # = '-'` to list instance partitions for all Instances in a project, e.g., - # `projects/myproject/instances/-`. - # @param page_size [::Integer] - # Number of instance partitions 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::Admin::Instance::V1::ListInstancePartitionsResponse#next_page_token next_page_token} - # from a previous - # {::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionsResponse ListInstancePartitionsResponse}. - # @param instance_partition_deadline [::Google::Protobuf::Timestamp, ::Hash] - # Optional. Deadline used while retrieving metadata for instance partitions. - # Instance partitions whose metadata cannot be retrieved within this deadline - # will be added to - # {::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionsResponse#unreachable unreachable} - # in - # {::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionsResponse ListInstancePartitionsResponse}. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Spanner::Admin::Instance::V1::InstancePartition>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Spanner::Admin::Instance::V1::InstancePartition>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/spanner/admin/instance/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionsRequest.new - # - # # Call the list_instance_partitions method. - # result = client.list_instance_partitions 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::Admin::Instance::V1::InstancePartition. - # p item - # end - # - def list_instance_partitions request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionsRequest - - # 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 - call_metadata = @config.rpcs.list_instance_partitions.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_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::Admin::Instance::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.list_instance_partitions.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_instance_partitions.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @instance_admin_stub.list_instance_partitions request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @instance_admin_stub, :list_instance_partitions, "instance_partitions", request, result, options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets information about a particular instance. - # - # @overload get_instance(request, options = nil) - # Pass arguments to `get_instance` via a request object, either of type - # {::Google::Cloud::Spanner::Admin::Instance::V1::GetInstanceRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Spanner::Admin::Instance::V1::GetInstanceRequest, ::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_instance(name: nil, field_mask: nil) - # Pass arguments to `get_instance` 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 requested instance. Values are of the form - # `projects//instances/`. - # @param field_mask [::Google::Protobuf::FieldMask, ::Hash] - # If field_mask is present, specifies the subset of - # {::Google::Cloud::Spanner::Admin::Instance::V1::Instance Instance} fields that should be - # returned. If absent, all - # {::Google::Cloud::Spanner::Admin::Instance::V1::Instance Instance} fields are returned. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Spanner::Admin::Instance::V1::Instance] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Spanner::Admin::Instance::V1::Instance] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/spanner/admin/instance/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Spanner::Admin::Instance::V1::GetInstanceRequest.new - # - # # Call the get_instance method. - # result = client.get_instance request - # - # # The returned object is of type Google::Cloud::Spanner::Admin::Instance::V1::Instance. - # p result - # - def get_instance request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Instance::V1::GetInstanceRequest - - # 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 - call_metadata = @config.rpcs.get_instance.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_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::Admin::Instance::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_instance.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_instance.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @instance_admin_stub.get_instance request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Creates an instance and begins preparing it to begin serving. The - # returned long-running operation - # can be used to track the progress of preparing the new - # instance. The instance name is assigned by the caller. If the - # named instance already exists, `CreateInstance` returns - # `ALREADY_EXISTS`. - # - # Immediately upon completion of this request: - # - # * The instance is readable via the API, with all requested attributes - # but no allocated resources. Its state is `CREATING`. - # - # Until completion of the returned operation: - # - # * Cancelling the operation renders the instance immediately unreadable - # via the API. - # * The instance can be deleted. - # * All other attempts to modify the instance are rejected. - # - # Upon completion of the returned operation: - # - # * Billing for all successfully-allocated resources begins (some types - # may have lower than the requested levels). - # * Databases can be created in the instance. - # * The instance's allocated resource levels are readable via the API. - # * The instance's state becomes `READY`. - # - # The returned long-running operation will - # have a name of the format `/operations/` and - # can be used to track creation of the instance. The - # metadata field type is - # {::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstanceMetadata CreateInstanceMetadata}. - # The response field type is - # {::Google::Cloud::Spanner::Admin::Instance::V1::Instance Instance}, if successful. - # - # @overload create_instance(request, options = nil) - # Pass arguments to `create_instance` via a request object, either of type - # {::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstanceRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstanceRequest, ::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_instance(parent: nil, instance_id: nil, instance: nil) - # Pass arguments to `create_instance` 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 parent [::String] - # Required. The name of the project in which to create the instance. Values - # are of the form `projects/`. - # @param instance_id [::String] - # Required. The ID of the instance to create. Valid identifiers are of the - # form `[a-z][-a-z0-9]*[a-z0-9]` and must be between 2 and 64 characters in - # length. - # @param instance [::Google::Cloud::Spanner::Admin::Instance::V1::Instance, ::Hash] - # Required. The instance to create. The name may be omitted, but if - # specified must be `/instances/`. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/spanner/admin/instance/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Spanner::Admin::Instance::V1::CreateInstanceRequest.new - # - # # Call the create_instance method. - # result = client.create_instance request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def create_instance request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstanceRequest - - # 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 - call_metadata = @config.rpcs.create_instance.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_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::Admin::Instance::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.create_instance.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_instance.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @instance_admin_stub.create_instance request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Updates an instance, and begins allocating or releasing resources - # as requested. The returned long-running operation can be used to track the - # progress of updating the instance. If the named instance does not - # exist, returns `NOT_FOUND`. - # - # Immediately upon completion of this request: - # - # * For resource types for which a decrease in the instance's allocation - # has been requested, billing is based on the newly-requested level. - # - # Until completion of the returned operation: - # - # * Cancelling the operation sets its metadata's - # {::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstanceMetadata#cancel_time cancel_time}, - # and begins restoring resources to their pre-request values. The - # operation is guaranteed to succeed at undoing all resource changes, - # after which point it terminates with a `CANCELLED` status. - # * All other attempts to modify the instance are rejected. - # * Reading the instance via the API continues to give the pre-request - # resource levels. - # - # Upon completion of the returned operation: - # - # * Billing begins for all successfully-allocated resources (some types - # may have lower than the requested levels). - # * All newly-reserved resources are available for serving the instance's - # tables. - # * The instance's new resource levels are readable via the API. - # - # The returned long-running operation will - # have a name of the format `/operations/` and - # can be used to track the instance modification. The - # metadata field type is - # {::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstanceMetadata UpdateInstanceMetadata}. - # The response field type is - # {::Google::Cloud::Spanner::Admin::Instance::V1::Instance Instance}, if successful. - # - # Authorization requires `spanner.instances.update` permission on - # the resource {::Google::Cloud::Spanner::Admin::Instance::V1::Instance#name name}. - # - # @overload update_instance(request, options = nil) - # Pass arguments to `update_instance` via a request object, either of type - # {::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstanceRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstanceRequest, ::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 update_instance(instance: nil, field_mask: nil) - # Pass arguments to `update_instance` 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 instance [::Google::Cloud::Spanner::Admin::Instance::V1::Instance, ::Hash] - # Required. The instance to update, which must always include the instance - # name. Otherwise, only fields mentioned in - # {::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstanceRequest#field_mask field_mask} - # need be included. - # @param field_mask [::Google::Protobuf::FieldMask, ::Hash] - # Required. A mask specifying which fields in - # {::Google::Cloud::Spanner::Admin::Instance::V1::Instance Instance} should be updated. - # The field mask must always be specified; this prevents any future fields in - # {::Google::Cloud::Spanner::Admin::Instance::V1::Instance Instance} from being erased - # accidentally by clients that do not know about them. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/spanner/admin/instance/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstanceRequest.new - # - # # Call the update_instance method. - # result = client.update_instance request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def update_instance request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstanceRequest - - # 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 - call_metadata = @config.rpcs.update_instance.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_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::Admin::Instance::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.update_instance.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_instance.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @instance_admin_stub.update_instance request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes an instance. - # - # Immediately upon completion of the request: - # - # * Billing ceases for all of the instance's reserved resources. - # - # Soon afterward: - # - # * The instance and *all of its databases* immediately and - # irrevocably disappear from the API. All data in the databases - # is permanently deleted. - # - # @overload delete_instance(request, options = nil) - # Pass arguments to `delete_instance` via a request object, either of type - # {::Google::Cloud::Spanner::Admin::Instance::V1::DeleteInstanceRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Spanner::Admin::Instance::V1::DeleteInstanceRequest, ::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_instance(name: nil) - # Pass arguments to `delete_instance` 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 instance to be deleted. Values are of the form - # `projects//instances/` - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/spanner/admin/instance/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Spanner::Admin::Instance::V1::DeleteInstanceRequest.new - # - # # Call the delete_instance method. - # result = client.delete_instance request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_instance request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Instance::V1::DeleteInstanceRequest - - # 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 - call_metadata = @config.rpcs.delete_instance.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_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::Admin::Instance::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.delete_instance.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_instance.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @instance_admin_stub.delete_instance request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Sets the access control policy on an instance resource. Replaces any - # existing policy. - # - # Authorization requires `spanner.instances.setIamPolicy` on - # [resource][google.iam.v1.SetIamPolicyRequest.resource]. - # - # @overload set_iam_policy(request, options = nil) - # Pass arguments to `set_iam_policy` via a request object, either of type - # {::Google::Iam::V1::SetIamPolicyRequest} or an equivalent Hash. - # - # @param request [::Google::Iam::V1::SetIamPolicyRequest, ::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 set_iam_policy(resource: nil, policy: nil, update_mask: nil) - # Pass arguments to `set_iam_policy` 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 resource [::String] - # REQUIRED: The resource for which the policy is being specified. - # See the operation documentation for the appropriate value for this field. - # @param policy [::Google::Iam::V1::Policy, ::Hash] - # REQUIRED: The complete policy to be applied to the `resource`. The size of - # the policy is limited to a few 10s of KB. An empty policy is a - # valid policy but certain Cloud Platform services (such as Projects) - # might reject them. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only - # the fields in the mask will be modified. If no mask is provided, the - # following default mask is used: - # - # `paths: "bindings, etag"` - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Iam::V1::Policy] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Iam::V1::Policy] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/spanner/admin/instance/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Iam::V1::SetIamPolicyRequest.new - # - # # Call the set_iam_policy method. - # result = client.set_iam_policy request - # - # # The returned object is of type Google::Iam::V1::Policy. - # p result - # - def set_iam_policy request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::SetIamPolicyRequest - - # 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 - call_metadata = @config.rpcs.set_iam_policy.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_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::Admin::Instance::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.set_iam_policy.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.set_iam_policy.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @instance_admin_stub.set_iam_policy request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets the access control policy for an instance resource. Returns an empty - # policy if an instance exists but does not have a policy set. - # - # Authorization requires `spanner.instances.getIamPolicy` on - # [resource][google.iam.v1.GetIamPolicyRequest.resource]. - # - # @overload get_iam_policy(request, options = nil) - # Pass arguments to `get_iam_policy` via a request object, either of type - # {::Google::Iam::V1::GetIamPolicyRequest} or an equivalent Hash. - # - # @param request [::Google::Iam::V1::GetIamPolicyRequest, ::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_iam_policy(resource: nil, options: nil) - # Pass arguments to `get_iam_policy` 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 resource [::String] - # REQUIRED: The resource for which the policy is being requested. - # See the operation documentation for the appropriate value for this field. - # @param options [::Google::Iam::V1::GetPolicyOptions, ::Hash] - # OPTIONAL: A `GetPolicyOptions` object for specifying options to - # `GetIamPolicy`. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Iam::V1::Policy] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Iam::V1::Policy] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/spanner/admin/instance/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Iam::V1::GetIamPolicyRequest.new - # - # # Call the get_iam_policy method. - # result = client.get_iam_policy request - # - # # The returned object is of type Google::Iam::V1::Policy. - # p result - # - def get_iam_policy request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::GetIamPolicyRequest - - # 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 - call_metadata = @config.rpcs.get_iam_policy.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_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::Admin::Instance::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_iam_policy.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_iam_policy.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @instance_admin_stub.get_iam_policy request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Returns permissions that the caller has on the specified instance resource. - # - # Attempting this RPC on a non-existent Cloud Spanner instance resource will - # result in a NOT_FOUND error if the user has `spanner.instances.list` - # permission on the containing Google Cloud Project. Otherwise returns an - # empty set of permissions. - # - # @overload test_iam_permissions(request, options = nil) - # Pass arguments to `test_iam_permissions` via a request object, either of type - # {::Google::Iam::V1::TestIamPermissionsRequest} or an equivalent Hash. - # - # @param request [::Google::Iam::V1::TestIamPermissionsRequest, ::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 test_iam_permissions(resource: nil, permissions: nil) - # Pass arguments to `test_iam_permissions` 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 resource [::String] - # REQUIRED: The resource for which the policy detail is being requested. - # See the operation documentation for the appropriate value for this field. - # @param permissions [::Array<::String>] - # The set of permissions to check for the `resource`. Permissions with - # wildcards (such as '*' or 'storage.*') are not allowed. For more - # information see - # [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Iam::V1::TestIamPermissionsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Iam::V1::TestIamPermissionsResponse] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/spanner/admin/instance/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Iam::V1::TestIamPermissionsRequest.new - # - # # Call the test_iam_permissions method. - # result = client.test_iam_permissions request - # - # # The returned object is of type Google::Iam::V1::TestIamPermissionsResponse. - # p result - # - def test_iam_permissions request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::TestIamPermissionsRequest - - # 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 - call_metadata = @config.rpcs.test_iam_permissions.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_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::Admin::Instance::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.test_iam_permissions.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.test_iam_permissions.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @instance_admin_stub.test_iam_permissions request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets information about a particular instance partition. - # - # @overload get_instance_partition(request, options = nil) - # Pass arguments to `get_instance_partition` via a request object, either of type - # {::Google::Cloud::Spanner::Admin::Instance::V1::GetInstancePartitionRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Spanner::Admin::Instance::V1::GetInstancePartitionRequest, ::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_instance_partition(name: nil) - # Pass arguments to `get_instance_partition` 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 requested instance partition. Values are of - # the form - # `projects/{project}/instances/{instance}/instancePartitions/{instance_partition}`. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Spanner::Admin::Instance::V1::InstancePartition] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Spanner::Admin::Instance::V1::InstancePartition] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/spanner/admin/instance/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Spanner::Admin::Instance::V1::GetInstancePartitionRequest.new - # - # # Call the get_instance_partition method. - # result = client.get_instance_partition request - # - # # The returned object is of type Google::Cloud::Spanner::Admin::Instance::V1::InstancePartition. - # p result - # - def get_instance_partition request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Instance::V1::GetInstancePartitionRequest - - # 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 - call_metadata = @config.rpcs.get_instance_partition.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_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::Admin::Instance::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_instance_partition.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_instance_partition.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @instance_admin_stub.get_instance_partition request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Creates an instance partition and begins preparing it to be used. The - # returned long-running operation - # can be used to track the progress of preparing the new instance partition. - # The instance partition name is assigned by the caller. If the named - # instance partition already exists, `CreateInstancePartition` returns - # `ALREADY_EXISTS`. - # - # Immediately upon completion of this request: - # - # * The instance partition is readable via the API, with all requested - # attributes but no allocated resources. Its state is `CREATING`. - # - # Until completion of the returned operation: - # - # * Cancelling the operation renders the instance partition immediately - # unreadable via the API. - # * The instance partition can be deleted. - # * All other attempts to modify the instance partition are rejected. - # - # Upon completion of the returned operation: - # - # * Billing for all successfully-allocated resources begins (some types - # may have lower than the requested levels). - # * Databases can start using this instance partition. - # * The instance partition's allocated resource levels are readable via the - # API. - # * The instance partition's state becomes `READY`. - # - # The returned long-running operation will - # have a name of the format - # `/operations/` and can be used to - # track creation of the instance partition. The - # metadata field type is - # {::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstancePartitionMetadata CreateInstancePartitionMetadata}. - # The response field type is - # {::Google::Cloud::Spanner::Admin::Instance::V1::InstancePartition InstancePartition}, if - # successful. - # - # @overload create_instance_partition(request, options = nil) - # Pass arguments to `create_instance_partition` via a request object, either of type - # {::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstancePartitionRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstancePartitionRequest, ::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_instance_partition(parent: nil, instance_partition_id: nil, instance_partition: nil) - # Pass arguments to `create_instance_partition` 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 parent [::String] - # Required. The name of the instance in which to create the instance - # partition. Values are of the form - # `projects//instances/`. - # @param instance_partition_id [::String] - # Required. The ID of the instance partition to create. Valid identifiers are - # of the form `[a-z][-a-z0-9]*[a-z0-9]` and must be between 2 and 64 - # characters in length. - # @param instance_partition [::Google::Cloud::Spanner::Admin::Instance::V1::InstancePartition, ::Hash] - # Required. The instance partition to create. The instance_partition.name may - # be omitted, but if specified must be - # `/instancePartitions/`. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/spanner/admin/instance/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Spanner::Admin::Instance::V1::CreateInstancePartitionRequest.new - # - # # Call the create_instance_partition method. - # result = client.create_instance_partition request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def create_instance_partition request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstancePartitionRequest - - # 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 - call_metadata = @config.rpcs.create_instance_partition.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_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::Admin::Instance::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.create_instance_partition.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_instance_partition.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @instance_admin_stub.create_instance_partition request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes an existing instance partition. Requires that the - # instance partition is not used by any database or backup and is not the - # default instance partition of an instance. - # - # Authorization requires `spanner.instancePartitions.delete` permission on - # the resource - # {::Google::Cloud::Spanner::Admin::Instance::V1::InstancePartition#name name}. - # - # @overload delete_instance_partition(request, options = nil) - # Pass arguments to `delete_instance_partition` via a request object, either of type - # {::Google::Cloud::Spanner::Admin::Instance::V1::DeleteInstancePartitionRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Spanner::Admin::Instance::V1::DeleteInstancePartitionRequest, ::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_instance_partition(name: nil, etag: nil) - # Pass arguments to `delete_instance_partition` 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 instance partition to be deleted. - # Values are of the form - # `projects/{project}/instances/{instance}/instancePartitions/{instance_partition}` - # @param etag [::String] - # Optional. If not empty, the API only deletes the instance partition when - # the etag provided matches the current status of the requested instance - # partition. Otherwise, deletes the instance partition without checking the - # current status of the requested instance partition. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/spanner/admin/instance/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Spanner::Admin::Instance::V1::DeleteInstancePartitionRequest.new - # - # # Call the delete_instance_partition method. - # result = client.delete_instance_partition request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_instance_partition request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Instance::V1::DeleteInstancePartitionRequest - - # 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 - call_metadata = @config.rpcs.delete_instance_partition.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_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::Admin::Instance::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.delete_instance_partition.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_instance_partition.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @instance_admin_stub.delete_instance_partition request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Updates an instance partition, and begins allocating or releasing resources - # as requested. The returned long-running operation can be used to track the - # progress of updating the instance partition. If the named instance - # partition does not exist, returns `NOT_FOUND`. - # - # Immediately upon completion of this request: - # - # * For resource types for which a decrease in the instance partition's - # allocation has been requested, billing is based on the newly-requested - # level. - # - # Until completion of the returned operation: - # - # * Cancelling the operation sets its metadata's - # {::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstancePartitionMetadata#cancel_time cancel_time}, - # and begins restoring resources to their pre-request values. The - # operation is guaranteed to succeed at undoing all resource changes, - # after which point it terminates with a `CANCELLED` status. - # * All other attempts to modify the instance partition are rejected. - # * Reading the instance partition via the API continues to give the - # pre-request resource levels. - # - # Upon completion of the returned operation: - # - # * Billing begins for all successfully-allocated resources (some types - # may have lower than the requested levels). - # * All newly-reserved resources are available for serving the instance - # partition's tables. - # * The instance partition's new resource levels are readable via the API. - # - # The returned long-running operation will - # have a name of the format - # `/operations/` and can be used to - # track the instance partition modification. The - # metadata field type is - # {::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstancePartitionMetadata UpdateInstancePartitionMetadata}. - # The response field type is - # {::Google::Cloud::Spanner::Admin::Instance::V1::InstancePartition InstancePartition}, if - # successful. - # - # Authorization requires `spanner.instancePartitions.update` permission on - # the resource - # {::Google::Cloud::Spanner::Admin::Instance::V1::InstancePartition#name name}. - # - # @overload update_instance_partition(request, options = nil) - # Pass arguments to `update_instance_partition` via a request object, either of type - # {::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstancePartitionRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstancePartitionRequest, ::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 update_instance_partition(instance_partition: nil, field_mask: nil) - # Pass arguments to `update_instance_partition` 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 instance_partition [::Google::Cloud::Spanner::Admin::Instance::V1::InstancePartition, ::Hash] - # Required. The instance partition to update, which must always include the - # instance partition name. Otherwise, only fields mentioned in - # {::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstancePartitionRequest#field_mask field_mask} - # need be included. - # @param field_mask [::Google::Protobuf::FieldMask, ::Hash] - # Required. A mask specifying which fields in - # {::Google::Cloud::Spanner::Admin::Instance::V1::InstancePartition InstancePartition} - # should be updated. The field mask must always be specified; this prevents - # any future fields in - # {::Google::Cloud::Spanner::Admin::Instance::V1::InstancePartition InstancePartition} - # from being erased accidentally by clients that do not know about them. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/spanner/admin/instance/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstancePartitionRequest.new - # - # # Call the update_instance_partition method. - # result = client.update_instance_partition request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def update_instance_partition request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstancePartitionRequest - - # 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 - call_metadata = @config.rpcs.update_instance_partition.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_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::Admin::Instance::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.update_instance_partition.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_instance_partition.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @instance_admin_stub.update_instance_partition request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Lists instance partition long-running operations in the given instance. - # An instance partition operation has a name of the form - # `projects//instances//instancePartitions//operations/`. - # The long-running operation - # metadata field type - # `metadata.type_url` describes the type of the metadata. Operations returned - # include those that have completed/failed/canceled within the last 7 days, - # and pending operations. Operations returned are ordered by - # `operation.metadata.value.start_time` in descending order starting from the - # most recently started operation. - # - # Authorization requires `spanner.instancePartitionOperations.list` - # permission on the resource - # {::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionOperationsRequest#parent parent}. - # - # @overload list_instance_partition_operations(request, options = nil) - # Pass arguments to `list_instance_partition_operations` via a request object, either of type - # {::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionOperationsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionOperationsRequest, ::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_instance_partition_operations(parent: nil, filter: nil, page_size: nil, page_token: nil, instance_partition_deadline: nil) - # Pass arguments to `list_instance_partition_operations` 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 parent [::String] - # Required. The parent instance of the instance partition operations. - # Values are of the form `projects//instances/`. - # @param filter [::String] - # Optional. An expression that filters the list of returned operations. - # - # A filter expression consists of a field name, a - # comparison operator, and a value for filtering. - # The value must be a string, a number, or a boolean. The comparison operator - # must be one of: `<`, `>`, `<=`, `>=`, `!=`, `=`, or `:`. - # Colon `:` is the contains operator. Filter rules are not case sensitive. - # - # The following fields in the Operation are eligible for filtering: - # - # * `name` - The name of the long-running operation - # * `done` - False if the operation is in progress, else true. - # * `metadata.@type` - the type of metadata. For example, the type string - # for - # {::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstancePartitionMetadata CreateInstancePartitionMetadata} - # is - # `type.googleapis.com/google.spanner.admin.instance.v1.CreateInstancePartitionMetadata`. - # * `metadata.` - any field in metadata.value. - # `metadata.@type` must be specified first, if filtering on metadata - # fields. - # * `error` - Error associated with the long-running operation. - # * `response.@type` - the type of response. - # * `response.` - any field in response.value. - # - # You can combine multiple expressions by enclosing each expression in - # parentheses. By default, expressions are combined with AND logic. However, - # you can specify AND, OR, and NOT logic explicitly. - # - # Here are a few examples: - # - # * `done:true` - The operation is complete. - # * `(metadata.@type=` \ - # `type.googleapis.com/google.spanner.admin.instance.v1.CreateInstancePartitionMetadata) - # AND` \ - # `(metadata.instance_partition.name:custom-instance-partition) AND` \ - # `(metadata.start_time < \"2021-03-28T14:50:00Z\") AND` \ - # `(error:*)` - Return operations where: - # * The operation's metadata type is - # {::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstancePartitionMetadata CreateInstancePartitionMetadata}. - # * The instance partition name contains "custom-instance-partition". - # * The operation started before 2021-03-28T14:50:00Z. - # * The operation resulted in an error. - # @param page_size [::Integer] - # Optional. Number of operations to be returned in the response. If 0 or - # less, defaults to the server's maximum allowed page size. - # @param page_token [::String] - # Optional. If non-empty, `page_token` should contain a - # {::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionOperationsResponse#next_page_token next_page_token} - # from a previous - # {::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionOperationsResponse ListInstancePartitionOperationsResponse} - # to the same `parent` and with the same `filter`. - # @param instance_partition_deadline [::Google::Protobuf::Timestamp, ::Hash] - # Optional. Deadline used while retrieving metadata for instance partition - # operations. Instance partitions whose operation metadata cannot be - # retrieved within this deadline will be added to - # {::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionOperationsResponse#unreachable_instance_partitions unreachable_instance_partitions} - # in - # {::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionOperationsResponse ListInstancePartitionOperationsResponse}. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/spanner/admin/instance/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionOperationsRequest.new - # - # # Call the list_instance_partition_operations method. - # result = client.list_instance_partition_operations 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::Longrunning::Operation. - # p item - # end - # - def list_instance_partition_operations request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionOperationsRequest - - # 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 - call_metadata = @config.rpcs.list_instance_partition_operations.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_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::Admin::Instance::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.list_instance_partition_operations.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_instance_partition_operations.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @instance_admin_stub.list_instance_partition_operations request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @instance_admin_stub, :list_instance_partition_operations, "operations", request, result, options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Moves an instance to the target instance configuration. You can use the - # returned long-running operation to track - # the progress of moving the instance. - # - # `MoveInstance` returns `FAILED_PRECONDITION` if the instance meets any of - # the following criteria: - # - # * Is undergoing a move to a different instance configuration - # * Has backups - # * Has an ongoing update - # * Contains any CMEK-enabled databases - # * Is a free trial instance - # - # While the operation is pending: - # - # * All other attempts to modify the instance, including changes to its - # compute capacity, are rejected. - # * The following database and backup admin operations are rejected: - # - # * `DatabaseAdmin.CreateDatabase` - # * `DatabaseAdmin.UpdateDatabaseDdl` (disabled if default_leader is - # specified in the request.) - # * `DatabaseAdmin.RestoreDatabase` - # * `DatabaseAdmin.CreateBackup` - # * `DatabaseAdmin.CopyBackup` - # - # * Both the source and target instance configurations are subject to - # hourly compute and storage charges. - # * The instance might experience higher read-write latencies and a higher - # transaction abort rate. However, moving an instance doesn't cause any - # downtime. - # - # The returned long-running operation has - # a name of the format - # `/operations/` and can be used to track - # the move instance operation. The - # metadata field type is - # {::Google::Cloud::Spanner::Admin::Instance::V1::MoveInstanceMetadata MoveInstanceMetadata}. - # The response field type is - # {::Google::Cloud::Spanner::Admin::Instance::V1::Instance Instance}, - # if successful. - # Cancelling the operation sets its metadata's - # {::Google::Cloud::Spanner::Admin::Instance::V1::MoveInstanceMetadata#cancel_time cancel_time}. - # Cancellation is not immediate because it involves moving any data - # previously moved to the target instance configuration back to the original - # instance configuration. You can use this operation to track the progress of - # the cancellation. Upon successful completion of the cancellation, the - # operation terminates with `CANCELLED` status. - # - # If not cancelled, upon completion of the returned operation: - # - # * The instance successfully moves to the target instance - # configuration. - # * You are billed for compute and storage in target instance - # configuration. - # - # Authorization requires the `spanner.instances.update` permission on - # the resource {::Google::Cloud::Spanner::Admin::Instance::V1::Instance instance}. - # - # For more details, see - # [Move an instance](https://cloud.google.com/spanner/docs/move-instance). - # - # @overload move_instance(request, options = nil) - # Pass arguments to `move_instance` via a request object, either of type - # {::Google::Cloud::Spanner::Admin::Instance::V1::MoveInstanceRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Spanner::Admin::Instance::V1::MoveInstanceRequest, ::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 move_instance(name: nil, target_config: nil) - # Pass arguments to `move_instance` 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 instance to move. - # Values are of the form `projects//instances/`. - # @param target_config [::String] - # Required. The target instance configuration where to move the instance. - # Values are of the form `projects//instanceConfigs/`. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/spanner/admin/instance/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Spanner::Admin::Instance::V1::MoveInstanceRequest.new - # - # # Call the move_instance method. - # result = client.move_instance request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def move_instance request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Instance::V1::MoveInstanceRequest - - # 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 - call_metadata = @config.rpcs.move_instance.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_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::Admin::Instance::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.move_instance.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.move_instance.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @instance_admin_stub.move_instance request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the InstanceAdmin REST API. - # - # This class represents the configuration for InstanceAdmin REST, - # 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::Admin::Instance::V1::InstanceAdmin::Rest::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 - # # list_instance_configs to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_instance_configs.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_instance_configs.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: - # * (`String`) The path to a service account key file in JSON format - # * (`Hash`) A service account key as a Hash - # * (`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)) - # * (`nil`) indicating no credentials - # - # 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] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional 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.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 :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 RPC class for the InstanceAdmin 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 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 `list_instance_configs` - # @return [::Gapic::Config::Method] - # - attr_reader :list_instance_configs - ## - # RPC-specific configuration for `get_instance_config` - # @return [::Gapic::Config::Method] - # - attr_reader :get_instance_config - ## - # RPC-specific configuration for `create_instance_config` - # @return [::Gapic::Config::Method] - # - attr_reader :create_instance_config - ## - # RPC-specific configuration for `update_instance_config` - # @return [::Gapic::Config::Method] - # - attr_reader :update_instance_config - ## - # RPC-specific configuration for `delete_instance_config` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_instance_config - ## - # RPC-specific configuration for `list_instance_config_operations` - # @return [::Gapic::Config::Method] - # - attr_reader :list_instance_config_operations - ## - # RPC-specific configuration for `list_instances` - # @return [::Gapic::Config::Method] - # - attr_reader :list_instances - ## - # RPC-specific configuration for `list_instance_partitions` - # @return [::Gapic::Config::Method] - # - attr_reader :list_instance_partitions - ## - # RPC-specific configuration for `get_instance` - # @return [::Gapic::Config::Method] - # - attr_reader :get_instance - ## - # RPC-specific configuration for `create_instance` - # @return [::Gapic::Config::Method] - # - attr_reader :create_instance - ## - # RPC-specific configuration for `update_instance` - # @return [::Gapic::Config::Method] - # - attr_reader :update_instance - ## - # RPC-specific configuration for `delete_instance` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_instance - ## - # RPC-specific configuration for `set_iam_policy` - # @return [::Gapic::Config::Method] - # - attr_reader :set_iam_policy - ## - # RPC-specific configuration for `get_iam_policy` - # @return [::Gapic::Config::Method] - # - attr_reader :get_iam_policy - ## - # RPC-specific configuration for `test_iam_permissions` - # @return [::Gapic::Config::Method] - # - attr_reader :test_iam_permissions - ## - # RPC-specific configuration for `get_instance_partition` - # @return [::Gapic::Config::Method] - # - attr_reader :get_instance_partition - ## - # RPC-specific configuration for `create_instance_partition` - # @return [::Gapic::Config::Method] - # - attr_reader :create_instance_partition - ## - # RPC-specific configuration for `delete_instance_partition` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_instance_partition - ## - # RPC-specific configuration for `update_instance_partition` - # @return [::Gapic::Config::Method] - # - attr_reader :update_instance_partition - ## - # RPC-specific configuration for `list_instance_partition_operations` - # @return [::Gapic::Config::Method] - # - attr_reader :list_instance_partition_operations - ## - # RPC-specific configuration for `move_instance` - # @return [::Gapic::Config::Method] - # - attr_reader :move_instance - - # @private - def initialize parent_rpcs = nil - list_instance_configs_config = parent_rpcs.list_instance_configs if parent_rpcs.respond_to? :list_instance_configs - @list_instance_configs = ::Gapic::Config::Method.new list_instance_configs_config - get_instance_config_config = parent_rpcs.get_instance_config if parent_rpcs.respond_to? :get_instance_config - @get_instance_config = ::Gapic::Config::Method.new get_instance_config_config - create_instance_config_config = parent_rpcs.create_instance_config if parent_rpcs.respond_to? :create_instance_config - @create_instance_config = ::Gapic::Config::Method.new create_instance_config_config - update_instance_config_config = parent_rpcs.update_instance_config if parent_rpcs.respond_to? :update_instance_config - @update_instance_config = ::Gapic::Config::Method.new update_instance_config_config - delete_instance_config_config = parent_rpcs.delete_instance_config if parent_rpcs.respond_to? :delete_instance_config - @delete_instance_config = ::Gapic::Config::Method.new delete_instance_config_config - list_instance_config_operations_config = parent_rpcs.list_instance_config_operations if parent_rpcs.respond_to? :list_instance_config_operations - @list_instance_config_operations = ::Gapic::Config::Method.new list_instance_config_operations_config - list_instances_config = parent_rpcs.list_instances if parent_rpcs.respond_to? :list_instances - @list_instances = ::Gapic::Config::Method.new list_instances_config - list_instance_partitions_config = parent_rpcs.list_instance_partitions if parent_rpcs.respond_to? :list_instance_partitions - @list_instance_partitions = ::Gapic::Config::Method.new list_instance_partitions_config - get_instance_config = parent_rpcs.get_instance if parent_rpcs.respond_to? :get_instance - @get_instance = ::Gapic::Config::Method.new get_instance_config - create_instance_config = parent_rpcs.create_instance if parent_rpcs.respond_to? :create_instance - @create_instance = ::Gapic::Config::Method.new create_instance_config - update_instance_config = parent_rpcs.update_instance if parent_rpcs.respond_to? :update_instance - @update_instance = ::Gapic::Config::Method.new update_instance_config - delete_instance_config = parent_rpcs.delete_instance if parent_rpcs.respond_to? :delete_instance - @delete_instance = ::Gapic::Config::Method.new delete_instance_config - set_iam_policy_config = parent_rpcs.set_iam_policy if parent_rpcs.respond_to? :set_iam_policy - @set_iam_policy = ::Gapic::Config::Method.new set_iam_policy_config - get_iam_policy_config = parent_rpcs.get_iam_policy if parent_rpcs.respond_to? :get_iam_policy - @get_iam_policy = ::Gapic::Config::Method.new get_iam_policy_config - test_iam_permissions_config = parent_rpcs.test_iam_permissions if parent_rpcs.respond_to? :test_iam_permissions - @test_iam_permissions = ::Gapic::Config::Method.new test_iam_permissions_config - get_instance_partition_config = parent_rpcs.get_instance_partition if parent_rpcs.respond_to? :get_instance_partition - @get_instance_partition = ::Gapic::Config::Method.new get_instance_partition_config - create_instance_partition_config = parent_rpcs.create_instance_partition if parent_rpcs.respond_to? :create_instance_partition - @create_instance_partition = ::Gapic::Config::Method.new create_instance_partition_config - delete_instance_partition_config = parent_rpcs.delete_instance_partition if parent_rpcs.respond_to? :delete_instance_partition - @delete_instance_partition = ::Gapic::Config::Method.new delete_instance_partition_config - update_instance_partition_config = parent_rpcs.update_instance_partition if parent_rpcs.respond_to? :update_instance_partition - @update_instance_partition = ::Gapic::Config::Method.new update_instance_partition_config - list_instance_partition_operations_config = parent_rpcs.list_instance_partition_operations if parent_rpcs.respond_to? :list_instance_partition_operations - @list_instance_partition_operations = ::Gapic::Config::Method.new list_instance_partition_operations_config - move_instance_config = parent_rpcs.move_instance if parent_rpcs.respond_to? :move_instance - @move_instance = ::Gapic::Config::Method.new move_instance_config - - yield self if block_given? - end - end - end - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google/cloud/spanner/admin/instance/v1/instance_admin/rest/operations.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google/cloud/spanner/admin/instance/v1/instance_admin/rest/operations.rb deleted file mode 100644 index 9c3ba878715a..000000000000 --- a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google/cloud/spanner/admin/instance/v1/instance_admin/rest/operations.rb +++ /dev/null @@ -1,1068 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 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/operation" - -module Google - module Cloud - module Spanner - module Admin - module Instance - module V1 - module InstanceAdmin - module Rest - # Service that implements Longrunning Operations API. - class Operations - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "spanner.$UNIVERSE_DOMAIN$" - - # @private - attr_reader :operations_stub - - ## - # Configuration for the InstanceAdmin Operations API. - # - # @yield [config] Configure the Operations client. - # @yieldparam config [Operations::Configuration] - # - # @return [Operations::Configuration] - # - def self.configure - @configure ||= Operations::Configuration.new - yield @configure if block_given? - @configure - end - - ## - # Configure the InstanceAdmin Operations 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 {Operations.configure}. - # - # @yield [config] Configure the Operations client. - # @yieldparam config [Operations::Configuration] - # - # @return [Operations::Configuration] - # - def configure - yield @config if block_given? - @config - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @operations_stub.universe_domain - end - - ## - # Create a new Operations client object. - # - # @yield [config] Configure the Client client. - # @yieldparam config [Operations::Configuration] - # - def initialize - # Create the configuration object - @config = Configuration.new Operations.configure - - # Yield the configuration if needed - yield @config if block_given? - - # Create credentials - credentials = @config.credentials - credentials ||= Credentials.default scope: @config.scope - 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 - - @operations_stub = OperationsServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials - ) - - # Used by an LRO wrapper for some methods of this service - @operations_client = self - end - - # Service calls - - ## - # Lists operations that match the specified filter in the request. If the - # server doesn't support this method, it returns `UNIMPLEMENTED`. - # - # @overload list_operations(request, options = nil) - # Pass arguments to `list_operations` via a request object, either of type - # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::ListOperationsRequest, ::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_operations(name: nil, filter: nil, page_size: nil, page_token: nil, return_partial_success: nil) - # Pass arguments to `list_operations` 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] - # The name of the operation's parent resource. - # @param filter [::String] - # The standard list filter. - # @param page_size [::Integer] - # The standard list page size. - # @param page_token [::String] - # The standard list page token. - # @param return_partial_success [::Boolean] - # When set to `true`, operations that are reachable are returned as normal, - # and those that are unreachable are returned in the - # [ListOperationsResponse.unreachable] field. - # - # This can only be `true` when reading across collections e.g. when `parent` - # is set to `"projects/example/locations/-"`. - # - # This field is not by default supported and will result in an - # `UNIMPLEMENTED` error if set unless explicitly documented otherwise in - # service or product specific documentation. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::ListOperationsRequest.new - # - # # Call the list_operations method. - # result = client.list_operations 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::Longrunning::Operation. - # p item - # end - # - def list_operations request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::ListOperationsRequest - - # 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 - call_metadata = @config.rpcs.list_operations.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_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::Admin::Instance::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.list_operations.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_operations.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.list_operations request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @operations_stub, :list_operations, "operations", request, result, options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets the latest state of a long-running operation. Clients can use this - # method to poll the operation result at intervals as recommended by the API - # service. - # - # @overload get_operation(request, options = nil) - # Pass arguments to `get_operation` via a request object, either of type - # {::Google::Longrunning::GetOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::GetOperationRequest, ::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_operation(name: nil) - # Pass arguments to `get_operation` 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] - # The name of the operation resource. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::GetOperationRequest.new - # - # # Call the get_operation method. - # result = client.get_operation request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def get_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::GetOperationRequest - - # 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 - call_metadata = @config.rpcs.get_operation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_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::Admin::Instance::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_operation.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.get_operation request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes a long-running operation. This method indicates that the client is - # no longer interested in the operation result. It does not cancel the - # operation. If the server doesn't support this method, it returns - # `google.rpc.Code.UNIMPLEMENTED`. - # - # @overload delete_operation(request, options = nil) - # Pass arguments to `delete_operation` via a request object, either of type - # {::Google::Longrunning::DeleteOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::DeleteOperationRequest, ::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_operation(name: nil) - # Pass arguments to `delete_operation` 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] - # The name of the operation resource to be deleted. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::DeleteOperationRequest.new - # - # # Call the delete_operation method. - # result = client.delete_operation request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::DeleteOperationRequest - - # 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 - call_metadata = @config.rpcs.delete_operation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_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::Admin::Instance::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.delete_operation request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Starts asynchronous cancellation on a long-running operation. The server - # makes a best effort to cancel the operation, but success is not - # guaranteed. If the server doesn't support this method, it returns - # `google.rpc.Code.UNIMPLEMENTED`. Clients can use - # Operations.GetOperation or - # other methods to check whether the cancellation succeeded or whether the - # operation completed despite cancellation. On successful cancellation, - # the operation is not deleted; instead, it becomes an operation with - # an {::Google::Longrunning::Operation#error Operation.error} value with a - # {::Google::Rpc::Status#code google.rpc.Status.code} of `1`, corresponding to - # `Code.CANCELLED`. - # - # @overload cancel_operation(request, options = nil) - # Pass arguments to `cancel_operation` via a request object, either of type - # {::Google::Longrunning::CancelOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::CancelOperationRequest, ::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 cancel_operation(name: nil) - # Pass arguments to `cancel_operation` 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] - # The name of the operation resource to be cancelled. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::CancelOperationRequest.new - # - # # Call the cancel_operation method. - # result = client.cancel_operation request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def cancel_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::CancelOperationRequest - - # 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 - call_metadata = @config.rpcs.cancel_operation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_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::Admin::Instance::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.cancel_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.cancel_operation request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the Operations REST API. - # - # This class represents the configuration for Operations REST, - # 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::Longrunning::Operations::Rest::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 - # # list_operations to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Longrunning::Operations::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_operations.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Longrunning::Operations::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_operations.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: - # * (`String`) The path to a service account key file in JSON format - # * (`Hash`) A service account key as a Hash - # * (`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)) - # * (`nil`) indicating no credentials - # - # 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] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional 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.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 :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 RPC class for the Operations 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 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 `list_operations` - # @return [::Gapic::Config::Method] - # - attr_reader :list_operations - ## - # RPC-specific configuration for `get_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :get_operation - ## - # RPC-specific configuration for `delete_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_operation - ## - # RPC-specific configuration for `cancel_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :cancel_operation - - # @private - def initialize parent_rpcs = nil - list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations - @list_operations = ::Gapic::Config::Method.new list_operations_config - get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation - @get_operation = ::Gapic::Config::Method.new get_operation_config - delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation - @delete_operation = ::Gapic::Config::Method.new delete_operation_config - cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation - @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config - - yield self if block_given? - end - end - end - end - - ## - # @private - # REST service stub for the Longrunning Operations API. - # Service stub contains baseline method implementations - # including transcoding, making the REST call, and deserialing the response. - class OperationsServiceStub - def initialize endpoint:, endpoint_template:, universe_domain:, credentials: - # These require statements are intentionally placed here to initialize - # the REST modules only when it's required. - require "gapic/rest" - - @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, - endpoint_template: endpoint_template, - universe_domain: universe_domain, - credentials: credentials - end - - ## - # Baseline implementation for the list_operations REST call - # - # @param request_pb [::Google::Longrunning::ListOperationsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::ListOperationsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::ListOperationsResponse] - # A result object deserialized from the server's reply - def list_operations request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = OperationsServiceStub.transcode_list_operations_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "list_operations", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::ListOperationsResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the get_operation REST call - # - # @param request_pb [::Google::Longrunning::GetOperationRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::Operation] - # A result object deserialized from the server's reply - def get_operation request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = OperationsServiceStub.transcode_get_operation_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "get_operation", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the delete_operation REST call - # - # @param request_pb [::Google::Longrunning::DeleteOperationRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # A result object deserialized from the server's reply - def delete_operation request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = OperationsServiceStub.transcode_delete_operation_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "delete_operation", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the cancel_operation REST call - # - # @param request_pb [::Google::Longrunning::CancelOperationRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # A result object deserialized from the server's reply - def cancel_operation request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = OperationsServiceStub.transcode_cancel_operation_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "cancel_operation", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # @private - # - # GRPC transcoding helper method for the list_operations REST call - # - # @param request_pb [::Google::Longrunning::ListOperationsRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_list_operations_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/instances/[^/]+/databases/[^/]+/operations/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/instances/[^/]+/operations/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/instances/[^/]+/backups/[^/]+/operations/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/instances/[^/]+/instancePartitions/[^/]+/operations/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/instanceConfigs/[^/]+/operations/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/instanceConfigs/[^/]+/ssdCaches/[^/]+/operations/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_operation REST call - # - # @param request_pb [::Google::Longrunning::GetOperationRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_get_operation_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/instances/[^/]+/databases/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/instances/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/instances/[^/]+/backups/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/instances/[^/]+/instancePartitions/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/instanceConfigs/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/instanceConfigs/[^/]+/ssdCaches/[^/]+/operations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_operation REST call - # - # @param request_pb [::Google::Longrunning::DeleteOperationRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_delete_operation_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/instances/[^/]+/databases/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :delete, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/instances/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :delete, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/instances/[^/]+/backups/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :delete, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/instances/[^/]+/instancePartitions/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :delete, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/instanceConfigs/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :delete, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/instanceConfigs/[^/]+/ssdCaches/[^/]+/operations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the cancel_operation REST call - # - # @param request_pb [::Google::Longrunning::CancelOperationRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_cancel_operation_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:cancel", - matches: [ - ["name", %r{^projects/[^/]+/instances/[^/]+/databases/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:cancel", - matches: [ - ["name", %r{^projects/[^/]+/instances/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:cancel", - matches: [ - ["name", %r{^projects/[^/]+/instances/[^/]+/backups/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:cancel", - matches: [ - ["name", %r{^projects/[^/]+/instances/[^/]+/instancePartitions/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:cancel", - matches: [ - ["name", %r{^projects/[^/]+/instanceConfigs/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:cancel", - matches: [ - ["name", %r{^projects/[^/]+/instanceConfigs/[^/]+/ssdCaches/[^/]+/operations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google/cloud/spanner/admin/instance/v1/instance_admin/rest/service_stub.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google/cloud/spanner/admin/instance/v1/instance_admin/rest/service_stub.rb deleted file mode 100644 index 6938a3c9105a..000000000000 --- a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google/cloud/spanner/admin/instance/v1/instance_admin/rest/service_stub.rb +++ /dev/null @@ -1,1376 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 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/spanner/admin/instance/v1/spanner_instance_admin_pb" - -module Google - module Cloud - module Spanner - module Admin - module Instance - module V1 - module InstanceAdmin - module Rest - ## - # REST service stub for the InstanceAdmin service. - # Service stub contains baseline method implementations - # including transcoding, making the REST call, and deserialing the response. - # - class ServiceStub - # @private - def initialize endpoint:, endpoint_template:, universe_domain:, credentials:, logger: - # These require statements are intentionally placed here to initialize - # the REST modules only when it's required. - require "gapic/rest" - - @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, - endpoint_template: endpoint_template, - universe_domain: universe_domain, - credentials: credentials, - numeric_enums: true, - service_name: self.class, - raise_faraday_errors: false, - logger: logger - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @client_stub.universe_domain - end - - ## - # The effective endpoint - # - # @return [String] - # - def endpoint - @client_stub.endpoint - end - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger stub: false - stub ? @client_stub.stub_logger : @client_stub.logger - end - - ## - # Baseline implementation for the list_instance_configs REST call - # - # @param request_pb [::Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigsResponse] - # A result object deserialized from the server's reply - def list_instance_configs request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_instance_configs_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "list_instance_configs", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigsResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the get_instance_config REST call - # - # @param request_pb [::Google::Cloud::Spanner::Admin::Instance::V1::GetInstanceConfigRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig] - # A result object deserialized from the server's reply - def get_instance_config request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_instance_config_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "get_instance_config", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the create_instance_config REST call - # - # @param request_pb [::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstanceConfigRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::Operation] - # A result object deserialized from the server's reply - def create_instance_config request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_instance_config_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "create_instance_config", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the update_instance_config REST call - # - # @param request_pb [::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstanceConfigRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::Operation] - # A result object deserialized from the server's reply - def update_instance_config request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_instance_config_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "update_instance_config", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the delete_instance_config REST call - # - # @param request_pb [::Google::Cloud::Spanner::Admin::Instance::V1::DeleteInstanceConfigRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # A result object deserialized from the server's reply - def delete_instance_config request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_delete_instance_config_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "delete_instance_config", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the list_instance_config_operations REST call - # - # @param request_pb [::Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigOperationsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigOperationsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigOperationsResponse] - # A result object deserialized from the server's reply - def list_instance_config_operations request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_instance_config_operations_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "list_instance_config_operations", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigOperationsResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the list_instances REST call - # - # @param request_pb [::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancesRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancesResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancesResponse] - # A result object deserialized from the server's reply - def list_instances request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_instances_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "list_instances", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancesResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the list_instance_partitions REST call - # - # @param request_pb [::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionsResponse] - # A result object deserialized from the server's reply - def list_instance_partitions request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_instance_partitions_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "list_instance_partitions", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionsResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the get_instance REST call - # - # @param request_pb [::Google::Cloud::Spanner::Admin::Instance::V1::GetInstanceRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Spanner::Admin::Instance::V1::Instance] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Spanner::Admin::Instance::V1::Instance] - # A result object deserialized from the server's reply - def get_instance request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_instance_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "get_instance", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Spanner::Admin::Instance::V1::Instance.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the create_instance REST call - # - # @param request_pb [::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstanceRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::Operation] - # A result object deserialized from the server's reply - def create_instance request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_instance_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "create_instance", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the update_instance REST call - # - # @param request_pb [::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstanceRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::Operation] - # A result object deserialized from the server's reply - def update_instance request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_instance_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "update_instance", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the delete_instance REST call - # - # @param request_pb [::Google::Cloud::Spanner::Admin::Instance::V1::DeleteInstanceRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # A result object deserialized from the server's reply - def delete_instance request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_delete_instance_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "delete_instance", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the set_iam_policy REST call - # - # @param request_pb [::Google::Iam::V1::SetIamPolicyRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Iam::V1::Policy] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Iam::V1::Policy] - # A result object deserialized from the server's reply - def set_iam_policy request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_set_iam_policy_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "set_iam_policy", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Iam::V1::Policy.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the get_iam_policy REST call - # - # @param request_pb [::Google::Iam::V1::GetIamPolicyRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Iam::V1::Policy] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Iam::V1::Policy] - # A result object deserialized from the server's reply - def get_iam_policy request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_iam_policy_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "get_iam_policy", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Iam::V1::Policy.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the test_iam_permissions REST call - # - # @param request_pb [::Google::Iam::V1::TestIamPermissionsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Iam::V1::TestIamPermissionsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Iam::V1::TestIamPermissionsResponse] - # A result object deserialized from the server's reply - def test_iam_permissions request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_test_iam_permissions_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "test_iam_permissions", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Iam::V1::TestIamPermissionsResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the get_instance_partition REST call - # - # @param request_pb [::Google::Cloud::Spanner::Admin::Instance::V1::GetInstancePartitionRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Spanner::Admin::Instance::V1::InstancePartition] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Spanner::Admin::Instance::V1::InstancePartition] - # A result object deserialized from the server's reply - def get_instance_partition request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_instance_partition_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "get_instance_partition", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Spanner::Admin::Instance::V1::InstancePartition.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the create_instance_partition REST call - # - # @param request_pb [::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstancePartitionRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::Operation] - # A result object deserialized from the server's reply - def create_instance_partition request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_instance_partition_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "create_instance_partition", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the delete_instance_partition REST call - # - # @param request_pb [::Google::Cloud::Spanner::Admin::Instance::V1::DeleteInstancePartitionRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # A result object deserialized from the server's reply - def delete_instance_partition request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_delete_instance_partition_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "delete_instance_partition", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the update_instance_partition REST call - # - # @param request_pb [::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstancePartitionRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::Operation] - # A result object deserialized from the server's reply - def update_instance_partition request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_instance_partition_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "update_instance_partition", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the list_instance_partition_operations REST call - # - # @param request_pb [::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionOperationsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionOperationsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionOperationsResponse] - # A result object deserialized from the server's reply - def list_instance_partition_operations request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_instance_partition_operations_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "list_instance_partition_operations", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionOperationsResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the move_instance REST call - # - # @param request_pb [::Google::Cloud::Spanner::Admin::Instance::V1::MoveInstanceRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::Operation] - # A result object deserialized from the server's reply - def move_instance request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_move_instance_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "move_instance", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # @private - # - # GRPC transcoding helper method for the list_instance_configs REST call - # - # @param request_pb [::Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigsRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_list_instance_configs_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/instanceConfigs", - matches: [ - ["parent", %r{^projects/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_instance_config REST call - # - # @param request_pb [::Google::Cloud::Spanner::Admin::Instance::V1::GetInstanceConfigRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_get_instance_config_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/instanceConfigs/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the create_instance_config REST call - # - # @param request_pb [::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstanceConfigRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_create_instance_config_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/instanceConfigs", - body: "*", - matches: [ - ["parent", %r{^projects/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_instance_config REST call - # - # @param request_pb [::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstanceConfigRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_update_instance_config_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v1/{instance_config.name}", - body: "*", - matches: [ - ["instance_config.name", %r{^projects/[^/]+/instanceConfigs/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_instance_config REST call - # - # @param request_pb [::Google::Cloud::Spanner::Admin::Instance::V1::DeleteInstanceConfigRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_delete_instance_config_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/instanceConfigs/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_instance_config_operations REST call - # - # @param request_pb [::Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigOperationsRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_list_instance_config_operations_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/instanceConfigOperations", - matches: [ - ["parent", %r{^projects/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_instances REST call - # - # @param request_pb [::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancesRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_list_instances_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/instances", - matches: [ - ["parent", %r{^projects/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_instance_partitions REST call - # - # @param request_pb [::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionsRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_list_instance_partitions_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/instancePartitions", - matches: [ - ["parent", %r{^projects/[^/]+/instances/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_instance REST call - # - # @param request_pb [::Google::Cloud::Spanner::Admin::Instance::V1::GetInstanceRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_get_instance_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/instances/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the create_instance REST call - # - # @param request_pb [::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstanceRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_create_instance_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/instances", - body: "*", - matches: [ - ["parent", %r{^projects/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_instance REST call - # - # @param request_pb [::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstanceRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_update_instance_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v1/{instance.name}", - body: "*", - matches: [ - ["instance.name", %r{^projects/[^/]+/instances/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_instance REST call - # - # @param request_pb [::Google::Cloud::Spanner::Admin::Instance::V1::DeleteInstanceRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_delete_instance_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/instances/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the set_iam_policy REST call - # - # @param request_pb [::Google::Iam::V1::SetIamPolicyRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_set_iam_policy_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{resource}:setIamPolicy", - body: "*", - matches: [ - ["resource", %r{^projects/[^/]+/instances/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_iam_policy REST call - # - # @param request_pb [::Google::Iam::V1::GetIamPolicyRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_get_iam_policy_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{resource}:getIamPolicy", - body: "*", - matches: [ - ["resource", %r{^projects/[^/]+/instances/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the test_iam_permissions REST call - # - # @param request_pb [::Google::Iam::V1::TestIamPermissionsRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_test_iam_permissions_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{resource}:testIamPermissions", - body: "*", - matches: [ - ["resource", %r{^projects/[^/]+/instances/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_instance_partition REST call - # - # @param request_pb [::Google::Cloud::Spanner::Admin::Instance::V1::GetInstancePartitionRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_get_instance_partition_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/instances/[^/]+/instancePartitions/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the create_instance_partition REST call - # - # @param request_pb [::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstancePartitionRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_create_instance_partition_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/instancePartitions", - body: "*", - matches: [ - ["parent", %r{^projects/[^/]+/instances/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_instance_partition REST call - # - # @param request_pb [::Google::Cloud::Spanner::Admin::Instance::V1::DeleteInstancePartitionRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_delete_instance_partition_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/instances/[^/]+/instancePartitions/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_instance_partition REST call - # - # @param request_pb [::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstancePartitionRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_update_instance_partition_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v1/{instance_partition.name}", - body: "*", - matches: [ - ["instance_partition.name", %r{^projects/[^/]+/instances/[^/]+/instancePartitions/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_instance_partition_operations REST call - # - # @param request_pb [::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionOperationsRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_list_instance_partition_operations_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/instancePartitionOperations", - matches: [ - ["parent", %r{^projects/[^/]+/instances/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the move_instance REST call - # - # @param request_pb [::Google::Cloud::Spanner::Admin::Instance::V1::MoveInstanceRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_move_instance_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:move", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/instances/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google/cloud/spanner/admin/instance/v1/rest.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google/cloud/spanner/admin/instance/v1/rest.rb deleted file mode 100644 index fbd7c0880ea5..000000000000 --- a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google/cloud/spanner/admin/instance/v1/rest.rb +++ /dev/null @@ -1,41 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 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/admin/instance/v1/instance_admin/rest" -require "google/cloud/spanner/admin/instance/v1/version" - -module Google - module Cloud - module Spanner - module Admin - module Instance - ## - # To load just the REST part of this package, including all its services, and instantiate a REST client: - # - # @example - # - # require "google/cloud/spanner/admin/instance/v1/rest" - # client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::Client.new - # - module V1 - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google/cloud/spanner/admin/instance/v1/version.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google/cloud/spanner/admin/instance/v1/version.rb deleted file mode 100644 index e72967bdfe7f..000000000000 --- a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google/cloud/spanner/admin/instance/v1/version.rb +++ /dev/null @@ -1,32 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 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 Admin - module Instance - module V1 - VERSION = "0.0.1" - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google/spanner/admin/instance/v1/common_pb.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google/spanner/admin/instance/v1/common_pb.rb deleted file mode 100644 index ff03859f1024..000000000000 --- a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google/spanner/admin/instance/v1/common_pb.rb +++ /dev/null @@ -1,53 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/spanner/admin/instance/v1/common.proto - -require 'google/protobuf' - -require 'google/api/field_behavior_pb' -require 'google/api/resource_pb' -require 'google/protobuf/timestamp_pb' - - -descriptor_data = "\n-google/spanner/admin/instance/v1/common.proto\x12 google.spanner.admin.instance.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\x8b\x01\n\x11OperationProgress\x12\x18\n\x10progress_percent\x18\x01 \x01(\x05\x12.\n\nstart_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12,\n\x08\x65nd_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\")\n\x10ReplicaSelection\x12\x15\n\x08location\x18\x01 \x01(\tB\x03\xe0\x41\x02*w\n\x11\x46ulfillmentPeriod\x12\"\n\x1e\x46ULFILLMENT_PERIOD_UNSPECIFIED\x10\x00\x12\x1d\n\x19\x46ULFILLMENT_PERIOD_NORMAL\x10\x01\x12\x1f\n\x1b\x46ULFILLMENT_PERIOD_EXTENDED\x10\x02\x42\xfd\x01\n$com.google.spanner.admin.instance.v1B\x0b\x43ommonProtoP\x01ZFcloud.google.com/go/spanner/admin/instance/apiv1/instancepb;instancepb\xaa\x02&Google.Cloud.Spanner.Admin.Instance.V1\xca\x02&Google\\Cloud\\Spanner\\Admin\\Instance\\V1\xea\x02+Google::Cloud::Spanner::Admin::Instance::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"], - ] - 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 Admin - module Instance - module V1 - OperationProgress = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.OperationProgress").msgclass - ReplicaSelection = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.ReplicaSelection").msgclass - FulfillmentPeriod = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.FulfillmentPeriod").enummodule - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google/spanner/admin/instance/v1/spanner_instance_admin_pb.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google/spanner/admin/instance/v1/spanner_instance_admin_pb.rb deleted file mode 100644 index ec466e66d795..000000000000 --- a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google/spanner/admin/instance/v1/spanner_instance_admin_pb.rb +++ /dev/null @@ -1,114 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/spanner/admin/instance/v1/spanner_instance_admin.proto - -require 'google/protobuf' - -require 'google/api/annotations_pb' -require 'google/api/client_pb' -require 'google/api/field_behavior_pb' -require 'google/api/resource_pb' -require 'google/iam/v1/iam_policy_pb' -require 'google/iam/v1/policy_pb' -require 'google/longrunning/operations_pb' -require 'google/protobuf/empty_pb' -require 'google/protobuf/field_mask_pb' -require 'google/protobuf/timestamp_pb' -require 'google/spanner/admin/instance/v1/common_pb' - - -descriptor_data = "\n=google/spanner/admin/instance/v1/spanner_instance_admin.proto\x12 google.spanner.admin.instance.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x1egoogle/iam/v1/iam_policy.proto\x1a\x1agoogle/iam/v1/policy.proto\x1a#google/longrunning/operations.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a-google/spanner/admin/instance/v1/common.proto\"\xda\x01\n\x0bReplicaInfo\x12\x10\n\x08location\x18\x01 \x01(\t\x12G\n\x04type\x18\x02 \x01(\x0e\x32\x39.google.spanner.admin.instance.v1.ReplicaInfo.ReplicaType\x12\x1f\n\x17\x64\x65\x66\x61ult_leader_location\x18\x03 \x01(\x08\"O\n\x0bReplicaType\x12\x14\n\x10TYPE_UNSPECIFIED\x10\x00\x12\x0e\n\nREAD_WRITE\x10\x01\x12\r\n\tREAD_ONLY\x10\x02\x12\x0b\n\x07WITNESS\x10\x03\"\xc0\n\n\x0eInstanceConfig\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x14\n\x0c\x64isplay_name\x18\x02 \x01(\t\x12O\n\x0b\x63onfig_type\x18\x05 \x01(\x0e\x32\x35.google.spanner.admin.instance.v1.InstanceConfig.TypeB\x03\xe0\x41\x03\x12?\n\x08replicas\x18\x03 \x03(\x0b\x32-.google.spanner.admin.instance.v1.ReplicaInfo\x12M\n\x11optional_replicas\x18\x06 \x03(\x0b\x32-.google.spanner.admin.instance.v1.ReplicaInfoB\x03\xe0\x41\x03\x12?\n\x0b\x62\x61se_config\x18\x07 \x01(\tB*\xfa\x41\'\n%spanner.googleapis.com/InstanceConfig\x12L\n\x06labels\x18\x08 \x03(\x0b\x32<.google.spanner.admin.instance.v1.InstanceConfig.LabelsEntry\x12\x0c\n\x04\x65tag\x18\t \x01(\t\x12\x16\n\x0eleader_options\x18\x04 \x03(\t\x12\x18\n\x0breconciling\x18\n \x01(\x08\x42\x03\xe0\x41\x03\x12J\n\x05state\x18\x0b \x01(\x0e\x32\x36.google.spanner.admin.instance.v1.InstanceConfig.StateB\x03\xe0\x41\x03\x12r\n\x1a\x66ree_instance_availability\x18\x0c \x01(\x0e\x32I.google.spanner.admin.instance.v1.InstanceConfig.FreeInstanceAvailabilityB\x03\xe0\x41\x03\x12U\n\x0bquorum_type\x18\x12 \x01(\x0e\x32;.google.spanner.admin.instance.v1.InstanceConfig.QuorumTypeB\x03\xe0\x41\x03\x12.\n!storage_limit_per_processing_unit\x18\x13 \x01(\x03\x42\x03\xe0\x41\x03\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"B\n\x04Type\x12\x14\n\x10TYPE_UNSPECIFIED\x10\x00\x12\x12\n\x0eGOOGLE_MANAGED\x10\x01\x12\x10\n\x0cUSER_MANAGED\x10\x02\"7\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0c\n\x08\x43REATING\x10\x01\x12\t\n\x05READY\x10\x02\"\x88\x01\n\x18\x46reeInstanceAvailability\x12*\n&FREE_INSTANCE_AVAILABILITY_UNSPECIFIED\x10\x00\x12\r\n\tAVAILABLE\x10\x01\x12\x0f\n\x0bUNSUPPORTED\x10\x02\x12\x0c\n\x08\x44ISABLED\x10\x03\x12\x12\n\x0eQUOTA_EXCEEDED\x10\x04\"X\n\nQuorumType\x12\x1b\n\x17QUORUM_TYPE_UNSPECIFIED\x10\x00\x12\n\n\x06REGION\x10\x01\x12\x0f\n\x0b\x44UAL_REGION\x10\x02\x12\x10\n\x0cMULTI_REGION\x10\x03:\x81\x01\xea\x41~\n%spanner.googleapis.com/InstanceConfig\x12\x34projects/{project}/instanceConfigs/{instance_config}*\x0finstanceConfigs2\x0einstanceConfig\"\xb2\x01\n\x16ReplicaComputeCapacity\x12R\n\x11replica_selection\x18\x01 \x01(\x0b\x32\x32.google.spanner.admin.instance.v1.ReplicaSelectionB\x03\xe0\x41\x02\x12\x14\n\nnode_count\x18\x02 \x01(\x05H\x00\x12\x1a\n\x10processing_units\x18\x03 \x01(\x05H\x00\x42\x12\n\x10\x63ompute_capacity\"\x84\n\n\x11\x41utoscalingConfig\x12\x66\n\x12\x61utoscaling_limits\x18\x01 \x01(\x0b\x32\x45.google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimitsB\x03\xe0\x41\x02\x12h\n\x13\x61utoscaling_targets\x18\x02 \x01(\x0b\x32\x46.google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingTargetsB\x03\xe0\x41\x02\x12|\n\x1e\x61symmetric_autoscaling_options\x18\x03 \x03(\x0b\x32O.google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOptionB\x03\xe0\x41\x01\x1a\x97\x01\n\x11\x41utoscalingLimits\x12\x13\n\tmin_nodes\x18\x01 \x01(\x05H\x00\x12\x1e\n\x14min_processing_units\x18\x02 \x01(\x05H\x00\x12\x13\n\tmax_nodes\x18\x03 \x01(\x05H\x01\x12\x1e\n\x14max_processing_units\x18\x04 \x01(\x05H\x01\x42\x0b\n\tmin_limitB\x0b\n\tmax_limit\x1a\x9e\x01\n\x12\x41utoscalingTargets\x12\x32\n%high_priority_cpu_utilization_percent\x18\x01 \x01(\x05\x42\x03\xe0\x41\x01\x12*\n\x1dtotal_cpu_utilization_percent\x18\x04 \x01(\x05\x42\x03\xe0\x41\x01\x12(\n\x1bstorage_utilization_percent\x18\x02 \x01(\x05\x42\x03\xe0\x41\x02\x1a\xe3\x04\n\x1b\x41symmetricAutoscalingOption\x12R\n\x11replica_selection\x18\x01 \x01(\x0b\x32\x32.google.spanner.admin.instance.v1.ReplicaSelectionB\x03\xe0\x41\x02\x12\x82\x01\n\toverrides\x18\x02 \x01(\x0b\x32j.google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.AutoscalingConfigOverridesB\x03\xe0\x41\x01\x1a\xea\x02\n\x1a\x41utoscalingConfigOverrides\x12\x66\n\x12\x61utoscaling_limits\x18\x01 \x01(\x0b\x32\x45.google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimitsB\x03\xe0\x41\x01\x12\x45\n8autoscaling_target_high_priority_cpu_utilization_percent\x18\x02 \x01(\x05\x42\x03\xe0\x41\x01\x12=\n0autoscaling_target_total_cpu_utilization_percent\x18\x04 \x01(\x05\x42\x03\xe0\x41\x01\x12\x32\n%disable_high_priority_cpu_autoscaling\x18\x05 \x01(\x08\x42\x03\xe0\x41\x01\x12*\n\x1d\x64isable_total_cpu_autoscaling\x18\x06 \x01(\x08\x42\x03\xe0\x41\x01\"\xaa\x0b\n\x08Instance\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12=\n\x06\x63onfig\x18\x02 \x01(\tB-\xe0\x41\x02\xfa\x41\'\n%spanner.googleapis.com/InstanceConfig\x12\x19\n\x0c\x64isplay_name\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12\x12\n\nnode_count\x18\x05 \x01(\x05\x12\x18\n\x10processing_units\x18\t \x01(\x05\x12_\n\x18replica_compute_capacity\x18\x13 \x03(\x0b\x32\x38.google.spanner.admin.instance.v1.ReplicaComputeCapacityB\x03\xe0\x41\x03\x12T\n\x12\x61utoscaling_config\x18\x11 \x01(\x0b\x32\x33.google.spanner.admin.instance.v1.AutoscalingConfigB\x03\xe0\x41\x01\x12\x44\n\x05state\x18\x06 \x01(\x0e\x32\x30.google.spanner.admin.instance.v1.Instance.StateB\x03\xe0\x41\x03\x12\x46\n\x06labels\x18\x07 \x03(\x0b\x32\x36.google.spanner.admin.instance.v1.Instance.LabelsEntry\x12N\n\rinstance_type\x18\n \x01(\x0e\x32\x37.google.spanner.admin.instance.v1.Instance.InstanceType\x12\x15\n\rendpoint_uris\x18\x08 \x03(\t\x12\x34\n\x0b\x63reate_time\x18\x0b \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x0c \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12V\n\x16\x66ree_instance_metadata\x18\r \x01(\x0b\x32\x36.google.spanner.admin.instance.v1.FreeInstanceMetadata\x12H\n\x07\x65\x64ition\x18\x14 \x01(\x0e\x32\x32.google.spanner.admin.instance.v1.Instance.EditionB\x03\xe0\x41\x01\x12o\n\x1c\x64\x65\x66\x61ult_backup_schedule_type\x18\x17 \x01(\x0e\x32\x44.google.spanner.admin.instance.v1.Instance.DefaultBackupScheduleTypeB\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\"7\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0c\n\x08\x43REATING\x10\x01\x12\t\n\x05READY\x10\x02\"Q\n\x0cInstanceType\x12\x1d\n\x19INSTANCE_TYPE_UNSPECIFIED\x10\x00\x12\x0f\n\x0bPROVISIONED\x10\x01\x12\x11\n\rFREE_INSTANCE\x10\x02\"U\n\x07\x45\x64ition\x12\x17\n\x13\x45\x44ITION_UNSPECIFIED\x10\x00\x12\x0c\n\x08STANDARD\x10\x01\x12\x0e\n\nENTERPRISE\x10\x02\x12\x13\n\x0f\x45NTERPRISE_PLUS\x10\x03\"b\n\x19\x44\x65\x66\x61ultBackupScheduleType\x12,\n(DEFAULT_BACKUP_SCHEDULE_TYPE_UNSPECIFIED\x10\x00\x12\x08\n\x04NONE\x10\x01\x12\r\n\tAUTOMATIC\x10\x02:b\xea\x41_\n\x1fspanner.googleapis.com/Instance\x12\'projects/{project}/instances/{instance}*\tinstances2\x08instance\"\x88\x01\n\x1aListInstanceConfigsRequest\x12\x43\n\x06parent\x18\x01 \x01(\tB3\xe0\x41\x02\xfa\x41-\n+cloudresourcemanager.googleapis.com/Project\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\"\x82\x01\n\x1bListInstanceConfigsResponse\x12J\n\x10instance_configs\x18\x01 \x03(\x0b\x32\x30.google.spanner.admin.instance.v1.InstanceConfig\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"W\n\x18GetInstanceConfigRequest\x12;\n\x04name\x18\x01 \x01(\tB-\xe0\x41\x02\xfa\x41\'\n%spanner.googleapis.com/InstanceConfig\"\xea\x01\n\x1b\x43reateInstanceConfigRequest\x12\x43\n\x06parent\x18\x01 \x01(\tB3\xe0\x41\x02\xfa\x41-\n+cloudresourcemanager.googleapis.com/Project\x12\x1f\n\x12instance_config_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12N\n\x0finstance_config\x18\x03 \x01(\x0b\x32\x30.google.spanner.admin.instance.v1.InstanceConfigB\x03\xe0\x41\x02\x12\x15\n\rvalidate_only\x18\x04 \x01(\x08\"\xba\x01\n\x1bUpdateInstanceConfigRequest\x12N\n\x0finstance_config\x18\x01 \x01(\x0b\x32\x30.google.spanner.admin.instance.v1.InstanceConfigB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\x12\x15\n\rvalidate_only\x18\x03 \x01(\x08\"\x7f\n\x1b\x44\x65leteInstanceConfigRequest\x12;\n\x04name\x18\x01 \x01(\tB-\xe0\x41\x02\xfa\x41\'\n%spanner.googleapis.com/InstanceConfig\x12\x0c\n\x04\x65tag\x18\x02 \x01(\t\x12\x15\n\rvalidate_only\x18\x03 \x01(\x08\"\xa1\x01\n#ListInstanceConfigOperationsRequest\x12\x43\n\x06parent\x18\x01 \x01(\tB3\xe0\x41\x02\xfa\x41-\n+cloudresourcemanager.googleapis.com/Project\x12\x0e\n\x06\x66ilter\x18\x02 \x01(\t\x12\x11\n\tpage_size\x18\x03 \x01(\x05\x12\x12\n\npage_token\x18\x04 \x01(\t\"r\n$ListInstanceConfigOperationsResponse\x12\x31\n\noperations\x18\x01 \x03(\x0b\x32\x1d.google.longrunning.Operation\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"{\n\x12GetInstanceRequest\x12\x35\n\x04name\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1fspanner.googleapis.com/Instance\x12.\n\nfield_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"\xb9\x01\n\x15\x43reateInstanceRequest\x12\x43\n\x06parent\x18\x01 \x01(\tB3\xe0\x41\x02\xfa\x41-\n+cloudresourcemanager.googleapis.com/Project\x12\x18\n\x0binstance_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x41\n\x08instance\x18\x03 \x01(\x0b\x32*.google.spanner.admin.instance.v1.InstanceB\x03\xe0\x41\x02\"\xc9\x01\n\x14ListInstancesRequest\x12\x43\n\x06parent\x18\x01 \x01(\tB3\xe0\x41\x02\xfa\x41-\n+cloudresourcemanager.googleapis.com/Project\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\x12\x35\n\x11instance_deadline\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"\x84\x01\n\x15ListInstancesResponse\x12=\n\tinstances\x18\x01 \x03(\x0b\x32*.google.spanner.admin.instance.v1.Instance\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x13\n\x0bunreachable\x18\x03 \x03(\t\"\x8f\x01\n\x15UpdateInstanceRequest\x12\x41\n\x08instance\x18\x01 \x01(\x0b\x32*.google.spanner.admin.instance.v1.InstanceB\x03\xe0\x41\x02\x12\x33\n\nfield_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\"N\n\x15\x44\x65leteInstanceRequest\x12\x35\n\x04name\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1fspanner.googleapis.com/Instance\"\xbf\x02\n\x16\x43reateInstanceMetadata\x12<\n\x08instance\x18\x01 \x01(\x0b\x32*.google.spanner.admin.instance.v1.Instance\x12.\n\nstart_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12/\n\x0b\x63\x61ncel_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12,\n\x08\x65nd_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12X\n\x1b\x65xpected_fulfillment_period\x18\x05 \x01(\x0e\x32\x33.google.spanner.admin.instance.v1.FulfillmentPeriod\"\xbf\x02\n\x16UpdateInstanceMetadata\x12<\n\x08instance\x18\x01 \x01(\x0b\x32*.google.spanner.admin.instance.v1.Instance\x12.\n\nstart_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12/\n\x0b\x63\x61ncel_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12,\n\x08\x65nd_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12X\n\x1b\x65xpected_fulfillment_period\x18\x05 \x01(\x0e\x32\x33.google.spanner.admin.instance.v1.FulfillmentPeriod\"\xce\x02\n\x14\x46reeInstanceMetadata\x12\x34\n\x0b\x65xpire_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x35\n\x0cupgrade_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12^\n\x0f\x65xpire_behavior\x18\x03 \x01(\x0e\x32\x45.google.spanner.admin.instance.v1.FreeInstanceMetadata.ExpireBehavior\"i\n\x0e\x45xpireBehavior\x12\x1f\n\x1b\x45XPIRE_BEHAVIOR_UNSPECIFIED\x10\x00\x12\x17\n\x13\x46REE_TO_PROVISIONED\x10\x01\x12\x1d\n\x19REMOVE_AFTER_GRACE_PERIOD\x10\x02\"\xe1\x01\n\x1c\x43reateInstanceConfigMetadata\x12I\n\x0finstance_config\x18\x01 \x01(\x0b\x32\x30.google.spanner.admin.instance.v1.InstanceConfig\x12\x45\n\x08progress\x18\x02 \x01(\x0b\x32\x33.google.spanner.admin.instance.v1.OperationProgress\x12/\n\x0b\x63\x61ncel_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"\xe1\x01\n\x1cUpdateInstanceConfigMetadata\x12I\n\x0finstance_config\x18\x01 \x01(\x0b\x32\x30.google.spanner.admin.instance.v1.InstanceConfig\x12\x45\n\x08progress\x18\x02 \x01(\x0b\x32\x33.google.spanner.admin.instance.v1.OperationProgress\x12/\n\x0b\x63\x61ncel_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"\x8f\x06\n\x11InstancePartition\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12=\n\x06\x63onfig\x18\x02 \x01(\tB-\xe0\x41\x02\xfa\x41\'\n%spanner.googleapis.com/InstanceConfig\x12\x19\n\x0c\x64isplay_name\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12\x14\n\nnode_count\x18\x05 \x01(\x05H\x00\x12\x1a\n\x10processing_units\x18\x06 \x01(\x05H\x00\x12T\n\x12\x61utoscaling_config\x18\r \x01(\x0b\x32\x33.google.spanner.admin.instance.v1.AutoscalingConfigB\x03\xe0\x41\x01\x12M\n\x05state\x18\x07 \x01(\x0e\x32\x39.google.spanner.admin.instance.v1.InstancePartition.StateB\x03\xe0\x41\x03\x12\x34\n\x0b\x63reate_time\x18\x08 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\t \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\"\n\x15referencing_databases\x18\n \x03(\tB\x03\xe0\x41\x03\x12\"\n\x13referencing_backups\x18\x0b \x03(\tB\x05\x18\x01\xe0\x41\x03\x12\x0c\n\x04\x65tag\x18\x0c \x01(\t\"7\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0c\n\x08\x43REATING\x10\x01\x12\t\n\x05READY\x10\x02:\xa6\x01\xea\x41\xa2\x01\n(spanner.googleapis.com/InstancePartition\x12Oprojects/{project}/instances/{instance}/instancePartitions/{instance_partition}*\x12instancePartitions2\x11instancePartitionB\x12\n\x10\x63ompute_capacity\"\x81\x02\n\x1f\x43reateInstancePartitionMetadata\x12O\n\x12instance_partition\x18\x01 \x01(\x0b\x32\x33.google.spanner.admin.instance.v1.InstancePartition\x12.\n\nstart_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12/\n\x0b\x63\x61ncel_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12,\n\x08\x65nd_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"\xd3\x01\n\x1e\x43reateInstancePartitionRequest\x12\x37\n\x06parent\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1fspanner.googleapis.com/Instance\x12\"\n\x15instance_partition_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12T\n\x12instance_partition\x18\x03 \x01(\x0b\x32\x33.google.spanner.admin.instance.v1.InstancePartitionB\x03\xe0\x41\x02\"n\n\x1e\x44\x65leteInstancePartitionRequest\x12>\n\x04name\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(spanner.googleapis.com/InstancePartition\x12\x0c\n\x04\x65tag\x18\x02 \x01(\t\"]\n\x1bGetInstancePartitionRequest\x12>\n\x04name\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(spanner.googleapis.com/InstancePartition\"\xab\x01\n\x1eUpdateInstancePartitionRequest\x12T\n\x12instance_partition\x18\x01 \x01(\x0b\x32\x33.google.spanner.admin.instance.v1.InstancePartitionB\x03\xe0\x41\x02\x12\x33\n\nfield_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\"\x81\x02\n\x1fUpdateInstancePartitionMetadata\x12O\n\x12instance_partition\x18\x01 \x01(\x0b\x32\x33.google.spanner.admin.instance.v1.InstancePartition\x12.\n\nstart_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12/\n\x0b\x63\x61ncel_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12,\n\x08\x65nd_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"\xc5\x01\n\x1dListInstancePartitionsRequest\x12\x37\n\x06parent\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1fspanner.googleapis.com/Instance\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\x12\x44\n\x1binstance_partition_deadline\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x01\"\xa0\x01\n\x1eListInstancePartitionsResponse\x12P\n\x13instance_partitions\x18\x01 \x03(\x0b\x32\x33.google.spanner.admin.instance.v1.InstancePartition\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x13\n\x0bunreachable\x18\x03 \x03(\t\"\xed\x01\n&ListInstancePartitionOperationsRequest\x12\x37\n\x06parent\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1fspanner.googleapis.com/Instance\x12\x13\n\x06\x66ilter\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x16\n\tpage_size\x18\x03 \x01(\x05\x42\x03\xe0\x41\x01\x12\x17\n\npage_token\x18\x04 \x01(\tB\x03\xe0\x41\x01\x12\x44\n\x1binstance_partition_deadline\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x01\"\x9e\x01\n\'ListInstancePartitionOperationsResponse\x12\x31\n\noperations\x18\x01 \x03(\x0b\x32\x1d.google.longrunning.Operation\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\'\n\x1funreachable_instance_partitions\x18\x03 \x03(\t\"\x92\x01\n\x13MoveInstanceRequest\x12\x35\n\x04name\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1fspanner.googleapis.com/Instance\x12\x44\n\rtarget_config\x18\x02 \x01(\tB-\xe0\x41\x02\xfa\x41\'\n%spanner.googleapis.com/InstanceConfig\"\x16\n\x14MoveInstanceResponse\"\xa5\x01\n\x14MoveInstanceMetadata\x12\x15\n\rtarget_config\x18\x01 \x01(\t\x12\x45\n\x08progress\x18\x02 \x01(\x0b\x32\x33.google.spanner.admin.instance.v1.OperationProgress\x12/\n\x0b\x63\x61ncel_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp2\xda\'\n\rInstanceAdmin\x12\xcc\x01\n\x13ListInstanceConfigs\x12<.google.spanner.admin.instance.v1.ListInstanceConfigsRequest\x1a=.google.spanner.admin.instance.v1.ListInstanceConfigsResponse\"8\xda\x41\x06parent\x82\xd3\xe4\x93\x02)\x12\'/v1/{parent=projects/*}/instanceConfigs\x12\xb9\x01\n\x11GetInstanceConfig\x12:.google.spanner.admin.instance.v1.GetInstanceConfigRequest\x1a\x30.google.spanner.admin.instance.v1.InstanceConfig\"6\xda\x41\x04name\x82\xd3\xe4\x93\x02)\x12\'/v1/{name=projects/*/instanceConfigs/*}\x12\xc8\x02\n\x14\x43reateInstanceConfig\x12=.google.spanner.admin.instance.v1.CreateInstanceConfigRequest\x1a\x1d.google.longrunning.Operation\"\xd1\x01\xca\x41p\n/google.spanner.admin.instance.v1.InstanceConfig\x12=google.spanner.admin.instance.v1.CreateInstanceConfigMetadata\xda\x41)parent,instance_config,instance_config_id\x82\xd3\xe4\x93\x02,\"\'/v1/{parent=projects/*}/instanceConfigs:\x01*\x12\xca\x02\n\x14UpdateInstanceConfig\x12=.google.spanner.admin.instance.v1.UpdateInstanceConfigRequest\x1a\x1d.google.longrunning.Operation\"\xd3\x01\xca\x41p\n/google.spanner.admin.instance.v1.InstanceConfig\x12=google.spanner.admin.instance.v1.UpdateInstanceConfigMetadata\xda\x41\x1binstance_config,update_mask\x82\xd3\xe4\x93\x02<27/v1/{instance_config.name=projects/*/instanceConfigs/*}:\x01*\x12\xa5\x01\n\x14\x44\x65leteInstanceConfig\x12=.google.spanner.admin.instance.v1.DeleteInstanceConfigRequest\x1a\x16.google.protobuf.Empty\"6\xda\x41\x04name\x82\xd3\xe4\x93\x02)*\'/v1/{name=projects/*/instanceConfigs/*}\x12\xf0\x01\n\x1cListInstanceConfigOperations\x12\x45.google.spanner.admin.instance.v1.ListInstanceConfigOperationsRequest\x1a\x46.google.spanner.admin.instance.v1.ListInstanceConfigOperationsResponse\"A\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x32\x12\x30/v1/{parent=projects/*}/instanceConfigOperations\x12\xb4\x01\n\rListInstances\x12\x36.google.spanner.admin.instance.v1.ListInstancesRequest\x1a\x37.google.spanner.admin.instance.v1.ListInstancesResponse\"2\xda\x41\x06parent\x82\xd3\xe4\x93\x02#\x12!/v1/{parent=projects/*}/instances\x12\xe4\x01\n\x16ListInstancePartitions\x12?.google.spanner.admin.instance.v1.ListInstancePartitionsRequest\x1a@.google.spanner.admin.instance.v1.ListInstancePartitionsResponse\"G\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x38\x12\x36/v1/{parent=projects/*/instances/*}/instancePartitions\x12\xa1\x01\n\x0bGetInstance\x12\x34.google.spanner.admin.instance.v1.GetInstanceRequest\x1a*.google.spanner.admin.instance.v1.Instance\"0\xda\x41\x04name\x82\xd3\xe4\x93\x02#\x12!/v1/{name=projects/*/instances/*}\x12\x9c\x02\n\x0e\x43reateInstance\x12\x37.google.spanner.admin.instance.v1.CreateInstanceRequest\x1a\x1d.google.longrunning.Operation\"\xb1\x01\xca\x41\x64\n)google.spanner.admin.instance.v1.Instance\x12\x37google.spanner.admin.instance.v1.CreateInstanceMetadata\xda\x41\x1bparent,instance_id,instance\x82\xd3\xe4\x93\x02&\"!/v1/{parent=projects/*}/instances:\x01*\x12\x9d\x02\n\x0eUpdateInstance\x12\x37.google.spanner.admin.instance.v1.UpdateInstanceRequest\x1a\x1d.google.longrunning.Operation\"\xb2\x01\xca\x41\x64\n)google.spanner.admin.instance.v1.Instance\x12\x37google.spanner.admin.instance.v1.UpdateInstanceMetadata\xda\x41\x13instance,field_mask\x82\xd3\xe4\x93\x02/2*/v1/{instance.name=projects/*/instances/*}:\x01*\x12\x93\x01\n\x0e\x44\x65leteInstance\x12\x37.google.spanner.admin.instance.v1.DeleteInstanceRequest\x1a\x16.google.protobuf.Empty\"0\xda\x41\x04name\x82\xd3\xe4\x93\x02#*!/v1/{name=projects/*/instances/*}\x12\x9a\x01\n\x0cSetIamPolicy\x12\".google.iam.v1.SetIamPolicyRequest\x1a\x15.google.iam.v1.Policy\"O\xda\x41\x0fresource,policy\x82\xd3\xe4\x93\x02\x37\"2/v1/{resource=projects/*/instances/*}:setIamPolicy:\x01*\x12\x93\x01\n\x0cGetIamPolicy\x12\".google.iam.v1.GetIamPolicyRequest\x1a\x15.google.iam.v1.Policy\"H\xda\x41\x08resource\x82\xd3\xe4\x93\x02\x37\"2/v1/{resource=projects/*/instances/*}:getIamPolicy:\x01*\x12\xc5\x01\n\x12TestIamPermissions\x12(.google.iam.v1.TestIamPermissionsRequest\x1a).google.iam.v1.TestIamPermissionsResponse\"Z\xda\x41\x14resource,permissions\x82\xd3\xe4\x93\x02=\"8/v1/{resource=projects/*/instances/*}:testIamPermissions:\x01*\x12\xd1\x01\n\x14GetInstancePartition\x12=.google.spanner.admin.instance.v1.GetInstancePartitionRequest\x1a\x33.google.spanner.admin.instance.v1.InstancePartition\"E\xda\x41\x04name\x82\xd3\xe4\x93\x02\x38\x12\x36/v1/{name=projects/*/instances/*/instancePartitions/*}\x12\xe9\x02\n\x17\x43reateInstancePartition\x12@.google.spanner.admin.instance.v1.CreateInstancePartitionRequest\x1a\x1d.google.longrunning.Operation\"\xec\x01\xca\x41v\n2google.spanner.admin.instance.v1.InstancePartition\x12@google.spanner.admin.instance.v1.CreateInstancePartitionMetadata\xda\x41/parent,instance_partition,instance_partition_id\x82\xd3\xe4\x93\x02;\"6/v1/{parent=projects/*/instances/*}/instancePartitions:\x01*\x12\xba\x01\n\x17\x44\x65leteInstancePartition\x12@.google.spanner.admin.instance.v1.DeleteInstancePartitionRequest\x1a\x16.google.protobuf.Empty\"E\xda\x41\x04name\x82\xd3\xe4\x93\x02\x38*6/v1/{name=projects/*/instances/*/instancePartitions/*}\x12\xea\x02\n\x17UpdateInstancePartition\x12@.google.spanner.admin.instance.v1.UpdateInstancePartitionRequest\x1a\x1d.google.longrunning.Operation\"\xed\x01\xca\x41v\n2google.spanner.admin.instance.v1.InstancePartition\x12@google.spanner.admin.instance.v1.UpdateInstancePartitionMetadata\xda\x41\x1dinstance_partition,field_mask\x82\xd3\xe4\x93\x02N2I/v1/{instance_partition.name=projects/*/instances/*/instancePartitions/*}:\x01*\x12\x88\x02\n\x1fListInstancePartitionOperations\x12H.google.spanner.admin.instance.v1.ListInstancePartitionOperationsRequest\x1aI.google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse\"P\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x41\x12?/v1/{parent=projects/*/instances/*}/instancePartitionOperations\x12\x89\x02\n\x0cMoveInstance\x12\x35.google.spanner.admin.instance.v1.MoveInstanceRequest\x1a\x1d.google.longrunning.Operation\"\xa2\x01\xca\x41n\n5google.spanner.admin.instance.v1.MoveInstanceResponse\x12\x35google.spanner.admin.instance.v1.MoveInstanceMetadata\x82\xd3\xe4\x93\x02+\"&/v1/{name=projects/*/instances/*}:move:\x01*\x1ax\xca\x41\x16spanner.googleapis.com\xd2\x41\\https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/spanner.adminB\x8b\x02\n$com.google.spanner.admin.instance.v1B\x19SpannerInstanceAdminProtoP\x01ZFcloud.google.com/go/spanner/admin/instance/apiv1/instancepb;instancepb\xaa\x02&Google.Cloud.Spanner.Admin.Instance.V1\xca\x02&Google\\Cloud\\Spanner\\Admin\\Instance\\V1\xea\x02+Google::Cloud::Spanner::Admin::Instance::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.admin.instance.v1.ReplicaSelection", "google/spanner/admin/instance/v1/common.proto"], - ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], - ["google.protobuf.FieldMask", "google/protobuf/field_mask.proto"], - ["google.longrunning.Operation", "google/longrunning/operations.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 Admin - module Instance - module V1 - ReplicaInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.ReplicaInfo").msgclass - ReplicaInfo::ReplicaType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.ReplicaInfo.ReplicaType").enummodule - InstanceConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.InstanceConfig").msgclass - InstanceConfig::Type = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.InstanceConfig.Type").enummodule - InstanceConfig::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.InstanceConfig.State").enummodule - InstanceConfig::FreeInstanceAvailability = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.InstanceConfig.FreeInstanceAvailability").enummodule - InstanceConfig::QuorumType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.InstanceConfig.QuorumType").enummodule - ReplicaComputeCapacity = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.ReplicaComputeCapacity").msgclass - AutoscalingConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.AutoscalingConfig").msgclass - AutoscalingConfig::AutoscalingLimits = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimits").msgclass - AutoscalingConfig::AutoscalingTargets = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingTargets").msgclass - AutoscalingConfig::AsymmetricAutoscalingOption = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption").msgclass - AutoscalingConfig::AsymmetricAutoscalingOption::AutoscalingConfigOverrides = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.AutoscalingConfigOverrides").msgclass - Instance = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.Instance").msgclass - Instance::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.Instance.State").enummodule - Instance::InstanceType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.Instance.InstanceType").enummodule - Instance::Edition = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.Instance.Edition").enummodule - Instance::DefaultBackupScheduleType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.Instance.DefaultBackupScheduleType").enummodule - ListInstanceConfigsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.ListInstanceConfigsRequest").msgclass - ListInstanceConfigsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.ListInstanceConfigsResponse").msgclass - GetInstanceConfigRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.GetInstanceConfigRequest").msgclass - CreateInstanceConfigRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.CreateInstanceConfigRequest").msgclass - UpdateInstanceConfigRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.UpdateInstanceConfigRequest").msgclass - DeleteInstanceConfigRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.DeleteInstanceConfigRequest").msgclass - ListInstanceConfigOperationsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.ListInstanceConfigOperationsRequest").msgclass - ListInstanceConfigOperationsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.ListInstanceConfigOperationsResponse").msgclass - GetInstanceRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.GetInstanceRequest").msgclass - CreateInstanceRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.CreateInstanceRequest").msgclass - ListInstancesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.ListInstancesRequest").msgclass - ListInstancesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.ListInstancesResponse").msgclass - UpdateInstanceRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.UpdateInstanceRequest").msgclass - DeleteInstanceRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.DeleteInstanceRequest").msgclass - CreateInstanceMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.CreateInstanceMetadata").msgclass - UpdateInstanceMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.UpdateInstanceMetadata").msgclass - FreeInstanceMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.FreeInstanceMetadata").msgclass - FreeInstanceMetadata::ExpireBehavior = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.FreeInstanceMetadata.ExpireBehavior").enummodule - CreateInstanceConfigMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.CreateInstanceConfigMetadata").msgclass - UpdateInstanceConfigMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.UpdateInstanceConfigMetadata").msgclass - InstancePartition = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.InstancePartition").msgclass - InstancePartition::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.InstancePartition.State").enummodule - CreateInstancePartitionMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.CreateInstancePartitionMetadata").msgclass - CreateInstancePartitionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.CreateInstancePartitionRequest").msgclass - DeleteInstancePartitionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.DeleteInstancePartitionRequest").msgclass - GetInstancePartitionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.GetInstancePartitionRequest").msgclass - UpdateInstancePartitionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.UpdateInstancePartitionRequest").msgclass - UpdateInstancePartitionMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.UpdateInstancePartitionMetadata").msgclass - ListInstancePartitionsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.ListInstancePartitionsRequest").msgclass - ListInstancePartitionsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.ListInstancePartitionsResponse").msgclass - ListInstancePartitionOperationsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.ListInstancePartitionOperationsRequest").msgclass - ListInstancePartitionOperationsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse").msgclass - MoveInstanceRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.MoveInstanceRequest").msgclass - MoveInstanceResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.MoveInstanceResponse").msgclass - MoveInstanceMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.MoveInstanceMetadata").msgclass - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google/spanner/admin/instance/v1/spanner_instance_admin_services_pb.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google/spanner/admin/instance/v1/spanner_instance_admin_services_pb.rb deleted file mode 100644 index d5b8848f47b8..000000000000 --- a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google/spanner/admin/instance/v1/spanner_instance_admin_services_pb.rb +++ /dev/null @@ -1,463 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# Source: google/spanner/admin/instance/v1/spanner_instance_admin.proto for package 'Google.Cloud.Spanner.Admin.Instance.V1' -# Original file comments: -# Copyright 2025 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 -# -# 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. -# - -require 'grpc' -require 'google/spanner/admin/instance/v1/spanner_instance_admin_pb' - -module Google - module Cloud - module Spanner - module Admin - module Instance - module V1 - module InstanceAdmin - # Cloud Spanner Instance Admin API - # - # The Cloud Spanner Instance Admin API can be used to create, delete, - # modify and list instances. Instances are dedicated Cloud Spanner serving - # and storage resources to be used by Cloud Spanner databases. - # - # Each instance has a "configuration", which dictates where the - # serving resources for the Cloud Spanner instance are located (e.g., - # US-central, Europe). Configurations are created by Google based on - # resource availability. - # - # Cloud Spanner billing is based on the instances that exist and their - # sizes. After an instance exists, there are no additional - # per-database or per-operation charges for use of the instance - # (though there may be additional network bandwidth charges). - # Instances offer isolation: problems with databases in one instance - # will not affect other instances. However, within an instance - # databases can affect each other. For example, if one database in an - # instance receives a lot of requests and consumes most of the - # instance resources, fewer resources are available for other - # databases in that instance, and their performance may suffer. - class Service - - include ::GRPC::GenericService - - self.marshal_class_method = :encode - self.unmarshal_class_method = :decode - self.service_name = 'google.spanner.admin.instance.v1.InstanceAdmin' - - # Lists the supported instance configurations for a given project. - # - # Returns both Google-managed configurations and user-managed - # configurations. - rpc :ListInstanceConfigs, ::Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigsRequest, ::Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigsResponse - # Gets information about a particular instance configuration. - rpc :GetInstanceConfig, ::Google::Cloud::Spanner::Admin::Instance::V1::GetInstanceConfigRequest, ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig - # Creates an instance configuration and begins preparing it to be used. The - # returned long-running operation - # can be used to track the progress of preparing the new - # instance configuration. The instance configuration name is assigned by the - # caller. If the named instance configuration already exists, - # `CreateInstanceConfig` returns `ALREADY_EXISTS`. - # - # Immediately after the request returns: - # - # * The instance configuration is readable via the API, with all requested - # attributes. The instance configuration's - # [reconciling][google.spanner.admin.instance.v1.InstanceConfig.reconciling] - # field is set to true. Its state is `CREATING`. - # - # While the operation is pending: - # - # * Cancelling the operation renders the instance configuration immediately - # unreadable via the API. - # * Except for deleting the creating resource, all other attempts to modify - # the instance configuration are rejected. - # - # Upon completion of the returned operation: - # - # * Instances can be created using the instance configuration. - # * The instance configuration's - # [reconciling][google.spanner.admin.instance.v1.InstanceConfig.reconciling] - # field becomes false. Its state becomes `READY`. - # - # The returned long-running operation will - # have a name of the format - # `/operations/` and can be used to track - # creation of the instance configuration. The - # metadata field type is - # [CreateInstanceConfigMetadata][google.spanner.admin.instance.v1.CreateInstanceConfigMetadata]. - # The response field type is - # [InstanceConfig][google.spanner.admin.instance.v1.InstanceConfig], if - # successful. - # - # Authorization requires `spanner.instanceConfigs.create` permission on - # the resource - # [parent][google.spanner.admin.instance.v1.CreateInstanceConfigRequest.parent]. - rpc :CreateInstanceConfig, ::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstanceConfigRequest, ::Google::Longrunning::Operation - # Updates an instance configuration. The returned - # long-running operation can be used to track - # the progress of updating the instance. If the named instance configuration - # does not exist, returns `NOT_FOUND`. - # - # Only user-managed configurations can be updated. - # - # Immediately after the request returns: - # - # * The instance configuration's - # [reconciling][google.spanner.admin.instance.v1.InstanceConfig.reconciling] - # field is set to true. - # - # While the operation is pending: - # - # * Cancelling the operation sets its metadata's - # [cancel_time][google.spanner.admin.instance.v1.UpdateInstanceConfigMetadata.cancel_time]. - # The operation is guaranteed to succeed at undoing all changes, after - # which point it terminates with a `CANCELLED` status. - # * All other attempts to modify the instance configuration are rejected. - # * Reading the instance configuration via the API continues to give the - # pre-request values. - # - # Upon completion of the returned operation: - # - # * Creating instances using the instance configuration uses the new - # values. - # * The new values of the instance configuration are readable via the API. - # * The instance configuration's - # [reconciling][google.spanner.admin.instance.v1.InstanceConfig.reconciling] - # field becomes false. - # - # The returned long-running operation will - # have a name of the format - # `/operations/` and can be used to track - # the instance configuration modification. The - # metadata field type is - # [UpdateInstanceConfigMetadata][google.spanner.admin.instance.v1.UpdateInstanceConfigMetadata]. - # The response field type is - # [InstanceConfig][google.spanner.admin.instance.v1.InstanceConfig], if - # successful. - # - # Authorization requires `spanner.instanceConfigs.update` permission on - # the resource [name][google.spanner.admin.instance.v1.InstanceConfig.name]. - rpc :UpdateInstanceConfig, ::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstanceConfigRequest, ::Google::Longrunning::Operation - # Deletes the instance configuration. Deletion is only allowed when no - # instances are using the configuration. If any instances are using - # the configuration, returns `FAILED_PRECONDITION`. - # - # Only user-managed configurations can be deleted. - # - # Authorization requires `spanner.instanceConfigs.delete` permission on - # the resource [name][google.spanner.admin.instance.v1.InstanceConfig.name]. - rpc :DeleteInstanceConfig, ::Google::Cloud::Spanner::Admin::Instance::V1::DeleteInstanceConfigRequest, ::Google::Protobuf::Empty - # Lists the user-managed instance configuration long-running - # operations in the given project. An instance - # configuration operation has a name of the form - # `projects//instanceConfigs//operations/`. - # The long-running operation - # metadata field type - # `metadata.type_url` describes the type of the metadata. Operations returned - # include those that have completed/failed/canceled within the last 7 days, - # and pending operations. Operations returned are ordered by - # `operation.metadata.value.start_time` in descending order starting - # from the most recently started operation. - rpc :ListInstanceConfigOperations, ::Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigOperationsRequest, ::Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigOperationsResponse - # Lists all instances in the given project. - rpc :ListInstances, ::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancesRequest, ::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancesResponse - # Lists all instance partitions for the given instance. - rpc :ListInstancePartitions, ::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionsRequest, ::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionsResponse - # Gets information about a particular instance. - rpc :GetInstance, ::Google::Cloud::Spanner::Admin::Instance::V1::GetInstanceRequest, ::Google::Cloud::Spanner::Admin::Instance::V1::Instance - # Creates an instance and begins preparing it to begin serving. The - # returned long-running operation - # can be used to track the progress of preparing the new - # instance. The instance name is assigned by the caller. If the - # named instance already exists, `CreateInstance` returns - # `ALREADY_EXISTS`. - # - # Immediately upon completion of this request: - # - # * The instance is readable via the API, with all requested attributes - # but no allocated resources. Its state is `CREATING`. - # - # Until completion of the returned operation: - # - # * Cancelling the operation renders the instance immediately unreadable - # via the API. - # * The instance can be deleted. - # * All other attempts to modify the instance are rejected. - # - # Upon completion of the returned operation: - # - # * Billing for all successfully-allocated resources begins (some types - # may have lower than the requested levels). - # * Databases can be created in the instance. - # * The instance's allocated resource levels are readable via the API. - # * The instance's state becomes `READY`. - # - # The returned long-running operation will - # have a name of the format `/operations/` and - # can be used to track creation of the instance. The - # metadata field type is - # [CreateInstanceMetadata][google.spanner.admin.instance.v1.CreateInstanceMetadata]. - # The response field type is - # [Instance][google.spanner.admin.instance.v1.Instance], if successful. - rpc :CreateInstance, ::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstanceRequest, ::Google::Longrunning::Operation - # Updates an instance, and begins allocating or releasing resources - # as requested. The returned long-running operation can be used to track the - # progress of updating the instance. If the named instance does not - # exist, returns `NOT_FOUND`. - # - # Immediately upon completion of this request: - # - # * For resource types for which a decrease in the instance's allocation - # has been requested, billing is based on the newly-requested level. - # - # Until completion of the returned operation: - # - # * Cancelling the operation sets its metadata's - # [cancel_time][google.spanner.admin.instance.v1.UpdateInstanceMetadata.cancel_time], - # and begins restoring resources to their pre-request values. The - # operation is guaranteed to succeed at undoing all resource changes, - # after which point it terminates with a `CANCELLED` status. - # * All other attempts to modify the instance are rejected. - # * Reading the instance via the API continues to give the pre-request - # resource levels. - # - # Upon completion of the returned operation: - # - # * Billing begins for all successfully-allocated resources (some types - # may have lower than the requested levels). - # * All newly-reserved resources are available for serving the instance's - # tables. - # * The instance's new resource levels are readable via the API. - # - # The returned long-running operation will - # have a name of the format `/operations/` and - # can be used to track the instance modification. The - # metadata field type is - # [UpdateInstanceMetadata][google.spanner.admin.instance.v1.UpdateInstanceMetadata]. - # The response field type is - # [Instance][google.spanner.admin.instance.v1.Instance], if successful. - # - # Authorization requires `spanner.instances.update` permission on - # the resource [name][google.spanner.admin.instance.v1.Instance.name]. - rpc :UpdateInstance, ::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstanceRequest, ::Google::Longrunning::Operation - # Deletes an instance. - # - # Immediately upon completion of the request: - # - # * Billing ceases for all of the instance's reserved resources. - # - # Soon afterward: - # - # * The instance and *all of its databases* immediately and - # irrevocably disappear from the API. All data in the databases - # is permanently deleted. - rpc :DeleteInstance, ::Google::Cloud::Spanner::Admin::Instance::V1::DeleteInstanceRequest, ::Google::Protobuf::Empty - # Sets the access control policy on an instance resource. Replaces any - # existing policy. - # - # Authorization requires `spanner.instances.setIamPolicy` on - # [resource][google.iam.v1.SetIamPolicyRequest.resource]. - rpc :SetIamPolicy, ::Google::Iam::V1::SetIamPolicyRequest, ::Google::Iam::V1::Policy - # Gets the access control policy for an instance resource. Returns an empty - # policy if an instance exists but does not have a policy set. - # - # Authorization requires `spanner.instances.getIamPolicy` on - # [resource][google.iam.v1.GetIamPolicyRequest.resource]. - rpc :GetIamPolicy, ::Google::Iam::V1::GetIamPolicyRequest, ::Google::Iam::V1::Policy - # Returns permissions that the caller has on the specified instance resource. - # - # Attempting this RPC on a non-existent Cloud Spanner instance resource will - # result in a NOT_FOUND error if the user has `spanner.instances.list` - # permission on the containing Google Cloud Project. Otherwise returns an - # empty set of permissions. - rpc :TestIamPermissions, ::Google::Iam::V1::TestIamPermissionsRequest, ::Google::Iam::V1::TestIamPermissionsResponse - # Gets information about a particular instance partition. - rpc :GetInstancePartition, ::Google::Cloud::Spanner::Admin::Instance::V1::GetInstancePartitionRequest, ::Google::Cloud::Spanner::Admin::Instance::V1::InstancePartition - # Creates an instance partition and begins preparing it to be used. The - # returned long-running operation - # can be used to track the progress of preparing the new instance partition. - # The instance partition name is assigned by the caller. If the named - # instance partition already exists, `CreateInstancePartition` returns - # `ALREADY_EXISTS`. - # - # Immediately upon completion of this request: - # - # * The instance partition is readable via the API, with all requested - # attributes but no allocated resources. Its state is `CREATING`. - # - # Until completion of the returned operation: - # - # * Cancelling the operation renders the instance partition immediately - # unreadable via the API. - # * The instance partition can be deleted. - # * All other attempts to modify the instance partition are rejected. - # - # Upon completion of the returned operation: - # - # * Billing for all successfully-allocated resources begins (some types - # may have lower than the requested levels). - # * Databases can start using this instance partition. - # * The instance partition's allocated resource levels are readable via the - # API. - # * The instance partition's state becomes `READY`. - # - # The returned long-running operation will - # have a name of the format - # `/operations/` and can be used to - # track creation of the instance partition. The - # metadata field type is - # [CreateInstancePartitionMetadata][google.spanner.admin.instance.v1.CreateInstancePartitionMetadata]. - # The response field type is - # [InstancePartition][google.spanner.admin.instance.v1.InstancePartition], if - # successful. - rpc :CreateInstancePartition, ::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstancePartitionRequest, ::Google::Longrunning::Operation - # Deletes an existing instance partition. Requires that the - # instance partition is not used by any database or backup and is not the - # default instance partition of an instance. - # - # Authorization requires `spanner.instancePartitions.delete` permission on - # the resource - # [name][google.spanner.admin.instance.v1.InstancePartition.name]. - rpc :DeleteInstancePartition, ::Google::Cloud::Spanner::Admin::Instance::V1::DeleteInstancePartitionRequest, ::Google::Protobuf::Empty - # Updates an instance partition, and begins allocating or releasing resources - # as requested. The returned long-running operation can be used to track the - # progress of updating the instance partition. If the named instance - # partition does not exist, returns `NOT_FOUND`. - # - # Immediately upon completion of this request: - # - # * For resource types for which a decrease in the instance partition's - # allocation has been requested, billing is based on the newly-requested - # level. - # - # Until completion of the returned operation: - # - # * Cancelling the operation sets its metadata's - # [cancel_time][google.spanner.admin.instance.v1.UpdateInstancePartitionMetadata.cancel_time], - # and begins restoring resources to their pre-request values. The - # operation is guaranteed to succeed at undoing all resource changes, - # after which point it terminates with a `CANCELLED` status. - # * All other attempts to modify the instance partition are rejected. - # * Reading the instance partition via the API continues to give the - # pre-request resource levels. - # - # Upon completion of the returned operation: - # - # * Billing begins for all successfully-allocated resources (some types - # may have lower than the requested levels). - # * All newly-reserved resources are available for serving the instance - # partition's tables. - # * The instance partition's new resource levels are readable via the API. - # - # The returned long-running operation will - # have a name of the format - # `/operations/` and can be used to - # track the instance partition modification. The - # metadata field type is - # [UpdateInstancePartitionMetadata][google.spanner.admin.instance.v1.UpdateInstancePartitionMetadata]. - # The response field type is - # [InstancePartition][google.spanner.admin.instance.v1.InstancePartition], if - # successful. - # - # Authorization requires `spanner.instancePartitions.update` permission on - # the resource - # [name][google.spanner.admin.instance.v1.InstancePartition.name]. - rpc :UpdateInstancePartition, ::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstancePartitionRequest, ::Google::Longrunning::Operation - # Lists instance partition long-running operations in the given instance. - # An instance partition operation has a name of the form - # `projects//instances//instancePartitions//operations/`. - # The long-running operation - # metadata field type - # `metadata.type_url` describes the type of the metadata. Operations returned - # include those that have completed/failed/canceled within the last 7 days, - # and pending operations. Operations returned are ordered by - # `operation.metadata.value.start_time` in descending order starting from the - # most recently started operation. - # - # Authorization requires `spanner.instancePartitionOperations.list` - # permission on the resource - # [parent][google.spanner.admin.instance.v1.ListInstancePartitionOperationsRequest.parent]. - rpc :ListInstancePartitionOperations, ::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionOperationsRequest, ::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionOperationsResponse - # Moves an instance to the target instance configuration. You can use the - # returned long-running operation to track - # the progress of moving the instance. - # - # `MoveInstance` returns `FAILED_PRECONDITION` if the instance meets any of - # the following criteria: - # - # * Is undergoing a move to a different instance configuration - # * Has backups - # * Has an ongoing update - # * Contains any CMEK-enabled databases - # * Is a free trial instance - # - # While the operation is pending: - # - # * All other attempts to modify the instance, including changes to its - # compute capacity, are rejected. - # * The following database and backup admin operations are rejected: - # - # * `DatabaseAdmin.CreateDatabase` - # * `DatabaseAdmin.UpdateDatabaseDdl` (disabled if default_leader is - # specified in the request.) - # * `DatabaseAdmin.RestoreDatabase` - # * `DatabaseAdmin.CreateBackup` - # * `DatabaseAdmin.CopyBackup` - # - # * Both the source and target instance configurations are subject to - # hourly compute and storage charges. - # * The instance might experience higher read-write latencies and a higher - # transaction abort rate. However, moving an instance doesn't cause any - # downtime. - # - # The returned long-running operation has - # a name of the format - # `/operations/` and can be used to track - # the move instance operation. The - # metadata field type is - # [MoveInstanceMetadata][google.spanner.admin.instance.v1.MoveInstanceMetadata]. - # The response field type is - # [Instance][google.spanner.admin.instance.v1.Instance], - # if successful. - # Cancelling the operation sets its metadata's - # [cancel_time][google.spanner.admin.instance.v1.MoveInstanceMetadata.cancel_time]. - # Cancellation is not immediate because it involves moving any data - # previously moved to the target instance configuration back to the original - # instance configuration. You can use this operation to track the progress of - # the cancellation. Upon successful completion of the cancellation, the - # operation terminates with `CANCELLED` status. - # - # If not cancelled, upon completion of the returned operation: - # - # * The instance successfully moves to the target instance - # configuration. - # * You are billed for compute and storage in target instance - # configuration. - # - # Authorization requires the `spanner.instances.update` permission on - # the resource [instance][google.spanner.admin.instance.v1.Instance]. - # - # For more details, see - # [Move an instance](https://cloud.google.com/spanner/docs/move-instance). - rpc :MoveInstance, ::Google::Cloud::Spanner::Admin::Instance::V1::MoveInstanceRequest, ::Google::Longrunning::Operation - end - - Stub = Service.rpc_stub_class - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/proto_docs/README.md b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/proto_docs/README.md deleted file mode 100644 index ff5b3befac4d..000000000000 --- a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/proto_docs/README.md +++ /dev/null @@ -1,4 +0,0 @@ -# Cloud Spanner Instance Admin 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-admin-instance-v1/proto_docs/google/api/client.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/proto_docs/google/api/client.rb deleted file mode 100644 index c6b6b60729c9..000000000000 --- a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/proto_docs/google/api/client.rb +++ /dev/null @@ -1,473 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 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-admin-instance-v1/proto_docs/google/api/field_behavior.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/proto_docs/google/api/field_behavior.rb deleted file mode 100644 index fb9115c630af..000000000000 --- a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/proto_docs/google/api/field_behavior.rb +++ /dev/null @@ -1,85 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 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-admin-instance-v1/proto_docs/google/api/launch_stage.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/proto_docs/google/api/launch_stage.rb deleted file mode 100644 index b836bdb60b21..000000000000 --- a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/proto_docs/google/api/launch_stage.rb +++ /dev/null @@ -1,71 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 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-admin-instance-v1/proto_docs/google/api/resource.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/proto_docs/google/api/resource.rb deleted file mode 100644 index 71b994c7ef20..000000000000 --- a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/proto_docs/google/api/resource.rb +++ /dev/null @@ -1,227 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 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-admin-instance-v1/proto_docs/google/iam/v1/iam_policy.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/proto_docs/google/iam/v1/iam_policy.rb deleted file mode 100644 index fbee4c39d435..000000000000 --- a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/proto_docs/google/iam/v1/iam_policy.rb +++ /dev/null @@ -1,87 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 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 Iam - module V1 - # Request message for `SetIamPolicy` method. - # @!attribute [rw] resource - # @return [::String] - # REQUIRED: The resource for which the policy is being specified. - # See the operation documentation for the appropriate value for this field. - # @!attribute [rw] policy - # @return [::Google::Iam::V1::Policy] - # REQUIRED: The complete policy to be applied to the `resource`. The size of - # the policy is limited to a few 10s of KB. An empty policy is a - # valid policy but certain Cloud Platform services (such as Projects) - # might reject them. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only - # the fields in the mask will be modified. If no mask is provided, the - # following default mask is used: - # - # `paths: "bindings, etag"` - class SetIamPolicyRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for `GetIamPolicy` method. - # @!attribute [rw] resource - # @return [::String] - # REQUIRED: The resource for which the policy is being requested. - # See the operation documentation for the appropriate value for this field. - # @!attribute [rw] options - # @return [::Google::Iam::V1::GetPolicyOptions] - # OPTIONAL: A `GetPolicyOptions` object for specifying options to - # `GetIamPolicy`. - class GetIamPolicyRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for `TestIamPermissions` method. - # @!attribute [rw] resource - # @return [::String] - # REQUIRED: The resource for which the policy detail is being requested. - # See the operation documentation for the appropriate value for this field. - # @!attribute [rw] permissions - # @return [::Array<::String>] - # The set of permissions to check for the `resource`. Permissions with - # wildcards (such as '*' or 'storage.*') are not allowed. For more - # information see - # [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). - class TestIamPermissionsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for `TestIamPermissions` method. - # @!attribute [rw] permissions - # @return [::Array<::String>] - # A subset of `TestPermissionsRequest.permissions` that the caller is - # allowed. - class TestIamPermissionsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end -end diff --git a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/proto_docs/google/iam/v1/options.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/proto_docs/google/iam/v1/options.rb deleted file mode 100644 index 848f8c2f7895..000000000000 --- a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/proto_docs/google/iam/v1/options.rb +++ /dev/null @@ -1,50 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 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 Iam - module V1 - # Encapsulates settings provided to GetIamPolicy. - # @!attribute [rw] requested_policy_version - # @return [::Integer] - # Optional. The maximum policy version that will be used to format the - # policy. - # - # Valid values are 0, 1, and 3. Requests specifying an invalid value will be - # rejected. - # - # Requests for policies with any conditional role bindings must specify - # version 3. Policies with no conditional role bindings may specify any valid - # value or leave the field unset. - # - # The policy in the response might use the policy version that you specified, - # or it might use a lower policy version. For example, if you specify version - # 3, but the policy has no conditional role bindings, the response uses - # version 1. - # - # To learn which resources support conditions in their IAM policies, see the - # [IAM - # documentation](https://cloud.google.com/iam/help/conditions/resource-policies). - class GetPolicyOptions - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end -end diff --git a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/proto_docs/google/iam/v1/policy.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/proto_docs/google/iam/v1/policy.rb deleted file mode 100644 index 79fdbd1e2eff..000000000000 --- a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/proto_docs/google/iam/v1/policy.rb +++ /dev/null @@ -1,426 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 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 Iam - module V1 - # An Identity and Access Management (IAM) policy, which specifies access - # controls for Google Cloud resources. - # - # - # A `Policy` is a collection of `bindings`. A `binding` binds one or more - # `members`, or principals, to a single `role`. Principals can be user - # accounts, service accounts, Google groups, and domains (such as G Suite). A - # `role` is a named list of permissions; each `role` can be an IAM predefined - # role or a user-created custom role. - # - # For some types of Google Cloud resources, a `binding` can also specify a - # `condition`, which is a logical expression that allows access to a resource - # only if the expression evaluates to `true`. A condition can add constraints - # based on attributes of the request, the resource, or both. To learn which - # resources support conditions in their IAM policies, see the - # [IAM - # documentation](https://cloud.google.com/iam/help/conditions/resource-policies). - # - # **JSON example:** - # - # ``` - # { - # "bindings": [ - # { - # "role": "roles/resourcemanager.organizationAdmin", - # "members": [ - # "user:mike@example.com", - # "group:admins@example.com", - # "domain:google.com", - # "serviceAccount:my-project-id@appspot.gserviceaccount.com" - # ] - # }, - # { - # "role": "roles/resourcemanager.organizationViewer", - # "members": [ - # "user:eve@example.com" - # ], - # "condition": { - # "title": "expirable access", - # "description": "Does not grant access after Sep 2020", - # "expression": "request.time < - # timestamp('2020-10-01T00:00:00.000Z')", - # } - # } - # ], - # "etag": "BwWWja0YfJA=", - # "version": 3 - # } - # ``` - # - # **YAML example:** - # - # ``` - # bindings: - # - members: - # - user:mike@example.com - # - group:admins@example.com - # - domain:google.com - # - serviceAccount:my-project-id@appspot.gserviceaccount.com - # role: roles/resourcemanager.organizationAdmin - # - members: - # - user:eve@example.com - # role: roles/resourcemanager.organizationViewer - # condition: - # title: expirable access - # description: Does not grant access after Sep 2020 - # expression: request.time < timestamp('2020-10-01T00:00:00.000Z') - # etag: BwWWja0YfJA= - # version: 3 - # ``` - # - # For a description of IAM and its features, see the - # [IAM documentation](https://cloud.google.com/iam/docs/). - # @!attribute [rw] version - # @return [::Integer] - # Specifies the format of the policy. - # - # Valid values are `0`, `1`, and `3`. Requests that specify an invalid value - # are rejected. - # - # Any operation that affects conditional role bindings must specify version - # `3`. This requirement applies to the following operations: - # - # * Getting a policy that includes a conditional role binding - # * Adding a conditional role binding to a policy - # * Changing a conditional role binding in a policy - # * Removing any role binding, with or without a condition, from a policy - # that includes conditions - # - # **Important:** If you use IAM Conditions, you must include the `etag` field - # whenever you call `setIamPolicy`. If you omit this field, then IAM allows - # you to overwrite a version `3` policy with a version `1` policy, and all of - # the conditions in the version `3` policy are lost. - # - # If a policy does not include any conditions, operations on that policy may - # specify any valid version or leave the field unset. - # - # To learn which resources support conditions in their IAM policies, see the - # [IAM - # documentation](https://cloud.google.com/iam/help/conditions/resource-policies). - # @!attribute [rw] bindings - # @return [::Array<::Google::Iam::V1::Binding>] - # Associates a list of `members`, or principals, with a `role`. Optionally, - # may specify a `condition` that determines how and when the `bindings` are - # applied. Each of the `bindings` must contain at least one principal. - # - # The `bindings` in a `Policy` can refer to up to 1,500 principals; up to 250 - # of these principals can be Google groups. Each occurrence of a principal - # counts towards these limits. For example, if the `bindings` grant 50 - # different roles to `user:alice@example.com`, and not to any other - # principal, then you can add another 1,450 principals to the `bindings` in - # the `Policy`. - # @!attribute [rw] audit_configs - # @return [::Array<::Google::Iam::V1::AuditConfig>] - # Specifies cloud audit logging configuration for this policy. - # @!attribute [rw] etag - # @return [::String] - # `etag` is used for optimistic concurrency control as a way to help - # prevent simultaneous updates of a policy from overwriting each other. - # It is strongly suggested that systems make use of the `etag` in the - # read-modify-write cycle to perform policy updates in order to avoid race - # conditions: An `etag` is returned in the response to `getIamPolicy`, and - # systems are expected to put that etag in the request to `setIamPolicy` to - # ensure that their change will be applied to the same version of the policy. - # - # **Important:** If you use IAM Conditions, you must include the `etag` field - # whenever you call `setIamPolicy`. If you omit this field, then IAM allows - # you to overwrite a version `3` policy with a version `1` policy, and all of - # the conditions in the version `3` policy are lost. - class Policy - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Associates `members`, or principals, with a `role`. - # @!attribute [rw] role - # @return [::String] - # Role that is assigned to the list of `members`, or principals. - # For example, `roles/viewer`, `roles/editor`, or `roles/owner`. - # @!attribute [rw] members - # @return [::Array<::String>] - # Specifies the principals requesting access for a Google Cloud resource. - # `members` can have the following values: - # - # * `allUsers`: A special identifier that represents anyone who is - # on the internet; with or without a Google account. - # - # * `allAuthenticatedUsers`: A special identifier that represents anyone - # who is authenticated with a Google account or a service account. - # - # * `user:{emailid}`: An email address that represents a specific Google - # account. For example, `alice@example.com` . - # - # - # * `serviceAccount:{emailid}`: An email address that represents a service - # account. For example, `my-other-app@appspot.gserviceaccount.com`. - # - # * `group:{emailid}`: An email address that represents a Google group. - # For example, `admins@example.com`. - # - # * `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus unique - # identifier) representing a user that has been recently deleted. For - # example, `alice@example.com?uid=123456789012345678901`. If the user is - # recovered, this value reverts to `user:{emailid}` and the recovered user - # retains the role in the binding. - # - # * `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address (plus - # unique identifier) representing a service account that has been recently - # deleted. For example, - # `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`. - # If the service account is undeleted, this value reverts to - # `serviceAccount:{emailid}` and the undeleted service account retains the - # role in the binding. - # - # * `deleted:group:{emailid}?uid={uniqueid}`: An email address (plus unique - # identifier) representing a Google group that has been recently - # deleted. For example, `admins@example.com?uid=123456789012345678901`. If - # the group is recovered, this value reverts to `group:{emailid}` and the - # recovered group retains the role in the binding. - # - # - # * `domain:{domain}`: The G Suite domain (primary) that represents all the - # users of that domain. For example, `google.com` or `example.com`. - # @!attribute [rw] condition - # @return [::Google::Type::Expr] - # The condition that is associated with this binding. - # - # If the condition evaluates to `true`, then this binding applies to the - # current request. - # - # If the condition evaluates to `false`, then this binding does not apply to - # the current request. However, a different role binding might grant the same - # role to one or more of the principals in this binding. - # - # To learn which resources support conditions in their IAM policies, see the - # [IAM - # documentation](https://cloud.google.com/iam/help/conditions/resource-policies). - class Binding - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Specifies the audit configuration for a service. - # The configuration determines which permission types are logged, and what - # identities, if any, are exempted from logging. - # An AuditConfig must have one or more AuditLogConfigs. - # - # If there are AuditConfigs for both `allServices` and a specific service, - # the union of the two AuditConfigs is used for that service: the log_types - # specified in each AuditConfig are enabled, and the exempted_members in each - # AuditLogConfig are exempted. - # - # Example Policy with multiple AuditConfigs: - # - # { - # "audit_configs": [ - # { - # "service": "allServices", - # "audit_log_configs": [ - # { - # "log_type": "DATA_READ", - # "exempted_members": [ - # "user:jose@example.com" - # ] - # }, - # { - # "log_type": "DATA_WRITE" - # }, - # { - # "log_type": "ADMIN_READ" - # } - # ] - # }, - # { - # "service": "sampleservice.googleapis.com", - # "audit_log_configs": [ - # { - # "log_type": "DATA_READ" - # }, - # { - # "log_type": "DATA_WRITE", - # "exempted_members": [ - # "user:aliya@example.com" - # ] - # } - # ] - # } - # ] - # } - # - # For sampleservice, this policy enables DATA_READ, DATA_WRITE and ADMIN_READ - # logging. It also exempts `jose@example.com` from DATA_READ logging, and - # `aliya@example.com` from DATA_WRITE logging. - # @!attribute [rw] service - # @return [::String] - # Specifies a service that will be enabled for audit logging. - # For example, `storage.googleapis.com`, `cloudsql.googleapis.com`. - # `allServices` is a special value that covers all services. - # @!attribute [rw] audit_log_configs - # @return [::Array<::Google::Iam::V1::AuditLogConfig>] - # The configuration for logging of each type of permission. - class AuditConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Provides the configuration for logging a type of permissions. - # Example: - # - # { - # "audit_log_configs": [ - # { - # "log_type": "DATA_READ", - # "exempted_members": [ - # "user:jose@example.com" - # ] - # }, - # { - # "log_type": "DATA_WRITE" - # } - # ] - # } - # - # This enables 'DATA_READ' and 'DATA_WRITE' logging, while exempting - # jose@example.com from DATA_READ logging. - # @!attribute [rw] log_type - # @return [::Google::Iam::V1::AuditLogConfig::LogType] - # The log type that this config enables. - # @!attribute [rw] exempted_members - # @return [::Array<::String>] - # Specifies the identities that do not cause logging for this type of - # permission. - # Follows the same format of - # [Binding.members][google.iam.v1.Binding.members]. - class AuditLogConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The list of valid permission types for which logging can be configured. - # Admin writes are always logged, and are not configurable. - module LogType - # Default case. Should never be this. - LOG_TYPE_UNSPECIFIED = 0 - - # Admin reads. Example: CloudIAM getIamPolicy - ADMIN_READ = 1 - - # Data writes. Example: CloudSQL Users create - DATA_WRITE = 2 - - # Data reads. Example: CloudSQL Users list - DATA_READ = 3 - end - end - - # The difference delta between two policies. - # @!attribute [rw] binding_deltas - # @return [::Array<::Google::Iam::V1::BindingDelta>] - # The delta for Bindings between two policies. - # @!attribute [rw] audit_config_deltas - # @return [::Array<::Google::Iam::V1::AuditConfigDelta>] - # The delta for AuditConfigs between two policies. - class PolicyDelta - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # One delta entry for Binding. Each individual change (only one member in each - # entry) to a binding will be a separate entry. - # @!attribute [rw] action - # @return [::Google::Iam::V1::BindingDelta::Action] - # The action that was performed on a Binding. - # Required - # @!attribute [rw] role - # @return [::String] - # Role that is assigned to `members`. - # For example, `roles/viewer`, `roles/editor`, or `roles/owner`. - # Required - # @!attribute [rw] member - # @return [::String] - # A single identity requesting access for a Google Cloud resource. - # Follows the same format of Binding.members. - # Required - # @!attribute [rw] condition - # @return [::Google::Type::Expr] - # The condition that is associated with this binding. - class BindingDelta - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The type of action performed on a Binding in a policy. - module Action - # Unspecified. - ACTION_UNSPECIFIED = 0 - - # Addition of a Binding. - ADD = 1 - - # Removal of a Binding. - REMOVE = 2 - end - end - - # One delta entry for AuditConfig. Each individual change (only one - # exempted_member in each entry) to a AuditConfig will be a separate entry. - # @!attribute [rw] action - # @return [::Google::Iam::V1::AuditConfigDelta::Action] - # The action that was performed on an audit configuration in a policy. - # Required - # @!attribute [rw] service - # @return [::String] - # Specifies a service that was configured for Cloud Audit Logging. - # For example, `storage.googleapis.com`, `cloudsql.googleapis.com`. - # `allServices` is a special value that covers all services. - # Required - # @!attribute [rw] exempted_member - # @return [::String] - # A single identity that is exempted from "data access" audit - # logging for the `service` specified above. - # Follows the same format of Binding.members. - # @!attribute [rw] log_type - # @return [::String] - # Specifies the log_type that was be enabled. ADMIN_ACTIVITY is always - # enabled, and cannot be configured. - # Required - class AuditConfigDelta - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The type of action performed on an audit configuration in a policy. - module Action - # Unspecified. - ACTION_UNSPECIFIED = 0 - - # Addition of an audit configuration. - ADD = 1 - - # Removal of an audit configuration. - REMOVE = 2 - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/proto_docs/google/longrunning/operations.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/proto_docs/google/longrunning/operations.rb deleted file mode 100644 index f2d9d79d9da4..000000000000 --- a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/proto_docs/google/longrunning/operations.rb +++ /dev/null @@ -1,191 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 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 Longrunning - # This resource represents a long-running operation that is the result of a - # network API call. - # @!attribute [rw] name - # @return [::String] - # The server-assigned name, which is only unique within the same service that - # originally returns it. If you use the default HTTP mapping, the - # `name` should be a resource name ending with `operations/{unique_id}`. - # @!attribute [rw] metadata - # @return [::Google::Protobuf::Any] - # Service-specific metadata associated with the operation. It typically - # contains progress information and common metadata such as create time. - # Some services might not provide such metadata. Any method that returns a - # long-running operation should document the metadata type, if any. - # @!attribute [rw] done - # @return [::Boolean] - # If the value is `false`, it means the operation is still in progress. - # If `true`, the operation is completed, and either `error` or `response` is - # available. - # @!attribute [rw] error - # @return [::Google::Rpc::Status] - # The error result of the operation in case of failure or cancellation. - # - # Note: The following fields are mutually exclusive: `error`, `response`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] response - # @return [::Google::Protobuf::Any] - # The normal, successful response of the operation. If the original - # method returns no data on success, such as `Delete`, the response is - # `google.protobuf.Empty`. If the original method is standard - # `Get`/`Create`/`Update`, the response should be the resource. For other - # methods, the response should have the type `XxxResponse`, where `Xxx` - # is the original method name. For example, if the original method name - # is `TakeSnapshot()`, the inferred response type is - # `TakeSnapshotResponse`. - # - # Note: The following fields are mutually exclusive: `response`, `error`. If a field in that set is populated, all other fields in the set will automatically be cleared. - class Operation - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # Operations.GetOperation. - # @!attribute [rw] name - # @return [::String] - # The name of the operation resource. - class GetOperationRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # Operations.ListOperations. - # @!attribute [rw] name - # @return [::String] - # The name of the operation's parent resource. - # @!attribute [rw] filter - # @return [::String] - # The standard list filter. - # @!attribute [rw] page_size - # @return [::Integer] - # The standard list page size. - # @!attribute [rw] page_token - # @return [::String] - # The standard list page token. - # @!attribute [rw] return_partial_success - # @return [::Boolean] - # When set to `true`, operations that are reachable are returned as normal, - # and those that are unreachable are returned in the - # [ListOperationsResponse.unreachable] field. - # - # This can only be `true` when reading across collections e.g. when `parent` - # is set to `"projects/example/locations/-"`. - # - # This field is not by default supported and will result in an - # `UNIMPLEMENTED` error if set unless explicitly documented otherwise in - # service or product specific documentation. - class ListOperationsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The response message for - # Operations.ListOperations. - # @!attribute [rw] operations - # @return [::Array<::Google::Longrunning::Operation>] - # A list of operations that matches the specified filter in the request. - # @!attribute [rw] next_page_token - # @return [::String] - # The standard List next-page token. - # @!attribute [rw] unreachable - # @return [::Array<::String>] - # Unordered list. Unreachable resources. Populated when the request sets - # `ListOperationsRequest.return_partial_success` and reads across - # collections e.g. when attempting to list all resources across all supported - # locations. - class ListOperationsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # Operations.CancelOperation. - # @!attribute [rw] name - # @return [::String] - # The name of the operation resource to be cancelled. - class CancelOperationRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # Operations.DeleteOperation. - # @!attribute [rw] name - # @return [::String] - # The name of the operation resource to be deleted. - class DeleteOperationRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # Operations.WaitOperation. - # @!attribute [rw] name - # @return [::String] - # The name of the operation resource to wait on. - # @!attribute [rw] timeout - # @return [::Google::Protobuf::Duration] - # The maximum duration to wait before timing out. If left blank, the wait - # will be at most the time permitted by the underlying HTTP/RPC protocol. - # If RPC context deadline is also specified, the shorter one will be used. - class WaitOperationRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A message representing the message types used by a long-running operation. - # - # Example: - # - # rpc Export(ExportRequest) returns (google.longrunning.Operation) { - # option (google.longrunning.operation_info) = { - # response_type: "ExportResponse" - # metadata_type: "ExportMetadata" - # }; - # } - # @!attribute [rw] response_type - # @return [::String] - # Required. The message name of the primary return type for this - # long-running operation. - # This type will be used to deserialize the LRO's response. - # - # If the response is in a different package from the rpc, a fully-qualified - # message name must be used (e.g. `google.protobuf.Struct`). - # - # Note: Altering this value constitutes a breaking change. - # @!attribute [rw] metadata_type - # @return [::String] - # Required. The message name of the metadata type for this long-running - # operation. - # - # If the response is in a different package from the rpc, a fully-qualified - # message name must be used (e.g. `google.protobuf.Struct`). - # - # Note: Altering this value constitutes a breaking change. - class OperationInfo - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/proto_docs/google/protobuf/any.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/proto_docs/google/protobuf/any.rb deleted file mode 100644 index 9e9bdbb09ea4..000000000000 --- a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/proto_docs/google/protobuf/any.rb +++ /dev/null @@ -1,145 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 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-admin-instance-v1/proto_docs/google/protobuf/duration.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/proto_docs/google/protobuf/duration.rb deleted file mode 100644 index 341efa296c29..000000000000 --- a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/proto_docs/google/protobuf/duration.rb +++ /dev/null @@ -1,98 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 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-admin-instance-v1/proto_docs/google/protobuf/empty.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/proto_docs/google/protobuf/empty.rb deleted file mode 100644 index c2acab1235a9..000000000000 --- a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/proto_docs/google/protobuf/empty.rb +++ /dev/null @@ -1,34 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 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-admin-instance-v1/proto_docs/google/protobuf/field_mask.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/proto_docs/google/protobuf/field_mask.rb deleted file mode 100644 index ad3c3ad25f0f..000000000000 --- a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/proto_docs/google/protobuf/field_mask.rb +++ /dev/null @@ -1,229 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 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 - # `FieldMask` represents a set of symbolic field paths, for example: - # - # paths: "f.a" - # paths: "f.b.d" - # - # Here `f` represents a field in some root message, `a` and `b` - # fields in the message found in `f`, and `d` a field found in the - # message in `f.b`. - # - # Field masks are used to specify a subset of fields that should be - # returned by a get operation or modified by an update operation. - # Field masks also have a custom JSON encoding (see below). - # - # # Field Masks in Projections - # - # When used in the context of a projection, a response message or - # sub-message is filtered by the API to only contain those fields as - # specified in the mask. For example, if the mask in the previous - # example is applied to a response message as follows: - # - # f { - # a : 22 - # b { - # d : 1 - # x : 2 - # } - # y : 13 - # } - # z: 8 - # - # The result will not contain specific values for fields x,y and z - # (their value will be set to the default, and omitted in proto text - # output): - # - # - # f { - # a : 22 - # b { - # d : 1 - # } - # } - # - # A repeated field is not allowed except at the last position of a - # paths string. - # - # If a FieldMask object is not present in a get operation, the - # operation applies to all fields (as if a FieldMask of all fields - # had been specified). - # - # Note that a field mask does not necessarily apply to the - # top-level response message. In case of a REST get operation, the - # field mask applies directly to the response, but in case of a REST - # list operation, the mask instead applies to each individual message - # in the returned resource list. In case of a REST custom method, - # other definitions may be used. Where the mask applies will be - # clearly documented together with its declaration in the API. In - # any case, the effect on the returned resource/resources is required - # behavior for APIs. - # - # # Field Masks in Update Operations - # - # A field mask in update operations specifies which fields of the - # targeted resource are going to be updated. The API is required - # to only change the values of the fields as specified in the mask - # and leave the others untouched. If a resource is passed in to - # describe the updated values, the API ignores the values of all - # fields not covered by the mask. - # - # If a repeated field is specified for an update operation, new values will - # be appended to the existing repeated field in the target resource. Note that - # a repeated field is only allowed in the last position of a `paths` string. - # - # If a sub-message is specified in the last position of the field mask for an - # update operation, then new value will be merged into the existing sub-message - # in the target resource. - # - # For example, given the target message: - # - # f { - # b { - # d: 1 - # x: 2 - # } - # c: [1] - # } - # - # And an update message: - # - # f { - # b { - # d: 10 - # } - # c: [2] - # } - # - # then if the field mask is: - # - # paths: ["f.b", "f.c"] - # - # then the result will be: - # - # f { - # b { - # d: 10 - # x: 2 - # } - # c: [1, 2] - # } - # - # An implementation may provide options to override this default behavior for - # repeated and message fields. - # - # In order to reset a field's value to the default, the field must - # be in the mask and set to the default value in the provided resource. - # Hence, in order to reset all fields of a resource, provide a default - # instance of the resource and set all fields in the mask, or do - # not provide a mask as described below. - # - # If a field mask is not present on update, the operation applies to - # all fields (as if a field mask of all fields has been specified). - # Note that in the presence of schema evolution, this may mean that - # fields the client does not know and has therefore not filled into - # the request will be reset to their default. If this is unwanted - # behavior, a specific service may require a client to always specify - # a field mask, producing an error if not. - # - # As with get operations, the location of the resource which - # describes the updated values in the request message depends on the - # operation kind. In any case, the effect of the field mask is - # required to be honored by the API. - # - # ## Considerations for HTTP REST - # - # The HTTP kind of an update operation which uses a field mask must - # be set to PATCH instead of PUT in order to satisfy HTTP semantics - # (PUT must only be used for full updates). - # - # # JSON Encoding of Field Masks - # - # In JSON, a field mask is encoded as a single string where paths are - # separated by a comma. Fields name in each path are converted - # to/from lower-camel naming conventions. - # - # As an example, consider the following message declarations: - # - # message Profile { - # User user = 1; - # Photo photo = 2; - # } - # message User { - # string display_name = 1; - # string address = 2; - # } - # - # In proto a field mask for `Profile` may look as such: - # - # mask { - # paths: "user.display_name" - # paths: "photo" - # } - # - # In JSON, the same mask is represented as below: - # - # { - # mask: "user.displayName,photo" - # } - # - # # Field Masks and Oneof Fields - # - # Field masks treat fields in oneofs just as regular fields. Consider the - # following message: - # - # message SampleMessage { - # oneof test_oneof { - # string name = 4; - # SubMessage sub_message = 9; - # } - # } - # - # The field mask can be: - # - # mask { - # paths: "name" - # } - # - # Or: - # - # mask { - # paths: "sub_message" - # } - # - # Note that oneof type names ("test_oneof" in this case) cannot be used in - # paths. - # - # ## Field Mask Verification - # - # The implementation of any API method which has a FieldMask type field in the - # request should verify the included field paths, and return an - # `INVALID_ARGUMENT` error if any path is unmappable. - # @!attribute [rw] paths - # @return [::Array<::String>] - # The set of field mask paths. - class FieldMask - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/proto_docs/google/protobuf/timestamp.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/proto_docs/google/protobuf/timestamp.rb deleted file mode 100644 index a005f395ccab..000000000000 --- a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/proto_docs/google/protobuf/timestamp.rb +++ /dev/null @@ -1,127 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 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-admin-instance-v1/proto_docs/google/rpc/status.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/proto_docs/google/rpc/status.rb deleted file mode 100644 index 3f61f95b2587..000000000000 --- a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/proto_docs/google/rpc/status.rb +++ /dev/null @@ -1,48 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 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-admin-instance-v1/proto_docs/google/spanner/admin/instance/v1/common.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/proto_docs/google/spanner/admin/instance/v1/common.rb deleted file mode 100644 index 1641b005b867..000000000000 --- a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/proto_docs/google/spanner/admin/instance/v1/common.rb +++ /dev/null @@ -1,71 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 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 Admin - module Instance - module V1 - # Encapsulates progress related information for a Cloud Spanner long - # running instance operations. - # @!attribute [rw] progress_percent - # @return [::Integer] - # Percent completion of the operation. - # Values are between 0 and 100 inclusive. - # @!attribute [rw] start_time - # @return [::Google::Protobuf::Timestamp] - # Time the request was received. - # @!attribute [rw] end_time - # @return [::Google::Protobuf::Timestamp] - # If set, the time at which this operation failed or was completed - # successfully. - class OperationProgress - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # ReplicaSelection identifies replicas with common properties. - # @!attribute [rw] location - # @return [::String] - # Required. Name of the location of the replicas (e.g., "us-central1"). - class ReplicaSelection - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Indicates the expected fulfillment period of an operation. - module FulfillmentPeriod - # Not specified. - FULFILLMENT_PERIOD_UNSPECIFIED = 0 - - # Normal fulfillment period. The operation is expected to complete within - # minutes. - FULFILLMENT_PERIOD_NORMAL = 1 - - # Extended fulfillment period. It can take up to an hour for the operation - # to complete. - FULFILLMENT_PERIOD_EXTENDED = 2 - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/proto_docs/google/spanner/admin/instance/v1/spanner_instance_admin.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/proto_docs/google/spanner/admin/instance/v1/spanner_instance_admin.rb deleted file mode 100644 index e7500c534c12..000000000000 --- a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/proto_docs/google/spanner/admin/instance/v1/spanner_instance_admin.rb +++ /dev/null @@ -1,1561 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 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 Admin - module Instance - module V1 - # @!attribute [rw] location - # @return [::String] - # The location of the serving resources, e.g., "us-central1". - # @!attribute [rw] type - # @return [::Google::Cloud::Spanner::Admin::Instance::V1::ReplicaInfo::ReplicaType] - # The type of replica. - # @!attribute [rw] default_leader_location - # @return [::Boolean] - # If true, this location is designated as the default leader location where - # leader replicas are placed. See the [region types - # documentation](https://cloud.google.com/spanner/docs/instances#region_types) - # for more details. - class ReplicaInfo - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Indicates the type of replica. See the [replica types - # documentation](https://cloud.google.com/spanner/docs/replication#replica_types) - # for more details. - module ReplicaType - # Not specified. - TYPE_UNSPECIFIED = 0 - - # Read-write replicas support both reads and writes. These replicas: - # - # * Maintain a full copy of your data. - # * Serve reads. - # * Can vote whether to commit a write. - # * Participate in leadership election. - # * Are eligible to become a leader. - READ_WRITE = 1 - - # Read-only replicas only support reads (not writes). Read-only replicas: - # - # * Maintain a full copy of your data. - # * Serve reads. - # * Do not participate in voting to commit writes. - # * Are not eligible to become a leader. - READ_ONLY = 2 - - # Witness replicas don't support reads but do participate in voting to - # commit writes. Witness replicas: - # - # * Do not maintain a full copy of data. - # * Do not serve reads. - # * Vote whether to commit writes. - # * Participate in leader election but are not eligible to become leader. - WITNESS = 3 - end - end - - # A possible configuration for a Cloud Spanner instance. Configurations - # define the geographic placement of nodes and their replication. - # @!attribute [rw] name - # @return [::String] - # A unique identifier for the instance configuration. Values - # are of the form - # `projects//instanceConfigs/[a-z][-a-z0-9]*`. - # - # User instance configuration must start with `custom-`. - # @!attribute [rw] display_name - # @return [::String] - # The name of this instance configuration as it appears in UIs. - # @!attribute [r] config_type - # @return [::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig::Type] - # Output only. Whether this instance configuration is a Google-managed or - # user-managed configuration. - # @!attribute [rw] replicas - # @return [::Array<::Google::Cloud::Spanner::Admin::Instance::V1::ReplicaInfo>] - # The geographic placement of nodes in this instance configuration and their - # replication properties. - # - # To create user-managed configurations, input - # `replicas` must include all replicas in `replicas` of the `base_config` - # and include one or more replicas in the `optional_replicas` of the - # `base_config`. - # @!attribute [r] optional_replicas - # @return [::Array<::Google::Cloud::Spanner::Admin::Instance::V1::ReplicaInfo>] - # Output only. The available optional replicas to choose from for - # user-managed configurations. Populated for Google-managed configurations. - # @!attribute [rw] base_config - # @return [::String] - # Base configuration name, e.g. projects//instanceConfigs/nam3, - # based on which this configuration is created. Only set for user-managed - # configurations. `base_config` must refer to a configuration of type - # `GOOGLE_MANAGED` in the same project as this configuration. - # @!attribute [rw] labels - # @return [::Google::Protobuf::Map{::String => ::String}] - # Cloud Labels are a flexible and lightweight mechanism for organizing cloud - # resources into groups that reflect a customer's organizational needs and - # deployment strategies. Cloud Labels can be used to filter collections of - # resources. They can be used to control how resource metrics are aggregated. - # And they can be used as arguments to policy management rules (e.g. route, - # firewall, load balancing, etc.). - # - # * Label keys must be between 1 and 63 characters long and must conform to - # the following regular expression: `[a-z][a-z0-9_-]{0,62}`. - # * Label values must be between 0 and 63 characters long and must conform - # to the regular expression `[a-z0-9_-]{0,63}`. - # * No more than 64 labels can be associated with a given resource. - # - # See https://goo.gl/xmQnxf for more information on and examples of labels. - # - # If you plan to use labels in your own code, please note that additional - # characters may be allowed in the future. Therefore, you are advised to use - # an internal label representation, such as JSON, which doesn't rely upon - # specific characters being disallowed. For example, representing labels - # as the string: name + "_" + value would prove problematic if we were to - # allow "_" in a future release. - # @!attribute [rw] etag - # @return [::String] - # etag is used for optimistic concurrency control as a way - # to help prevent simultaneous updates of a instance configuration from - # overwriting each other. It is strongly suggested that systems make use of - # the etag in the read-modify-write cycle to perform instance configuration - # updates in order to avoid race conditions: An etag is returned in the - # response which contains instance configurations, and systems are expected - # to put that etag in the request to update instance configuration to ensure - # that their change is applied to the same version of the instance - # configuration. If no etag is provided in the call to update the instance - # configuration, then the existing instance configuration is overwritten - # blindly. - # @!attribute [rw] leader_options - # @return [::Array<::String>] - # Allowed values of the "default_leader" schema option for databases in - # instances that use this instance configuration. - # @!attribute [r] reconciling - # @return [::Boolean] - # Output only. If true, the instance configuration is being created or - # updated. If false, there are no ongoing operations for the instance - # configuration. - # @!attribute [r] state - # @return [::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig::State] - # Output only. The current instance configuration state. Applicable only for - # `USER_MANAGED` configurations. - # @!attribute [r] free_instance_availability - # @return [::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig::FreeInstanceAvailability] - # Output only. Describes whether free instances are available to be created - # in this instance configuration. - # @!attribute [r] quorum_type - # @return [::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig::QuorumType] - # Output only. The `QuorumType` of the instance configuration. - # @!attribute [r] storage_limit_per_processing_unit - # @return [::Integer] - # Output only. The storage limit in bytes per processing unit. - class InstanceConfig - 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 - - # The type of this configuration. - module Type - # Unspecified. - TYPE_UNSPECIFIED = 0 - - # Google-managed configuration. - GOOGLE_MANAGED = 1 - - # User-managed configuration. - USER_MANAGED = 2 - end - - # Indicates the current state of the instance configuration. - module State - # Not specified. - STATE_UNSPECIFIED = 0 - - # The instance configuration is still being created. - CREATING = 1 - - # The instance configuration is fully created and ready to be used to - # create instances. - READY = 2 - end - - # Describes the availability for free instances to be created in an instance - # configuration. - module FreeInstanceAvailability - # Not specified. - FREE_INSTANCE_AVAILABILITY_UNSPECIFIED = 0 - - # Indicates that free instances are available to be created in this - # instance configuration. - AVAILABLE = 1 - - # Indicates that free instances are not supported in this instance - # configuration. - UNSUPPORTED = 2 - - # Indicates that free instances are currently not available to be created - # in this instance configuration. - DISABLED = 3 - - # Indicates that additional free instances cannot be created in this - # instance configuration because the project has reached its limit of free - # instances. - QUOTA_EXCEEDED = 4 - end - - # Indicates the quorum type of this instance configuration. - module QuorumType - # Quorum type not specified. - QUORUM_TYPE_UNSPECIFIED = 0 - - # An instance configuration tagged with `REGION` quorum type forms a write - # quorum in a single region. - REGION = 1 - - # An instance configuration tagged with the `DUAL_REGION` quorum type forms - # a write quorum with exactly two read-write regions in a multi-region - # configuration. - # - # This instance configuration requires failover in the event of - # regional failures. - DUAL_REGION = 2 - - # An instance configuration tagged with the `MULTI_REGION` quorum type - # forms a write quorum from replicas that are spread across more than one - # region in a multi-region configuration. - MULTI_REGION = 3 - end - end - - # ReplicaComputeCapacity describes the amount of server resources that are - # allocated to each replica identified by the replica selection. - # @!attribute [rw] replica_selection - # @return [::Google::Cloud::Spanner::Admin::Instance::V1::ReplicaSelection] - # Required. Identifies replicas by specified properties. - # All replicas in the selection have the same amount of compute capacity. - # @!attribute [rw] node_count - # @return [::Integer] - # The number of nodes allocated to each replica. - # - # This may be zero in API responses for instances that are not yet in - # state `READY`. - # - # Note: The following fields are mutually exclusive: `node_count`, `processing_units`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] processing_units - # @return [::Integer] - # The number of processing units allocated to each replica. - # - # This may be zero in API responses for instances that are not yet in - # state `READY`. - # - # Note: The following fields are mutually exclusive: `processing_units`, `node_count`. If a field in that set is populated, all other fields in the set will automatically be cleared. - class ReplicaComputeCapacity - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Autoscaling configuration for an instance. - # @!attribute [rw] autoscaling_limits - # @return [::Google::Cloud::Spanner::Admin::Instance::V1::AutoscalingConfig::AutoscalingLimits] - # Required. Autoscaling limits for an instance. - # @!attribute [rw] autoscaling_targets - # @return [::Google::Cloud::Spanner::Admin::Instance::V1::AutoscalingConfig::AutoscalingTargets] - # Required. The autoscaling targets for an instance. - # @!attribute [rw] asymmetric_autoscaling_options - # @return [::Array<::Google::Cloud::Spanner::Admin::Instance::V1::AutoscalingConfig::AsymmetricAutoscalingOption>] - # Optional. Optional asymmetric autoscaling options. - # Replicas matching the replica selection criteria will be autoscaled - # independently from other replicas. The autoscaler will scale the replicas - # based on the utilization of replicas identified by the replica selection. - # Replica selections should not overlap with each other. - # - # Other replicas (those do not match any replica selection) will be - # autoscaled together and will have the same compute capacity allocated to - # them. - class AutoscalingConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The autoscaling limits for the instance. Users can define the minimum and - # maximum compute capacity allocated to the instance, and the autoscaler will - # only scale within that range. Users can either use nodes or processing - # units to specify the limits, but should use the same unit to set both the - # min_limit and max_limit. - # @!attribute [rw] min_nodes - # @return [::Integer] - # Minimum number of nodes allocated to the instance. If set, this number - # should be greater than or equal to 1. - # - # Note: The following fields are mutually exclusive: `min_nodes`, `min_processing_units`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] min_processing_units - # @return [::Integer] - # Minimum number of processing units allocated to the instance. If set, - # this number should be multiples of 1000. - # - # Note: The following fields are mutually exclusive: `min_processing_units`, `min_nodes`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] max_nodes - # @return [::Integer] - # Maximum number of nodes allocated to the instance. If set, this number - # should be greater than or equal to min_nodes. - # - # Note: The following fields are mutually exclusive: `max_nodes`, `max_processing_units`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] max_processing_units - # @return [::Integer] - # Maximum number of processing units allocated to the instance. If set, - # this number should be multiples of 1000 and be greater than or equal to - # min_processing_units. - # - # Note: The following fields are mutually exclusive: `max_processing_units`, `max_nodes`. If a field in that set is populated, all other fields in the set will automatically be cleared. - class AutoscalingLimits - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The autoscaling targets for an instance. - # @!attribute [rw] high_priority_cpu_utilization_percent - # @return [::Integer] - # Optional. The target high priority cpu utilization percentage that the - # autoscaler should be trying to achieve for the instance. This number is - # on a scale from 0 (no utilization) to 100 (full utilization). The valid - # range is [10, 90] inclusive. If not specified or set to 0, the autoscaler - # skips scaling based on high priority CPU utilization. - # @!attribute [rw] total_cpu_utilization_percent - # @return [::Integer] - # Optional. The target total CPU utilization percentage that the autoscaler - # should be trying to achieve for the instance. This number is on a scale - # from 0 (no utilization) to 100 (full utilization). The valid range is - # [10, 90] inclusive. If not specified or set to 0, the autoscaler skips - # scaling based on total CPU utilization. If both - # `high_priority_cpu_utilization_percent` and - # `total_cpu_utilization_percent` are specified, the autoscaler provisions - # the larger of the two required compute capacities to satisfy both - # targets. - # @!attribute [rw] storage_utilization_percent - # @return [::Integer] - # Required. The target storage utilization percentage that the autoscaler - # should be trying to achieve for the instance. This number is on a scale - # from 0 (no utilization) to 100 (full utilization). The valid range is - # [10, 99] inclusive. - class AutoscalingTargets - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # AsymmetricAutoscalingOption specifies the scaling of replicas identified by - # the given selection. - # @!attribute [rw] replica_selection - # @return [::Google::Cloud::Spanner::Admin::Instance::V1::ReplicaSelection] - # Required. Selects the replicas to which this AsymmetricAutoscalingOption - # applies. Only read-only replicas are supported. - # @!attribute [rw] overrides - # @return [::Google::Cloud::Spanner::Admin::Instance::V1::AutoscalingConfig::AsymmetricAutoscalingOption::AutoscalingConfigOverrides] - # Optional. Overrides applied to the top-level autoscaling configuration - # for the selected replicas. - class AsymmetricAutoscalingOption - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Overrides the top-level autoscaling configuration for the replicas - # identified by `replica_selection`. All fields in this message are - # optional. Any unspecified fields will use the corresponding values from - # the top-level autoscaling configuration. - # @!attribute [rw] autoscaling_limits - # @return [::Google::Cloud::Spanner::Admin::Instance::V1::AutoscalingConfig::AutoscalingLimits] - # Optional. If specified, overrides the min/max limit in the top-level - # autoscaling configuration for the selected replicas. - # @!attribute [rw] autoscaling_target_high_priority_cpu_utilization_percent - # @return [::Integer] - # Optional. If specified, overrides the autoscaling target - # high_priority_cpu_utilization_percent in the top-level autoscaling - # configuration for the selected replicas. - # @!attribute [rw] autoscaling_target_total_cpu_utilization_percent - # @return [::Integer] - # Optional. If specified, overrides the - # autoscaling target `total_cpu_utilization_percent` - # in the top-level autoscaling configuration for the selected replicas. - # @!attribute [rw] disable_high_priority_cpu_autoscaling - # @return [::Boolean] - # Optional. If true, disables high priority CPU autoscaling for the - # selected replicas and ignores - # {::Google::Cloud::Spanner::Admin::Instance::V1::AutoscalingConfig::AutoscalingTargets#high_priority_cpu_utilization_percent high_priority_cpu_utilization_percent} - # in the top-level autoscaling configuration. - # - # When setting this field to true, setting - # {::Google::Cloud::Spanner::Admin::Instance::V1::AutoscalingConfig::AsymmetricAutoscalingOption::AutoscalingConfigOverrides#autoscaling_target_high_priority_cpu_utilization_percent autoscaling_target_high_priority_cpu_utilization_percent} - # field to a non-zero value for the same replica is not supported. - # - # If false, the - # {::Google::Cloud::Spanner::Admin::Instance::V1::AutoscalingConfig::AsymmetricAutoscalingOption::AutoscalingConfigOverrides#autoscaling_target_high_priority_cpu_utilization_percent autoscaling_target_high_priority_cpu_utilization_percent} - # field in the replica will be used if set to a non-zero value. - # Otherwise, the - # {::Google::Cloud::Spanner::Admin::Instance::V1::AutoscalingConfig::AutoscalingTargets#high_priority_cpu_utilization_percent high_priority_cpu_utilization_percent} - # field in the top-level autoscaling configuration will be used. - # - # Setting both - # {::Google::Cloud::Spanner::Admin::Instance::V1::AutoscalingConfig::AsymmetricAutoscalingOption::AutoscalingConfigOverrides#disable_high_priority_cpu_autoscaling disable_high_priority_cpu_autoscaling} - # and - # {::Google::Cloud::Spanner::Admin::Instance::V1::AutoscalingConfig::AsymmetricAutoscalingOption::AutoscalingConfigOverrides#disable_total_cpu_autoscaling disable_total_cpu_autoscaling} - # to true for the same replica is not supported. - # @!attribute [rw] disable_total_cpu_autoscaling - # @return [::Boolean] - # Optional. If true, disables total CPU autoscaling for the selected - # replicas and ignores - # {::Google::Cloud::Spanner::Admin::Instance::V1::AutoscalingConfig::AutoscalingTargets#total_cpu_utilization_percent total_cpu_utilization_percent} - # in the top-level autoscaling configuration. - # - # When setting this field to true, setting - # {::Google::Cloud::Spanner::Admin::Instance::V1::AutoscalingConfig::AsymmetricAutoscalingOption::AutoscalingConfigOverrides#autoscaling_target_total_cpu_utilization_percent autoscaling_target_total_cpu_utilization_percent} - # field to a non-zero value for the same replica is not supported. - # - # If false, the - # {::Google::Cloud::Spanner::Admin::Instance::V1::AutoscalingConfig::AsymmetricAutoscalingOption::AutoscalingConfigOverrides#autoscaling_target_total_cpu_utilization_percent autoscaling_target_total_cpu_utilization_percent} - # field in the replica will be used if set to a non-zero value. - # Otherwise, the - # {::Google::Cloud::Spanner::Admin::Instance::V1::AutoscalingConfig::AutoscalingTargets#total_cpu_utilization_percent total_cpu_utilization_percent} - # field in the top-level autoscaling configuration will be used. - # - # Setting both - # {::Google::Cloud::Spanner::Admin::Instance::V1::AutoscalingConfig::AsymmetricAutoscalingOption::AutoscalingConfigOverrides#disable_high_priority_cpu_autoscaling disable_high_priority_cpu_autoscaling} - # and - # {::Google::Cloud::Spanner::Admin::Instance::V1::AutoscalingConfig::AsymmetricAutoscalingOption::AutoscalingConfigOverrides#disable_total_cpu_autoscaling disable_total_cpu_autoscaling} - # to true for the same replica is not supported. - class AutoscalingConfigOverrides - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - - # An isolated set of Cloud Spanner resources on which databases can be hosted. - # @!attribute [rw] name - # @return [::String] - # Required. A unique identifier for the instance, which cannot be changed - # after the instance is created. Values are of the form - # `projects//instances/[a-z][-a-z0-9]*[a-z0-9]`. The final - # segment of the name must be between 2 and 64 characters in length. - # @!attribute [rw] config - # @return [::String] - # Required. The name of the instance's configuration. Values are of the form - # `projects//instanceConfigs/`. See - # also {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig InstanceConfig} and - # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#list_instance_configs ListInstanceConfigs}. - # @!attribute [rw] display_name - # @return [::String] - # Required. The descriptive name for this instance as it appears in UIs. - # Must be unique per project and between 4 and 30 characters in length. - # @!attribute [rw] node_count - # @return [::Integer] - # The number of nodes allocated to this instance. At most, one of either - # `node_count` or `processing_units` should be present in the message. - # - # Users can set the `node_count` field to specify the target number of nodes - # allocated to the instance. - # - # If autoscaling is enabled, `node_count` is treated as an `OUTPUT_ONLY` - # field and reflects the current number of nodes allocated to the instance. - # - # This might be zero in API responses for instances that are not yet in the - # `READY` state. - # - # - # For more information, see - # [Compute capacity, nodes, and processing - # units](https://cloud.google.com/spanner/docs/compute-capacity). - # @!attribute [rw] processing_units - # @return [::Integer] - # The number of processing units allocated to this instance. At most, one of - # either `processing_units` or `node_count` should be present in the message. - # - # Users can set the `processing_units` field to specify the target number of - # processing units allocated to the instance. - # - # If autoscaling is enabled, `processing_units` is treated as an - # `OUTPUT_ONLY` field and reflects the current number of processing units - # allocated to the instance. - # - # This might be zero in API responses for instances that are not yet in the - # `READY` state. - # - # - # For more information, see - # [Compute capacity, nodes and processing - # units](https://cloud.google.com/spanner/docs/compute-capacity). - # @!attribute [r] replica_compute_capacity - # @return [::Array<::Google::Cloud::Spanner::Admin::Instance::V1::ReplicaComputeCapacity>] - # Output only. Lists the compute capacity per ReplicaSelection. A replica - # selection identifies a set of replicas with common properties. Replicas - # identified by a ReplicaSelection are scaled with the same compute capacity. - # @!attribute [rw] autoscaling_config - # @return [::Google::Cloud::Spanner::Admin::Instance::V1::AutoscalingConfig] - # Optional. The autoscaling configuration. Autoscaling is enabled if this - # field is set. When autoscaling is enabled, node_count and processing_units - # are treated as OUTPUT_ONLY fields and reflect the current compute capacity - # allocated to the instance. - # @!attribute [r] state - # @return [::Google::Cloud::Spanner::Admin::Instance::V1::Instance::State] - # Output only. The current instance state. For - # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#create_instance CreateInstance}, - # the state must be either omitted or set to `CREATING`. For - # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#update_instance UpdateInstance}, - # the state must be either omitted or set to `READY`. - # @!attribute [rw] labels - # @return [::Google::Protobuf::Map{::String => ::String}] - # Cloud Labels are a flexible and lightweight mechanism for organizing cloud - # resources into groups that reflect a customer's organizational needs and - # deployment strategies. Cloud Labels can be used to filter collections of - # resources. They can be used to control how resource metrics are aggregated. - # And they can be used as arguments to policy management rules (e.g. route, - # firewall, load balancing, etc.). - # - # * Label keys must be between 1 and 63 characters long and must conform to - # the following regular expression: `[a-z][a-z0-9_-]{0,62}`. - # * Label values must be between 0 and 63 characters long and must conform - # to the regular expression `[a-z0-9_-]{0,63}`. - # * No more than 64 labels can be associated with a given resource. - # - # See https://goo.gl/xmQnxf for more information on and examples of labels. - # - # If you plan to use labels in your own code, please note that additional - # characters may be allowed in the future. And so you are advised to use an - # internal label representation, such as JSON, which doesn't rely upon - # specific characters being disallowed. For example, representing labels - # as the string: name + "_" + value would prove problematic if we were to - # allow "_" in a future release. - # @!attribute [rw] instance_type - # @return [::Google::Cloud::Spanner::Admin::Instance::V1::Instance::InstanceType] - # The `InstanceType` of the current instance. - # @!attribute [rw] endpoint_uris - # @return [::Array<::String>] - # Deprecated. This field is not populated. - # @!attribute [r] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time at which the instance was created. - # @!attribute [r] update_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time at which the instance was most recently updated. - # @!attribute [rw] free_instance_metadata - # @return [::Google::Cloud::Spanner::Admin::Instance::V1::FreeInstanceMetadata] - # Free instance metadata. Only populated for free instances. - # @!attribute [rw] edition - # @return [::Google::Cloud::Spanner::Admin::Instance::V1::Instance::Edition] - # Optional. The `Edition` of the current instance. - # @!attribute [rw] default_backup_schedule_type - # @return [::Google::Cloud::Spanner::Admin::Instance::V1::Instance::DefaultBackupScheduleType] - # Optional. Controls the default backup schedule behavior for new databases - # within the instance. By default, a backup schedule is created automatically - # when a new database is created in a new instance. - # - # Note that the `AUTOMATIC` value isn't permitted for free instances, - # as backups and backup schedules aren't supported for free instances. - # - # In the `GetInstance` or `ListInstances` response, if the value of - # `default_backup_schedule_type` isn't set, or set to `NONE`, Spanner doesn't - # create a default backup schedule for new databases in the instance. - class Instance - 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 - - # Indicates the current state of the instance. - module State - # Not specified. - STATE_UNSPECIFIED = 0 - - # The instance is still being created. Resources may not be - # available yet, and operations such as database creation may not - # work. - CREATING = 1 - - # The instance is fully created and ready to do work such as - # creating databases. - READY = 2 - end - - # The type of this instance. The type can be used to distinguish product - # variants, that can affect aspects like: usage restrictions, quotas and - # billing. Currently this is used to distinguish FREE_INSTANCE vs PROVISIONED - # instances. - module InstanceType - # Not specified. - INSTANCE_TYPE_UNSPECIFIED = 0 - - # Provisioned instances have dedicated resources, standard usage limits and - # support. - PROVISIONED = 1 - - # Free instances provide no guarantee for dedicated resources, - # [node_count, processing_units] should be 0. They come - # with stricter usage limits and limited support. - FREE_INSTANCE = 2 - end - - # The edition selected for this instance. Different editions provide - # different capabilities at different price points. - module Edition - # Edition not specified. - EDITION_UNSPECIFIED = 0 - - # Standard edition. - STANDARD = 1 - - # Enterprise edition. - ENTERPRISE = 2 - - # Enterprise Plus edition. - ENTERPRISE_PLUS = 3 - end - - # Indicates the - # [default backup - # schedule](https://cloud.google.com/spanner/docs/backup#default-backup-schedules) - # behavior for new databases within the instance. - module DefaultBackupScheduleType - # Not specified. - DEFAULT_BACKUP_SCHEDULE_TYPE_UNSPECIFIED = 0 - - # A default backup schedule isn't created automatically when a new database - # is created in the instance. - NONE = 1 - - # A default backup schedule is created automatically when a new database - # is created in the instance. The default backup schedule creates a full - # backup every 24 hours. These full backups are retained for 7 days. - # You can edit or delete the default backup schedule once it's created. - AUTOMATIC = 2 - end - end - - # The request for - # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#list_instance_configs ListInstanceConfigs}. - # @!attribute [rw] parent - # @return [::String] - # Required. The name of the project for which a list of supported instance - # configurations is requested. Values are of the form - # `projects/`. - # @!attribute [rw] page_size - # @return [::Integer] - # Number of instance configurations 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::Admin::Instance::V1::ListInstanceConfigsResponse#next_page_token next_page_token} - # from a previous - # {::Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigsResponse ListInstanceConfigsResponse}. - class ListInstanceConfigsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The response for - # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#list_instance_configs ListInstanceConfigs}. - # @!attribute [rw] instance_configs - # @return [::Array<::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig>] - # The list of requested instance configurations. - # @!attribute [rw] next_page_token - # @return [::String] - # `next_page_token` can be sent in a subsequent - # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#list_instance_configs ListInstanceConfigs} - # call to fetch more of the matching instance configurations. - class ListInstanceConfigsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request for - # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#get_instance_config GetInstanceConfigRequest}. - # @!attribute [rw] name - # @return [::String] - # Required. The name of the requested instance configuration. Values are of - # the form `projects//instanceConfigs/`. - class GetInstanceConfigRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request for - # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#create_instance_config CreateInstanceConfig}. - # @!attribute [rw] parent - # @return [::String] - # Required. The name of the project in which to create the instance - # configuration. Values are of the form `projects/`. - # @!attribute [rw] instance_config_id - # @return [::String] - # Required. The ID of the instance configuration to create. Valid identifiers - # are of the form `custom-[-a-z0-9]*[a-z0-9]` and must be between 2 and 64 - # characters in length. The `custom-` prefix is required to avoid name - # conflicts with Google-managed configurations. - # @!attribute [rw] instance_config - # @return [::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig] - # Required. The `InstanceConfig` proto of the configuration to create. - # `instance_config.name` must be - # `/instanceConfigs/`. - # `instance_config.base_config` must be a Google-managed configuration name, - # e.g. /instanceConfigs/us-east1, /instanceConfigs/nam3. - # @!attribute [rw] validate_only - # @return [::Boolean] - # An option to validate, but not actually execute, a request, - # and provide the same response. - class CreateInstanceConfigRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request for - # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#update_instance_config UpdateInstanceConfig}. - # @!attribute [rw] instance_config - # @return [::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig] - # Required. The user instance configuration to update, which must always - # include the instance configuration name. Otherwise, only fields mentioned - # in - # {::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstanceConfigRequest#update_mask update_mask} - # need be included. To prevent conflicts of concurrent updates, - # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig#reconciling etag} can - # be used. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # Required. A mask specifying which fields in - # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig InstanceConfig} should be - # updated. The field mask must always be specified; this prevents any future - # fields in {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig InstanceConfig} - # from being erased accidentally by clients that do not know about them. Only - # display_name and labels can be updated. - # @!attribute [rw] validate_only - # @return [::Boolean] - # An option to validate, but not actually execute, a request, - # and provide the same response. - class UpdateInstanceConfigRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request for - # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#delete_instance_config DeleteInstanceConfig}. - # @!attribute [rw] name - # @return [::String] - # Required. The name of the instance configuration to be deleted. - # Values are of the form - # `projects//instanceConfigs/` - # @!attribute [rw] etag - # @return [::String] - # Used for optimistic concurrency control as a way to help prevent - # simultaneous deletes of an instance configuration from overwriting each - # other. If not empty, the API - # only deletes the instance configuration when the etag provided matches the - # current status of the requested instance configuration. Otherwise, deletes - # the instance configuration without checking the current status of the - # requested instance configuration. - # @!attribute [rw] validate_only - # @return [::Boolean] - # An option to validate, but not actually execute, a request, - # and provide the same response. - class DeleteInstanceConfigRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request for - # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#list_instance_config_operations ListInstanceConfigOperations}. - # @!attribute [rw] parent - # @return [::String] - # Required. The project of the instance configuration operations. - # Values are of the form `projects/`. - # @!attribute [rw] filter - # @return [::String] - # An expression that filters the list of returned operations. - # - # A filter expression consists of a field name, a - # comparison operator, and a value for filtering. - # The value must be a string, a number, or a boolean. The comparison operator - # must be one of: `<`, `>`, `<=`, `>=`, `!=`, `=`, or `:`. - # Colon `:` is the contains operator. Filter rules are not case sensitive. - # - # The following fields in the Operation are eligible for filtering: - # - # * `name` - The name of the long-running operation - # * `done` - False if the operation is in progress, else true. - # * `metadata.@type` - the type of metadata. For example, the type string - # for - # {::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstanceConfigMetadata CreateInstanceConfigMetadata} - # is - # `type.googleapis.com/google.spanner.admin.instance.v1.CreateInstanceConfigMetadata`. - # * `metadata.` - any field in metadata.value. - # `metadata.@type` must be specified first, if filtering on metadata - # fields. - # * `error` - Error associated with the long-running operation. - # * `response.@type` - the type of response. - # * `response.` - any field in response.value. - # - # You can combine multiple expressions by enclosing each expression in - # parentheses. By default, expressions are combined with AND logic. However, - # you can specify AND, OR, and NOT logic explicitly. - # - # Here are a few examples: - # - # * `done:true` - The operation is complete. - # * `(metadata.@type=` \ - # `type.googleapis.com/google.spanner.admin.instance.v1.CreateInstanceConfigMetadata) - # AND` \ - # `(metadata.instance_config.name:custom-config) AND` \ - # `(metadata.progress.start_time < \"2021-03-28T14:50:00Z\") AND` \ - # `(error:*)` - Return operations where: - # * The operation's metadata type is - # {::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstanceConfigMetadata CreateInstanceConfigMetadata}. - # * The instance configuration name contains "custom-config". - # * The operation started before 2021-03-28T14:50:00Z. - # * The operation resulted in an error. - # @!attribute [rw] page_size - # @return [::Integer] - # Number of operations 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::Admin::Instance::V1::ListInstanceConfigOperationsResponse#next_page_token next_page_token} - # from a previous - # {::Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigOperationsResponse ListInstanceConfigOperationsResponse} - # to the same `parent` and with the same `filter`. - class ListInstanceConfigOperationsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The response for - # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#list_instance_config_operations ListInstanceConfigOperations}. - # @!attribute [rw] operations - # @return [::Array<::Google::Longrunning::Operation>] - # The list of matching instance configuration long-running operations. Each - # operation's name will be - # prefixed by the name of the instance configuration. The operation's - # metadata field type - # `metadata.type_url` describes the type of the metadata. - # @!attribute [rw] next_page_token - # @return [::String] - # `next_page_token` can be sent in a subsequent - # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#list_instance_config_operations ListInstanceConfigOperations} - # call to fetch more of the matching metadata. - class ListInstanceConfigOperationsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request for - # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#get_instance GetInstance}. - # @!attribute [rw] name - # @return [::String] - # Required. The name of the requested instance. Values are of the form - # `projects//instances/`. - # @!attribute [rw] field_mask - # @return [::Google::Protobuf::FieldMask] - # If field_mask is present, specifies the subset of - # {::Google::Cloud::Spanner::Admin::Instance::V1::Instance Instance} fields that should be - # returned. If absent, all - # {::Google::Cloud::Spanner::Admin::Instance::V1::Instance Instance} fields are returned. - class GetInstanceRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request for - # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#create_instance CreateInstance}. - # @!attribute [rw] parent - # @return [::String] - # Required. The name of the project in which to create the instance. Values - # are of the form `projects/`. - # @!attribute [rw] instance_id - # @return [::String] - # Required. The ID of the instance to create. Valid identifiers are of the - # form `[a-z][-a-z0-9]*[a-z0-9]` and must be between 2 and 64 characters in - # length. - # @!attribute [rw] instance - # @return [::Google::Cloud::Spanner::Admin::Instance::V1::Instance] - # Required. The instance to create. The name may be omitted, but if - # specified must be `/instances/`. - class CreateInstanceRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request for - # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#list_instances ListInstances}. - # @!attribute [rw] parent - # @return [::String] - # Required. The name of the project for which a list of instances is - # requested. Values are of the form `projects/`. - # @!attribute [rw] page_size - # @return [::Integer] - # Number of instances 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::Admin::Instance::V1::ListInstancesResponse#next_page_token next_page_token} - # from a previous - # {::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancesResponse ListInstancesResponse}. - # @!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: - # - # * `name` - # * `display_name` - # * `labels.key` where key is the name of a label - # - # Some examples of using filters are: - # - # * `name:*` --> The instance has a name. - # * `name:Howl` --> The instance's name contains the string "howl". - # * `name:HOWL` --> Equivalent to above. - # * `NAME:howl` --> Equivalent to above. - # * `labels.env:*` --> The instance has the label "env". - # * `labels.env:dev` --> The instance has the label "env" and the value of - # the label contains the string "dev". - # * `name:howl labels.env:dev` --> The instance's name contains "howl" and - # it has the label "env" with its value - # containing "dev". - # @!attribute [rw] instance_deadline - # @return [::Google::Protobuf::Timestamp] - # Deadline used while retrieving metadata for instances. - # Instances whose metadata cannot be retrieved within this deadline will be - # added to - # {::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancesResponse#unreachable unreachable} - # in - # {::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancesResponse ListInstancesResponse}. - class ListInstancesRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The response for - # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#list_instances ListInstances}. - # @!attribute [rw] instances - # @return [::Array<::Google::Cloud::Spanner::Admin::Instance::V1::Instance>] - # The list of requested instances. - # @!attribute [rw] next_page_token - # @return [::String] - # `next_page_token` can be sent in a subsequent - # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#list_instances ListInstances} - # call to fetch more of the matching instances. - # @!attribute [rw] unreachable - # @return [::Array<::String>] - # The list of unreachable instances. - # It includes the names of instances whose metadata could not be retrieved - # within - # {::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancesRequest#instance_deadline instance_deadline}. - class ListInstancesResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request for - # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#update_instance UpdateInstance}. - # @!attribute [rw] instance - # @return [::Google::Cloud::Spanner::Admin::Instance::V1::Instance] - # Required. The instance to update, which must always include the instance - # name. Otherwise, only fields mentioned in - # {::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstanceRequest#field_mask field_mask} - # need be included. - # @!attribute [rw] field_mask - # @return [::Google::Protobuf::FieldMask] - # Required. A mask specifying which fields in - # {::Google::Cloud::Spanner::Admin::Instance::V1::Instance Instance} should be updated. - # The field mask must always be specified; this prevents any future fields in - # {::Google::Cloud::Spanner::Admin::Instance::V1::Instance Instance} from being erased - # accidentally by clients that do not know about them. - class UpdateInstanceRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request for - # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#delete_instance DeleteInstance}. - # @!attribute [rw] name - # @return [::String] - # Required. The name of the instance to be deleted. Values are of the form - # `projects//instances/` - class DeleteInstanceRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Metadata type for the operation returned by - # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#create_instance CreateInstance}. - # @!attribute [rw] instance - # @return [::Google::Cloud::Spanner::Admin::Instance::V1::Instance] - # The instance being created. - # @!attribute [rw] start_time - # @return [::Google::Protobuf::Timestamp] - # The time at which the - # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#create_instance CreateInstance} - # request was received. - # @!attribute [rw] cancel_time - # @return [::Google::Protobuf::Timestamp] - # The time at which this operation was cancelled. If set, this operation is - # in the process of undoing itself (which is guaranteed to succeed) and - # cannot be cancelled again. - # @!attribute [rw] end_time - # @return [::Google::Protobuf::Timestamp] - # The time at which this operation failed or was completed successfully. - # @!attribute [rw] expected_fulfillment_period - # @return [::Google::Cloud::Spanner::Admin::Instance::V1::FulfillmentPeriod] - # The expected fulfillment period of this create operation. - class CreateInstanceMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Metadata type for the operation returned by - # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#update_instance UpdateInstance}. - # @!attribute [rw] instance - # @return [::Google::Cloud::Spanner::Admin::Instance::V1::Instance] - # The desired end state of the update. - # @!attribute [rw] start_time - # @return [::Google::Protobuf::Timestamp] - # The time at which - # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#update_instance UpdateInstance} - # request was received. - # @!attribute [rw] cancel_time - # @return [::Google::Protobuf::Timestamp] - # The time at which this operation was cancelled. If set, this operation is - # in the process of undoing itself (which is guaranteed to succeed) and - # cannot be cancelled again. - # @!attribute [rw] end_time - # @return [::Google::Protobuf::Timestamp] - # The time at which this operation failed or was completed successfully. - # @!attribute [rw] expected_fulfillment_period - # @return [::Google::Cloud::Spanner::Admin::Instance::V1::FulfillmentPeriod] - # The expected fulfillment period of this update operation. - class UpdateInstanceMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Free instance specific metadata that is kept even after an instance has been - # upgraded for tracking purposes. - # @!attribute [r] expire_time - # @return [::Google::Protobuf::Timestamp] - # Output only. Timestamp after which the instance will either be upgraded or - # scheduled for deletion after a grace period. ExpireBehavior is used to - # choose between upgrading or scheduling the free instance for deletion. This - # timestamp is set during the creation of a free instance. - # @!attribute [r] upgrade_time - # @return [::Google::Protobuf::Timestamp] - # Output only. If present, the timestamp at which the free instance was - # upgraded to a provisioned instance. - # @!attribute [rw] expire_behavior - # @return [::Google::Cloud::Spanner::Admin::Instance::V1::FreeInstanceMetadata::ExpireBehavior] - # Specifies the expiration behavior of a free instance. The default of - # ExpireBehavior is `REMOVE_AFTER_GRACE_PERIOD`. This can be modified during - # or after creation, and before expiration. - class FreeInstanceMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Allows users to change behavior when a free instance expires. - module ExpireBehavior - # Not specified. - EXPIRE_BEHAVIOR_UNSPECIFIED = 0 - - # When the free instance expires, upgrade the instance to a provisioned - # instance. - FREE_TO_PROVISIONED = 1 - - # When the free instance expires, disable the instance, and delete it - # after the grace period passes if it has not been upgraded. - REMOVE_AFTER_GRACE_PERIOD = 2 - end - end - - # Metadata type for the operation returned by - # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#create_instance_config CreateInstanceConfig}. - # @!attribute [rw] instance_config - # @return [::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig] - # The target instance configuration end state. - # @!attribute [rw] progress - # @return [::Google::Cloud::Spanner::Admin::Instance::V1::OperationProgress] - # The progress of the - # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#create_instance_config CreateInstanceConfig} - # operation. - # @!attribute [rw] cancel_time - # @return [::Google::Protobuf::Timestamp] - # The time at which this operation was cancelled. - class CreateInstanceConfigMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Metadata type for the operation returned by - # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#update_instance_config UpdateInstanceConfig}. - # @!attribute [rw] instance_config - # @return [::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig] - # The desired instance configuration after updating. - # @!attribute [rw] progress - # @return [::Google::Cloud::Spanner::Admin::Instance::V1::OperationProgress] - # The progress of the - # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#update_instance_config UpdateInstanceConfig} - # operation. - # @!attribute [rw] cancel_time - # @return [::Google::Protobuf::Timestamp] - # The time at which this operation was cancelled. - class UpdateInstanceConfigMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # An isolated set of Cloud Spanner resources that databases can define - # placements on. - # @!attribute [rw] name - # @return [::String] - # Required. A unique identifier for the instance partition. Values are of the - # form - # `projects//instances//instancePartitions/[a-z][-a-z0-9]*[a-z0-9]`. - # The final segment of the name must be between 2 and 64 characters in - # length. An instance partition's name cannot be changed after the instance - # partition is created. - # @!attribute [rw] config - # @return [::String] - # Required. The name of the instance partition's configuration. Values are of - # the form `projects//instanceConfigs/`. See also - # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig InstanceConfig} and - # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#list_instance_configs ListInstanceConfigs}. - # @!attribute [rw] display_name - # @return [::String] - # Required. The descriptive name for this instance partition as it appears in - # UIs. Must be unique per project and between 4 and 30 characters in length. - # @!attribute [rw] node_count - # @return [::Integer] - # The number of nodes allocated to this instance partition. - # - # Users can set the `node_count` field to specify the target number of - # nodes allocated to the instance partition. - # - # This may be zero in API responses for instance partitions that are not - # yet in state `READY`. - # - # Note: The following fields are mutually exclusive: `node_count`, `processing_units`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] processing_units - # @return [::Integer] - # The number of processing units allocated to this instance partition. - # - # Users can set the `processing_units` field to specify the target number - # of processing units allocated to the instance partition. - # - # This might be zero in API responses for instance partitions that are not - # yet in the `READY` state. - # - # Note: The following fields are mutually exclusive: `processing_units`, `node_count`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] autoscaling_config - # @return [::Google::Cloud::Spanner::Admin::Instance::V1::AutoscalingConfig] - # Optional. The autoscaling configuration. Autoscaling is enabled if this - # field is set. When autoscaling is enabled, fields in compute_capacity are - # treated as OUTPUT_ONLY fields and reflect the current compute capacity - # allocated to the instance partition. - # @!attribute [r] state - # @return [::Google::Cloud::Spanner::Admin::Instance::V1::InstancePartition::State] - # Output only. The current instance partition state. - # @!attribute [r] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time at which the instance partition was created. - # @!attribute [r] update_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time at which the instance partition was most recently - # updated. - # @!attribute [r] referencing_databases - # @return [::Array<::String>] - # Output only. The names of the databases that reference this - # instance partition. Referencing databases should share the parent instance. - # The existence of any referencing database prevents the instance partition - # from being deleted. - # @!attribute [r] referencing_backups - # @deprecated This field is deprecated and may be removed in the next major version update. - # @return [::Array<::String>] - # Output only. Deprecated: This field is not populated. - # Output only. The names of the backups that reference this instance - # partition. Referencing backups should share the parent instance. The - # existence of any referencing backup prevents the instance partition from - # being deleted. - # @!attribute [rw] etag - # @return [::String] - # Used for optimistic concurrency control as a way - # to help prevent simultaneous updates of a instance partition from - # overwriting each other. It is strongly suggested that systems make use of - # the etag in the read-modify-write cycle to perform instance partition - # updates in order to avoid race conditions: An etag is returned in the - # response which contains instance partitions, and systems are expected to - # put that etag in the request to update instance partitions to ensure that - # their change will be applied to the same version of the instance partition. - # If no etag is provided in the call to update instance partition, then the - # existing instance partition is overwritten blindly. - class InstancePartition - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Indicates the current state of the instance partition. - module State - # Not specified. - STATE_UNSPECIFIED = 0 - - # The instance partition is still being created. Resources may not be - # available yet, and operations such as creating placements using this - # instance partition may not work. - CREATING = 1 - - # The instance partition is fully created and ready to do work such as - # creating placements and using in databases. - READY = 2 - end - end - - # Metadata type for the operation returned by - # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#create_instance_partition CreateInstancePartition}. - # @!attribute [rw] instance_partition - # @return [::Google::Cloud::Spanner::Admin::Instance::V1::InstancePartition] - # The instance partition being created. - # @!attribute [rw] start_time - # @return [::Google::Protobuf::Timestamp] - # The time at which the - # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#create_instance_partition CreateInstancePartition} - # request was received. - # @!attribute [rw] cancel_time - # @return [::Google::Protobuf::Timestamp] - # The time at which this operation was cancelled. If set, this operation is - # in the process of undoing itself (which is guaranteed to succeed) and - # cannot be cancelled again. - # @!attribute [rw] end_time - # @return [::Google::Protobuf::Timestamp] - # The time at which this operation failed or was completed successfully. - class CreateInstancePartitionMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request for - # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#create_instance_partition CreateInstancePartition}. - # @!attribute [rw] parent - # @return [::String] - # Required. The name of the instance in which to create the instance - # partition. Values are of the form - # `projects//instances/`. - # @!attribute [rw] instance_partition_id - # @return [::String] - # Required. The ID of the instance partition to create. Valid identifiers are - # of the form `[a-z][-a-z0-9]*[a-z0-9]` and must be between 2 and 64 - # characters in length. - # @!attribute [rw] instance_partition - # @return [::Google::Cloud::Spanner::Admin::Instance::V1::InstancePartition] - # Required. The instance partition to create. The instance_partition.name may - # be omitted, but if specified must be - # `/instancePartitions/`. - class CreateInstancePartitionRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request for - # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#delete_instance_partition DeleteInstancePartition}. - # @!attribute [rw] name - # @return [::String] - # Required. The name of the instance partition to be deleted. - # Values are of the form - # `projects/{project}/instances/{instance}/instancePartitions/{instance_partition}` - # @!attribute [rw] etag - # @return [::String] - # Optional. If not empty, the API only deletes the instance partition when - # the etag provided matches the current status of the requested instance - # partition. Otherwise, deletes the instance partition without checking the - # current status of the requested instance partition. - class DeleteInstancePartitionRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request for - # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#get_instance_partition GetInstancePartition}. - # @!attribute [rw] name - # @return [::String] - # Required. The name of the requested instance partition. Values are of - # the form - # `projects/{project}/instances/{instance}/instancePartitions/{instance_partition}`. - class GetInstancePartitionRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request for - # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#update_instance_partition UpdateInstancePartition}. - # @!attribute [rw] instance_partition - # @return [::Google::Cloud::Spanner::Admin::Instance::V1::InstancePartition] - # Required. The instance partition to update, which must always include the - # instance partition name. Otherwise, only fields mentioned in - # {::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstancePartitionRequest#field_mask field_mask} - # need be included. - # @!attribute [rw] field_mask - # @return [::Google::Protobuf::FieldMask] - # Required. A mask specifying which fields in - # {::Google::Cloud::Spanner::Admin::Instance::V1::InstancePartition InstancePartition} - # should be updated. The field mask must always be specified; this prevents - # any future fields in - # {::Google::Cloud::Spanner::Admin::Instance::V1::InstancePartition InstancePartition} - # from being erased accidentally by clients that do not know about them. - class UpdateInstancePartitionRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Metadata type for the operation returned by - # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#update_instance_partition UpdateInstancePartition}. - # @!attribute [rw] instance_partition - # @return [::Google::Cloud::Spanner::Admin::Instance::V1::InstancePartition] - # The desired end state of the update. - # @!attribute [rw] start_time - # @return [::Google::Protobuf::Timestamp] - # The time at which - # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#update_instance_partition UpdateInstancePartition} - # request was received. - # @!attribute [rw] cancel_time - # @return [::Google::Protobuf::Timestamp] - # The time at which this operation was cancelled. If set, this operation is - # in the process of undoing itself (which is guaranteed to succeed) and - # cannot be cancelled again. - # @!attribute [rw] end_time - # @return [::Google::Protobuf::Timestamp] - # The time at which this operation failed or was completed successfully. - class UpdateInstancePartitionMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request for - # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#list_instance_partitions ListInstancePartitions}. - # @!attribute [rw] parent - # @return [::String] - # Required. The instance whose instance partitions should be listed. Values - # are of the form `projects//instances/`. Use `{instance} - # = '-'` to list instance partitions for all Instances in a project, e.g., - # `projects/myproject/instances/-`. - # @!attribute [rw] page_size - # @return [::Integer] - # Number of instance partitions 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::Admin::Instance::V1::ListInstancePartitionsResponse#next_page_token next_page_token} - # from a previous - # {::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionsResponse ListInstancePartitionsResponse}. - # @!attribute [rw] instance_partition_deadline - # @return [::Google::Protobuf::Timestamp] - # Optional. Deadline used while retrieving metadata for instance partitions. - # Instance partitions whose metadata cannot be retrieved within this deadline - # will be added to - # {::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionsResponse#unreachable unreachable} - # in - # {::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionsResponse ListInstancePartitionsResponse}. - class ListInstancePartitionsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The response for - # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#list_instance_partitions ListInstancePartitions}. - # @!attribute [rw] instance_partitions - # @return [::Array<::Google::Cloud::Spanner::Admin::Instance::V1::InstancePartition>] - # The list of requested instancePartitions. - # @!attribute [rw] next_page_token - # @return [::String] - # `next_page_token` can be sent in a subsequent - # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#list_instance_partitions ListInstancePartitions} - # call to fetch more of the matching instance partitions. - # @!attribute [rw] unreachable - # @return [::Array<::String>] - # The list of unreachable instances or instance partitions. - # It includes the names of instances or instance partitions whose metadata - # could not be retrieved within - # {::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionsRequest#instance_partition_deadline instance_partition_deadline}. - class ListInstancePartitionsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request for - # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#list_instance_partition_operations ListInstancePartitionOperations}. - # @!attribute [rw] parent - # @return [::String] - # Required. The parent instance of the instance partition operations. - # Values are of the form `projects//instances/`. - # @!attribute [rw] filter - # @return [::String] - # Optional. An expression that filters the list of returned operations. - # - # A filter expression consists of a field name, a - # comparison operator, and a value for filtering. - # The value must be a string, a number, or a boolean. The comparison operator - # must be one of: `<`, `>`, `<=`, `>=`, `!=`, `=`, or `:`. - # Colon `:` is the contains operator. Filter rules are not case sensitive. - # - # The following fields in the Operation are eligible for filtering: - # - # * `name` - The name of the long-running operation - # * `done` - False if the operation is in progress, else true. - # * `metadata.@type` - the type of metadata. For example, the type string - # for - # {::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstancePartitionMetadata CreateInstancePartitionMetadata} - # is - # `type.googleapis.com/google.spanner.admin.instance.v1.CreateInstancePartitionMetadata`. - # * `metadata.` - any field in metadata.value. - # `metadata.@type` must be specified first, if filtering on metadata - # fields. - # * `error` - Error associated with the long-running operation. - # * `response.@type` - the type of response. - # * `response.` - any field in response.value. - # - # You can combine multiple expressions by enclosing each expression in - # parentheses. By default, expressions are combined with AND logic. However, - # you can specify AND, OR, and NOT logic explicitly. - # - # Here are a few examples: - # - # * `done:true` - The operation is complete. - # * `(metadata.@type=` \ - # `type.googleapis.com/google.spanner.admin.instance.v1.CreateInstancePartitionMetadata) - # AND` \ - # `(metadata.instance_partition.name:custom-instance-partition) AND` \ - # `(metadata.start_time < \"2021-03-28T14:50:00Z\") AND` \ - # `(error:*)` - Return operations where: - # * The operation's metadata type is - # {::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstancePartitionMetadata CreateInstancePartitionMetadata}. - # * The instance partition name contains "custom-instance-partition". - # * The operation started before 2021-03-28T14:50:00Z. - # * The operation resulted in an error. - # @!attribute [rw] page_size - # @return [::Integer] - # Optional. Number of operations 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] - # Optional. If non-empty, `page_token` should contain a - # {::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionOperationsResponse#next_page_token next_page_token} - # from a previous - # {::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionOperationsResponse ListInstancePartitionOperationsResponse} - # to the same `parent` and with the same `filter`. - # @!attribute [rw] instance_partition_deadline - # @return [::Google::Protobuf::Timestamp] - # Optional. Deadline used while retrieving metadata for instance partition - # operations. Instance partitions whose operation metadata cannot be - # retrieved within this deadline will be added to - # {::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionOperationsResponse#unreachable_instance_partitions unreachable_instance_partitions} - # in - # {::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionOperationsResponse ListInstancePartitionOperationsResponse}. - class ListInstancePartitionOperationsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The response for - # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#list_instance_partition_operations ListInstancePartitionOperations}. - # @!attribute [rw] operations - # @return [::Array<::Google::Longrunning::Operation>] - # The list of matching instance partition long-running operations. Each - # operation's name will be - # prefixed by the instance partition's name. The operation's - # metadata field type - # `metadata.type_url` describes the type of the metadata. - # @!attribute [rw] next_page_token - # @return [::String] - # `next_page_token` can be sent in a subsequent - # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#list_instance_partition_operations ListInstancePartitionOperations} - # call to fetch more of the matching metadata. - # @!attribute [rw] unreachable_instance_partitions - # @return [::Array<::String>] - # The list of unreachable instance partitions. - # It includes the names of instance partitions whose operation metadata could - # not be retrieved within - # {::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionOperationsRequest#instance_partition_deadline instance_partition_deadline}. - class ListInstancePartitionOperationsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request for - # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#move_instance MoveInstance}. - # @!attribute [rw] name - # @return [::String] - # Required. The instance to move. - # Values are of the form `projects//instances/`. - # @!attribute [rw] target_config - # @return [::String] - # Required. The target instance configuration where to move the instance. - # Values are of the form `projects//instanceConfigs/`. - class MoveInstanceRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The response for - # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#move_instance MoveInstance}. - class MoveInstanceResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Metadata type for the operation returned by - # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#move_instance MoveInstance}. - # @!attribute [rw] target_config - # @return [::String] - # The target instance configuration where to move the instance. - # Values are of the form `projects//instanceConfigs/`. - # @!attribute [rw] progress - # @return [::Google::Cloud::Spanner::Admin::Instance::V1::OperationProgress] - # The progress of the - # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#move_instance MoveInstance} - # operation. - # {::Google::Cloud::Spanner::Admin::Instance::V1::OperationProgress#progress_percent progress_percent} - # is reset when cancellation is requested. - # @!attribute [rw] cancel_time - # @return [::Google::Protobuf::Timestamp] - # The time at which this operation was cancelled. - class MoveInstanceMetadata - 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-admin-instance-v1/proto_docs/google/type/expr.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/proto_docs/google/type/expr.rb deleted file mode 100644 index 9505eeb8657e..000000000000 --- a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/proto_docs/google/type/expr.rb +++ /dev/null @@ -1,75 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 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 Type - # Represents a textual expression in the Common Expression Language (CEL) - # syntax. CEL is a C-like expression language. The syntax and semantics of CEL - # are documented at https://github.com/google/cel-spec. - # - # Example (Comparison): - # - # title: "Summary size limit" - # description: "Determines if a summary is less than 100 chars" - # expression: "document.summary.size() < 100" - # - # Example (Equality): - # - # title: "Requestor is owner" - # description: "Determines if requestor is the document owner" - # expression: "document.owner == request.auth.claims.email" - # - # Example (Logic): - # - # title: "Public documents" - # description: "Determine whether the document should be publicly visible" - # expression: "document.type != 'private' && document.type != 'internal'" - # - # Example (Data Manipulation): - # - # title: "Notification string" - # description: "Create a notification string with a timestamp." - # expression: "'New message received at ' + string(document.create_time)" - # - # The exact variables and functions that may be referenced within an expression - # are determined by the service that evaluates it. See the service - # documentation for additional information. - # @!attribute [rw] expression - # @return [::String] - # Textual representation of an expression in Common Expression Language - # syntax. - # @!attribute [rw] title - # @return [::String] - # Optional. Title for the expression, i.e. a short string describing - # its purpose. This can be used e.g. in UIs which allow to enter the - # expression. - # @!attribute [rw] description - # @return [::String] - # Optional. Description of the expression. This is a longer text which - # describes the expression, e.g. when hovered over it in a UI. - # @!attribute [rw] location - # @return [::String] - # Optional. String indicating the location of the expression for error - # reporting, e.g. a file name and a position in the file. - class Expr - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/Gemfile b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/Gemfile deleted file mode 100644 index 84bfa1a1fb23..000000000000 --- a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/Gemfile +++ /dev/null @@ -1,32 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 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-admin-instance-v1", path: "../" -else - gem "google-cloud-spanner-admin-instance-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-admin-instance-v1/snippets/instance_admin/create_instance.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/create_instance.rb deleted file mode 100644 index 3a98c906707a..000000000000 --- a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/create_instance.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 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_InstanceAdmin_CreateInstance_sync] -require "google/cloud/spanner/admin/instance/v1" - -## -# Snippet for the create_instance call in the InstanceAdmin 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::Admin::Instance::V1::InstanceAdmin::Client#create_instance. -# -def create_instance - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Spanner::Admin::Instance::V1::CreateInstanceRequest.new - - # Call the create_instance method. - result = client.create_instance request - - # The returned object is of type Gapic::Operation. You can use it to - # check the status of an operation, cancel it, or wait for results. - # Here is how to wait for a response. - result.wait_until_done! timeout: 60 - if result.response? - p result.response - else - puts "No response received." - end -end -# [END spanner_v1_generated_InstanceAdmin_CreateInstance_sync] diff --git a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/create_instance_config.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/create_instance_config.rb deleted file mode 100644 index d35298c9192a..000000000000 --- a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/create_instance_config.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 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_InstanceAdmin_CreateInstanceConfig_sync] -require "google/cloud/spanner/admin/instance/v1" - -## -# Snippet for the create_instance_config call in the InstanceAdmin 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::Admin::Instance::V1::InstanceAdmin::Client#create_instance_config. -# -def create_instance_config - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Spanner::Admin::Instance::V1::CreateInstanceConfigRequest.new - - # Call the create_instance_config method. - result = client.create_instance_config request - - # The returned object is of type Gapic::Operation. You can use it to - # check the status of an operation, cancel it, or wait for results. - # Here is how to wait for a response. - result.wait_until_done! timeout: 60 - if result.response? - p result.response - else - puts "No response received." - end -end -# [END spanner_v1_generated_InstanceAdmin_CreateInstanceConfig_sync] diff --git a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/create_instance_partition.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/create_instance_partition.rb deleted file mode 100644 index f27f995ceb98..000000000000 --- a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/create_instance_partition.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 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_InstanceAdmin_CreateInstancePartition_sync] -require "google/cloud/spanner/admin/instance/v1" - -## -# Snippet for the create_instance_partition call in the InstanceAdmin 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::Admin::Instance::V1::InstanceAdmin::Client#create_instance_partition. -# -def create_instance_partition - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Spanner::Admin::Instance::V1::CreateInstancePartitionRequest.new - - # Call the create_instance_partition method. - result = client.create_instance_partition request - - # The returned object is of type Gapic::Operation. You can use it to - # check the status of an operation, cancel it, or wait for results. - # Here is how to wait for a response. - result.wait_until_done! timeout: 60 - if result.response? - p result.response - else - puts "No response received." - end -end -# [END spanner_v1_generated_InstanceAdmin_CreateInstancePartition_sync] diff --git a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/delete_instance.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/delete_instance.rb deleted file mode 100644 index 23b3d83cd532..000000000000 --- a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/delete_instance.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 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_InstanceAdmin_DeleteInstance_sync] -require "google/cloud/spanner/admin/instance/v1" - -## -# Snippet for the delete_instance call in the InstanceAdmin 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::Admin::Instance::V1::InstanceAdmin::Client#delete_instance. -# -def delete_instance - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Spanner::Admin::Instance::V1::DeleteInstanceRequest.new - - # Call the delete_instance method. - result = client.delete_instance request - - # The returned object is of type Google::Protobuf::Empty. - p result -end -# [END spanner_v1_generated_InstanceAdmin_DeleteInstance_sync] diff --git a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/delete_instance_config.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/delete_instance_config.rb deleted file mode 100644 index 3accbd00c975..000000000000 --- a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/delete_instance_config.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 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_InstanceAdmin_DeleteInstanceConfig_sync] -require "google/cloud/spanner/admin/instance/v1" - -## -# Snippet for the delete_instance_config call in the InstanceAdmin 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::Admin::Instance::V1::InstanceAdmin::Client#delete_instance_config. -# -def delete_instance_config - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Spanner::Admin::Instance::V1::DeleteInstanceConfigRequest.new - - # Call the delete_instance_config method. - result = client.delete_instance_config request - - # The returned object is of type Google::Protobuf::Empty. - p result -end -# [END spanner_v1_generated_InstanceAdmin_DeleteInstanceConfig_sync] diff --git a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/delete_instance_partition.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/delete_instance_partition.rb deleted file mode 100644 index c214d4b15c0d..000000000000 --- a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/delete_instance_partition.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 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_InstanceAdmin_DeleteInstancePartition_sync] -require "google/cloud/spanner/admin/instance/v1" - -## -# Snippet for the delete_instance_partition call in the InstanceAdmin 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::Admin::Instance::V1::InstanceAdmin::Client#delete_instance_partition. -# -def delete_instance_partition - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Spanner::Admin::Instance::V1::DeleteInstancePartitionRequest.new - - # Call the delete_instance_partition method. - result = client.delete_instance_partition request - - # The returned object is of type Google::Protobuf::Empty. - p result -end -# [END spanner_v1_generated_InstanceAdmin_DeleteInstancePartition_sync] diff --git a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/get_iam_policy.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/get_iam_policy.rb deleted file mode 100644 index 42f2002a544d..000000000000 --- a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/get_iam_policy.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 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_InstanceAdmin_GetIamPolicy_sync] -require "google/cloud/spanner/admin/instance/v1" - -## -# Snippet for the get_iam_policy call in the InstanceAdmin 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::Admin::Instance::V1::InstanceAdmin::Client#get_iam_policy. -# -def get_iam_policy - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Iam::V1::GetIamPolicyRequest.new - - # Call the get_iam_policy method. - result = client.get_iam_policy request - - # The returned object is of type Google::Iam::V1::Policy. - p result -end -# [END spanner_v1_generated_InstanceAdmin_GetIamPolicy_sync] diff --git a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/get_instance.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/get_instance.rb deleted file mode 100644 index c1b513d28fb7..000000000000 --- a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/get_instance.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 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_InstanceAdmin_GetInstance_sync] -require "google/cloud/spanner/admin/instance/v1" - -## -# Snippet for the get_instance call in the InstanceAdmin 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::Admin::Instance::V1::InstanceAdmin::Client#get_instance. -# -def get_instance - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Spanner::Admin::Instance::V1::GetInstanceRequest.new - - # Call the get_instance method. - result = client.get_instance request - - # The returned object is of type Google::Cloud::Spanner::Admin::Instance::V1::Instance. - p result -end -# [END spanner_v1_generated_InstanceAdmin_GetInstance_sync] diff --git a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/get_instance_config.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/get_instance_config.rb deleted file mode 100644 index 79ead90a98f7..000000000000 --- a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/get_instance_config.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 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_InstanceAdmin_GetInstanceConfig_sync] -require "google/cloud/spanner/admin/instance/v1" - -## -# Snippet for the get_instance_config call in the InstanceAdmin 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::Admin::Instance::V1::InstanceAdmin::Client#get_instance_config. -# -def get_instance_config - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Spanner::Admin::Instance::V1::GetInstanceConfigRequest.new - - # Call the get_instance_config method. - result = client.get_instance_config request - - # The returned object is of type Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig. - p result -end -# [END spanner_v1_generated_InstanceAdmin_GetInstanceConfig_sync] diff --git a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/get_instance_partition.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/get_instance_partition.rb deleted file mode 100644 index 52670156a1fb..000000000000 --- a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/get_instance_partition.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 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_InstanceAdmin_GetInstancePartition_sync] -require "google/cloud/spanner/admin/instance/v1" - -## -# Snippet for the get_instance_partition call in the InstanceAdmin 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::Admin::Instance::V1::InstanceAdmin::Client#get_instance_partition. -# -def get_instance_partition - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Spanner::Admin::Instance::V1::GetInstancePartitionRequest.new - - # Call the get_instance_partition method. - result = client.get_instance_partition request - - # The returned object is of type Google::Cloud::Spanner::Admin::Instance::V1::InstancePartition. - p result -end -# [END spanner_v1_generated_InstanceAdmin_GetInstancePartition_sync] diff --git a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/list_instance_config_operations.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/list_instance_config_operations.rb deleted file mode 100644 index 299cfbef445e..000000000000 --- a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/list_instance_config_operations.rb +++ /dev/null @@ -1,51 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 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_InstanceAdmin_ListInstanceConfigOperations_sync] -require "google/cloud/spanner/admin/instance/v1" - -## -# Snippet for the list_instance_config_operations call in the InstanceAdmin 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::Admin::Instance::V1::InstanceAdmin::Client#list_instance_config_operations. -# -def list_instance_config_operations - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigOperationsRequest.new - - # Call the list_instance_config_operations method. - result = client.list_instance_config_operations 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::Longrunning::Operation. - p item - end -end -# [END spanner_v1_generated_InstanceAdmin_ListInstanceConfigOperations_sync] diff --git a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/list_instance_configs.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/list_instance_configs.rb deleted file mode 100644 index 3f952eac6ecc..000000000000 --- a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/list_instance_configs.rb +++ /dev/null @@ -1,51 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 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_InstanceAdmin_ListInstanceConfigs_sync] -require "google/cloud/spanner/admin/instance/v1" - -## -# Snippet for the list_instance_configs call in the InstanceAdmin 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::Admin::Instance::V1::InstanceAdmin::Client#list_instance_configs. -# -def list_instance_configs - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigsRequest.new - - # Call the list_instance_configs method. - result = client.list_instance_configs 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::Admin::Instance::V1::InstanceConfig. - p item - end -end -# [END spanner_v1_generated_InstanceAdmin_ListInstanceConfigs_sync] diff --git a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/list_instance_partition_operations.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/list_instance_partition_operations.rb deleted file mode 100644 index fa87412bfdcb..000000000000 --- a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/list_instance_partition_operations.rb +++ /dev/null @@ -1,51 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 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_InstanceAdmin_ListInstancePartitionOperations_sync] -require "google/cloud/spanner/admin/instance/v1" - -## -# Snippet for the list_instance_partition_operations call in the InstanceAdmin 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::Admin::Instance::V1::InstanceAdmin::Client#list_instance_partition_operations. -# -def list_instance_partition_operations - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionOperationsRequest.new - - # Call the list_instance_partition_operations method. - result = client.list_instance_partition_operations 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::Longrunning::Operation. - p item - end -end -# [END spanner_v1_generated_InstanceAdmin_ListInstancePartitionOperations_sync] diff --git a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/list_instance_partitions.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/list_instance_partitions.rb deleted file mode 100644 index eb2fdce229d2..000000000000 --- a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/list_instance_partitions.rb +++ /dev/null @@ -1,51 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 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_InstanceAdmin_ListInstancePartitions_sync] -require "google/cloud/spanner/admin/instance/v1" - -## -# Snippet for the list_instance_partitions call in the InstanceAdmin 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::Admin::Instance::V1::InstanceAdmin::Client#list_instance_partitions. -# -def list_instance_partitions - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionsRequest.new - - # Call the list_instance_partitions method. - result = client.list_instance_partitions 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::Admin::Instance::V1::InstancePartition. - p item - end -end -# [END spanner_v1_generated_InstanceAdmin_ListInstancePartitions_sync] diff --git a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/list_instances.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/list_instances.rb deleted file mode 100644 index 362f27d203ac..000000000000 --- a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/list_instances.rb +++ /dev/null @@ -1,51 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 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_InstanceAdmin_ListInstances_sync] -require "google/cloud/spanner/admin/instance/v1" - -## -# Snippet for the list_instances call in the InstanceAdmin 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::Admin::Instance::V1::InstanceAdmin::Client#list_instances. -# -def list_instances - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Spanner::Admin::Instance::V1::ListInstancesRequest.new - - # Call the list_instances method. - result = client.list_instances 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::Admin::Instance::V1::Instance. - p item - end -end -# [END spanner_v1_generated_InstanceAdmin_ListInstances_sync] diff --git a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/move_instance.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/move_instance.rb deleted file mode 100644 index 2a6e743ba785..000000000000 --- a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/move_instance.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 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_InstanceAdmin_MoveInstance_sync] -require "google/cloud/spanner/admin/instance/v1" - -## -# Snippet for the move_instance call in the InstanceAdmin 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::Admin::Instance::V1::InstanceAdmin::Client#move_instance. -# -def move_instance - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Spanner::Admin::Instance::V1::MoveInstanceRequest.new - - # Call the move_instance method. - result = client.move_instance request - - # The returned object is of type Gapic::Operation. You can use it to - # check the status of an operation, cancel it, or wait for results. - # Here is how to wait for a response. - result.wait_until_done! timeout: 60 - if result.response? - p result.response - else - puts "No response received." - end -end -# [END spanner_v1_generated_InstanceAdmin_MoveInstance_sync] diff --git a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/set_iam_policy.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/set_iam_policy.rb deleted file mode 100644 index f7b9a08b4dc0..000000000000 --- a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/set_iam_policy.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 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_InstanceAdmin_SetIamPolicy_sync] -require "google/cloud/spanner/admin/instance/v1" - -## -# Snippet for the set_iam_policy call in the InstanceAdmin 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::Admin::Instance::V1::InstanceAdmin::Client#set_iam_policy. -# -def set_iam_policy - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Iam::V1::SetIamPolicyRequest.new - - # Call the set_iam_policy method. - result = client.set_iam_policy request - - # The returned object is of type Google::Iam::V1::Policy. - p result -end -# [END spanner_v1_generated_InstanceAdmin_SetIamPolicy_sync] diff --git a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/test_iam_permissions.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/test_iam_permissions.rb deleted file mode 100644 index 45bf9761b29c..000000000000 --- a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/test_iam_permissions.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 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_InstanceAdmin_TestIamPermissions_sync] -require "google/cloud/spanner/admin/instance/v1" - -## -# Snippet for the test_iam_permissions call in the InstanceAdmin 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::Admin::Instance::V1::InstanceAdmin::Client#test_iam_permissions. -# -def test_iam_permissions - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Iam::V1::TestIamPermissionsRequest.new - - # Call the test_iam_permissions method. - result = client.test_iam_permissions request - - # The returned object is of type Google::Iam::V1::TestIamPermissionsResponse. - p result -end -# [END spanner_v1_generated_InstanceAdmin_TestIamPermissions_sync] diff --git a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/update_instance.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/update_instance.rb deleted file mode 100644 index b7682504ebc1..000000000000 --- a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/update_instance.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 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_InstanceAdmin_UpdateInstance_sync] -require "google/cloud/spanner/admin/instance/v1" - -## -# Snippet for the update_instance call in the InstanceAdmin 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::Admin::Instance::V1::InstanceAdmin::Client#update_instance. -# -def update_instance - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstanceRequest.new - - # Call the update_instance method. - result = client.update_instance request - - # The returned object is of type Gapic::Operation. You can use it to - # check the status of an operation, cancel it, or wait for results. - # Here is how to wait for a response. - result.wait_until_done! timeout: 60 - if result.response? - p result.response - else - puts "No response received." - end -end -# [END spanner_v1_generated_InstanceAdmin_UpdateInstance_sync] diff --git a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/update_instance_config.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/update_instance_config.rb deleted file mode 100644 index 5483412c7a53..000000000000 --- a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/update_instance_config.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 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_InstanceAdmin_UpdateInstanceConfig_sync] -require "google/cloud/spanner/admin/instance/v1" - -## -# Snippet for the update_instance_config call in the InstanceAdmin 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::Admin::Instance::V1::InstanceAdmin::Client#update_instance_config. -# -def update_instance_config - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstanceConfigRequest.new - - # Call the update_instance_config method. - result = client.update_instance_config request - - # The returned object is of type Gapic::Operation. You can use it to - # check the status of an operation, cancel it, or wait for results. - # Here is how to wait for a response. - result.wait_until_done! timeout: 60 - if result.response? - p result.response - else - puts "No response received." - end -end -# [END spanner_v1_generated_InstanceAdmin_UpdateInstanceConfig_sync] diff --git a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/update_instance_partition.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/update_instance_partition.rb deleted file mode 100644 index 551be2fdd53f..000000000000 --- a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/update_instance_partition.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 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_InstanceAdmin_UpdateInstancePartition_sync] -require "google/cloud/spanner/admin/instance/v1" - -## -# Snippet for the update_instance_partition call in the InstanceAdmin 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::Admin::Instance::V1::InstanceAdmin::Client#update_instance_partition. -# -def update_instance_partition - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstancePartitionRequest.new - - # Call the update_instance_partition method. - result = client.update_instance_partition request - - # The returned object is of type Gapic::Operation. You can use it to - # check the status of an operation, cancel it, or wait for results. - # Here is how to wait for a response. - result.wait_until_done! timeout: 60 - if result.response? - p result.response - else - puts "No response received." - end -end -# [END spanner_v1_generated_InstanceAdmin_UpdateInstancePartition_sync] diff --git a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/snippet_metadata_google.spanner.admin.instance.v1.json b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/snippet_metadata_google.spanner.admin.instance.v1.json deleted file mode 100644 index d91b8bef1312..000000000000 --- a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/snippet_metadata_google.spanner.admin.instance.v1.json +++ /dev/null @@ -1,855 +0,0 @@ -{ - "client_library": { - "name": "google-cloud-spanner-admin-instance-v1", - "version": "", - "language": "RUBY", - "apis": [ - { - "id": "google.spanner.admin.instance.v1", - "version": "v1" - } - ] - }, - "snippets": [ - { - "region_tag": "spanner_v1_generated_InstanceAdmin_ListInstanceConfigs_sync", - "title": "Snippet for the list_instance_configs call in the InstanceAdmin service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#list_instance_configs.", - "file": "instance_admin/list_instance_configs.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_instance_configs", - "full_name": "::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#list_instance_configs", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigsResponse", - "client": { - "short_name": "InstanceAdmin::Client", - "full_name": "::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client" - }, - "method": { - "short_name": "ListInstanceConfigs", - "full_name": "google.spanner.admin.instance.v1.InstanceAdmin.ListInstanceConfigs", - "service": { - "short_name": "InstanceAdmin", - "full_name": "google.spanner.admin.instance.v1.InstanceAdmin" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "spanner_v1_generated_InstanceAdmin_GetInstanceConfig_sync", - "title": "Snippet for the get_instance_config call in the InstanceAdmin service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#get_instance_config.", - "file": "instance_admin/get_instance_config.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_instance_config", - "full_name": "::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#get_instance_config", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Spanner::Admin::Instance::V1::GetInstanceConfigRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig", - "client": { - "short_name": "InstanceAdmin::Client", - "full_name": "::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client" - }, - "method": { - "short_name": "GetInstanceConfig", - "full_name": "google.spanner.admin.instance.v1.InstanceAdmin.GetInstanceConfig", - "service": { - "short_name": "InstanceAdmin", - "full_name": "google.spanner.admin.instance.v1.InstanceAdmin" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "spanner_v1_generated_InstanceAdmin_CreateInstanceConfig_sync", - "title": "Snippet for the create_instance_config call in the InstanceAdmin service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#create_instance_config.", - "file": "instance_admin/create_instance_config.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_instance_config", - "full_name": "::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#create_instance_config", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstanceConfigRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "InstanceAdmin::Client", - "full_name": "::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client" - }, - "method": { - "short_name": "CreateInstanceConfig", - "full_name": "google.spanner.admin.instance.v1.InstanceAdmin.CreateInstanceConfig", - "service": { - "short_name": "InstanceAdmin", - "full_name": "google.spanner.admin.instance.v1.InstanceAdmin" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "spanner_v1_generated_InstanceAdmin_UpdateInstanceConfig_sync", - "title": "Snippet for the update_instance_config call in the InstanceAdmin service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#update_instance_config.", - "file": "instance_admin/update_instance_config.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_instance_config", - "full_name": "::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#update_instance_config", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstanceConfigRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "InstanceAdmin::Client", - "full_name": "::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client" - }, - "method": { - "short_name": "UpdateInstanceConfig", - "full_name": "google.spanner.admin.instance.v1.InstanceAdmin.UpdateInstanceConfig", - "service": { - "short_name": "InstanceAdmin", - "full_name": "google.spanner.admin.instance.v1.InstanceAdmin" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "spanner_v1_generated_InstanceAdmin_DeleteInstanceConfig_sync", - "title": "Snippet for the delete_instance_config call in the InstanceAdmin service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#delete_instance_config.", - "file": "instance_admin/delete_instance_config.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_instance_config", - "full_name": "::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#delete_instance_config", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Spanner::Admin::Instance::V1::DeleteInstanceConfigRequest", - "name": "request" - } - ], - "result_type": "::Google::Protobuf::Empty", - "client": { - "short_name": "InstanceAdmin::Client", - "full_name": "::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client" - }, - "method": { - "short_name": "DeleteInstanceConfig", - "full_name": "google.spanner.admin.instance.v1.InstanceAdmin.DeleteInstanceConfig", - "service": { - "short_name": "InstanceAdmin", - "full_name": "google.spanner.admin.instance.v1.InstanceAdmin" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "spanner_v1_generated_InstanceAdmin_ListInstanceConfigOperations_sync", - "title": "Snippet for the list_instance_config_operations call in the InstanceAdmin service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#list_instance_config_operations.", - "file": "instance_admin/list_instance_config_operations.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_instance_config_operations", - "full_name": "::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#list_instance_config_operations", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigOperationsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigOperationsResponse", - "client": { - "short_name": "InstanceAdmin::Client", - "full_name": "::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client" - }, - "method": { - "short_name": "ListInstanceConfigOperations", - "full_name": "google.spanner.admin.instance.v1.InstanceAdmin.ListInstanceConfigOperations", - "service": { - "short_name": "InstanceAdmin", - "full_name": "google.spanner.admin.instance.v1.InstanceAdmin" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "spanner_v1_generated_InstanceAdmin_ListInstances_sync", - "title": "Snippet for the list_instances call in the InstanceAdmin service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#list_instances.", - "file": "instance_admin/list_instances.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_instances", - "full_name": "::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#list_instances", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancesRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancesResponse", - "client": { - "short_name": "InstanceAdmin::Client", - "full_name": "::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client" - }, - "method": { - "short_name": "ListInstances", - "full_name": "google.spanner.admin.instance.v1.InstanceAdmin.ListInstances", - "service": { - "short_name": "InstanceAdmin", - "full_name": "google.spanner.admin.instance.v1.InstanceAdmin" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "spanner_v1_generated_InstanceAdmin_ListInstancePartitions_sync", - "title": "Snippet for the list_instance_partitions call in the InstanceAdmin service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#list_instance_partitions.", - "file": "instance_admin/list_instance_partitions.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_instance_partitions", - "full_name": "::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#list_instance_partitions", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionsResponse", - "client": { - "short_name": "InstanceAdmin::Client", - "full_name": "::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client" - }, - "method": { - "short_name": "ListInstancePartitions", - "full_name": "google.spanner.admin.instance.v1.InstanceAdmin.ListInstancePartitions", - "service": { - "short_name": "InstanceAdmin", - "full_name": "google.spanner.admin.instance.v1.InstanceAdmin" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "spanner_v1_generated_InstanceAdmin_GetInstance_sync", - "title": "Snippet for the get_instance call in the InstanceAdmin service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#get_instance.", - "file": "instance_admin/get_instance.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_instance", - "full_name": "::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#get_instance", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Spanner::Admin::Instance::V1::GetInstanceRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Spanner::Admin::Instance::V1::Instance", - "client": { - "short_name": "InstanceAdmin::Client", - "full_name": "::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client" - }, - "method": { - "short_name": "GetInstance", - "full_name": "google.spanner.admin.instance.v1.InstanceAdmin.GetInstance", - "service": { - "short_name": "InstanceAdmin", - "full_name": "google.spanner.admin.instance.v1.InstanceAdmin" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "spanner_v1_generated_InstanceAdmin_CreateInstance_sync", - "title": "Snippet for the create_instance call in the InstanceAdmin service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#create_instance.", - "file": "instance_admin/create_instance.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_instance", - "full_name": "::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#create_instance", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstanceRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "InstanceAdmin::Client", - "full_name": "::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client" - }, - "method": { - "short_name": "CreateInstance", - "full_name": "google.spanner.admin.instance.v1.InstanceAdmin.CreateInstance", - "service": { - "short_name": "InstanceAdmin", - "full_name": "google.spanner.admin.instance.v1.InstanceAdmin" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "spanner_v1_generated_InstanceAdmin_UpdateInstance_sync", - "title": "Snippet for the update_instance call in the InstanceAdmin service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#update_instance.", - "file": "instance_admin/update_instance.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_instance", - "full_name": "::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#update_instance", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstanceRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "InstanceAdmin::Client", - "full_name": "::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client" - }, - "method": { - "short_name": "UpdateInstance", - "full_name": "google.spanner.admin.instance.v1.InstanceAdmin.UpdateInstance", - "service": { - "short_name": "InstanceAdmin", - "full_name": "google.spanner.admin.instance.v1.InstanceAdmin" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "spanner_v1_generated_InstanceAdmin_DeleteInstance_sync", - "title": "Snippet for the delete_instance call in the InstanceAdmin service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#delete_instance.", - "file": "instance_admin/delete_instance.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_instance", - "full_name": "::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#delete_instance", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Spanner::Admin::Instance::V1::DeleteInstanceRequest", - "name": "request" - } - ], - "result_type": "::Google::Protobuf::Empty", - "client": { - "short_name": "InstanceAdmin::Client", - "full_name": "::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client" - }, - "method": { - "short_name": "DeleteInstance", - "full_name": "google.spanner.admin.instance.v1.InstanceAdmin.DeleteInstance", - "service": { - "short_name": "InstanceAdmin", - "full_name": "google.spanner.admin.instance.v1.InstanceAdmin" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "spanner_v1_generated_InstanceAdmin_SetIamPolicy_sync", - "title": "Snippet for the set_iam_policy call in the InstanceAdmin service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#set_iam_policy.", - "file": "instance_admin/set_iam_policy.rb", - "language": "RUBY", - "client_method": { - "short_name": "set_iam_policy", - "full_name": "::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#set_iam_policy", - "async": false, - "parameters": [ - { - "type": "::Google::Iam::V1::SetIamPolicyRequest", - "name": "request" - } - ], - "result_type": "::Google::Iam::V1::Policy", - "client": { - "short_name": "InstanceAdmin::Client", - "full_name": "::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client" - }, - "method": { - "short_name": "SetIamPolicy", - "full_name": "google.spanner.admin.instance.v1.InstanceAdmin.SetIamPolicy", - "service": { - "short_name": "InstanceAdmin", - "full_name": "google.spanner.admin.instance.v1.InstanceAdmin" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "spanner_v1_generated_InstanceAdmin_GetIamPolicy_sync", - "title": "Snippet for the get_iam_policy call in the InstanceAdmin service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#get_iam_policy.", - "file": "instance_admin/get_iam_policy.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_iam_policy", - "full_name": "::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#get_iam_policy", - "async": false, - "parameters": [ - { - "type": "::Google::Iam::V1::GetIamPolicyRequest", - "name": "request" - } - ], - "result_type": "::Google::Iam::V1::Policy", - "client": { - "short_name": "InstanceAdmin::Client", - "full_name": "::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client" - }, - "method": { - "short_name": "GetIamPolicy", - "full_name": "google.spanner.admin.instance.v1.InstanceAdmin.GetIamPolicy", - "service": { - "short_name": "InstanceAdmin", - "full_name": "google.spanner.admin.instance.v1.InstanceAdmin" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "spanner_v1_generated_InstanceAdmin_TestIamPermissions_sync", - "title": "Snippet for the test_iam_permissions call in the InstanceAdmin service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#test_iam_permissions.", - "file": "instance_admin/test_iam_permissions.rb", - "language": "RUBY", - "client_method": { - "short_name": "test_iam_permissions", - "full_name": "::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#test_iam_permissions", - "async": false, - "parameters": [ - { - "type": "::Google::Iam::V1::TestIamPermissionsRequest", - "name": "request" - } - ], - "result_type": "::Google::Iam::V1::TestIamPermissionsResponse", - "client": { - "short_name": "InstanceAdmin::Client", - "full_name": "::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client" - }, - "method": { - "short_name": "TestIamPermissions", - "full_name": "google.spanner.admin.instance.v1.InstanceAdmin.TestIamPermissions", - "service": { - "short_name": "InstanceAdmin", - "full_name": "google.spanner.admin.instance.v1.InstanceAdmin" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "spanner_v1_generated_InstanceAdmin_GetInstancePartition_sync", - "title": "Snippet for the get_instance_partition call in the InstanceAdmin service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#get_instance_partition.", - "file": "instance_admin/get_instance_partition.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_instance_partition", - "full_name": "::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#get_instance_partition", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Spanner::Admin::Instance::V1::GetInstancePartitionRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Spanner::Admin::Instance::V1::InstancePartition", - "client": { - "short_name": "InstanceAdmin::Client", - "full_name": "::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client" - }, - "method": { - "short_name": "GetInstancePartition", - "full_name": "google.spanner.admin.instance.v1.InstanceAdmin.GetInstancePartition", - "service": { - "short_name": "InstanceAdmin", - "full_name": "google.spanner.admin.instance.v1.InstanceAdmin" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "spanner_v1_generated_InstanceAdmin_CreateInstancePartition_sync", - "title": "Snippet for the create_instance_partition call in the InstanceAdmin service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#create_instance_partition.", - "file": "instance_admin/create_instance_partition.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_instance_partition", - "full_name": "::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#create_instance_partition", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstancePartitionRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "InstanceAdmin::Client", - "full_name": "::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client" - }, - "method": { - "short_name": "CreateInstancePartition", - "full_name": "google.spanner.admin.instance.v1.InstanceAdmin.CreateInstancePartition", - "service": { - "short_name": "InstanceAdmin", - "full_name": "google.spanner.admin.instance.v1.InstanceAdmin" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "spanner_v1_generated_InstanceAdmin_DeleteInstancePartition_sync", - "title": "Snippet for the delete_instance_partition call in the InstanceAdmin service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#delete_instance_partition.", - "file": "instance_admin/delete_instance_partition.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_instance_partition", - "full_name": "::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#delete_instance_partition", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Spanner::Admin::Instance::V1::DeleteInstancePartitionRequest", - "name": "request" - } - ], - "result_type": "::Google::Protobuf::Empty", - "client": { - "short_name": "InstanceAdmin::Client", - "full_name": "::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client" - }, - "method": { - "short_name": "DeleteInstancePartition", - "full_name": "google.spanner.admin.instance.v1.InstanceAdmin.DeleteInstancePartition", - "service": { - "short_name": "InstanceAdmin", - "full_name": "google.spanner.admin.instance.v1.InstanceAdmin" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "spanner_v1_generated_InstanceAdmin_UpdateInstancePartition_sync", - "title": "Snippet for the update_instance_partition call in the InstanceAdmin service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#update_instance_partition.", - "file": "instance_admin/update_instance_partition.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_instance_partition", - "full_name": "::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#update_instance_partition", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstancePartitionRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "InstanceAdmin::Client", - "full_name": "::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client" - }, - "method": { - "short_name": "UpdateInstancePartition", - "full_name": "google.spanner.admin.instance.v1.InstanceAdmin.UpdateInstancePartition", - "service": { - "short_name": "InstanceAdmin", - "full_name": "google.spanner.admin.instance.v1.InstanceAdmin" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "spanner_v1_generated_InstanceAdmin_ListInstancePartitionOperations_sync", - "title": "Snippet for the list_instance_partition_operations call in the InstanceAdmin service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#list_instance_partition_operations.", - "file": "instance_admin/list_instance_partition_operations.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_instance_partition_operations", - "full_name": "::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#list_instance_partition_operations", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionOperationsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionOperationsResponse", - "client": { - "short_name": "InstanceAdmin::Client", - "full_name": "::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client" - }, - "method": { - "short_name": "ListInstancePartitionOperations", - "full_name": "google.spanner.admin.instance.v1.InstanceAdmin.ListInstancePartitionOperations", - "service": { - "short_name": "InstanceAdmin", - "full_name": "google.spanner.admin.instance.v1.InstanceAdmin" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "spanner_v1_generated_InstanceAdmin_MoveInstance_sync", - "title": "Snippet for the move_instance call in the InstanceAdmin service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#move_instance.", - "file": "instance_admin/move_instance.rb", - "language": "RUBY", - "client_method": { - "short_name": "move_instance", - "full_name": "::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#move_instance", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Spanner::Admin::Instance::V1::MoveInstanceRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "InstanceAdmin::Client", - "full_name": "::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client" - }, - "method": { - "short_name": "MoveInstance", - "full_name": "google.spanner.admin.instance.v1.InstanceAdmin.MoveInstance", - "service": { - "short_name": "InstanceAdmin", - "full_name": "google.spanner.admin.instance.v1.InstanceAdmin" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - } - ] -} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/test/google/cloud/spanner/admin/instance/v1/instance_admin_operations_test.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/test/google/cloud/spanner/admin/instance/v1/instance_admin_operations_test.rb deleted file mode 100644 index faf591bc6e13..000000000000 --- a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/test/google/cloud/spanner/admin/instance/v1/instance_admin_operations_test.rb +++ /dev/null @@ -1,400 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 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/admin/instance/v1/spanner_instance_admin_pb" -require "google/spanner/admin/instance/v1/spanner_instance_admin_services_pb" -require "google/cloud/spanner/admin/instance/v1/instance_admin" - -class ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::OperationsTest < 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_list_operations - # Create GRPC objects. - grpc_response = ::Google::Longrunning::ListOperationsResponse.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" - filter = "hello world" - page_size = 42 - page_token = "hello world" - return_partial_success = true - - list_operations_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_operations, name - assert_kind_of ::Google::Longrunning::ListOperationsRequest, request - assert_equal "hello world", request["name"] - assert_equal "hello world", request["filter"] - assert_equal 42, request["page_size"] - assert_equal "hello world", request["page_token"] - assert_equal true, request["return_partial_success"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_operations_client_stub do - # Create client - client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success }) 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_operations name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success 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_operations ::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success) 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_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success }, 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_operations(::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success), 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_operations_client_stub.call_rpc_count - end - end - - def test_get_operation - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.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_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_operation, name - assert_kind_of ::Google::Longrunning::GetOperationRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_operation_client_stub do - # Create client - client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_operation({ name: name }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_operation name: name do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_operation ::Google::Longrunning::GetOperationRequest.new(name: name) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_operation({ name: name }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_operation(::Google::Longrunning::GetOperationRequest.new(name: name), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, get_operation_client_stub.call_rpc_count - end - end - - def test_delete_operation - # 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_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_operation, name - assert_kind_of ::Google::Longrunning::DeleteOperationRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_operation_client_stub do - # Create client - client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_operation({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.delete_operation name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.delete_operation ::Google::Longrunning::DeleteOperationRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.delete_operation({ 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_operation(::Google::Longrunning::DeleteOperationRequest.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_operation_client_stub.call_rpc_count - end - end - - def test_cancel_operation - # 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" - - cancel_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :cancel_operation, name - assert_kind_of ::Google::Longrunning::CancelOperationRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, cancel_operation_client_stub do - # Create client - client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.cancel_operation({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.cancel_operation name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.cancel_operation ::Google::Longrunning::CancelOperationRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.cancel_operation({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.cancel_operation(::Google::Longrunning::CancelOperationRequest.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, cancel_operation_client_stub.call_rpc_count - end - end - - def test_wait_operation - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.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" - timeout = {} - - wait_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :wait_operation, name - assert_kind_of ::Google::Longrunning::WaitOperationRequest, request - assert_equal "hello world", request["name"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Duration), request["timeout"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, wait_operation_client_stub do - # Create client - client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.wait_operation({ name: name, timeout: timeout }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.wait_operation name: name, timeout: timeout do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.wait_operation ::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.wait_operation({ name: name, timeout: timeout }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.wait_operation(::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, wait_operation_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::Admin::Instance::V1::InstanceAdmin::Operations.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::Admin::Instance::V1::InstanceAdmin::Operations::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/test/google/cloud/spanner/admin/instance/v1/instance_admin_paths_test.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/test/google/cloud/spanner/admin/instance/v1/instance_admin_paths_test.rb deleted file mode 100644 index b1cfcaafa442..000000000000 --- a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/test/google/cloud/spanner/admin/instance/v1/instance_admin_paths_test.rb +++ /dev/null @@ -1,91 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 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/admin/instance/v1/instance_admin" - -class ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::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_instance_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::Admin::Instance::V1::InstanceAdmin::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.instance_path project: "value0", instance: "value1" - assert_equal "projects/value0/instances/value1", path - end - end - - def test_instance_config_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::Admin::Instance::V1::InstanceAdmin::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.instance_config_path project: "value0", instance_config: "value1" - assert_equal "projects/value0/instanceConfigs/value1", path - end - end - - def test_instance_partition_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::Admin::Instance::V1::InstanceAdmin::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.instance_partition_path project: "value0", instance: "value1", instance_partition: "value2" - assert_equal "projects/value0/instances/value1/instancePartitions/value2", path - end - end - - def test_project_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::Admin::Instance::V1::InstanceAdmin::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.project_path project: "value0" - assert_equal "projects/value0", path - end - end -end diff --git a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/test/google/cloud/spanner/admin/instance/v1/instance_admin_rest_test.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/test/google/cloud/spanner/admin/instance/v1/instance_admin_rest_test.rb deleted file mode 100644 index faaff8aaf29e..000000000000 --- a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/test/google/cloud/spanner/admin/instance/v1/instance_admin_rest_test.rb +++ /dev/null @@ -1,1269 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 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/rest" -require "google/spanner/admin/instance/v1/spanner_instance_admin_pb" -require "google/cloud/spanner/admin/instance/v1/instance_admin/rest" - - -class ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::ClientTest < Minitest::Test - class ClientStub - attr_accessor :call_count, :requests - - def initialize response, &block - @response = response - @block = block - @call_count = 0 - @requests = [] - end - - def make_get_request uri:, params: {}, options: {}, method_name: nil - make_http_request :get, uri: uri, body: nil, params: params, options: options, method_name: method_name - end - - def make_delete_request uri:, params: {}, options: {}, method_name: nil - make_http_request :delete, uri: uri, body: nil, params: params, options: options, method_name: method_name - end - - def make_post_request uri:, body: nil, params: {}, options: {}, method_name: nil - make_http_request :post, uri: uri, body: body, params: params, options: options, method_name: method_name - end - - def make_patch_request uri:, body:, params: {}, options: {}, method_name: nil - make_http_request :patch, uri: uri, body: body, params: params, options: options, method_name: method_name - end - - def make_put_request uri:, body:, params: {}, options: {}, method_name: nil - make_http_request :put, uri: uri, body: body, params: params, options: options, method_name: method_name - end - - def make_http_request *args, **kwargs - @call_count += 1 - - @requests << @block&.call(*args, **kwargs) - - @response - 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_list_instance_configs - # Create test objects. - client_result = ::Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigsResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - page_size = 42 - page_token = "hello world" - - list_instance_configs_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::ServiceStub.stub :transcode_list_instance_configs_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_instance_configs_client_stub do - # Create client - client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_instance_configs({ parent: parent, page_size: page_size, page_token: page_token }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.list_instance_configs parent: parent, page_size: page_size, page_token: page_token do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.list_instance_configs ::Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigsRequest.new(parent: parent, page_size: page_size, page_token: page_token) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.list_instance_configs({ parent: parent, page_size: page_size, page_token: page_token }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.list_instance_configs(::Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigsRequest.new(parent: parent, page_size: page_size, page_token: page_token), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, list_instance_configs_client_stub.call_count - end - end - end - - def test_get_instance_config - # Create test objects. - client_result = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_instance_config_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::ServiceStub.stub :transcode_get_instance_config_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_instance_config_client_stub do - # Create client - client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_instance_config({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_instance_config name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_instance_config ::Google::Cloud::Spanner::Admin::Instance::V1::GetInstanceConfigRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_instance_config({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_instance_config(::Google::Cloud::Spanner::Admin::Instance::V1::GetInstanceConfigRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_instance_config_client_stub.call_count - end - end - end - - def test_create_instance_config - # Create test objects. - client_result = ::Google::Longrunning::Operation.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - instance_config_id = "hello world" - instance_config = {} - validate_only = true - - create_instance_config_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::ServiceStub.stub :transcode_create_instance_config_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_instance_config_client_stub do - # Create client - client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_instance_config({ parent: parent, instance_config_id: instance_config_id, instance_config: instance_config, validate_only: validate_only }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_instance_config parent: parent, instance_config_id: instance_config_id, instance_config: instance_config, validate_only: validate_only do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_instance_config ::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstanceConfigRequest.new(parent: parent, instance_config_id: instance_config_id, instance_config: instance_config, validate_only: validate_only) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_instance_config({ parent: parent, instance_config_id: instance_config_id, instance_config: instance_config, validate_only: validate_only }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_instance_config(::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstanceConfigRequest.new(parent: parent, instance_config_id: instance_config_id, instance_config: instance_config, validate_only: validate_only), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_instance_config_client_stub.call_count - end - end - end - - def test_update_instance_config - # Create test objects. - client_result = ::Google::Longrunning::Operation.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - instance_config = {} - update_mask = {} - validate_only = true - - update_instance_config_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::ServiceStub.stub :transcode_update_instance_config_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_instance_config_client_stub do - # Create client - client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_instance_config({ instance_config: instance_config, update_mask: update_mask, validate_only: validate_only }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_instance_config instance_config: instance_config, update_mask: update_mask, validate_only: validate_only do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_instance_config ::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstanceConfigRequest.new(instance_config: instance_config, update_mask: update_mask, validate_only: validate_only) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.update_instance_config({ instance_config: instance_config, update_mask: update_mask, validate_only: validate_only }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.update_instance_config(::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstanceConfigRequest.new(instance_config: instance_config, update_mask: update_mask, validate_only: validate_only), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, update_instance_config_client_stub.call_count - end - end - end - - def test_delete_instance_config - # Create test objects. - client_result = ::Google::Protobuf::Empty.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - etag = "hello world" - validate_only = true - - delete_instance_config_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::ServiceStub.stub :transcode_delete_instance_config_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_instance_config_client_stub do - # Create client - client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.delete_instance_config({ name: name, etag: etag, validate_only: validate_only }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.delete_instance_config name: name, etag: etag, validate_only: validate_only do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.delete_instance_config ::Google::Cloud::Spanner::Admin::Instance::V1::DeleteInstanceConfigRequest.new(name: name, etag: etag, validate_only: validate_only) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.delete_instance_config({ name: name, etag: etag, validate_only: validate_only }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.delete_instance_config(::Google::Cloud::Spanner::Admin::Instance::V1::DeleteInstanceConfigRequest.new(name: name, etag: etag, validate_only: validate_only), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, delete_instance_config_client_stub.call_count - end - end - end - - def test_list_instance_config_operations - # Create test objects. - client_result = ::Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigOperationsResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - filter = "hello world" - page_size = 42 - page_token = "hello world" - - list_instance_config_operations_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::ServiceStub.stub :transcode_list_instance_config_operations_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_instance_config_operations_client_stub do - # Create client - client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_instance_config_operations({ parent: parent, filter: filter, page_size: page_size, page_token: page_token }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.list_instance_config_operations parent: parent, filter: filter, page_size: page_size, page_token: page_token do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.list_instance_config_operations ::Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigOperationsRequest.new(parent: parent, filter: filter, page_size: page_size, page_token: page_token) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.list_instance_config_operations({ parent: parent, filter: filter, page_size: page_size, page_token: page_token }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.list_instance_config_operations(::Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigOperationsRequest.new(parent: parent, filter: filter, page_size: page_size, page_token: page_token), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, list_instance_config_operations_client_stub.call_count - end - end - end - - def test_list_instances - # Create test objects. - client_result = ::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancesResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - page_size = 42 - page_token = "hello world" - filter = "hello world" - instance_deadline = {} - - list_instances_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::ServiceStub.stub :transcode_list_instances_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_instances_client_stub do - # Create client - client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_instances({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, instance_deadline: instance_deadline }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.list_instances parent: parent, page_size: page_size, page_token: page_token, filter: filter, instance_deadline: instance_deadline do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.list_instances ::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancesRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, instance_deadline: instance_deadline) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.list_instances({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, instance_deadline: instance_deadline }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.list_instances(::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancesRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, instance_deadline: instance_deadline), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, list_instances_client_stub.call_count - end - end - end - - def test_list_instance_partitions - # Create test objects. - client_result = ::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionsResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - page_size = 42 - page_token = "hello world" - instance_partition_deadline = {} - - list_instance_partitions_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::ServiceStub.stub :transcode_list_instance_partitions_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_instance_partitions_client_stub do - # Create client - client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_instance_partitions({ parent: parent, page_size: page_size, page_token: page_token, instance_partition_deadline: instance_partition_deadline }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.list_instance_partitions parent: parent, page_size: page_size, page_token: page_token, instance_partition_deadline: instance_partition_deadline do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.list_instance_partitions ::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionsRequest.new(parent: parent, page_size: page_size, page_token: page_token, instance_partition_deadline: instance_partition_deadline) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.list_instance_partitions({ parent: parent, page_size: page_size, page_token: page_token, instance_partition_deadline: instance_partition_deadline }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.list_instance_partitions(::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionsRequest.new(parent: parent, page_size: page_size, page_token: page_token, instance_partition_deadline: instance_partition_deadline), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, list_instance_partitions_client_stub.call_count - end - end - end - - def test_get_instance - # Create test objects. - client_result = ::Google::Cloud::Spanner::Admin::Instance::V1::Instance.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - field_mask = {} - - get_instance_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::ServiceStub.stub :transcode_get_instance_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_instance_client_stub do - # Create client - client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_instance({ name: name, field_mask: field_mask }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_instance name: name, field_mask: field_mask do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_instance ::Google::Cloud::Spanner::Admin::Instance::V1::GetInstanceRequest.new(name: name, field_mask: field_mask) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_instance({ name: name, field_mask: field_mask }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_instance(::Google::Cloud::Spanner::Admin::Instance::V1::GetInstanceRequest.new(name: name, field_mask: field_mask), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_instance_client_stub.call_count - end - end - end - - def test_create_instance - # Create test objects. - client_result = ::Google::Longrunning::Operation.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - instance_id = "hello world" - instance = {} - - create_instance_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::ServiceStub.stub :transcode_create_instance_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_instance_client_stub do - # Create client - client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_instance({ parent: parent, instance_id: instance_id, instance: instance }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_instance parent: parent, instance_id: instance_id, instance: instance do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_instance ::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstanceRequest.new(parent: parent, instance_id: instance_id, instance: instance) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_instance({ parent: parent, instance_id: instance_id, instance: instance }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_instance(::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstanceRequest.new(parent: parent, instance_id: instance_id, instance: instance), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_instance_client_stub.call_count - end - end - end - - def test_update_instance - # Create test objects. - client_result = ::Google::Longrunning::Operation.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - instance = {} - field_mask = {} - - update_instance_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::ServiceStub.stub :transcode_update_instance_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_instance_client_stub do - # Create client - client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_instance({ instance: instance, field_mask: field_mask }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_instance instance: instance, field_mask: field_mask do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_instance ::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstanceRequest.new(instance: instance, field_mask: field_mask) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.update_instance({ instance: instance, field_mask: field_mask }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.update_instance(::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstanceRequest.new(instance: instance, field_mask: field_mask), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, update_instance_client_stub.call_count - end - end - end - - def test_delete_instance - # Create test objects. - client_result = ::Google::Protobuf::Empty.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - delete_instance_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::ServiceStub.stub :transcode_delete_instance_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_instance_client_stub do - # Create client - client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.delete_instance({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.delete_instance name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.delete_instance ::Google::Cloud::Spanner::Admin::Instance::V1::DeleteInstanceRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.delete_instance({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.delete_instance(::Google::Cloud::Spanner::Admin::Instance::V1::DeleteInstanceRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, delete_instance_client_stub.call_count - end - end - end - - def test_set_iam_policy - # Create test objects. - client_result = ::Google::Iam::V1::Policy.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - resource = "hello world" - policy = {} - update_mask = {} - - set_iam_policy_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::ServiceStub.stub :transcode_set_iam_policy_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, set_iam_policy_client_stub do - # Create client - client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.set_iam_policy({ resource: resource, policy: policy, update_mask: update_mask }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.set_iam_policy resource: resource, policy: policy, update_mask: update_mask do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.set_iam_policy ::Google::Iam::V1::SetIamPolicyRequest.new(resource: resource, policy: policy, update_mask: update_mask) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.set_iam_policy({ resource: resource, policy: policy, update_mask: update_mask }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.set_iam_policy(::Google::Iam::V1::SetIamPolicyRequest.new(resource: resource, policy: policy, update_mask: update_mask), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, set_iam_policy_client_stub.call_count - end - end - end - - def test_get_iam_policy - # Create test objects. - client_result = ::Google::Iam::V1::Policy.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - resource = "hello world" - options = {} - - get_iam_policy_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::ServiceStub.stub :transcode_get_iam_policy_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_iam_policy_client_stub do - # Create client - client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_iam_policy({ resource: resource, options: options }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_iam_policy resource: resource, options: options do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_iam_policy ::Google::Iam::V1::GetIamPolicyRequest.new(resource: resource, options: options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_iam_policy({ resource: resource, options: options }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_iam_policy(::Google::Iam::V1::GetIamPolicyRequest.new(resource: resource, options: options), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_iam_policy_client_stub.call_count - end - end - end - - def test_test_iam_permissions - # Create test objects. - client_result = ::Google::Iam::V1::TestIamPermissionsResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - resource = "hello world" - permissions = ["hello world"] - - test_iam_permissions_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::ServiceStub.stub :transcode_test_iam_permissions_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, test_iam_permissions_client_stub do - # Create client - client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.test_iam_permissions({ resource: resource, permissions: permissions }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.test_iam_permissions resource: resource, permissions: permissions do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.test_iam_permissions ::Google::Iam::V1::TestIamPermissionsRequest.new(resource: resource, permissions: permissions) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.test_iam_permissions({ resource: resource, permissions: permissions }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.test_iam_permissions(::Google::Iam::V1::TestIamPermissionsRequest.new(resource: resource, permissions: permissions), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, test_iam_permissions_client_stub.call_count - end - end - end - - def test_get_instance_partition - # Create test objects. - client_result = ::Google::Cloud::Spanner::Admin::Instance::V1::InstancePartition.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_instance_partition_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::ServiceStub.stub :transcode_get_instance_partition_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_instance_partition_client_stub do - # Create client - client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_instance_partition({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_instance_partition name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_instance_partition ::Google::Cloud::Spanner::Admin::Instance::V1::GetInstancePartitionRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_instance_partition({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_instance_partition(::Google::Cloud::Spanner::Admin::Instance::V1::GetInstancePartitionRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_instance_partition_client_stub.call_count - end - end - end - - def test_create_instance_partition - # Create test objects. - client_result = ::Google::Longrunning::Operation.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - instance_partition_id = "hello world" - instance_partition = {} - - create_instance_partition_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::ServiceStub.stub :transcode_create_instance_partition_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_instance_partition_client_stub do - # Create client - client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_instance_partition({ parent: parent, instance_partition_id: instance_partition_id, instance_partition: instance_partition }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_instance_partition parent: parent, instance_partition_id: instance_partition_id, instance_partition: instance_partition do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_instance_partition ::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstancePartitionRequest.new(parent: parent, instance_partition_id: instance_partition_id, instance_partition: instance_partition) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_instance_partition({ parent: parent, instance_partition_id: instance_partition_id, instance_partition: instance_partition }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_instance_partition(::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstancePartitionRequest.new(parent: parent, instance_partition_id: instance_partition_id, instance_partition: instance_partition), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_instance_partition_client_stub.call_count - end - end - end - - def test_delete_instance_partition - # Create test objects. - client_result = ::Google::Protobuf::Empty.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - etag = "hello world" - - delete_instance_partition_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::ServiceStub.stub :transcode_delete_instance_partition_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_instance_partition_client_stub do - # Create client - client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.delete_instance_partition({ name: name, etag: etag }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.delete_instance_partition name: name, etag: etag do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.delete_instance_partition ::Google::Cloud::Spanner::Admin::Instance::V1::DeleteInstancePartitionRequest.new(name: name, etag: etag) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.delete_instance_partition({ name: name, etag: etag }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.delete_instance_partition(::Google::Cloud::Spanner::Admin::Instance::V1::DeleteInstancePartitionRequest.new(name: name, etag: etag), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, delete_instance_partition_client_stub.call_count - end - end - end - - def test_update_instance_partition - # Create test objects. - client_result = ::Google::Longrunning::Operation.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - instance_partition = {} - field_mask = {} - - update_instance_partition_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::ServiceStub.stub :transcode_update_instance_partition_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_instance_partition_client_stub do - # Create client - client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_instance_partition({ instance_partition: instance_partition, field_mask: field_mask }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_instance_partition instance_partition: instance_partition, field_mask: field_mask do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_instance_partition ::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstancePartitionRequest.new(instance_partition: instance_partition, field_mask: field_mask) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.update_instance_partition({ instance_partition: instance_partition, field_mask: field_mask }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.update_instance_partition(::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstancePartitionRequest.new(instance_partition: instance_partition, field_mask: field_mask), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, update_instance_partition_client_stub.call_count - end - end - end - - def test_list_instance_partition_operations - # Create test objects. - client_result = ::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionOperationsResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - filter = "hello world" - page_size = 42 - page_token = "hello world" - instance_partition_deadline = {} - - list_instance_partition_operations_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::ServiceStub.stub :transcode_list_instance_partition_operations_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_instance_partition_operations_client_stub do - # Create client - client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_instance_partition_operations({ parent: parent, filter: filter, page_size: page_size, page_token: page_token, instance_partition_deadline: instance_partition_deadline }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.list_instance_partition_operations parent: parent, filter: filter, page_size: page_size, page_token: page_token, instance_partition_deadline: instance_partition_deadline do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.list_instance_partition_operations ::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionOperationsRequest.new(parent: parent, filter: filter, page_size: page_size, page_token: page_token, instance_partition_deadline: instance_partition_deadline) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.list_instance_partition_operations({ parent: parent, filter: filter, page_size: page_size, page_token: page_token, instance_partition_deadline: instance_partition_deadline }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.list_instance_partition_operations(::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionOperationsRequest.new(parent: parent, filter: filter, page_size: page_size, page_token: page_token, instance_partition_deadline: instance_partition_deadline), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, list_instance_partition_operations_client_stub.call_count - end - end - end - - def test_move_instance - # Create test objects. - client_result = ::Google::Longrunning::Operation.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - target_config = "hello world" - - move_instance_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::ServiceStub.stub :transcode_move_instance_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, move_instance_client_stub do - # Create client - client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.move_instance({ name: name, target_config: target_config }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.move_instance name: name, target_config: target_config do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.move_instance ::Google::Cloud::Spanner::Admin::Instance::V1::MoveInstanceRequest.new(name: name, target_config: target_config) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.move_instance({ name: name, target_config: target_config }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.move_instance(::Google::Cloud::Spanner::Admin::Instance::V1::MoveInstanceRequest.new(name: name, target_config: target_config), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, move_instance_client_stub.call_count - end - end - end - - def test_configure - credentials_token = :dummy_value - - client = block_config = config = nil - dummy_stub = ClientStub.new nil - Gapic::Rest::ClientStub.stub :new, dummy_stub do - client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::Client.new do |config| - config.credentials = credentials_token - end - end - - config = client.configure do |c| - block_config = c - end - - assert_same block_config, config - assert_kind_of ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::Client::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/test/google/cloud/spanner/admin/instance/v1/instance_admin_test.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/test/google/cloud/spanner/admin/instance/v1/instance_admin_test.rb deleted file mode 100644 index 7667c086ab44..000000000000 --- a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/test/google/cloud/spanner/admin/instance/v1/instance_admin_test.rb +++ /dev/null @@ -1,1468 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 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/admin/instance/v1/spanner_instance_admin_pb" -require "google/cloud/spanner/admin/instance/v1/instance_admin" - -class ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::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_list_instance_configs - # Create GRPC objects. - grpc_response = ::Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigsResponse.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. - parent = "hello world" - page_size = 42 - page_token = "hello world" - - list_instance_configs_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_instance_configs, name - assert_kind_of ::Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigsRequest, request - assert_equal "hello world", request["parent"] - assert_equal 42, request["page_size"] - assert_equal "hello world", request["page_token"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_instance_configs_client_stub do - # Create client - client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_instance_configs({ parent: parent, page_size: page_size, page_token: page_token }) 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_instance_configs parent: parent, page_size: page_size, page_token: page_token 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_instance_configs ::Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigsRequest.new(parent: parent, page_size: page_size, page_token: page_token) 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_instance_configs({ parent: parent, page_size: page_size, page_token: page_token }, 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_instance_configs(::Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigsRequest.new(parent: parent, page_size: page_size, page_token: page_token), 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_instance_configs_client_stub.call_rpc_count - end - end - - def test_get_instance_config - # Create GRPC objects. - grpc_response = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig.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_instance_config_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_instance_config, name - assert_kind_of ::Google::Cloud::Spanner::Admin::Instance::V1::GetInstanceConfigRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_instance_config_client_stub do - # Create client - client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_instance_config({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_instance_config name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_instance_config ::Google::Cloud::Spanner::Admin::Instance::V1::GetInstanceConfigRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_instance_config({ 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_instance_config(::Google::Cloud::Spanner::Admin::Instance::V1::GetInstanceConfigRequest.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_instance_config_client_stub.call_rpc_count - end - end - - def test_create_instance_config - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.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. - parent = "hello world" - instance_config_id = "hello world" - instance_config = {} - validate_only = true - - create_instance_config_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_instance_config, name - assert_kind_of ::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstanceConfigRequest, request - assert_equal "hello world", request["parent"] - assert_equal "hello world", request["instance_config_id"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig), request["instance_config"] - assert_equal true, request["validate_only"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_instance_config_client_stub do - # Create client - client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_instance_config({ parent: parent, instance_config_id: instance_config_id, instance_config: instance_config, validate_only: validate_only }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.create_instance_config parent: parent, instance_config_id: instance_config_id, instance_config: instance_config, validate_only: validate_only do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.create_instance_config ::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstanceConfigRequest.new(parent: parent, instance_config_id: instance_config_id, instance_config: instance_config, validate_only: validate_only) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.create_instance_config({ parent: parent, instance_config_id: instance_config_id, instance_config: instance_config, validate_only: validate_only }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.create_instance_config(::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstanceConfigRequest.new(parent: parent, instance_config_id: instance_config_id, instance_config: instance_config, validate_only: validate_only), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, create_instance_config_client_stub.call_rpc_count - end - end - - def test_update_instance_config - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.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. - instance_config = {} - update_mask = {} - validate_only = true - - update_instance_config_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_instance_config, name - assert_kind_of ::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstanceConfigRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig), request["instance_config"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - assert_equal true, request["validate_only"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_instance_config_client_stub do - # Create client - client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_instance_config({ instance_config: instance_config, update_mask: update_mask, validate_only: validate_only }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.update_instance_config instance_config: instance_config, update_mask: update_mask, validate_only: validate_only do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.update_instance_config ::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstanceConfigRequest.new(instance_config: instance_config, update_mask: update_mask, validate_only: validate_only) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.update_instance_config({ instance_config: instance_config, update_mask: update_mask, validate_only: validate_only }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.update_instance_config(::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstanceConfigRequest.new(instance_config: instance_config, update_mask: update_mask, validate_only: validate_only), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, update_instance_config_client_stub.call_rpc_count - end - end - - def test_delete_instance_config - # 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" - etag = "hello world" - validate_only = true - - delete_instance_config_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_instance_config, name - assert_kind_of ::Google::Cloud::Spanner::Admin::Instance::V1::DeleteInstanceConfigRequest, request - assert_equal "hello world", request["name"] - assert_equal "hello world", request["etag"] - assert_equal true, request["validate_only"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_instance_config_client_stub do - # Create client - client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_instance_config({ name: name, etag: etag, validate_only: validate_only }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.delete_instance_config name: name, etag: etag, validate_only: validate_only do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.delete_instance_config ::Google::Cloud::Spanner::Admin::Instance::V1::DeleteInstanceConfigRequest.new(name: name, etag: etag, validate_only: validate_only) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.delete_instance_config({ name: name, etag: etag, validate_only: validate_only }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.delete_instance_config(::Google::Cloud::Spanner::Admin::Instance::V1::DeleteInstanceConfigRequest.new(name: name, etag: etag, validate_only: validate_only), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, delete_instance_config_client_stub.call_rpc_count - end - end - - def test_list_instance_config_operations - # Create GRPC objects. - grpc_response = ::Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigOperationsResponse.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. - parent = "hello world" - filter = "hello world" - page_size = 42 - page_token = "hello world" - - list_instance_config_operations_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_instance_config_operations, name - assert_kind_of ::Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigOperationsRequest, request - assert_equal "hello world", request["parent"] - assert_equal "hello world", request["filter"] - assert_equal 42, request["page_size"] - assert_equal "hello world", request["page_token"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_instance_config_operations_client_stub do - # Create client - client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_instance_config_operations({ parent: parent, filter: filter, page_size: page_size, page_token: page_token }) 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_instance_config_operations parent: parent, filter: filter, page_size: page_size, page_token: page_token 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_instance_config_operations ::Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigOperationsRequest.new(parent: parent, filter: filter, page_size: page_size, page_token: page_token) 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_instance_config_operations({ parent: parent, filter: filter, page_size: page_size, page_token: page_token }, 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_instance_config_operations(::Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigOperationsRequest.new(parent: parent, filter: filter, page_size: page_size, page_token: page_token), 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_instance_config_operations_client_stub.call_rpc_count - end - end - - def test_list_instances - # Create GRPC objects. - grpc_response = ::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancesResponse.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. - parent = "hello world" - page_size = 42 - page_token = "hello world" - filter = "hello world" - instance_deadline = {} - - list_instances_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_instances, name - assert_kind_of ::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancesRequest, request - assert_equal "hello world", request["parent"] - assert_equal 42, request["page_size"] - assert_equal "hello world", request["page_token"] - assert_equal "hello world", request["filter"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Timestamp), request["instance_deadline"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_instances_client_stub do - # Create client - client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_instances({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, instance_deadline: instance_deadline }) 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_instances parent: parent, page_size: page_size, page_token: page_token, filter: filter, instance_deadline: instance_deadline 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_instances ::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancesRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, instance_deadline: instance_deadline) 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_instances({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, instance_deadline: instance_deadline }, 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_instances(::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancesRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, instance_deadline: instance_deadline), 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_instances_client_stub.call_rpc_count - end - end - - def test_list_instance_partitions - # Create GRPC objects. - grpc_response = ::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionsResponse.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. - parent = "hello world" - page_size = 42 - page_token = "hello world" - instance_partition_deadline = {} - - list_instance_partitions_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_instance_partitions, name - assert_kind_of ::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionsRequest, request - assert_equal "hello world", request["parent"] - assert_equal 42, request["page_size"] - assert_equal "hello world", request["page_token"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Timestamp), request["instance_partition_deadline"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_instance_partitions_client_stub do - # Create client - client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_instance_partitions({ parent: parent, page_size: page_size, page_token: page_token, instance_partition_deadline: instance_partition_deadline }) 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_instance_partitions parent: parent, page_size: page_size, page_token: page_token, instance_partition_deadline: instance_partition_deadline 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_instance_partitions ::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionsRequest.new(parent: parent, page_size: page_size, page_token: page_token, instance_partition_deadline: instance_partition_deadline) 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_instance_partitions({ parent: parent, page_size: page_size, page_token: page_token, instance_partition_deadline: instance_partition_deadline }, 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_instance_partitions(::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionsRequest.new(parent: parent, page_size: page_size, page_token: page_token, instance_partition_deadline: instance_partition_deadline), 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_instance_partitions_client_stub.call_rpc_count - end - end - - def test_get_instance - # Create GRPC objects. - grpc_response = ::Google::Cloud::Spanner::Admin::Instance::V1::Instance.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" - field_mask = {} - - get_instance_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_instance, name - assert_kind_of ::Google::Cloud::Spanner::Admin::Instance::V1::GetInstanceRequest, request - assert_equal "hello world", request["name"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["field_mask"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_instance_client_stub do - # Create client - client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_instance({ name: name, field_mask: field_mask }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_instance name: name, field_mask: field_mask do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_instance ::Google::Cloud::Spanner::Admin::Instance::V1::GetInstanceRequest.new(name: name, field_mask: field_mask) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_instance({ name: name, field_mask: field_mask }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_instance(::Google::Cloud::Spanner::Admin::Instance::V1::GetInstanceRequest.new(name: name, field_mask: field_mask), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, get_instance_client_stub.call_rpc_count - end - end - - def test_create_instance - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.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. - parent = "hello world" - instance_id = "hello world" - instance = {} - - create_instance_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_instance, name - assert_kind_of ::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstanceRequest, request - assert_equal "hello world", request["parent"] - assert_equal "hello world", request["instance_id"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Spanner::Admin::Instance::V1::Instance), request["instance"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_instance_client_stub do - # Create client - client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_instance({ parent: parent, instance_id: instance_id, instance: instance }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.create_instance parent: parent, instance_id: instance_id, instance: instance do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.create_instance ::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstanceRequest.new(parent: parent, instance_id: instance_id, instance: instance) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.create_instance({ parent: parent, instance_id: instance_id, instance: instance }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.create_instance(::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstanceRequest.new(parent: parent, instance_id: instance_id, instance: instance), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, create_instance_client_stub.call_rpc_count - end - end - - def test_update_instance - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.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. - instance = {} - field_mask = {} - - update_instance_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_instance, name - assert_kind_of ::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstanceRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Spanner::Admin::Instance::V1::Instance), request["instance"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["field_mask"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_instance_client_stub do - # Create client - client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_instance({ instance: instance, field_mask: field_mask }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.update_instance instance: instance, field_mask: field_mask do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.update_instance ::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstanceRequest.new(instance: instance, field_mask: field_mask) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.update_instance({ instance: instance, field_mask: field_mask }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.update_instance(::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstanceRequest.new(instance: instance, field_mask: field_mask), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, update_instance_client_stub.call_rpc_count - end - end - - def test_delete_instance - # 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_instance_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_instance, name - assert_kind_of ::Google::Cloud::Spanner::Admin::Instance::V1::DeleteInstanceRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_instance_client_stub do - # Create client - client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_instance({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.delete_instance name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.delete_instance ::Google::Cloud::Spanner::Admin::Instance::V1::DeleteInstanceRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.delete_instance({ 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_instance(::Google::Cloud::Spanner::Admin::Instance::V1::DeleteInstanceRequest.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_instance_client_stub.call_rpc_count - end - end - - def test_set_iam_policy - # Create GRPC objects. - grpc_response = ::Google::Iam::V1::Policy.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. - resource = "hello world" - policy = {} - update_mask = {} - - set_iam_policy_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :set_iam_policy, name - assert_kind_of ::Google::Iam::V1::SetIamPolicyRequest, request - assert_equal "hello world", request["resource"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Iam::V1::Policy), request["policy"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, set_iam_policy_client_stub do - # Create client - client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.set_iam_policy({ resource: resource, policy: policy, update_mask: update_mask }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.set_iam_policy resource: resource, policy: policy, update_mask: update_mask do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.set_iam_policy ::Google::Iam::V1::SetIamPolicyRequest.new(resource: resource, policy: policy, update_mask: update_mask) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.set_iam_policy({ resource: resource, policy: policy, update_mask: update_mask }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.set_iam_policy(::Google::Iam::V1::SetIamPolicyRequest.new(resource: resource, policy: policy, update_mask: update_mask), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, set_iam_policy_client_stub.call_rpc_count - end - end - - def test_get_iam_policy - # Create GRPC objects. - grpc_response = ::Google::Iam::V1::Policy.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. - resource = "hello world" - options = {} - - get_iam_policy_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_iam_policy, name - assert_kind_of ::Google::Iam::V1::GetIamPolicyRequest, request - assert_equal "hello world", request["resource"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Iam::V1::GetPolicyOptions), request["options"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_iam_policy_client_stub do - # Create client - client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_iam_policy({ resource: resource, options: options }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_iam_policy resource: resource, options: options do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_iam_policy ::Google::Iam::V1::GetIamPolicyRequest.new(resource: resource, options: options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_iam_policy({ resource: resource, options: options }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_iam_policy(::Google::Iam::V1::GetIamPolicyRequest.new(resource: resource, options: options), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, get_iam_policy_client_stub.call_rpc_count - end - end - - def test_test_iam_permissions - # Create GRPC objects. - grpc_response = ::Google::Iam::V1::TestIamPermissionsResponse.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. - resource = "hello world" - permissions = ["hello world"] - - test_iam_permissions_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :test_iam_permissions, name - assert_kind_of ::Google::Iam::V1::TestIamPermissionsRequest, request - assert_equal "hello world", request["resource"] - assert_equal ["hello world"], request["permissions"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, test_iam_permissions_client_stub do - # Create client - client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.test_iam_permissions({ resource: resource, permissions: permissions }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.test_iam_permissions resource: resource, permissions: permissions do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.test_iam_permissions ::Google::Iam::V1::TestIamPermissionsRequest.new(resource: resource, permissions: permissions) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.test_iam_permissions({ resource: resource, permissions: permissions }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.test_iam_permissions(::Google::Iam::V1::TestIamPermissionsRequest.new(resource: resource, permissions: permissions), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, test_iam_permissions_client_stub.call_rpc_count - end - end - - def test_get_instance_partition - # Create GRPC objects. - grpc_response = ::Google::Cloud::Spanner::Admin::Instance::V1::InstancePartition.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_instance_partition_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_instance_partition, name - assert_kind_of ::Google::Cloud::Spanner::Admin::Instance::V1::GetInstancePartitionRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_instance_partition_client_stub do - # Create client - client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_instance_partition({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_instance_partition name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_instance_partition ::Google::Cloud::Spanner::Admin::Instance::V1::GetInstancePartitionRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_instance_partition({ 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_instance_partition(::Google::Cloud::Spanner::Admin::Instance::V1::GetInstancePartitionRequest.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_instance_partition_client_stub.call_rpc_count - end - end - - def test_create_instance_partition - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.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. - parent = "hello world" - instance_partition_id = "hello world" - instance_partition = {} - - create_instance_partition_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_instance_partition, name - assert_kind_of ::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstancePartitionRequest, request - assert_equal "hello world", request["parent"] - assert_equal "hello world", request["instance_partition_id"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Spanner::Admin::Instance::V1::InstancePartition), request["instance_partition"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_instance_partition_client_stub do - # Create client - client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_instance_partition({ parent: parent, instance_partition_id: instance_partition_id, instance_partition: instance_partition }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.create_instance_partition parent: parent, instance_partition_id: instance_partition_id, instance_partition: instance_partition do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.create_instance_partition ::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstancePartitionRequest.new(parent: parent, instance_partition_id: instance_partition_id, instance_partition: instance_partition) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.create_instance_partition({ parent: parent, instance_partition_id: instance_partition_id, instance_partition: instance_partition }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.create_instance_partition(::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstancePartitionRequest.new(parent: parent, instance_partition_id: instance_partition_id, instance_partition: instance_partition), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, create_instance_partition_client_stub.call_rpc_count - end - end - - def test_delete_instance_partition - # 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" - etag = "hello world" - - delete_instance_partition_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_instance_partition, name - assert_kind_of ::Google::Cloud::Spanner::Admin::Instance::V1::DeleteInstancePartitionRequest, request - assert_equal "hello world", request["name"] - assert_equal "hello world", request["etag"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_instance_partition_client_stub do - # Create client - client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_instance_partition({ name: name, etag: etag }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.delete_instance_partition name: name, etag: etag do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.delete_instance_partition ::Google::Cloud::Spanner::Admin::Instance::V1::DeleteInstancePartitionRequest.new(name: name, etag: etag) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.delete_instance_partition({ name: name, etag: etag }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.delete_instance_partition(::Google::Cloud::Spanner::Admin::Instance::V1::DeleteInstancePartitionRequest.new(name: name, etag: etag), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, delete_instance_partition_client_stub.call_rpc_count - end - end - - def test_update_instance_partition - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.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. - instance_partition = {} - field_mask = {} - - update_instance_partition_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_instance_partition, name - assert_kind_of ::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstancePartitionRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Spanner::Admin::Instance::V1::InstancePartition), request["instance_partition"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["field_mask"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_instance_partition_client_stub do - # Create client - client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_instance_partition({ instance_partition: instance_partition, field_mask: field_mask }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.update_instance_partition instance_partition: instance_partition, field_mask: field_mask do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.update_instance_partition ::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstancePartitionRequest.new(instance_partition: instance_partition, field_mask: field_mask) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.update_instance_partition({ instance_partition: instance_partition, field_mask: field_mask }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.update_instance_partition(::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstancePartitionRequest.new(instance_partition: instance_partition, field_mask: field_mask), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, update_instance_partition_client_stub.call_rpc_count - end - end - - def test_list_instance_partition_operations - # Create GRPC objects. - grpc_response = ::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionOperationsResponse.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. - parent = "hello world" - filter = "hello world" - page_size = 42 - page_token = "hello world" - instance_partition_deadline = {} - - list_instance_partition_operations_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_instance_partition_operations, name - assert_kind_of ::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionOperationsRequest, request - assert_equal "hello world", request["parent"] - assert_equal "hello world", request["filter"] - assert_equal 42, request["page_size"] - assert_equal "hello world", request["page_token"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Timestamp), request["instance_partition_deadline"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_instance_partition_operations_client_stub do - # Create client - client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_instance_partition_operations({ parent: parent, filter: filter, page_size: page_size, page_token: page_token, instance_partition_deadline: instance_partition_deadline }) 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_instance_partition_operations parent: parent, filter: filter, page_size: page_size, page_token: page_token, instance_partition_deadline: instance_partition_deadline 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_instance_partition_operations ::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionOperationsRequest.new(parent: parent, filter: filter, page_size: page_size, page_token: page_token, instance_partition_deadline: instance_partition_deadline) 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_instance_partition_operations({ parent: parent, filter: filter, page_size: page_size, page_token: page_token, instance_partition_deadline: instance_partition_deadline }, 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_instance_partition_operations(::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionOperationsRequest.new(parent: parent, filter: filter, page_size: page_size, page_token: page_token, instance_partition_deadline: instance_partition_deadline), 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_instance_partition_operations_client_stub.call_rpc_count - end - end - - def test_move_instance - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.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" - target_config = "hello world" - - move_instance_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :move_instance, name - assert_kind_of ::Google::Cloud::Spanner::Admin::Instance::V1::MoveInstanceRequest, request - assert_equal "hello world", request["name"] - assert_equal "hello world", request["target_config"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, move_instance_client_stub do - # Create client - client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.move_instance({ name: name, target_config: target_config }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.move_instance name: name, target_config: target_config do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.move_instance ::Google::Cloud::Spanner::Admin::Instance::V1::MoveInstanceRequest.new(name: name, target_config: target_config) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.move_instance({ name: name, target_config: target_config }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.move_instance(::Google::Cloud::Spanner::Admin::Instance::V1::MoveInstanceRequest.new(name: name, target_config: target_config), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, move_instance_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::Admin::Instance::V1::InstanceAdmin::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::Admin::Instance::V1::InstanceAdmin::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::Admin::Instance::V1::InstanceAdmin::Client.new do |config| - config.credentials = creds - end - assert_kind_of ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client, client - assert_equal creds, client.configure.credentials - end - end - - def test_operations_client - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - - client = nil - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new do |config| - config.credentials = grpc_channel - end - end - - assert_kind_of ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Operations, client.operations_client - end -end diff --git a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/test/helper.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/test/helper.rb deleted file mode 100644 index 968201e8049d..000000000000 --- a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/test/helper.rb +++ /dev/null @@ -1,25 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 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"