From 02aa4105191a5ada6132a085d98f66c02a587490 Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Mon, 25 Mar 2024 18:56:57 +0000 Subject: [PATCH 1/2] feat: add Vector Index API PiperOrigin-RevId: 618867415 Source-Link: https://github.com/googleapis/googleapis/commit/277145d108819fa30fbed3a7cbbb50f91eb6155e Source-Link: https://github.com/googleapis/googleapis-gen/commit/adcd3076784b5ae4e53a7b9be15d7720c2c07de7 Copy-Tag: eyJwIjoiZ29vZ2xlLWNsb3VkLWZpcmVzdG9yZS1hZG1pbi12MS8uT3dsQm90LnlhbWwiLCJoIjoiYWRjZDMwNzY3ODRiNWFlNGU1M2E3YjliZTE1ZDc3MjBjMmMwN2RlNyJ9 --- .../.gitignore | 22 + .../.repo-metadata.json | 18 + .../.rubocop.yml | 33 + .../google-cloud-firestore-admin-v1/.toys.rb | 28 + .../google-cloud-firestore-admin-v1/.yardopts | 12 + .../AUTHENTICATION.md | 122 + .../CHANGELOG.md | 2 + .../google-cloud-firestore-admin-v1/Gemfile | 11 + .../LICENSE.md | 201 ++ .../google-cloud-firestore-admin-v1/README.md | 144 + .../google-cloud-firestore-admin-v1/Rakefile | 169 + .../gapic_metadata.json | 133 + .../google-cloud-firestore-admin-v1.gemspec | 29 + .../lib/google-cloud-firestore-admin-v1.rb | 21 + .../lib/google/cloud/firestore/admin/v1.rb | 47 + .../firestore/admin/v1/firestore_admin.rb | 85 + .../admin/v1/firestore_admin/client.rb | 2806 +++++++++++++++++ .../admin/v1/firestore_admin/credentials.rb | 54 + .../admin/v1/firestore_admin/operations.rb | 803 +++++ .../admin/v1/firestore_admin/paths.rb | 182 ++ .../admin/v1/firestore_admin/rest.rb | 82 + .../admin/v1/firestore_admin/rest/client.rb | 2619 +++++++++++++++ .../v1/firestore_admin/rest/operations.rb | 897 ++++++ .../v1/firestore_admin/rest/service_stub.rb | 1437 +++++++++ .../google/cloud/firestore/admin/v1/rest.rb | 39 + .../cloud/firestore/admin/v1/version.rb | 30 + .../google/firestore/admin/v1/backup_pb.rb | 51 + .../google/firestore/admin/v1/database_pb.rb | 56 + .../lib/google/firestore/admin/v1/field_pb.rb | 52 + .../firestore/admin/v1/firestore_admin_pb.rb | 96 + .../admin/v1/firestore_admin_services_pb.rb | 178 ++ .../lib/google/firestore/admin/v1/index_pb.rb | 55 + .../google/firestore/admin/v1/location_pb.rb | 44 + .../google/firestore/admin/v1/operation_pb.rb | 61 + .../google/firestore/admin/v1/schedule_pb.rb | 54 + .../proto_docs/README.md | 4 + .../proto_docs/google/api/client.rb | 399 +++ .../proto_docs/google/api/field_behavior.rb | 85 + .../proto_docs/google/api/launch_stage.rb | 71 + .../proto_docs/google/api/resource.rb | 222 ++ .../google/firestore/admin/v1/backup.rb | 99 + .../google/firestore/admin/v1/database.rb | 197 ++ .../google/firestore/admin/v1/field.rb | 138 + .../firestore/admin/v1/firestore_admin.rb | 509 +++ .../google/firestore/admin/v1/index.rb | 198 ++ .../google/firestore/admin/v1/location.rb | 35 + .../google/firestore/admin/v1/operation.rb | 288 ++ .../google/firestore/admin/v1/schedule.rb | 88 + .../google/longrunning/operations.rb | 164 + .../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 + .../proto_docs/google/type/dayofweek.rb | 49 + .../snippets/Gemfile | 32 + .../firestore_admin/create_backup_schedule.rb | 47 + .../firestore_admin/create_database.rb | 54 + .../snippets/firestore_admin/create_index.rb | 54 + .../snippets/firestore_admin/delete_backup.rb | 47 + .../firestore_admin/delete_backup_schedule.rb | 47 + .../firestore_admin/delete_database.rb | 54 + .../snippets/firestore_admin/delete_index.rb | 47 + .../firestore_admin/export_documents.rb | 54 + .../snippets/firestore_admin/get_backup.rb | 47 + .../firestore_admin/get_backup_schedule.rb | 47 + .../snippets/firestore_admin/get_database.rb | 47 + .../snippets/firestore_admin/get_field.rb | 47 + .../snippets/firestore_admin/get_index.rb | 47 + .../firestore_admin/import_documents.rb | 54 + .../firestore_admin/list_backup_schedules.rb | 47 + .../snippets/firestore_admin/list_backups.rb | 47 + .../firestore_admin/list_databases.rb | 47 + .../snippets/firestore_admin/list_fields.rb | 51 + .../snippets/firestore_admin/list_indexes.rb | 51 + .../firestore_admin/restore_database.rb | 54 + .../firestore_admin/update_backup_schedule.rb | 47 + .../firestore_admin/update_database.rb | 54 + .../snippets/firestore_admin/update_field.rb | 54 + ...et_metadata_google.firestore.admin.v1.json | 935 ++++++ .../v1/firestore_admin_operations_test.rb | 389 +++ .../admin/v1/firestore_admin_paths_test.rb | 131 + .../admin/v1/firestore_admin_rest_test.rb | 1356 ++++++++ .../admin/v1/firestore_admin_test.rb | 1520 +++++++++ .../test/helper.rb | 23 + 86 files changed, 19431 insertions(+) create mode 100644 owl-bot-staging/google-cloud-firestore-admin-v1/.gitignore create mode 100644 owl-bot-staging/google-cloud-firestore-admin-v1/.repo-metadata.json create mode 100644 owl-bot-staging/google-cloud-firestore-admin-v1/.rubocop.yml create mode 100644 owl-bot-staging/google-cloud-firestore-admin-v1/.toys.rb create mode 100644 owl-bot-staging/google-cloud-firestore-admin-v1/.yardopts create mode 100644 owl-bot-staging/google-cloud-firestore-admin-v1/AUTHENTICATION.md create mode 100644 owl-bot-staging/google-cloud-firestore-admin-v1/CHANGELOG.md create mode 100644 owl-bot-staging/google-cloud-firestore-admin-v1/Gemfile create mode 100644 owl-bot-staging/google-cloud-firestore-admin-v1/LICENSE.md create mode 100644 owl-bot-staging/google-cloud-firestore-admin-v1/README.md create mode 100644 owl-bot-staging/google-cloud-firestore-admin-v1/Rakefile create mode 100644 owl-bot-staging/google-cloud-firestore-admin-v1/gapic_metadata.json create mode 100644 owl-bot-staging/google-cloud-firestore-admin-v1/google-cloud-firestore-admin-v1.gemspec create mode 100644 owl-bot-staging/google-cloud-firestore-admin-v1/lib/google-cloud-firestore-admin-v1.rb create mode 100644 owl-bot-staging/google-cloud-firestore-admin-v1/lib/google/cloud/firestore/admin/v1.rb create mode 100644 owl-bot-staging/google-cloud-firestore-admin-v1/lib/google/cloud/firestore/admin/v1/firestore_admin.rb create mode 100644 owl-bot-staging/google-cloud-firestore-admin-v1/lib/google/cloud/firestore/admin/v1/firestore_admin/client.rb create mode 100644 owl-bot-staging/google-cloud-firestore-admin-v1/lib/google/cloud/firestore/admin/v1/firestore_admin/credentials.rb create mode 100644 owl-bot-staging/google-cloud-firestore-admin-v1/lib/google/cloud/firestore/admin/v1/firestore_admin/operations.rb create mode 100644 owl-bot-staging/google-cloud-firestore-admin-v1/lib/google/cloud/firestore/admin/v1/firestore_admin/paths.rb create mode 100644 owl-bot-staging/google-cloud-firestore-admin-v1/lib/google/cloud/firestore/admin/v1/firestore_admin/rest.rb create mode 100644 owl-bot-staging/google-cloud-firestore-admin-v1/lib/google/cloud/firestore/admin/v1/firestore_admin/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-firestore-admin-v1/lib/google/cloud/firestore/admin/v1/firestore_admin/rest/operations.rb create mode 100644 owl-bot-staging/google-cloud-firestore-admin-v1/lib/google/cloud/firestore/admin/v1/firestore_admin/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-firestore-admin-v1/lib/google/cloud/firestore/admin/v1/rest.rb create mode 100644 owl-bot-staging/google-cloud-firestore-admin-v1/lib/google/cloud/firestore/admin/v1/version.rb create mode 100644 owl-bot-staging/google-cloud-firestore-admin-v1/lib/google/firestore/admin/v1/backup_pb.rb create mode 100644 owl-bot-staging/google-cloud-firestore-admin-v1/lib/google/firestore/admin/v1/database_pb.rb create mode 100644 owl-bot-staging/google-cloud-firestore-admin-v1/lib/google/firestore/admin/v1/field_pb.rb create mode 100644 owl-bot-staging/google-cloud-firestore-admin-v1/lib/google/firestore/admin/v1/firestore_admin_pb.rb create mode 100644 owl-bot-staging/google-cloud-firestore-admin-v1/lib/google/firestore/admin/v1/firestore_admin_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-firestore-admin-v1/lib/google/firestore/admin/v1/index_pb.rb create mode 100644 owl-bot-staging/google-cloud-firestore-admin-v1/lib/google/firestore/admin/v1/location_pb.rb create mode 100644 owl-bot-staging/google-cloud-firestore-admin-v1/lib/google/firestore/admin/v1/operation_pb.rb create mode 100644 owl-bot-staging/google-cloud-firestore-admin-v1/lib/google/firestore/admin/v1/schedule_pb.rb create mode 100644 owl-bot-staging/google-cloud-firestore-admin-v1/proto_docs/README.md create mode 100644 owl-bot-staging/google-cloud-firestore-admin-v1/proto_docs/google/api/client.rb create mode 100644 owl-bot-staging/google-cloud-firestore-admin-v1/proto_docs/google/api/field_behavior.rb create mode 100644 owl-bot-staging/google-cloud-firestore-admin-v1/proto_docs/google/api/launch_stage.rb create mode 100644 owl-bot-staging/google-cloud-firestore-admin-v1/proto_docs/google/api/resource.rb create mode 100644 owl-bot-staging/google-cloud-firestore-admin-v1/proto_docs/google/firestore/admin/v1/backup.rb create mode 100644 owl-bot-staging/google-cloud-firestore-admin-v1/proto_docs/google/firestore/admin/v1/database.rb create mode 100644 owl-bot-staging/google-cloud-firestore-admin-v1/proto_docs/google/firestore/admin/v1/field.rb create mode 100644 owl-bot-staging/google-cloud-firestore-admin-v1/proto_docs/google/firestore/admin/v1/firestore_admin.rb create mode 100644 owl-bot-staging/google-cloud-firestore-admin-v1/proto_docs/google/firestore/admin/v1/index.rb create mode 100644 owl-bot-staging/google-cloud-firestore-admin-v1/proto_docs/google/firestore/admin/v1/location.rb create mode 100644 owl-bot-staging/google-cloud-firestore-admin-v1/proto_docs/google/firestore/admin/v1/operation.rb create mode 100644 owl-bot-staging/google-cloud-firestore-admin-v1/proto_docs/google/firestore/admin/v1/schedule.rb create mode 100644 owl-bot-staging/google-cloud-firestore-admin-v1/proto_docs/google/longrunning/operations.rb create mode 100644 owl-bot-staging/google-cloud-firestore-admin-v1/proto_docs/google/protobuf/any.rb create mode 100644 owl-bot-staging/google-cloud-firestore-admin-v1/proto_docs/google/protobuf/duration.rb create mode 100644 owl-bot-staging/google-cloud-firestore-admin-v1/proto_docs/google/protobuf/empty.rb create mode 100644 owl-bot-staging/google-cloud-firestore-admin-v1/proto_docs/google/protobuf/field_mask.rb create mode 100644 owl-bot-staging/google-cloud-firestore-admin-v1/proto_docs/google/protobuf/timestamp.rb create mode 100644 owl-bot-staging/google-cloud-firestore-admin-v1/proto_docs/google/rpc/status.rb create mode 100644 owl-bot-staging/google-cloud-firestore-admin-v1/proto_docs/google/type/dayofweek.rb create mode 100644 owl-bot-staging/google-cloud-firestore-admin-v1/snippets/Gemfile create mode 100644 owl-bot-staging/google-cloud-firestore-admin-v1/snippets/firestore_admin/create_backup_schedule.rb create mode 100644 owl-bot-staging/google-cloud-firestore-admin-v1/snippets/firestore_admin/create_database.rb create mode 100644 owl-bot-staging/google-cloud-firestore-admin-v1/snippets/firestore_admin/create_index.rb create mode 100644 owl-bot-staging/google-cloud-firestore-admin-v1/snippets/firestore_admin/delete_backup.rb create mode 100644 owl-bot-staging/google-cloud-firestore-admin-v1/snippets/firestore_admin/delete_backup_schedule.rb create mode 100644 owl-bot-staging/google-cloud-firestore-admin-v1/snippets/firestore_admin/delete_database.rb create mode 100644 owl-bot-staging/google-cloud-firestore-admin-v1/snippets/firestore_admin/delete_index.rb create mode 100644 owl-bot-staging/google-cloud-firestore-admin-v1/snippets/firestore_admin/export_documents.rb create mode 100644 owl-bot-staging/google-cloud-firestore-admin-v1/snippets/firestore_admin/get_backup.rb create mode 100644 owl-bot-staging/google-cloud-firestore-admin-v1/snippets/firestore_admin/get_backup_schedule.rb create mode 100644 owl-bot-staging/google-cloud-firestore-admin-v1/snippets/firestore_admin/get_database.rb create mode 100644 owl-bot-staging/google-cloud-firestore-admin-v1/snippets/firestore_admin/get_field.rb create mode 100644 owl-bot-staging/google-cloud-firestore-admin-v1/snippets/firestore_admin/get_index.rb create mode 100644 owl-bot-staging/google-cloud-firestore-admin-v1/snippets/firestore_admin/import_documents.rb create mode 100644 owl-bot-staging/google-cloud-firestore-admin-v1/snippets/firestore_admin/list_backup_schedules.rb create mode 100644 owl-bot-staging/google-cloud-firestore-admin-v1/snippets/firestore_admin/list_backups.rb create mode 100644 owl-bot-staging/google-cloud-firestore-admin-v1/snippets/firestore_admin/list_databases.rb create mode 100644 owl-bot-staging/google-cloud-firestore-admin-v1/snippets/firestore_admin/list_fields.rb create mode 100644 owl-bot-staging/google-cloud-firestore-admin-v1/snippets/firestore_admin/list_indexes.rb create mode 100644 owl-bot-staging/google-cloud-firestore-admin-v1/snippets/firestore_admin/restore_database.rb create mode 100644 owl-bot-staging/google-cloud-firestore-admin-v1/snippets/firestore_admin/update_backup_schedule.rb create mode 100644 owl-bot-staging/google-cloud-firestore-admin-v1/snippets/firestore_admin/update_database.rb create mode 100644 owl-bot-staging/google-cloud-firestore-admin-v1/snippets/firestore_admin/update_field.rb create mode 100644 owl-bot-staging/google-cloud-firestore-admin-v1/snippets/snippet_metadata_google.firestore.admin.v1.json create mode 100644 owl-bot-staging/google-cloud-firestore-admin-v1/test/google/cloud/firestore/admin/v1/firestore_admin_operations_test.rb create mode 100644 owl-bot-staging/google-cloud-firestore-admin-v1/test/google/cloud/firestore/admin/v1/firestore_admin_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-firestore-admin-v1/test/google/cloud/firestore/admin/v1/firestore_admin_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-firestore-admin-v1/test/google/cloud/firestore/admin/v1/firestore_admin_test.rb create mode 100644 owl-bot-staging/google-cloud-firestore-admin-v1/test/helper.rb diff --git a/owl-bot-staging/google-cloud-firestore-admin-v1/.gitignore b/owl-bot-staging/google-cloud-firestore-admin-v1/.gitignore new file mode 100644 index 000000000000..0135b6bc6cfc --- /dev/null +++ b/owl-bot-staging/google-cloud-firestore-admin-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-firestore-admin-v1/.repo-metadata.json b/owl-bot-staging/google-cloud-firestore-admin-v1/.repo-metadata.json new file mode 100644 index 000000000000..5fe9788514ab --- /dev/null +++ b/owl-bot-staging/google-cloud-firestore-admin-v1/.repo-metadata.json @@ -0,0 +1,18 @@ +{ + "api_id": "firestore.googleapis.com", + "api_shortname": "firestore", + "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-firestore-admin-v1/latest", + "distribution_name": "google-cloud-firestore-admin-v1", + "is_cloud": true, + "language": "ruby", + "name": "firestore", + "name_pretty": "Cloud Firestore Admin V1 API", + "product_documentation": "https://cloud.google.com/firestore", + "release_level": "unreleased", + "repo": "googleapis/google-cloud-ruby", + "requires_billing": true, + "ruby-cloud-description": "Cloud Firestore is a NoSQL document database built for automatic scaling, high performance, and ease of application development. Note that google-cloud-firestore-admin-v1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-firestore-admin instead. See the readme for more details.", + "ruby-cloud-env-prefix": "FIRESTORE", + "ruby-cloud-product-url": "https://cloud.google.com/firestore", + "library_type": "GAPIC_AUTO" +} diff --git a/owl-bot-staging/google-cloud-firestore-admin-v1/.rubocop.yml b/owl-bot-staging/google-cloud-firestore-admin-v1/.rubocop.yml new file mode 100644 index 000000000000..8cc38d8fdd28 --- /dev/null +++ b/owl-bot-staging/google-cloud-firestore-admin-v1/.rubocop.yml @@ -0,0 +1,33 @@ +inherit_gem: + google-style: google-style.yml + +AllCops: + Exclude: + - "google-cloud-firestore-admin-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-firestore-admin-v1.rb" diff --git a/owl-bot-staging/google-cloud-firestore-admin-v1/.toys.rb b/owl-bot-staging/google-cloud-firestore-admin-v1/.toys.rb new file mode 100644 index 000000000000..23434bdd5d5b --- /dev/null +++ b/owl-bot-staging/google-cloud-firestore-admin-v1/.toys.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true + +# Copyright 2024 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-firestore-admin-v1/.yardopts b/owl-bot-staging/google-cloud-firestore-admin-v1/.yardopts new file mode 100644 index 000000000000..6eb0d4f42a37 --- /dev/null +++ b/owl-bot-staging/google-cloud-firestore-admin-v1/.yardopts @@ -0,0 +1,12 @@ +--no-private +--title="Cloud Firestore 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-firestore-admin-v1/AUTHENTICATION.md b/owl-bot-staging/google-cloud-firestore-admin-v1/AUTHENTICATION.md new file mode 100644 index 000000000000..8143a0bdf549 --- /dev/null +++ b/owl-bot-staging/google-cloud-firestore-admin-v1/AUTHENTICATION.md @@ -0,0 +1,122 @@ +# Authentication + +The recommended way to authenticate to the google-cloud-firestore-admin-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-firestore-admin-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/firestore/admin/v1" + +client = ::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client.new do |config| + config.credentials = "path/to/credentialfile.json" +end +``` + +To configure a credentials file globally for all clients: + +```ruby +require "google/cloud/firestore/admin/v1" + +::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client.configure do |config| + config.credentials = "path/to/credentialfile.json" +end + +client = ::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::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-firestore-admin-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/firestore/admin/v1" + +ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" + +client = ::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::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-firestore-admin-v1/CHANGELOG.md b/owl-bot-staging/google-cloud-firestore-admin-v1/CHANGELOG.md new file mode 100644 index 000000000000..f88957a62ba2 --- /dev/null +++ b/owl-bot-staging/google-cloud-firestore-admin-v1/CHANGELOG.md @@ -0,0 +1,2 @@ +# Release History + diff --git a/owl-bot-staging/google-cloud-firestore-admin-v1/Gemfile b/owl-bot-staging/google-cloud-firestore-admin-v1/Gemfile new file mode 100644 index 000000000000..95163a6d11f8 --- /dev/null +++ b/owl-bot-staging/google-cloud-firestore-admin-v1/Gemfile @@ -0,0 +1,11 @@ +source "https://rubygems.org" + +gemspec + +gem "google-style", "~> 1.27.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-firestore-admin-v1/LICENSE.md b/owl-bot-staging/google-cloud-firestore-admin-v1/LICENSE.md new file mode 100644 index 000000000000..c261857ba6ad --- /dev/null +++ b/owl-bot-staging/google-cloud-firestore-admin-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-firestore-admin-v1/README.md b/owl-bot-staging/google-cloud-firestore-admin-v1/README.md new file mode 100644 index 000000000000..651048031089 --- /dev/null +++ b/owl-bot-staging/google-cloud-firestore-admin-v1/README.md @@ -0,0 +1,144 @@ +# Ruby Client for the Cloud Firestore Admin V1 API + +Accesses the NoSQL document database built for automatic scaling, high performance, and ease of application development. + +Cloud Firestore is a NoSQL document database built for automatic scaling, high performance, and ease of application development. + +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 Firestore Admin V1 API. Most users should consider using +the main client gem, +[google-cloud-firestore-admin](https://rubygems.org/gems/google-cloud-firestore-admin). +See the section below titled *Which client should I use?* for more information. + +## Installation + +``` +$ gem install google-cloud-firestore-admin-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/firestore.googleapis.com) +1. [Set up authentication.](AUTHENTICATION.md) + +## Quick Start + +```ruby +require "google/cloud/firestore/admin/v1" + +client = ::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client.new +request = ::Google::Cloud::Firestore::Admin::V1::CreateIndexRequest.new # (request fields as keyword arguments...) +response = client.create_index request +``` + +View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-firestore-admin-v1/latest) +for class and method documentation. + +See also the [Product Documentation](https://cloud.google.com/firestore) +for general usage information. + +## Enabling Logging + +To enable logging for this library, set the logger for the underlying [gRPC](https://github.com/grpc/grpc/tree/master/src/ruby) library. +The logger that you set may be a Ruby stdlib [`Logger`](https://ruby-doc.org/current/stdlibs/logger/Logger.html) as shown below, +or a [`Google::Cloud::Logging::Logger`](https://cloud.google.com/ruby/docs/reference/google-cloud-logging/latest) +that will write logs to [Cloud Logging](https://cloud.google.com/logging/). See [grpc/logconfig.rb](https://github.com/grpc/grpc/blob/master/src/ruby/lib/grpc/logconfig.rb) +and the gRPC [spec_helper.rb](https://github.com/grpc/grpc/blob/master/src/ruby/spec/spec_helper.rb) for additional information. + +Configuring a Ruby stdlib logger: + +```ruby +require "logger" + +module MyLogger + LOGGER = Logger.new $stderr, level: Logger::WARN + def logger + LOGGER + end +end + +# Define a gRPC module-level logger method before grpc/logconfig.rb loads. +module GRPC + extend MyLogger +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 2.7+. + +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-firestore-admin`, +and lower-level _versioned_ client libraries with names such as +`google-cloud-firestore-admin-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-firestore-admin`. +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-firestore-admin-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-firestore-admin-v1/Rakefile b/owl-bot-staging/google-cloud-firestore-admin-v1/Rakefile new file mode 100644 index 000000000000..faefa4f5948c --- /dev/null +++ b/owl-bot-staging/google-cloud-firestore-admin-v1/Rakefile @@ -0,0 +1,169 @@ +# frozen_string_literal: true + +# Copyright 2024 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-firestore-admin-v1 acceptance tests." +task :acceptance, :project, :keyfile do |t, args| + project = args[:project] + project ||= + ENV["FIRESTORE_TEST_PROJECT"] || + ENV["GCLOUD_TEST_PROJECT"] + keyfile = args[:keyfile] + keyfile ||= + ENV["FIRESTORE_TEST_KEYFILE"] || + ENV["GCLOUD_TEST_KEYFILE"] + if keyfile + keyfile = File.read keyfile + else + keyfile ||= + ENV["FIRESTORE_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 FIRESTORE_TEST_PROJECT=test123 FIRESTORE_TEST_KEYFILE=/path/to/keyfile.json rake acceptance" + end + require "google/cloud/firestore/admin/v1/firestore_admin/credentials" + ::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Credentials.env_vars.each do |path| + ENV[path] = nil + end + ENV["FIRESTORE_PROJECT"] = project + ENV["FIRESTORE_TEST_PROJECT"] = project + ENV["FIRESTORE_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-firestore-admin-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-firestore-admin-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-firestore-admin-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-firestore-admin-v1 gem does not have doctest tests." +end + +desc "Run the CI build" +task :ci do + header "BUILDING google-cloud-firestore-admin-v1" + header "google-cloud-firestore-admin-v1 rubocop", "*" + Rake::Task[:rubocop].invoke + header "google-cloud-firestore-admin-v1 yard", "*" + Rake::Task[:yard].invoke + header "google-cloud-firestore-admin-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-firestore-admin-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-firestore-admin-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-firestore-admin-v1/gapic_metadata.json b/owl-bot-staging/google-cloud-firestore-admin-v1/gapic_metadata.json new file mode 100644 index 000000000000..d03cbc67e9fe --- /dev/null +++ b/owl-bot-staging/google-cloud-firestore-admin-v1/gapic_metadata.json @@ -0,0 +1,133 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "ruby", + "protoPackage": "google.firestore.admin.v1", + "libraryPackage": "::Google::Cloud::Firestore::Admin::V1", + "services": { + "FirestoreAdmin": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client", + "rpcs": { + "CreateIndex": { + "methods": [ + "create_index" + ] + }, + "ListIndexes": { + "methods": [ + "list_indexes" + ] + }, + "GetIndex": { + "methods": [ + "get_index" + ] + }, + "DeleteIndex": { + "methods": [ + "delete_index" + ] + }, + "GetField": { + "methods": [ + "get_field" + ] + }, + "UpdateField": { + "methods": [ + "update_field" + ] + }, + "ListFields": { + "methods": [ + "list_fields" + ] + }, + "ExportDocuments": { + "methods": [ + "export_documents" + ] + }, + "ImportDocuments": { + "methods": [ + "import_documents" + ] + }, + "CreateDatabase": { + "methods": [ + "create_database" + ] + }, + "GetDatabase": { + "methods": [ + "get_database" + ] + }, + "ListDatabases": { + "methods": [ + "list_databases" + ] + }, + "UpdateDatabase": { + "methods": [ + "update_database" + ] + }, + "DeleteDatabase": { + "methods": [ + "delete_database" + ] + }, + "GetBackup": { + "methods": [ + "get_backup" + ] + }, + "ListBackups": { + "methods": [ + "list_backups" + ] + }, + "DeleteBackup": { + "methods": [ + "delete_backup" + ] + }, + "RestoreDatabase": { + "methods": [ + "restore_database" + ] + }, + "CreateBackupSchedule": { + "methods": [ + "create_backup_schedule" + ] + }, + "GetBackupSchedule": { + "methods": [ + "get_backup_schedule" + ] + }, + "ListBackupSchedules": { + "methods": [ + "list_backup_schedules" + ] + }, + "UpdateBackupSchedule": { + "methods": [ + "update_backup_schedule" + ] + }, + "DeleteBackupSchedule": { + "methods": [ + "delete_backup_schedule" + ] + } + } + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-firestore-admin-v1/google-cloud-firestore-admin-v1.gemspec b/owl-bot-staging/google-cloud-firestore-admin-v1/google-cloud-firestore-admin-v1.gemspec new file mode 100644 index 000000000000..1fee7e93bf83 --- /dev/null +++ b/owl-bot-staging/google-cloud-firestore-admin-v1/google-cloud-firestore-admin-v1.gemspec @@ -0,0 +1,29 @@ +# -*- ruby -*- +# encoding: utf-8 + +require File.expand_path("lib/google/cloud/firestore/admin/v1/version", __dir__) + +Gem::Specification.new do |gem| + gem.name = "google-cloud-firestore-admin-v1" + gem.version = Google::Cloud::Firestore::Admin::V1::VERSION + + gem.authors = ["Google LLC"] + gem.email = "googleapis-packages@google.com" + gem.description = "Cloud Firestore is a NoSQL document database built for automatic scaling, high performance, and ease of application development. Note that google-cloud-firestore-admin-v1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-firestore-admin instead. See the readme for more details." + gem.summary = "Accesses the NoSQL document database built for automatic scaling, high performance, and ease of application development." + 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 = ">= 2.7" + + gem.add_dependency "gapic-common", ">= 0.21.1", "< 2.a" + gem.add_dependency "google-cloud-errors", "~> 1.0" + gem.add_dependency "google-cloud-location", ">= 0.7", "< 2.a" +end diff --git a/owl-bot-staging/google-cloud-firestore-admin-v1/lib/google-cloud-firestore-admin-v1.rb b/owl-bot-staging/google-cloud-firestore-admin-v1/lib/google-cloud-firestore-admin-v1.rb new file mode 100644 index 000000000000..1bfa732ab41c --- /dev/null +++ b/owl-bot-staging/google-cloud-firestore-admin-v1/lib/google-cloud-firestore-admin-v1.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +# Copyright 2024 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/firestore/admin/v1" diff --git a/owl-bot-staging/google-cloud-firestore-admin-v1/lib/google/cloud/firestore/admin/v1.rb b/owl-bot-staging/google-cloud-firestore-admin-v1/lib/google/cloud/firestore/admin/v1.rb new file mode 100644 index 000000000000..e27ad19a0821 --- /dev/null +++ b/owl-bot-staging/google-cloud-firestore-admin-v1/lib/google/cloud/firestore/admin/v1.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2024 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/firestore/admin/v1/firestore_admin" +require "google/cloud/firestore/admin/v1/version" + +module Google + module Cloud + module Firestore + module Admin + ## + # API client module. + # + # @example Load this package, including all its services, and instantiate a gRPC client + # + # require "google/cloud/firestore/admin/v1" + # client = ::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client.new + # + # @example Load this package, including all its services, and instantiate a REST client + # + # require "google/cloud/firestore/admin/v1" + # client = ::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Rest::Client.new + # + module V1 + end + end + end + end +end + +helper_path = ::File.join __dir__, "v1", "_helpers.rb" +require "google/cloud/firestore/admin/v1/_helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-firestore-admin-v1/lib/google/cloud/firestore/admin/v1/firestore_admin.rb b/owl-bot-staging/google-cloud-firestore-admin-v1/lib/google/cloud/firestore/admin/v1/firestore_admin.rb new file mode 100644 index 000000000000..8e676cd49717 --- /dev/null +++ b/owl-bot-staging/google-cloud-firestore-admin-v1/lib/google/cloud/firestore/admin/v1/firestore_admin.rb @@ -0,0 +1,85 @@ +# frozen_string_literal: true + +# Copyright 2024 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/firestore/admin/v1/version" + +require "google/cloud/firestore/admin/v1/firestore_admin/credentials" +require "google/cloud/firestore/admin/v1/firestore_admin/paths" +require "google/cloud/firestore/admin/v1/firestore_admin/operations" +require "google/cloud/firestore/admin/v1/firestore_admin/client" +require "google/cloud/firestore/admin/v1/firestore_admin/rest" + +module Google + module Cloud + module Firestore + module Admin + module V1 + ## + # The Cloud Firestore Admin API. + # + # This API provides several administrative services for Cloud Firestore. + # + # Project, Database, Namespace, Collection, Collection Group, and Document are + # used as defined in the Google Cloud Firestore API. + # + # Operation: An Operation represents work being performed in the background. + # + # The index service manages Cloud Firestore indexes. + # + # Index creation is performed asynchronously. + # An Operation resource is created for each such asynchronous operation. + # The state of the operation (including any errors encountered) + # may be queried via the Operation resource. + # + # The Operations collection provides a record of actions performed for the + # specified Project (including any Operations in progress). Operations are not + # created directly but through calls on other collections or resources. + # + # An Operation that is done may be deleted so that it is no longer listed as + # part of the Operation collection. Operations are garbage collected after + # 30 days. By default, ListOperations will only return in progress and failed + # operations. To list completed operation, issue a ListOperations request with + # the filter `done: true`. + # + # Operations are created by service `FirestoreAdmin`, but are accessed via + # service `google.longrunning.Operations`. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/firestore/admin/v1/firestore_admin" + # client = ::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/firestore/admin/v1/firestore_admin/rest" + # client = ::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Rest::Client.new + # + module FirestoreAdmin + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "firestore_admin", "helpers.rb" +require "google/cloud/firestore/admin/v1/firestore_admin/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-firestore-admin-v1/lib/google/cloud/firestore/admin/v1/firestore_admin/client.rb b/owl-bot-staging/google-cloud-firestore-admin-v1/lib/google/cloud/firestore/admin/v1/firestore_admin/client.rb new file mode 100644 index 000000000000..292eb29e51a2 --- /dev/null +++ b/owl-bot-staging/google-cloud-firestore-admin-v1/lib/google/cloud/firestore/admin/v1/firestore_admin/client.rb @@ -0,0 +1,2806 @@ +# frozen_string_literal: true + +# Copyright 2024 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/firestore/admin/v1/firestore_admin_pb" +require "google/cloud/location" + +module Google + module Cloud + module Firestore + module Admin + module V1 + module FirestoreAdmin + ## + # Client for the FirestoreAdmin service. + # + # The Cloud Firestore Admin API. + # + # This API provides several administrative services for Cloud Firestore. + # + # Project, Database, Namespace, Collection, Collection Group, and Document are + # used as defined in the Google Cloud Firestore API. + # + # Operation: An Operation represents work being performed in the background. + # + # The index service manages Cloud Firestore indexes. + # + # Index creation is performed asynchronously. + # An Operation resource is created for each such asynchronous operation. + # The state of the operation (including any errors encountered) + # may be queried via the Operation resource. + # + # The Operations collection provides a record of actions performed for the + # specified Project (including any Operations in progress). Operations are not + # created directly but through calls on other collections or resources. + # + # An Operation that is done may be deleted so that it is no longer listed as + # part of the Operation collection. Operations are garbage collected after + # 30 days. By default, ListOperations will only return in progress and failed + # operations. To list completed operation, issue a ListOperations request with + # the filter `done: true`. + # + # Operations are created by service `FirestoreAdmin`, but are accessed via + # service `google.longrunning.Operations`. + # + class Client + # @private + DEFAULT_ENDPOINT_TEMPLATE = "firestore.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :firestore_admin_stub + + ## + # Configure the FirestoreAdmin Client class. + # + # See {::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all FirestoreAdmin clients + # ::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::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", "Firestore", "Admin", "V1"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get parent_name + break parent_const.configure if parent_const.respond_to? :configure + namespace.pop + end + default_config = Client::Configuration.new parent_config + + default_config.rpcs.create_index.timeout = 60.0 + + default_config.rpcs.list_indexes.timeout = 60.0 + default_config.rpcs.list_indexes.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 13, 4] + } + + default_config.rpcs.get_index.timeout = 60.0 + default_config.rpcs.get_index.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 13, 4] + } + + default_config.rpcs.delete_index.timeout = 60.0 + default_config.rpcs.delete_index.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 13, 4] + } + + default_config.rpcs.get_field.timeout = 60.0 + default_config.rpcs.get_field.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 13, 4] + } + + default_config.rpcs.update_field.timeout = 60.0 + + default_config.rpcs.list_fields.timeout = 60.0 + default_config.rpcs.list_fields.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 13, 4] + } + + default_config.rpcs.export_documents.timeout = 60.0 + + default_config.rpcs.import_documents.timeout = 60.0 + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the FirestoreAdmin 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::Firestore::Admin::V1::FirestoreAdmin::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 + @firestore_admin_stub.universe_domain + end + + ## + # Create a new FirestoreAdmin client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the FirestoreAdmin 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/firestore/admin/v1/firestore_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 + + @firestore_admin_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::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 + ) + + @location_client = Google::Cloud::Location::Locations::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @firestore_admin_stub.endpoint + config.universe_domain = @firestore_admin_stub.universe_domain + end + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Operations] + # + attr_reader :operations_client + + ## + # Get the associated client for mix-in of the Locations. + # + # @return [Google::Cloud::Location::Locations::Client] + # + attr_reader :location_client + + # Service calls + + ## + # Creates a composite index. This returns a + # {::Google::Longrunning::Operation google.longrunning.Operation} which may be + # used to track the status of the creation. The metadata for the operation + # will be the type + # {::Google::Cloud::Firestore::Admin::V1::IndexOperationMetadata IndexOperationMetadata}. + # + # @overload create_index(request, options = nil) + # Pass arguments to `create_index` via a request object, either of type + # {::Google::Cloud::Firestore::Admin::V1::CreateIndexRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Firestore::Admin::V1::CreateIndexRequest, ::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_index(parent: nil, index: nil) + # Pass arguments to `create_index` 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. A parent name of the form + # `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}` + # @param index [::Google::Cloud::Firestore::Admin::V1::Index, ::Hash] + # Required. The composite index to create. + # + # @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/firestore/admin/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Firestore::Admin::V1::CreateIndexRequest.new + # + # # Call the create_index method. + # result = client.create_index 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_index request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Firestore::Admin::V1::CreateIndexRequest + + # 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_index.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project 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::Firestore::Admin::V1::VERSION + 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_index.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_index.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @firestore_admin_stub.call_rpc :create_index, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists composite indexes. + # + # @overload list_indexes(request, options = nil) + # Pass arguments to `list_indexes` via a request object, either of type + # {::Google::Cloud::Firestore::Admin::V1::ListIndexesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Firestore::Admin::V1::ListIndexesRequest, ::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_indexes(parent: nil, filter: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_indexes` 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. A parent name of the form + # `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}` + # @param filter [::String] + # The filter to apply to list results. + # @param page_size [::Integer] + # The number of results to return. + # @param page_token [::String] + # A page token, returned from a previous call to + # {::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client#list_indexes FirestoreAdmin.ListIndexes}, + # that may be used to get the next page of results. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Firestore::Admin::V1::Index>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::Firestore::Admin::V1::Index>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/firestore/admin/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Firestore::Admin::V1::ListIndexesRequest.new + # + # # Call the list_indexes method. + # result = client.list_indexes 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::Firestore::Admin::V1::Index. + # p item + # end + # + def list_indexes request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Firestore::Admin::V1::ListIndexesRequest + + # 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_indexes.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project 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::Firestore::Admin::V1::VERSION + 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_indexes.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_indexes.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @firestore_admin_stub.call_rpc :list_indexes, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @firestore_admin_stub, :list_indexes, request, response, operation, options + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets a composite index. + # + # @overload get_index(request, options = nil) + # Pass arguments to `get_index` via a request object, either of type + # {::Google::Cloud::Firestore::Admin::V1::GetIndexRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Firestore::Admin::V1::GetIndexRequest, ::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_index(name: nil) + # Pass arguments to `get_index` 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. A name of the form + # `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/indexes/{index_id}` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Firestore::Admin::V1::Index] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Firestore::Admin::V1::Index] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/firestore/admin/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Firestore::Admin::V1::GetIndexRequest.new + # + # # Call the get_index method. + # result = client.get_index request + # + # # The returned object is of type Google::Cloud::Firestore::Admin::V1::Index. + # p result + # + def get_index request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Firestore::Admin::V1::GetIndexRequest + + # 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_index.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project 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::Firestore::Admin::V1::VERSION + 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_index.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_index.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @firestore_admin_stub.call_rpc :get_index, request, options: options do |response, operation| + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a composite index. + # + # @overload delete_index(request, options = nil) + # Pass arguments to `delete_index` via a request object, either of type + # {::Google::Cloud::Firestore::Admin::V1::DeleteIndexRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Firestore::Admin::V1::DeleteIndexRequest, ::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_index(name: nil) + # Pass arguments to `delete_index` 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. A name of the form + # `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/indexes/{index_id}` + # + # @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/firestore/admin/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Firestore::Admin::V1::DeleteIndexRequest.new + # + # # Call the delete_index method. + # result = client.delete_index request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_index request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Firestore::Admin::V1::DeleteIndexRequest + + # 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_index.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project 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::Firestore::Admin::V1::VERSION + 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_index.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_index.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @firestore_admin_stub.call_rpc :delete_index, request, options: options do |response, operation| + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets the metadata and configuration for a Field. + # + # @overload get_field(request, options = nil) + # Pass arguments to `get_field` via a request object, either of type + # {::Google::Cloud::Firestore::Admin::V1::GetFieldRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Firestore::Admin::V1::GetFieldRequest, ::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_field(name: nil) + # Pass arguments to `get_field` 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. A name of the form + # `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/fields/{field_id}` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Firestore::Admin::V1::Field] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Firestore::Admin::V1::Field] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/firestore/admin/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Firestore::Admin::V1::GetFieldRequest.new + # + # # Call the get_field method. + # result = client.get_field request + # + # # The returned object is of type Google::Cloud::Firestore::Admin::V1::Field. + # p result + # + def get_field request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Firestore::Admin::V1::GetFieldRequest + + # 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_field.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project 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::Firestore::Admin::V1::VERSION + 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_field.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_field.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @firestore_admin_stub.call_rpc :get_field, request, options: options do |response, operation| + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates a field configuration. Currently, field updates apply only to + # single field index configuration. However, calls to + # {::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client#update_field FirestoreAdmin.UpdateField} + # should provide a field mask to avoid changing any configuration that the + # caller isn't aware of. The field mask should be specified as: `{ paths: + # "index_config" }`. + # + # This call returns a + # {::Google::Longrunning::Operation google.longrunning.Operation} which may be + # used to track the status of the field update. The metadata for the + # operation will be the type + # {::Google::Cloud::Firestore::Admin::V1::FieldOperationMetadata FieldOperationMetadata}. + # + # To configure the default field settings for the database, use + # the special `Field` with resource name: + # `projects/{project_id}/databases/{database_id}/collectionGroups/__default__/fields/*`. + # + # @overload update_field(request, options = nil) + # Pass arguments to `update_field` via a request object, either of type + # {::Google::Cloud::Firestore::Admin::V1::UpdateFieldRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Firestore::Admin::V1::UpdateFieldRequest, ::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_field(field: nil, update_mask: nil) + # Pass arguments to `update_field` 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 field [::Google::Cloud::Firestore::Admin::V1::Field, ::Hash] + # Required. The field to be updated. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # A mask, relative to the field. If specified, only configuration specified + # by this field_mask will be updated in the field. + # + # @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/firestore/admin/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Firestore::Admin::V1::UpdateFieldRequest.new + # + # # Call the update_field method. + # result = client.update_field 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_field request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Firestore::Admin::V1::UpdateFieldRequest + + # 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_field.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project 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::Firestore::Admin::V1::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.field&.name + header_params["field.name"] = request.field.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_field.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_field.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @firestore_admin_stub.call_rpc :update_field, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists the field configuration and metadata for this database. + # + # Currently, + # {::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client#list_fields FirestoreAdmin.ListFields} + # only supports listing fields that have been explicitly overridden. To issue + # this query, call + # {::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client#list_fields FirestoreAdmin.ListFields} + # with the filter set to `indexConfig.usesAncestorConfig:false` or + # `ttlConfig:*`. + # + # @overload list_fields(request, options = nil) + # Pass arguments to `list_fields` via a request object, either of type + # {::Google::Cloud::Firestore::Admin::V1::ListFieldsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Firestore::Admin::V1::ListFieldsRequest, ::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_fields(parent: nil, filter: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_fields` 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. A parent name of the form + # `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}` + # @param filter [::String] + # The filter to apply to list results. Currently, + # {::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client#list_fields FirestoreAdmin.ListFields} + # only supports listing fields that have been explicitly overridden. To issue + # this query, call + # {::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client#list_fields FirestoreAdmin.ListFields} + # with a filter that includes `indexConfig.usesAncestorConfig:false` . + # @param page_size [::Integer] + # The number of results to return. + # @param page_token [::String] + # A page token, returned from a previous call to + # {::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client#list_fields FirestoreAdmin.ListFields}, + # that may be used to get the next page of results. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Firestore::Admin::V1::Field>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::Firestore::Admin::V1::Field>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/firestore/admin/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Firestore::Admin::V1::ListFieldsRequest.new + # + # # Call the list_fields method. + # result = client.list_fields 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::Firestore::Admin::V1::Field. + # p item + # end + # + def list_fields request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Firestore::Admin::V1::ListFieldsRequest + + # 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_fields.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project 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::Firestore::Admin::V1::VERSION + 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_fields.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_fields.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @firestore_admin_stub.call_rpc :list_fields, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @firestore_admin_stub, :list_fields, request, response, operation, options + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Exports a copy of all or a subset of documents from Google Cloud Firestore + # to another storage system, such as Google Cloud Storage. Recent updates to + # documents may not be reflected in the export. The export occurs in the + # background and its progress can be monitored and managed via the + # Operation resource that is created. The output of an export may only be + # used once the associated operation is done. If an export operation is + # cancelled before completion it may leave partial data behind in Google + # Cloud Storage. + # + # For more details on export behavior and output format, refer to: + # https://cloud.google.com/firestore/docs/manage-data/export-import + # + # @overload export_documents(request, options = nil) + # Pass arguments to `export_documents` via a request object, either of type + # {::Google::Cloud::Firestore::Admin::V1::ExportDocumentsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Firestore::Admin::V1::ExportDocumentsRequest, ::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 export_documents(name: nil, collection_ids: nil, output_uri_prefix: nil, namespace_ids: nil, snapshot_time: nil) + # Pass arguments to `export_documents` 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. Database to export. Should be of the form: + # `projects/{project_id}/databases/{database_id}`. + # @param collection_ids [::Array<::String>] + # Which collection ids to export. Unspecified means all collections. + # @param output_uri_prefix [::String] + # The output URI. Currently only supports Google Cloud Storage URIs of the + # form: `gs://BUCKET_NAME[/NAMESPACE_PATH]`, where `BUCKET_NAME` is the name + # of the Google Cloud Storage bucket and `NAMESPACE_PATH` is an optional + # Google Cloud Storage namespace path. When + # choosing a name, be sure to consider Google Cloud Storage naming + # guidelines: https://cloud.google.com/storage/docs/naming. + # If the URI is a bucket (without a namespace path), a prefix will be + # generated based on the start time. + # @param namespace_ids [::Array<::String>] + # An empty list represents all namespaces. This is the preferred + # usage for databases that don't use namespaces. + # + # An empty string element represents the default namespace. This should be + # used if the database has data in non-default namespaces, but doesn't want + # to include them. Each namespace in this list must be unique. + # @param snapshot_time [::Google::Protobuf::Timestamp, ::Hash] + # The timestamp that corresponds to the version of the database to be + # exported. The timestamp must be in the past, rounded to the minute and not + # older than + # {::Google::Cloud::Firestore::Admin::V1::Database#earliest_version_time earliestVersionTime}. + # If specified, then the exported documents will represent a consistent view + # of the database at the provided time. Otherwise, there are no guarantees + # about the consistency of the exported documents. + # + # @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/firestore/admin/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Firestore::Admin::V1::ExportDocumentsRequest.new + # + # # Call the export_documents method. + # result = client.export_documents 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 export_documents request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Firestore::Admin::V1::ExportDocumentsRequest + + # 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.export_documents.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project 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::Firestore::Admin::V1::VERSION + 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.export_documents.timeout, + metadata: metadata, + retry_policy: @config.rpcs.export_documents.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @firestore_admin_stub.call_rpc :export_documents, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Imports documents into Google Cloud Firestore. Existing documents with the + # same name are overwritten. The import occurs in the background and its + # progress can be monitored and managed via the Operation resource that is + # created. If an ImportDocuments operation is cancelled, it is possible + # that a subset of the data has already been imported to Cloud Firestore. + # + # @overload import_documents(request, options = nil) + # Pass arguments to `import_documents` via a request object, either of type + # {::Google::Cloud::Firestore::Admin::V1::ImportDocumentsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Firestore::Admin::V1::ImportDocumentsRequest, ::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 import_documents(name: nil, collection_ids: nil, input_uri_prefix: nil, namespace_ids: nil) + # Pass arguments to `import_documents` 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. Database to import into. Should be of the form: + # `projects/{project_id}/databases/{database_id}`. + # @param collection_ids [::Array<::String>] + # Which collection ids to import. Unspecified means all collections included + # in the import. + # @param input_uri_prefix [::String] + # Location of the exported files. + # This must match the output_uri_prefix of an ExportDocumentsResponse from + # an export that has completed successfully. + # See: + # {::Google::Cloud::Firestore::Admin::V1::ExportDocumentsResponse#output_uri_prefix google.firestore.admin.v1.ExportDocumentsResponse.output_uri_prefix}. + # @param namespace_ids [::Array<::String>] + # An empty list represents all namespaces. This is the preferred + # usage for databases that don't use namespaces. + # + # An empty string element represents the default namespace. This should be + # used if the database has data in non-default namespaces, but doesn't want + # to include them. Each namespace in this list must be unique. + # + # @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/firestore/admin/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Firestore::Admin::V1::ImportDocumentsRequest.new + # + # # Call the import_documents method. + # result = client.import_documents 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 import_documents request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Firestore::Admin::V1::ImportDocumentsRequest + + # 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.import_documents.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project 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::Firestore::Admin::V1::VERSION + 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.import_documents.timeout, + metadata: metadata, + retry_policy: @config.rpcs.import_documents.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @firestore_admin_stub.call_rpc :import_documents, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Create a database. + # + # @overload create_database(request, options = nil) + # Pass arguments to `create_database` via a request object, either of type + # {::Google::Cloud::Firestore::Admin::V1::CreateDatabaseRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Firestore::Admin::V1::CreateDatabaseRequest, ::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_database(parent: nil, database: nil, database_id: nil) + # Pass arguments to `create_database` 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. A parent name of the form + # `projects/{project_id}` + # @param database [::Google::Cloud::Firestore::Admin::V1::Database, ::Hash] + # Required. The Database to create. + # @param database_id [::String] + # Required. The ID to use for the database, which will become the final + # component of the database's resource name. + # + # This value should be 4-63 characters. Valid characters are /[a-z][0-9]-/ + # with first character a letter and the last a letter or a number. Must not + # be UUID-like /[0-9a-f]\\{8}(-[0-9a-f]\\{4})\\{3}-[0-9a-f]\\{12}/. + # + # "(default)" database id is also valid. + # + # @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/firestore/admin/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Firestore::Admin::V1::CreateDatabaseRequest.new + # + # # Call the create_database method. + # result = client.create_database 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_database request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Firestore::Admin::V1::CreateDatabaseRequest + + # 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_database.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project 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::Firestore::Admin::V1::VERSION + 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_database.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_database.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @firestore_admin_stub.call_rpc :create_database, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets information about a database. + # + # @overload get_database(request, options = nil) + # Pass arguments to `get_database` via a request object, either of type + # {::Google::Cloud::Firestore::Admin::V1::GetDatabaseRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Firestore::Admin::V1::GetDatabaseRequest, ::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_database(name: nil) + # Pass arguments to `get_database` 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. A name of the form + # `projects/{project_id}/databases/{database_id}` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Firestore::Admin::V1::Database] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Firestore::Admin::V1::Database] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/firestore/admin/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Firestore::Admin::V1::GetDatabaseRequest.new + # + # # Call the get_database method. + # result = client.get_database request + # + # # The returned object is of type Google::Cloud::Firestore::Admin::V1::Database. + # p result + # + def get_database request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Firestore::Admin::V1::GetDatabaseRequest + + # 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_database.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project 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::Firestore::Admin::V1::VERSION + 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_database.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_database.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @firestore_admin_stub.call_rpc :get_database, request, options: options do |response, operation| + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # List all the databases in the project. + # + # @overload list_databases(request, options = nil) + # Pass arguments to `list_databases` via a request object, either of type + # {::Google::Cloud::Firestore::Admin::V1::ListDatabasesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Firestore::Admin::V1::ListDatabasesRequest, ::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_databases(parent: nil) + # Pass arguments to `list_databases` 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. A parent name of the form + # `projects/{project_id}` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Firestore::Admin::V1::ListDatabasesResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Firestore::Admin::V1::ListDatabasesResponse] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/firestore/admin/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Firestore::Admin::V1::ListDatabasesRequest.new + # + # # Call the list_databases method. + # result = client.list_databases request + # + # # The returned object is of type Google::Cloud::Firestore::Admin::V1::ListDatabasesResponse. + # p result + # + def list_databases request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Firestore::Admin::V1::ListDatabasesRequest + + # 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_databases.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project 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::Firestore::Admin::V1::VERSION + 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_databases.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_databases.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @firestore_admin_stub.call_rpc :list_databases, request, options: options do |response, operation| + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates a database. + # + # @overload update_database(request, options = nil) + # Pass arguments to `update_database` via a request object, either of type + # {::Google::Cloud::Firestore::Admin::V1::UpdateDatabaseRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Firestore::Admin::V1::UpdateDatabaseRequest, ::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_database(database: nil, update_mask: nil) + # Pass arguments to `update_database` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param database [::Google::Cloud::Firestore::Admin::V1::Database, ::Hash] + # Required. The database to update. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # The list of fields to be updated. + # + # @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/firestore/admin/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Firestore::Admin::V1::UpdateDatabaseRequest.new + # + # # Call the update_database method. + # result = client.update_database 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_database request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Firestore::Admin::V1::UpdateDatabaseRequest + + # 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_database.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project 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::Firestore::Admin::V1::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.database&.name + header_params["database.name"] = request.database.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_database.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_database.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @firestore_admin_stub.call_rpc :update_database, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a database. + # + # @overload delete_database(request, options = nil) + # Pass arguments to `delete_database` via a request object, either of type + # {::Google::Cloud::Firestore::Admin::V1::DeleteDatabaseRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Firestore::Admin::V1::DeleteDatabaseRequest, ::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_database(name: nil, etag: nil) + # Pass arguments to `delete_database` 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. A name of the form + # `projects/{project_id}/databases/{database_id}` + # @param etag [::String] + # The current etag of the Database. + # If an etag is provided and does not match the current etag of the database, + # deletion will be blocked and a FAILED_PRECONDITION error will be returned. + # + # @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/firestore/admin/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Firestore::Admin::V1::DeleteDatabaseRequest.new + # + # # Call the delete_database method. + # result = client.delete_database 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 delete_database request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Firestore::Admin::V1::DeleteDatabaseRequest + + # 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_database.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project 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::Firestore::Admin::V1::VERSION + 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_database.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_database.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @firestore_admin_stub.call_rpc :delete_database, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets information about a backup. + # + # @overload get_backup(request, options = nil) + # Pass arguments to `get_backup` via a request object, either of type + # {::Google::Cloud::Firestore::Admin::V1::GetBackupRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Firestore::Admin::V1::GetBackupRequest, ::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_backup(name: nil) + # Pass arguments to `get_backup` 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. Name of the backup to fetch. + # + # Format is `projects/{project}/locations/{location}/backups/{backup}`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Firestore::Admin::V1::Backup] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Firestore::Admin::V1::Backup] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/firestore/admin/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Firestore::Admin::V1::GetBackupRequest.new + # + # # Call the get_backup method. + # result = client.get_backup request + # + # # The returned object is of type Google::Cloud::Firestore::Admin::V1::Backup. + # p result + # + def get_backup request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Firestore::Admin::V1::GetBackupRequest + + # 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_backup.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project 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::Firestore::Admin::V1::VERSION + 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_backup.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_backup.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @firestore_admin_stub.call_rpc :get_backup, request, options: options do |response, operation| + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists all the backups. + # + # @overload list_backups(request, options = nil) + # Pass arguments to `list_backups` via a request object, either of type + # {::Google::Cloud::Firestore::Admin::V1::ListBackupsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Firestore::Admin::V1::ListBackupsRequest, ::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_backups(parent: nil) + # Pass arguments to `list_backups` 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 location to list backups from. + # + # Format is `projects/{project}/locations/{location}`. + # Use `{location} = '-'` to list backups from all locations for the given + # project. This allows listing backups from a single location or from all + # locations. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Firestore::Admin::V1::ListBackupsResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Firestore::Admin::V1::ListBackupsResponse] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/firestore/admin/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Firestore::Admin::V1::ListBackupsRequest.new + # + # # Call the list_backups method. + # result = client.list_backups request + # + # # The returned object is of type Google::Cloud::Firestore::Admin::V1::ListBackupsResponse. + # p result + # + def list_backups request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Firestore::Admin::V1::ListBackupsRequest + + # 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_backups.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project 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::Firestore::Admin::V1::VERSION + 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_backups.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_backups.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @firestore_admin_stub.call_rpc :list_backups, request, options: options do |response, operation| + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a backup. + # + # @overload delete_backup(request, options = nil) + # Pass arguments to `delete_backup` via a request object, either of type + # {::Google::Cloud::Firestore::Admin::V1::DeleteBackupRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Firestore::Admin::V1::DeleteBackupRequest, ::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_backup(name: nil) + # Pass arguments to `delete_backup` 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. Name of the backup to delete. + # + # format is `projects/{project}/locations/{location}/backups/{backup}`. + # + # @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/firestore/admin/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Firestore::Admin::V1::DeleteBackupRequest.new + # + # # Call the delete_backup method. + # result = client.delete_backup request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_backup request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Firestore::Admin::V1::DeleteBackupRequest + + # 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_backup.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project 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::Firestore::Admin::V1::VERSION + 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_backup.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_backup.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @firestore_admin_stub.call_rpc :delete_backup, request, options: options do |response, operation| + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates a new database by restoring from an existing backup. + # + # The new database must be in the same cloud region or multi-region location + # as the existing backup. This behaves similar to + # [FirestoreAdmin.CreateDatabase][google.firestore.admin.v1.CreateDatabase] + # except instead of creating a new empty database, a new database is created + # with the database type, index configuration, and documents from an existing + # backup. + # + # The {::Google::Longrunning::Operation long-running operation} can be used to + # track the progress of the restore, with the Operation's + # {::Google::Longrunning::Operation#metadata metadata} field type being the + # {::Google::Cloud::Firestore::Admin::V1::RestoreDatabaseMetadata RestoreDatabaseMetadata}. + # The {::Google::Longrunning::Operation#response response} type is the + # {::Google::Cloud::Firestore::Admin::V1::Database Database} if the restore was + # successful. The new database is not readable or writeable until the LRO has + # completed. + # + # @overload restore_database(request, options = nil) + # Pass arguments to `restore_database` via a request object, either of type + # {::Google::Cloud::Firestore::Admin::V1::RestoreDatabaseRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Firestore::Admin::V1::RestoreDatabaseRequest, ::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 restore_database(parent: nil, database_id: nil, backup: nil) + # Pass arguments to `restore_database` 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 to restore the database in. Format is + # `projects/{project_id}`. + # @param database_id [::String] + # Required. The ID to use for the database, which will become the final + # component of the database's resource name. This database id must not be + # associated with an existing database. + # + # This value should be 4-63 characters. Valid characters are /[a-z][0-9]-/ + # with first character a letter and the last a letter or a number. Must not + # be UUID-like /[0-9a-f]\\{8}(-[0-9a-f]\\{4})\\{3}-[0-9a-f]\\{12}/. + # + # "(default)" database id is also valid. + # @param backup [::String] + # Required. Backup to restore from. Must be from the same project as the + # parent. + # + # Format is: `projects/{project_id}/locations/{location}/backups/{backup}` + # + # @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/firestore/admin/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Firestore::Admin::V1::RestoreDatabaseRequest.new + # + # # Call the restore_database method. + # result = client.restore_database 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 restore_database request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Firestore::Admin::V1::RestoreDatabaseRequest + + # 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.restore_database.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project 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::Firestore::Admin::V1::VERSION + 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.restore_database.timeout, + metadata: metadata, + retry_policy: @config.rpcs.restore_database.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @firestore_admin_stub.call_rpc :restore_database, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates a backup schedule on a database. + # At most two backup schedules can be configured on a database, one daily + # backup schedule with retention up to 7 days and one weekly backup schedule + # with retention up to 14 weeks. + # + # @overload create_backup_schedule(request, options = nil) + # Pass arguments to `create_backup_schedule` via a request object, either of type + # {::Google::Cloud::Firestore::Admin::V1::CreateBackupScheduleRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Firestore::Admin::V1::CreateBackupScheduleRequest, ::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_backup_schedule(parent: nil, backup_schedule: nil) + # Pass arguments to `create_backup_schedule` 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 database. + # + # Format `projects/{project}/databases/{database}` + # @param backup_schedule [::Google::Cloud::Firestore::Admin::V1::BackupSchedule, ::Hash] + # Required. The backup schedule to create. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Firestore::Admin::V1::BackupSchedule] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Firestore::Admin::V1::BackupSchedule] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/firestore/admin/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Firestore::Admin::V1::CreateBackupScheduleRequest.new + # + # # Call the create_backup_schedule method. + # result = client.create_backup_schedule request + # + # # The returned object is of type Google::Cloud::Firestore::Admin::V1::BackupSchedule. + # p result + # + def create_backup_schedule request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Firestore::Admin::V1::CreateBackupScheduleRequest + + # 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_backup_schedule.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project 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::Firestore::Admin::V1::VERSION + 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_backup_schedule.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_backup_schedule.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @firestore_admin_stub.call_rpc :create_backup_schedule, request, options: options do |response, operation| + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets information about a backup schedule. + # + # @overload get_backup_schedule(request, options = nil) + # Pass arguments to `get_backup_schedule` via a request object, either of type + # {::Google::Cloud::Firestore::Admin::V1::GetBackupScheduleRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Firestore::Admin::V1::GetBackupScheduleRequest, ::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_backup_schedule(name: nil) + # Pass arguments to `get_backup_schedule` 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 backup schedule. + # + # Format + # `projects/{project}/databases/{database}/backupSchedules/{backup_schedule}` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Firestore::Admin::V1::BackupSchedule] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Firestore::Admin::V1::BackupSchedule] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/firestore/admin/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Firestore::Admin::V1::GetBackupScheduleRequest.new + # + # # Call the get_backup_schedule method. + # result = client.get_backup_schedule request + # + # # The returned object is of type Google::Cloud::Firestore::Admin::V1::BackupSchedule. + # p result + # + def get_backup_schedule request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Firestore::Admin::V1::GetBackupScheduleRequest + + # 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_backup_schedule.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project 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::Firestore::Admin::V1::VERSION + 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_backup_schedule.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_backup_schedule.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @firestore_admin_stub.call_rpc :get_backup_schedule, request, options: options do |response, operation| + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # List backup schedules. + # + # @overload list_backup_schedules(request, options = nil) + # Pass arguments to `list_backup_schedules` via a request object, either of type + # {::Google::Cloud::Firestore::Admin::V1::ListBackupSchedulesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Firestore::Admin::V1::ListBackupSchedulesRequest, ::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_backup_schedules(parent: nil) + # Pass arguments to `list_backup_schedules` 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 database. + # + # Format is `projects/{project}/databases/{database}`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Firestore::Admin::V1::ListBackupSchedulesResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Firestore::Admin::V1::ListBackupSchedulesResponse] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/firestore/admin/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Firestore::Admin::V1::ListBackupSchedulesRequest.new + # + # # Call the list_backup_schedules method. + # result = client.list_backup_schedules request + # + # # The returned object is of type Google::Cloud::Firestore::Admin::V1::ListBackupSchedulesResponse. + # p result + # + def list_backup_schedules request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Firestore::Admin::V1::ListBackupSchedulesRequest + + # 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_backup_schedules.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project 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::Firestore::Admin::V1::VERSION + 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_backup_schedules.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_backup_schedules.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @firestore_admin_stub.call_rpc :list_backup_schedules, request, options: options do |response, operation| + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates a backup schedule. + # + # @overload update_backup_schedule(request, options = nil) + # Pass arguments to `update_backup_schedule` via a request object, either of type + # {::Google::Cloud::Firestore::Admin::V1::UpdateBackupScheduleRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Firestore::Admin::V1::UpdateBackupScheduleRequest, ::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_backup_schedule(backup_schedule: nil, update_mask: nil) + # Pass arguments to `update_backup_schedule` 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 backup_schedule [::Google::Cloud::Firestore::Admin::V1::BackupSchedule, ::Hash] + # Required. The backup schedule to update. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # The list of fields to be updated. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Firestore::Admin::V1::BackupSchedule] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Firestore::Admin::V1::BackupSchedule] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/firestore/admin/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Firestore::Admin::V1::UpdateBackupScheduleRequest.new + # + # # Call the update_backup_schedule method. + # result = client.update_backup_schedule request + # + # # The returned object is of type Google::Cloud::Firestore::Admin::V1::BackupSchedule. + # p result + # + def update_backup_schedule request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Firestore::Admin::V1::UpdateBackupScheduleRequest + + # 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_backup_schedule.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project 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::Firestore::Admin::V1::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.backup_schedule&.name + header_params["backup_schedule.name"] = request.backup_schedule.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_backup_schedule.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_backup_schedule.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @firestore_admin_stub.call_rpc :update_backup_schedule, request, options: options do |response, operation| + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a backup schedule. + # + # @overload delete_backup_schedule(request, options = nil) + # Pass arguments to `delete_backup_schedule` via a request object, either of type + # {::Google::Cloud::Firestore::Admin::V1::DeleteBackupScheduleRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Firestore::Admin::V1::DeleteBackupScheduleRequest, ::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_backup_schedule(name: nil) + # Pass arguments to `delete_backup_schedule` 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 backup schedule. + # + # Format + # `projects/{project}/databases/{database}/backupSchedules/{backup_schedule}` + # + # @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/firestore/admin/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Firestore::Admin::V1::DeleteBackupScheduleRequest.new + # + # # Call the delete_backup_schedule method. + # result = client.delete_backup_schedule request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_backup_schedule request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Firestore::Admin::V1::DeleteBackupScheduleRequest + + # 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_backup_schedule.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project 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::Firestore::Admin::V1::VERSION + 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_backup_schedule.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_backup_schedule.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @firestore_admin_stub.call_rpc :delete_backup_schedule, request, options: options do |response, operation| + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the FirestoreAdmin API. + # + # This class represents the configuration for FirestoreAdmin, + # 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::Firestore::Admin::V1::FirestoreAdmin::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # create_index to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.create_index.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.create_index.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)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no 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] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "firestore.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + 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 + + # @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 FirestoreAdmin API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `create_index` + # @return [::Gapic::Config::Method] + # + attr_reader :create_index + ## + # RPC-specific configuration for `list_indexes` + # @return [::Gapic::Config::Method] + # + attr_reader :list_indexes + ## + # RPC-specific configuration for `get_index` + # @return [::Gapic::Config::Method] + # + attr_reader :get_index + ## + # RPC-specific configuration for `delete_index` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_index + ## + # RPC-specific configuration for `get_field` + # @return [::Gapic::Config::Method] + # + attr_reader :get_field + ## + # RPC-specific configuration for `update_field` + # @return [::Gapic::Config::Method] + # + attr_reader :update_field + ## + # RPC-specific configuration for `list_fields` + # @return [::Gapic::Config::Method] + # + attr_reader :list_fields + ## + # RPC-specific configuration for `export_documents` + # @return [::Gapic::Config::Method] + # + attr_reader :export_documents + ## + # RPC-specific configuration for `import_documents` + # @return [::Gapic::Config::Method] + # + attr_reader :import_documents + ## + # RPC-specific configuration for `create_database` + # @return [::Gapic::Config::Method] + # + attr_reader :create_database + ## + # RPC-specific configuration for `get_database` + # @return [::Gapic::Config::Method] + # + attr_reader :get_database + ## + # RPC-specific configuration for `list_databases` + # @return [::Gapic::Config::Method] + # + attr_reader :list_databases + ## + # RPC-specific configuration for `update_database` + # @return [::Gapic::Config::Method] + # + attr_reader :update_database + ## + # RPC-specific configuration for `delete_database` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_database + ## + # RPC-specific configuration for `get_backup` + # @return [::Gapic::Config::Method] + # + attr_reader :get_backup + ## + # RPC-specific configuration for `list_backups` + # @return [::Gapic::Config::Method] + # + attr_reader :list_backups + ## + # RPC-specific configuration for `delete_backup` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_backup + ## + # RPC-specific configuration for `restore_database` + # @return [::Gapic::Config::Method] + # + attr_reader :restore_database + ## + # RPC-specific configuration for `create_backup_schedule` + # @return [::Gapic::Config::Method] + # + attr_reader :create_backup_schedule + ## + # RPC-specific configuration for `get_backup_schedule` + # @return [::Gapic::Config::Method] + # + attr_reader :get_backup_schedule + ## + # RPC-specific configuration for `list_backup_schedules` + # @return [::Gapic::Config::Method] + # + attr_reader :list_backup_schedules + ## + # RPC-specific configuration for `update_backup_schedule` + # @return [::Gapic::Config::Method] + # + attr_reader :update_backup_schedule + ## + # RPC-specific configuration for `delete_backup_schedule` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_backup_schedule + + # @private + def initialize parent_rpcs = nil + create_index_config = parent_rpcs.create_index if parent_rpcs.respond_to? :create_index + @create_index = ::Gapic::Config::Method.new create_index_config + list_indexes_config = parent_rpcs.list_indexes if parent_rpcs.respond_to? :list_indexes + @list_indexes = ::Gapic::Config::Method.new list_indexes_config + get_index_config = parent_rpcs.get_index if parent_rpcs.respond_to? :get_index + @get_index = ::Gapic::Config::Method.new get_index_config + delete_index_config = parent_rpcs.delete_index if parent_rpcs.respond_to? :delete_index + @delete_index = ::Gapic::Config::Method.new delete_index_config + get_field_config = parent_rpcs.get_field if parent_rpcs.respond_to? :get_field + @get_field = ::Gapic::Config::Method.new get_field_config + update_field_config = parent_rpcs.update_field if parent_rpcs.respond_to? :update_field + @update_field = ::Gapic::Config::Method.new update_field_config + list_fields_config = parent_rpcs.list_fields if parent_rpcs.respond_to? :list_fields + @list_fields = ::Gapic::Config::Method.new list_fields_config + export_documents_config = parent_rpcs.export_documents if parent_rpcs.respond_to? :export_documents + @export_documents = ::Gapic::Config::Method.new export_documents_config + import_documents_config = parent_rpcs.import_documents if parent_rpcs.respond_to? :import_documents + @import_documents = ::Gapic::Config::Method.new import_documents_config + create_database_config = parent_rpcs.create_database if parent_rpcs.respond_to? :create_database + @create_database = ::Gapic::Config::Method.new create_database_config + get_database_config = parent_rpcs.get_database if parent_rpcs.respond_to? :get_database + @get_database = ::Gapic::Config::Method.new get_database_config + list_databases_config = parent_rpcs.list_databases if parent_rpcs.respond_to? :list_databases + @list_databases = ::Gapic::Config::Method.new list_databases_config + update_database_config = parent_rpcs.update_database if parent_rpcs.respond_to? :update_database + @update_database = ::Gapic::Config::Method.new update_database_config + delete_database_config = parent_rpcs.delete_database if parent_rpcs.respond_to? :delete_database + @delete_database = ::Gapic::Config::Method.new delete_database_config + get_backup_config = parent_rpcs.get_backup if parent_rpcs.respond_to? :get_backup + @get_backup = ::Gapic::Config::Method.new get_backup_config + list_backups_config = parent_rpcs.list_backups if parent_rpcs.respond_to? :list_backups + @list_backups = ::Gapic::Config::Method.new list_backups_config + delete_backup_config = parent_rpcs.delete_backup if parent_rpcs.respond_to? :delete_backup + @delete_backup = ::Gapic::Config::Method.new delete_backup_config + restore_database_config = parent_rpcs.restore_database if parent_rpcs.respond_to? :restore_database + @restore_database = ::Gapic::Config::Method.new restore_database_config + create_backup_schedule_config = parent_rpcs.create_backup_schedule if parent_rpcs.respond_to? :create_backup_schedule + @create_backup_schedule = ::Gapic::Config::Method.new create_backup_schedule_config + get_backup_schedule_config = parent_rpcs.get_backup_schedule if parent_rpcs.respond_to? :get_backup_schedule + @get_backup_schedule = ::Gapic::Config::Method.new get_backup_schedule_config + list_backup_schedules_config = parent_rpcs.list_backup_schedules if parent_rpcs.respond_to? :list_backup_schedules + @list_backup_schedules = ::Gapic::Config::Method.new list_backup_schedules_config + update_backup_schedule_config = parent_rpcs.update_backup_schedule if parent_rpcs.respond_to? :update_backup_schedule + @update_backup_schedule = ::Gapic::Config::Method.new update_backup_schedule_config + delete_backup_schedule_config = parent_rpcs.delete_backup_schedule if parent_rpcs.respond_to? :delete_backup_schedule + @delete_backup_schedule = ::Gapic::Config::Method.new delete_backup_schedule_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-firestore-admin-v1/lib/google/cloud/firestore/admin/v1/firestore_admin/credentials.rb b/owl-bot-staging/google-cloud-firestore-admin-v1/lib/google/cloud/firestore/admin/v1/firestore_admin/credentials.rb new file mode 100644 index 000000000000..5c8dbd98ca64 --- /dev/null +++ b/owl-bot-staging/google-cloud-firestore-admin-v1/lib/google/cloud/firestore/admin/v1/firestore_admin/credentials.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2024 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 Firestore + module Admin + module V1 + module FirestoreAdmin + # Credentials for the FirestoreAdmin API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/datastore" + ] + self.env_vars = [ + "FIRESTORE_CREDENTIALS", + "FIRESTORE_KEYFILE", + "GOOGLE_CLOUD_CREDENTIALS", + "GOOGLE_CLOUD_KEYFILE", + "GCLOUD_KEYFILE", + "FIRESTORE_CREDENTIALS_JSON", + "FIRESTORE_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 diff --git a/owl-bot-staging/google-cloud-firestore-admin-v1/lib/google/cloud/firestore/admin/v1/firestore_admin/operations.rb b/owl-bot-staging/google-cloud-firestore-admin-v1/lib/google/cloud/firestore/admin/v1/firestore_admin/operations.rb new file mode 100644 index 000000000000..fe6ece7518aa --- /dev/null +++ b/owl-bot-staging/google-cloud-firestore-admin-v1/lib/google/cloud/firestore/admin/v1/firestore_admin/operations.rb @@ -0,0 +1,803 @@ +# frozen_string_literal: true + +# Copyright 2024 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 Firestore + module Admin + module V1 + module FirestoreAdmin + # Service that implements Longrunning Operations API. + class Operations + # @private + DEFAULT_ENDPOINT_TEMPLATE = "firestore.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :operations_stub + + ## + # Configuration for the FirestoreAdmin 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 FirestoreAdmin 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`. + # + # NOTE: the `name` binding allows API services to override the binding + # to use different resource name schemes, such as `users/*/operations`. To + # override the binding, API services can add a binding such as + # `"/v1/{name=users/*}/operations"` to their service configuration. + # For backwards compatibility, the default name includes the operations + # collection id, however overriding users must ensure the name binding + # is the parent resource, without the operations collection id. + # + # @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) + # 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. + # + # @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 and x-goog-user-project 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::Firestore::Admin::V1::VERSION + 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? + return 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 and x-goog-user-project 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::Firestore::Admin::V1::VERSION + 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? + return 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 and x-goog-user-project 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::Firestore::Admin::V1::VERSION + 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? + return response + 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 and x-goog-user-project 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::Firestore::Admin::V1::VERSION + 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? + return response + 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 and x-goog-user-project 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::Firestore::Admin::V1::VERSION + 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? + return 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: + # * (`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)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no 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] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "firestore.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + 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 + + # @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 diff --git a/owl-bot-staging/google-cloud-firestore-admin-v1/lib/google/cloud/firestore/admin/v1/firestore_admin/paths.rb b/owl-bot-staging/google-cloud-firestore-admin-v1/lib/google/cloud/firestore/admin/v1/firestore_admin/paths.rb new file mode 100644 index 000000000000..ca81de998ab2 --- /dev/null +++ b/owl-bot-staging/google-cloud-firestore-admin-v1/lib/google/cloud/firestore/admin/v1/firestore_admin/paths.rb @@ -0,0 +1,182 @@ +# frozen_string_literal: true + +# Copyright 2024 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 Firestore + module Admin + module V1 + module FirestoreAdmin + # Path helper methods for the FirestoreAdmin API. + module Paths + ## + # Create a fully-qualified Backup resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/backups/{backup}` + # + # @param project [String] + # @param location [String] + # @param backup [String] + # + # @return [::String] + def backup_path project:, location:, backup: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/backups/#{backup}" + end + + ## + # Create a fully-qualified BackupSchedule resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/databases/{database}/backupSchedules/{backup_schedule}` + # + # @param project [String] + # @param database [String] + # @param backup_schedule [String] + # + # @return [::String] + def backup_schedule_path project:, database:, backup_schedule: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "database cannot contain /" if database.to_s.include? "/" + + "projects/#{project}/databases/#{database}/backupSchedules/#{backup_schedule}" + end + + ## + # Create a fully-qualified CollectionGroup resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/databases/{database}/collectionGroups/{collection}` + # + # @param project [String] + # @param database [String] + # @param collection [String] + # + # @return [::String] + def collection_group_path project:, database:, collection: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "database cannot contain /" if database.to_s.include? "/" + + "projects/#{project}/databases/#{database}/collectionGroups/#{collection}" + end + + ## + # Create a fully-qualified Database resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/databases/{database}` + # + # @param project [String] + # @param database [String] + # + # @return [::String] + def database_path project:, database: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + + "projects/#{project}/databases/#{database}" + end + + ## + # Create a fully-qualified Field resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/databases/{database}/collectionGroups/{collection}/fields/{field}` + # + # @param project [String] + # @param database [String] + # @param collection [String] + # @param field [String] + # + # @return [::String] + def field_path project:, database:, collection:, field: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "database cannot contain /" if database.to_s.include? "/" + raise ::ArgumentError, "collection cannot contain /" if collection.to_s.include? "/" + + "projects/#{project}/databases/#{database}/collectionGroups/#{collection}/fields/#{field}" + end + + ## + # Create a fully-qualified Index resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/databases/{database}/collectionGroups/{collection}/indexes/{index}` + # + # @param project [String] + # @param database [String] + # @param collection [String] + # @param index [String] + # + # @return [::String] + def index_path project:, database:, collection:, index: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "database cannot contain /" if database.to_s.include? "/" + raise ::ArgumentError, "collection cannot contain /" if collection.to_s.include? "/" + + "projects/#{project}/databases/#{database}/collectionGroups/#{collection}/indexes/#{index}" + end + + ## + # Create a fully-qualified Location resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}` + # + # @param project [String] + # @param location [String] + # + # @return [::String] + def location_path project:, location: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + + "projects/#{project}/locations/#{location}" + 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 diff --git a/owl-bot-staging/google-cloud-firestore-admin-v1/lib/google/cloud/firestore/admin/v1/firestore_admin/rest.rb b/owl-bot-staging/google-cloud-firestore-admin-v1/lib/google/cloud/firestore/admin/v1/firestore_admin/rest.rb new file mode 100644 index 000000000000..6372c7b142db --- /dev/null +++ b/owl-bot-staging/google-cloud-firestore-admin-v1/lib/google/cloud/firestore/admin/v1/firestore_admin/rest.rb @@ -0,0 +1,82 @@ +# frozen_string_literal: true + +# Copyright 2024 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/firestore/admin/v1/version" + +require "google/cloud/firestore/admin/v1/firestore_admin/credentials" +require "google/cloud/firestore/admin/v1/firestore_admin/paths" +require "google/cloud/firestore/admin/v1/firestore_admin/rest/operations" +require "google/cloud/firestore/admin/v1/firestore_admin/rest/client" + +module Google + module Cloud + module Firestore + module Admin + module V1 + ## + # The Cloud Firestore Admin API. + # + # This API provides several administrative services for Cloud Firestore. + # + # Project, Database, Namespace, Collection, Collection Group, and Document are + # used as defined in the Google Cloud Firestore API. + # + # Operation: An Operation represents work being performed in the background. + # + # The index service manages Cloud Firestore indexes. + # + # Index creation is performed asynchronously. + # An Operation resource is created for each such asynchronous operation. + # The state of the operation (including any errors encountered) + # may be queried via the Operation resource. + # + # The Operations collection provides a record of actions performed for the + # specified Project (including any Operations in progress). Operations are not + # created directly but through calls on other collections or resources. + # + # An Operation that is done may be deleted so that it is no longer listed as + # part of the Operation collection. Operations are garbage collected after + # 30 days. By default, ListOperations will only return in progress and failed + # operations. To list completed operation, issue a ListOperations request with + # the filter `done: true`. + # + # Operations are created by service `FirestoreAdmin`, but are accessed via + # service `google.longrunning.Operations`. + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/firestore/admin/v1/firestore_admin/rest" + # client = ::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Rest::Client.new + # + module FirestoreAdmin + # Client for the REST transport + module Rest + end + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "rest", "helpers.rb" +require "google/cloud/firestore/admin/v1/firestore_admin/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-firestore-admin-v1/lib/google/cloud/firestore/admin/v1/firestore_admin/rest/client.rb b/owl-bot-staging/google-cloud-firestore-admin-v1/lib/google/cloud/firestore/admin/v1/firestore_admin/rest/client.rb new file mode 100644 index 000000000000..e87338b923b5 --- /dev/null +++ b/owl-bot-staging/google-cloud-firestore-admin-v1/lib/google/cloud/firestore/admin/v1/firestore_admin/rest/client.rb @@ -0,0 +1,2619 @@ +# frozen_string_literal: true + +# Copyright 2024 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/firestore/admin/v1/firestore_admin_pb" +require "google/cloud/firestore/admin/v1/firestore_admin/rest/service_stub" +require "google/cloud/location/rest" + +module Google + module Cloud + module Firestore + module Admin + module V1 + module FirestoreAdmin + module Rest + ## + # REST client for the FirestoreAdmin service. + # + # The Cloud Firestore Admin API. + # + # This API provides several administrative services for Cloud Firestore. + # + # Project, Database, Namespace, Collection, Collection Group, and Document are + # used as defined in the Google Cloud Firestore API. + # + # Operation: An Operation represents work being performed in the background. + # + # The index service manages Cloud Firestore indexes. + # + # Index creation is performed asynchronously. + # An Operation resource is created for each such asynchronous operation. + # The state of the operation (including any errors encountered) + # may be queried via the Operation resource. + # + # The Operations collection provides a record of actions performed for the + # specified Project (including any Operations in progress). Operations are not + # created directly but through calls on other collections or resources. + # + # An Operation that is done may be deleted so that it is no longer listed as + # part of the Operation collection. Operations are garbage collected after + # 30 days. By default, ListOperations will only return in progress and failed + # operations. To list completed operation, issue a ListOperations request with + # the filter `done: true`. + # + # Operations are created by service `FirestoreAdmin`, but are accessed via + # service `google.longrunning.Operations`. + # + class Client + # @private + DEFAULT_ENDPOINT_TEMPLATE = "firestore.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :firestore_admin_stub + + ## + # Configure the FirestoreAdmin Client class. + # + # See {::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all FirestoreAdmin clients + # ::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::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", "Firestore", "Admin", "V1"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get parent_name + break parent_const.configure if parent_const.respond_to? :configure + namespace.pop + end + default_config = Client::Configuration.new parent_config + + default_config.rpcs.create_index.timeout = 60.0 + + default_config.rpcs.list_indexes.timeout = 60.0 + default_config.rpcs.list_indexes.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 13, 4] + } + + default_config.rpcs.get_index.timeout = 60.0 + default_config.rpcs.get_index.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 13, 4] + } + + default_config.rpcs.delete_index.timeout = 60.0 + default_config.rpcs.delete_index.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 13, 4] + } + + default_config.rpcs.get_field.timeout = 60.0 + default_config.rpcs.get_field.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 13, 4] + } + + default_config.rpcs.update_field.timeout = 60.0 + + default_config.rpcs.list_fields.timeout = 60.0 + default_config.rpcs.list_fields.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 13, 4] + } + + default_config.rpcs.export_documents.timeout = 60.0 + + default_config.rpcs.import_documents.timeout = 60.0 + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the FirestoreAdmin 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::Firestore::Admin::V1::FirestoreAdmin::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 + @firestore_admin_stub.universe_domain + end + + ## + # Create a new FirestoreAdmin REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the FirestoreAdmin 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::Firestore::Admin::V1::FirestoreAdmin::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 + + @firestore_admin_stub = ::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials + ) + + @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @firestore_admin_stub.endpoint + config.universe_domain = @firestore_admin_stub.universe_domain + end + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Rest::Operations] + # + attr_reader :operations_client + + ## + # Get the associated client for mix-in of the Locations. + # + # @return [Google::Cloud::Location::Locations::Rest::Client] + # + attr_reader :location_client + + # Service calls + + ## + # Creates a composite index. This returns a + # {::Google::Longrunning::Operation google.longrunning.Operation} which may be + # used to track the status of the creation. The metadata for the operation + # will be the type + # {::Google::Cloud::Firestore::Admin::V1::IndexOperationMetadata IndexOperationMetadata}. + # + # @overload create_index(request, options = nil) + # Pass arguments to `create_index` via a request object, either of type + # {::Google::Cloud::Firestore::Admin::V1::CreateIndexRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Firestore::Admin::V1::CreateIndexRequest, ::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_index(parent: nil, index: nil) + # Pass arguments to `create_index` 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. A parent name of the form + # `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}` + # @param index [::Google::Cloud::Firestore::Admin::V1::Index, ::Hash] + # Required. The composite index to create. + # @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/firestore/admin/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Firestore::Admin::V1::CreateIndexRequest.new + # + # # Call the create_index method. + # result = client.create_index 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_index request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Firestore::Admin::V1::CreateIndexRequest + + # 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_index.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project 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::Firestore::Admin::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.create_index.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_index.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @firestore_admin_stub.create_index request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + return result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists composite indexes. + # + # @overload list_indexes(request, options = nil) + # Pass arguments to `list_indexes` via a request object, either of type + # {::Google::Cloud::Firestore::Admin::V1::ListIndexesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Firestore::Admin::V1::ListIndexesRequest, ::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_indexes(parent: nil, filter: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_indexes` 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. A parent name of the form + # `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}` + # @param filter [::String] + # The filter to apply to list results. + # @param page_size [::Integer] + # The number of results to return. + # @param page_token [::String] + # A page token, returned from a previous call to + # {::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Rest::Client#list_indexes FirestoreAdmin.ListIndexes}, + # that may be used to get the next page of results. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Firestore::Admin::V1::Index>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Firestore::Admin::V1::Index>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/firestore/admin/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Firestore::Admin::V1::ListIndexesRequest.new + # + # # Call the list_indexes method. + # result = client.list_indexes 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::Firestore::Admin::V1::Index. + # p item + # end + # + def list_indexes request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Firestore::Admin::V1::ListIndexesRequest + + # 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_indexes.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project 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::Firestore::Admin::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_indexes.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_indexes.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @firestore_admin_stub.list_indexes request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @firestore_admin_stub, :list_indexes, "indexes", request, result, options + yield result, operation if block_given? + return result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets a composite index. + # + # @overload get_index(request, options = nil) + # Pass arguments to `get_index` via a request object, either of type + # {::Google::Cloud::Firestore::Admin::V1::GetIndexRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Firestore::Admin::V1::GetIndexRequest, ::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_index(name: nil) + # Pass arguments to `get_index` 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. A name of the form + # `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/indexes/{index_id}` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Firestore::Admin::V1::Index] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Firestore::Admin::V1::Index] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/firestore/admin/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Firestore::Admin::V1::GetIndexRequest.new + # + # # Call the get_index method. + # result = client.get_index request + # + # # The returned object is of type Google::Cloud::Firestore::Admin::V1::Index. + # p result + # + def get_index request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Firestore::Admin::V1::GetIndexRequest + + # 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_index.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project 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::Firestore::Admin::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_index.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_index.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @firestore_admin_stub.get_index request, options do |result, operation| + yield result, operation if block_given? + return result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a composite index. + # + # @overload delete_index(request, options = nil) + # Pass arguments to `delete_index` via a request object, either of type + # {::Google::Cloud::Firestore::Admin::V1::DeleteIndexRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Firestore::Admin::V1::DeleteIndexRequest, ::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_index(name: nil) + # Pass arguments to `delete_index` 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. A name of the form + # `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/indexes/{index_id}` + # @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/firestore/admin/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Firestore::Admin::V1::DeleteIndexRequest.new + # + # # Call the delete_index method. + # result = client.delete_index request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_index request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Firestore::Admin::V1::DeleteIndexRequest + + # 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_index.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project 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::Firestore::Admin::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.delete_index.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_index.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @firestore_admin_stub.delete_index request, options do |result, operation| + yield result, operation if block_given? + return result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets the metadata and configuration for a Field. + # + # @overload get_field(request, options = nil) + # Pass arguments to `get_field` via a request object, either of type + # {::Google::Cloud::Firestore::Admin::V1::GetFieldRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Firestore::Admin::V1::GetFieldRequest, ::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_field(name: nil) + # Pass arguments to `get_field` 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. A name of the form + # `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/fields/{field_id}` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Firestore::Admin::V1::Field] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Firestore::Admin::V1::Field] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/firestore/admin/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Firestore::Admin::V1::GetFieldRequest.new + # + # # Call the get_field method. + # result = client.get_field request + # + # # The returned object is of type Google::Cloud::Firestore::Admin::V1::Field. + # p result + # + def get_field request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Firestore::Admin::V1::GetFieldRequest + + # 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_field.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project 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::Firestore::Admin::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_field.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_field.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @firestore_admin_stub.get_field request, options do |result, operation| + yield result, operation if block_given? + return result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates a field configuration. Currently, field updates apply only to + # single field index configuration. However, calls to + # {::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Rest::Client#update_field FirestoreAdmin.UpdateField} + # should provide a field mask to avoid changing any configuration that the + # caller isn't aware of. The field mask should be specified as: `{ paths: + # "index_config" }`. + # + # This call returns a + # {::Google::Longrunning::Operation google.longrunning.Operation} which may be + # used to track the status of the field update. The metadata for the + # operation will be the type + # {::Google::Cloud::Firestore::Admin::V1::FieldOperationMetadata FieldOperationMetadata}. + # + # To configure the default field settings for the database, use + # the special `Field` with resource name: + # `projects/{project_id}/databases/{database_id}/collectionGroups/__default__/fields/*`. + # + # @overload update_field(request, options = nil) + # Pass arguments to `update_field` via a request object, either of type + # {::Google::Cloud::Firestore::Admin::V1::UpdateFieldRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Firestore::Admin::V1::UpdateFieldRequest, ::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_field(field: nil, update_mask: nil) + # Pass arguments to `update_field` 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 field [::Google::Cloud::Firestore::Admin::V1::Field, ::Hash] + # Required. The field to be updated. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # A mask, relative to the field. If specified, only configuration specified + # by this field_mask will be updated in the field. + # @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/firestore/admin/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Firestore::Admin::V1::UpdateFieldRequest.new + # + # # Call the update_field method. + # result = client.update_field 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_field request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Firestore::Admin::V1::UpdateFieldRequest + + # 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_field.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project 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::Firestore::Admin::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.update_field.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_field.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @firestore_admin_stub.update_field request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + return result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists the field configuration and metadata for this database. + # + # Currently, + # {::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Rest::Client#list_fields FirestoreAdmin.ListFields} + # only supports listing fields that have been explicitly overridden. To issue + # this query, call + # {::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Rest::Client#list_fields FirestoreAdmin.ListFields} + # with the filter set to `indexConfig.usesAncestorConfig:false` or + # `ttlConfig:*`. + # + # @overload list_fields(request, options = nil) + # Pass arguments to `list_fields` via a request object, either of type + # {::Google::Cloud::Firestore::Admin::V1::ListFieldsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Firestore::Admin::V1::ListFieldsRequest, ::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_fields(parent: nil, filter: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_fields` 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. A parent name of the form + # `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}` + # @param filter [::String] + # The filter to apply to list results. Currently, + # {::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Rest::Client#list_fields FirestoreAdmin.ListFields} + # only supports listing fields that have been explicitly overridden. To issue + # this query, call + # {::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Rest::Client#list_fields FirestoreAdmin.ListFields} + # with a filter that includes `indexConfig.usesAncestorConfig:false` . + # @param page_size [::Integer] + # The number of results to return. + # @param page_token [::String] + # A page token, returned from a previous call to + # {::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Rest::Client#list_fields FirestoreAdmin.ListFields}, + # that may be used to get the next page of results. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Firestore::Admin::V1::Field>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Firestore::Admin::V1::Field>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/firestore/admin/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Firestore::Admin::V1::ListFieldsRequest.new + # + # # Call the list_fields method. + # result = client.list_fields 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::Firestore::Admin::V1::Field. + # p item + # end + # + def list_fields request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Firestore::Admin::V1::ListFieldsRequest + + # 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_fields.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project 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::Firestore::Admin::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_fields.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_fields.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @firestore_admin_stub.list_fields request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @firestore_admin_stub, :list_fields, "fields", request, result, options + yield result, operation if block_given? + return result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Exports a copy of all or a subset of documents from Google Cloud Firestore + # to another storage system, such as Google Cloud Storage. Recent updates to + # documents may not be reflected in the export. The export occurs in the + # background and its progress can be monitored and managed via the + # Operation resource that is created. The output of an export may only be + # used once the associated operation is done. If an export operation is + # cancelled before completion it may leave partial data behind in Google + # Cloud Storage. + # + # For more details on export behavior and output format, refer to: + # https://cloud.google.com/firestore/docs/manage-data/export-import + # + # @overload export_documents(request, options = nil) + # Pass arguments to `export_documents` via a request object, either of type + # {::Google::Cloud::Firestore::Admin::V1::ExportDocumentsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Firestore::Admin::V1::ExportDocumentsRequest, ::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 export_documents(name: nil, collection_ids: nil, output_uri_prefix: nil, namespace_ids: nil, snapshot_time: nil) + # Pass arguments to `export_documents` 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. Database to export. Should be of the form: + # `projects/{project_id}/databases/{database_id}`. + # @param collection_ids [::Array<::String>] + # Which collection ids to export. Unspecified means all collections. + # @param output_uri_prefix [::String] + # The output URI. Currently only supports Google Cloud Storage URIs of the + # form: `gs://BUCKET_NAME[/NAMESPACE_PATH]`, where `BUCKET_NAME` is the name + # of the Google Cloud Storage bucket and `NAMESPACE_PATH` is an optional + # Google Cloud Storage namespace path. When + # choosing a name, be sure to consider Google Cloud Storage naming + # guidelines: https://cloud.google.com/storage/docs/naming. + # If the URI is a bucket (without a namespace path), a prefix will be + # generated based on the start time. + # @param namespace_ids [::Array<::String>] + # An empty list represents all namespaces. This is the preferred + # usage for databases that don't use namespaces. + # + # An empty string element represents the default namespace. This should be + # used if the database has data in non-default namespaces, but doesn't want + # to include them. Each namespace in this list must be unique. + # @param snapshot_time [::Google::Protobuf::Timestamp, ::Hash] + # The timestamp that corresponds to the version of the database to be + # exported. The timestamp must be in the past, rounded to the minute and not + # older than + # {::Google::Cloud::Firestore::Admin::V1::Database#earliest_version_time earliestVersionTime}. + # If specified, then the exported documents will represent a consistent view + # of the database at the provided time. Otherwise, there are no guarantees + # about the consistency of the exported documents. + # @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/firestore/admin/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Firestore::Admin::V1::ExportDocumentsRequest.new + # + # # Call the export_documents method. + # result = client.export_documents 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 export_documents request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Firestore::Admin::V1::ExportDocumentsRequest + + # 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.export_documents.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project 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::Firestore::Admin::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.export_documents.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.export_documents.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @firestore_admin_stub.export_documents request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + return result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Imports documents into Google Cloud Firestore. Existing documents with the + # same name are overwritten. The import occurs in the background and its + # progress can be monitored and managed via the Operation resource that is + # created. If an ImportDocuments operation is cancelled, it is possible + # that a subset of the data has already been imported to Cloud Firestore. + # + # @overload import_documents(request, options = nil) + # Pass arguments to `import_documents` via a request object, either of type + # {::Google::Cloud::Firestore::Admin::V1::ImportDocumentsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Firestore::Admin::V1::ImportDocumentsRequest, ::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 import_documents(name: nil, collection_ids: nil, input_uri_prefix: nil, namespace_ids: nil) + # Pass arguments to `import_documents` 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. Database to import into. Should be of the form: + # `projects/{project_id}/databases/{database_id}`. + # @param collection_ids [::Array<::String>] + # Which collection ids to import. Unspecified means all collections included + # in the import. + # @param input_uri_prefix [::String] + # Location of the exported files. + # This must match the output_uri_prefix of an ExportDocumentsResponse from + # an export that has completed successfully. + # See: + # {::Google::Cloud::Firestore::Admin::V1::ExportDocumentsResponse#output_uri_prefix google.firestore.admin.v1.ExportDocumentsResponse.output_uri_prefix}. + # @param namespace_ids [::Array<::String>] + # An empty list represents all namespaces. This is the preferred + # usage for databases that don't use namespaces. + # + # An empty string element represents the default namespace. This should be + # used if the database has data in non-default namespaces, but doesn't want + # to include them. Each namespace in this list must be unique. + # @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/firestore/admin/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Firestore::Admin::V1::ImportDocumentsRequest.new + # + # # Call the import_documents method. + # result = client.import_documents 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 import_documents request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Firestore::Admin::V1::ImportDocumentsRequest + + # 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.import_documents.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project 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::Firestore::Admin::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.import_documents.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.import_documents.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @firestore_admin_stub.import_documents request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + return result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Create a database. + # + # @overload create_database(request, options = nil) + # Pass arguments to `create_database` via a request object, either of type + # {::Google::Cloud::Firestore::Admin::V1::CreateDatabaseRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Firestore::Admin::V1::CreateDatabaseRequest, ::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_database(parent: nil, database: nil, database_id: nil) + # Pass arguments to `create_database` 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. A parent name of the form + # `projects/{project_id}` + # @param database [::Google::Cloud::Firestore::Admin::V1::Database, ::Hash] + # Required. The Database to create. + # @param database_id [::String] + # Required. The ID to use for the database, which will become the final + # component of the database's resource name. + # + # This value should be 4-63 characters. Valid characters are /[a-z][0-9]-/ + # with first character a letter and the last a letter or a number. Must not + # be UUID-like /[0-9a-f]\\{8}(-[0-9a-f]\\{4})\\{3}-[0-9a-f]\\{12}/. + # + # "(default)" database id is also valid. + # @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/firestore/admin/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Firestore::Admin::V1::CreateDatabaseRequest.new + # + # # Call the create_database method. + # result = client.create_database 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_database request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Firestore::Admin::V1::CreateDatabaseRequest + + # 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_database.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project 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::Firestore::Admin::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.create_database.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_database.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @firestore_admin_stub.create_database request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + return result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets information about a database. + # + # @overload get_database(request, options = nil) + # Pass arguments to `get_database` via a request object, either of type + # {::Google::Cloud::Firestore::Admin::V1::GetDatabaseRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Firestore::Admin::V1::GetDatabaseRequest, ::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_database(name: nil) + # Pass arguments to `get_database` 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. A name of the form + # `projects/{project_id}/databases/{database_id}` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Firestore::Admin::V1::Database] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Firestore::Admin::V1::Database] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/firestore/admin/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Firestore::Admin::V1::GetDatabaseRequest.new + # + # # Call the get_database method. + # result = client.get_database request + # + # # The returned object is of type Google::Cloud::Firestore::Admin::V1::Database. + # p result + # + def get_database request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Firestore::Admin::V1::GetDatabaseRequest + + # 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_database.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project 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::Firestore::Admin::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_database.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_database.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @firestore_admin_stub.get_database request, options do |result, operation| + yield result, operation if block_given? + return result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # List all the databases in the project. + # + # @overload list_databases(request, options = nil) + # Pass arguments to `list_databases` via a request object, either of type + # {::Google::Cloud::Firestore::Admin::V1::ListDatabasesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Firestore::Admin::V1::ListDatabasesRequest, ::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_databases(parent: nil) + # Pass arguments to `list_databases` 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. A parent name of the form + # `projects/{project_id}` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Firestore::Admin::V1::ListDatabasesResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Firestore::Admin::V1::ListDatabasesResponse] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/firestore/admin/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Firestore::Admin::V1::ListDatabasesRequest.new + # + # # Call the list_databases method. + # result = client.list_databases request + # + # # The returned object is of type Google::Cloud::Firestore::Admin::V1::ListDatabasesResponse. + # p result + # + def list_databases request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Firestore::Admin::V1::ListDatabasesRequest + + # 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_databases.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project 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::Firestore::Admin::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_databases.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_databases.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @firestore_admin_stub.list_databases request, options do |result, operation| + yield result, operation if block_given? + return result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates a database. + # + # @overload update_database(request, options = nil) + # Pass arguments to `update_database` via a request object, either of type + # {::Google::Cloud::Firestore::Admin::V1::UpdateDatabaseRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Firestore::Admin::V1::UpdateDatabaseRequest, ::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_database(database: nil, update_mask: nil) + # Pass arguments to `update_database` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param database [::Google::Cloud::Firestore::Admin::V1::Database, ::Hash] + # Required. The database to update. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # The list of fields to be updated. + # @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/firestore/admin/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Firestore::Admin::V1::UpdateDatabaseRequest.new + # + # # Call the update_database method. + # result = client.update_database 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_database request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Firestore::Admin::V1::UpdateDatabaseRequest + + # 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_database.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project 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::Firestore::Admin::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.update_database.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_database.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @firestore_admin_stub.update_database request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + return result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a database. + # + # @overload delete_database(request, options = nil) + # Pass arguments to `delete_database` via a request object, either of type + # {::Google::Cloud::Firestore::Admin::V1::DeleteDatabaseRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Firestore::Admin::V1::DeleteDatabaseRequest, ::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_database(name: nil, etag: nil) + # Pass arguments to `delete_database` 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. A name of the form + # `projects/{project_id}/databases/{database_id}` + # @param etag [::String] + # The current etag of the Database. + # If an etag is provided and does not match the current etag of the database, + # deletion will be blocked and a FAILED_PRECONDITION error will be returned. + # @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/firestore/admin/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Firestore::Admin::V1::DeleteDatabaseRequest.new + # + # # Call the delete_database method. + # result = client.delete_database 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 delete_database request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Firestore::Admin::V1::DeleteDatabaseRequest + + # 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_database.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project 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::Firestore::Admin::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.delete_database.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_database.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @firestore_admin_stub.delete_database request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + return result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets information about a backup. + # + # @overload get_backup(request, options = nil) + # Pass arguments to `get_backup` via a request object, either of type + # {::Google::Cloud::Firestore::Admin::V1::GetBackupRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Firestore::Admin::V1::GetBackupRequest, ::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_backup(name: nil) + # Pass arguments to `get_backup` 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. Name of the backup to fetch. + # + # Format is `projects/{project}/locations/{location}/backups/{backup}`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Firestore::Admin::V1::Backup] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Firestore::Admin::V1::Backup] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/firestore/admin/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Firestore::Admin::V1::GetBackupRequest.new + # + # # Call the get_backup method. + # result = client.get_backup request + # + # # The returned object is of type Google::Cloud::Firestore::Admin::V1::Backup. + # p result + # + def get_backup request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Firestore::Admin::V1::GetBackupRequest + + # 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_backup.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project 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::Firestore::Admin::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_backup.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_backup.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @firestore_admin_stub.get_backup request, options do |result, operation| + yield result, operation if block_given? + return result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists all the backups. + # + # @overload list_backups(request, options = nil) + # Pass arguments to `list_backups` via a request object, either of type + # {::Google::Cloud::Firestore::Admin::V1::ListBackupsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Firestore::Admin::V1::ListBackupsRequest, ::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_backups(parent: nil) + # Pass arguments to `list_backups` 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 location to list backups from. + # + # Format is `projects/{project}/locations/{location}`. + # Use `{location} = '-'` to list backups from all locations for the given + # project. This allows listing backups from a single location or from all + # locations. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Firestore::Admin::V1::ListBackupsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Firestore::Admin::V1::ListBackupsResponse] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/firestore/admin/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Firestore::Admin::V1::ListBackupsRequest.new + # + # # Call the list_backups method. + # result = client.list_backups request + # + # # The returned object is of type Google::Cloud::Firestore::Admin::V1::ListBackupsResponse. + # p result + # + def list_backups request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Firestore::Admin::V1::ListBackupsRequest + + # 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_backups.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project 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::Firestore::Admin::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_backups.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_backups.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @firestore_admin_stub.list_backups request, options do |result, operation| + yield result, operation if block_given? + return result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a backup. + # + # @overload delete_backup(request, options = nil) + # Pass arguments to `delete_backup` via a request object, either of type + # {::Google::Cloud::Firestore::Admin::V1::DeleteBackupRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Firestore::Admin::V1::DeleteBackupRequest, ::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_backup(name: nil) + # Pass arguments to `delete_backup` 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. Name of the backup to delete. + # + # format is `projects/{project}/locations/{location}/backups/{backup}`. + # @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/firestore/admin/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Firestore::Admin::V1::DeleteBackupRequest.new + # + # # Call the delete_backup method. + # result = client.delete_backup request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_backup request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Firestore::Admin::V1::DeleteBackupRequest + + # 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_backup.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project 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::Firestore::Admin::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.delete_backup.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_backup.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @firestore_admin_stub.delete_backup request, options do |result, operation| + yield result, operation if block_given? + return result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates a new database by restoring from an existing backup. + # + # The new database must be in the same cloud region or multi-region location + # as the existing backup. This behaves similar to + # [FirestoreAdmin.CreateDatabase][google.firestore.admin.v1.CreateDatabase] + # except instead of creating a new empty database, a new database is created + # with the database type, index configuration, and documents from an existing + # backup. + # + # The {::Google::Longrunning::Operation long-running operation} can be used to + # track the progress of the restore, with the Operation's + # {::Google::Longrunning::Operation#metadata metadata} field type being the + # {::Google::Cloud::Firestore::Admin::V1::RestoreDatabaseMetadata RestoreDatabaseMetadata}. + # The {::Google::Longrunning::Operation#response response} type is the + # {::Google::Cloud::Firestore::Admin::V1::Database Database} if the restore was + # successful. The new database is not readable or writeable until the LRO has + # completed. + # + # @overload restore_database(request, options = nil) + # Pass arguments to `restore_database` via a request object, either of type + # {::Google::Cloud::Firestore::Admin::V1::RestoreDatabaseRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Firestore::Admin::V1::RestoreDatabaseRequest, ::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 restore_database(parent: nil, database_id: nil, backup: nil) + # Pass arguments to `restore_database` 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 to restore the database in. Format is + # `projects/{project_id}`. + # @param database_id [::String] + # Required. The ID to use for the database, which will become the final + # component of the database's resource name. This database id must not be + # associated with an existing database. + # + # This value should be 4-63 characters. Valid characters are /[a-z][0-9]-/ + # with first character a letter and the last a letter or a number. Must not + # be UUID-like /[0-9a-f]\\{8}(-[0-9a-f]\\{4})\\{3}-[0-9a-f]\\{12}/. + # + # "(default)" database id is also valid. + # @param backup [::String] + # Required. Backup to restore from. Must be from the same project as the + # parent. + # + # Format is: `projects/{project_id}/locations/{location}/backups/{backup}` + # @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/firestore/admin/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Firestore::Admin::V1::RestoreDatabaseRequest.new + # + # # Call the restore_database method. + # result = client.restore_database 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 restore_database request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Firestore::Admin::V1::RestoreDatabaseRequest + + # 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.restore_database.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project 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::Firestore::Admin::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.restore_database.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.restore_database.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @firestore_admin_stub.restore_database request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + return result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates a backup schedule on a database. + # At most two backup schedules can be configured on a database, one daily + # backup schedule with retention up to 7 days and one weekly backup schedule + # with retention up to 14 weeks. + # + # @overload create_backup_schedule(request, options = nil) + # Pass arguments to `create_backup_schedule` via a request object, either of type + # {::Google::Cloud::Firestore::Admin::V1::CreateBackupScheduleRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Firestore::Admin::V1::CreateBackupScheduleRequest, ::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_backup_schedule(parent: nil, backup_schedule: nil) + # Pass arguments to `create_backup_schedule` 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 database. + # + # Format `projects/{project}/databases/{database}` + # @param backup_schedule [::Google::Cloud::Firestore::Admin::V1::BackupSchedule, ::Hash] + # Required. The backup schedule to create. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Firestore::Admin::V1::BackupSchedule] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Firestore::Admin::V1::BackupSchedule] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/firestore/admin/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Firestore::Admin::V1::CreateBackupScheduleRequest.new + # + # # Call the create_backup_schedule method. + # result = client.create_backup_schedule request + # + # # The returned object is of type Google::Cloud::Firestore::Admin::V1::BackupSchedule. + # p result + # + def create_backup_schedule request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Firestore::Admin::V1::CreateBackupScheduleRequest + + # 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_backup_schedule.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project 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::Firestore::Admin::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.create_backup_schedule.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_backup_schedule.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @firestore_admin_stub.create_backup_schedule request, options do |result, operation| + yield result, operation if block_given? + return result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets information about a backup schedule. + # + # @overload get_backup_schedule(request, options = nil) + # Pass arguments to `get_backup_schedule` via a request object, either of type + # {::Google::Cloud::Firestore::Admin::V1::GetBackupScheduleRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Firestore::Admin::V1::GetBackupScheduleRequest, ::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_backup_schedule(name: nil) + # Pass arguments to `get_backup_schedule` 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 backup schedule. + # + # Format + # `projects/{project}/databases/{database}/backupSchedules/{backup_schedule}` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Firestore::Admin::V1::BackupSchedule] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Firestore::Admin::V1::BackupSchedule] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/firestore/admin/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Firestore::Admin::V1::GetBackupScheduleRequest.new + # + # # Call the get_backup_schedule method. + # result = client.get_backup_schedule request + # + # # The returned object is of type Google::Cloud::Firestore::Admin::V1::BackupSchedule. + # p result + # + def get_backup_schedule request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Firestore::Admin::V1::GetBackupScheduleRequest + + # 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_backup_schedule.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project 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::Firestore::Admin::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_backup_schedule.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_backup_schedule.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @firestore_admin_stub.get_backup_schedule request, options do |result, operation| + yield result, operation if block_given? + return result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # List backup schedules. + # + # @overload list_backup_schedules(request, options = nil) + # Pass arguments to `list_backup_schedules` via a request object, either of type + # {::Google::Cloud::Firestore::Admin::V1::ListBackupSchedulesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Firestore::Admin::V1::ListBackupSchedulesRequest, ::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_backup_schedules(parent: nil) + # Pass arguments to `list_backup_schedules` 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 database. + # + # Format is `projects/{project}/databases/{database}`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Firestore::Admin::V1::ListBackupSchedulesResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Firestore::Admin::V1::ListBackupSchedulesResponse] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/firestore/admin/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Firestore::Admin::V1::ListBackupSchedulesRequest.new + # + # # Call the list_backup_schedules method. + # result = client.list_backup_schedules request + # + # # The returned object is of type Google::Cloud::Firestore::Admin::V1::ListBackupSchedulesResponse. + # p result + # + def list_backup_schedules request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Firestore::Admin::V1::ListBackupSchedulesRequest + + # 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_backup_schedules.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project 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::Firestore::Admin::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_backup_schedules.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_backup_schedules.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @firestore_admin_stub.list_backup_schedules request, options do |result, operation| + yield result, operation if block_given? + return result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates a backup schedule. + # + # @overload update_backup_schedule(request, options = nil) + # Pass arguments to `update_backup_schedule` via a request object, either of type + # {::Google::Cloud::Firestore::Admin::V1::UpdateBackupScheduleRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Firestore::Admin::V1::UpdateBackupScheduleRequest, ::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_backup_schedule(backup_schedule: nil, update_mask: nil) + # Pass arguments to `update_backup_schedule` 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 backup_schedule [::Google::Cloud::Firestore::Admin::V1::BackupSchedule, ::Hash] + # Required. The backup schedule to update. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # The list of fields to be updated. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Firestore::Admin::V1::BackupSchedule] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Firestore::Admin::V1::BackupSchedule] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/firestore/admin/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Firestore::Admin::V1::UpdateBackupScheduleRequest.new + # + # # Call the update_backup_schedule method. + # result = client.update_backup_schedule request + # + # # The returned object is of type Google::Cloud::Firestore::Admin::V1::BackupSchedule. + # p result + # + def update_backup_schedule request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Firestore::Admin::V1::UpdateBackupScheduleRequest + + # 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_backup_schedule.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project 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::Firestore::Admin::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.update_backup_schedule.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_backup_schedule.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @firestore_admin_stub.update_backup_schedule request, options do |result, operation| + yield result, operation if block_given? + return result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a backup schedule. + # + # @overload delete_backup_schedule(request, options = nil) + # Pass arguments to `delete_backup_schedule` via a request object, either of type + # {::Google::Cloud::Firestore::Admin::V1::DeleteBackupScheduleRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Firestore::Admin::V1::DeleteBackupScheduleRequest, ::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_backup_schedule(name: nil) + # Pass arguments to `delete_backup_schedule` 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 backup schedule. + # + # Format + # `projects/{project}/databases/{database}/backupSchedules/{backup_schedule}` + # @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/firestore/admin/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Firestore::Admin::V1::DeleteBackupScheduleRequest.new + # + # # Call the delete_backup_schedule method. + # result = client.delete_backup_schedule request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_backup_schedule request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Firestore::Admin::V1::DeleteBackupScheduleRequest + + # 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_backup_schedule.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project 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::Firestore::Admin::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.delete_backup_schedule.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_backup_schedule.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @firestore_admin_stub.delete_backup_schedule request, options do |result, operation| + yield result, operation if block_given? + return result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the FirestoreAdmin REST API. + # + # This class represents the configuration for FirestoreAdmin 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::Firestore::Admin::V1::FirestoreAdmin::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 + # # create_index to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.create_index.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.create_index.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 + # @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] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "firestore.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::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 + + # @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 FirestoreAdmin 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 `create_index` + # @return [::Gapic::Config::Method] + # + attr_reader :create_index + ## + # RPC-specific configuration for `list_indexes` + # @return [::Gapic::Config::Method] + # + attr_reader :list_indexes + ## + # RPC-specific configuration for `get_index` + # @return [::Gapic::Config::Method] + # + attr_reader :get_index + ## + # RPC-specific configuration for `delete_index` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_index + ## + # RPC-specific configuration for `get_field` + # @return [::Gapic::Config::Method] + # + attr_reader :get_field + ## + # RPC-specific configuration for `update_field` + # @return [::Gapic::Config::Method] + # + attr_reader :update_field + ## + # RPC-specific configuration for `list_fields` + # @return [::Gapic::Config::Method] + # + attr_reader :list_fields + ## + # RPC-specific configuration for `export_documents` + # @return [::Gapic::Config::Method] + # + attr_reader :export_documents + ## + # RPC-specific configuration for `import_documents` + # @return [::Gapic::Config::Method] + # + attr_reader :import_documents + ## + # RPC-specific configuration for `create_database` + # @return [::Gapic::Config::Method] + # + attr_reader :create_database + ## + # RPC-specific configuration for `get_database` + # @return [::Gapic::Config::Method] + # + attr_reader :get_database + ## + # RPC-specific configuration for `list_databases` + # @return [::Gapic::Config::Method] + # + attr_reader :list_databases + ## + # RPC-specific configuration for `update_database` + # @return [::Gapic::Config::Method] + # + attr_reader :update_database + ## + # RPC-specific configuration for `delete_database` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_database + ## + # RPC-specific configuration for `get_backup` + # @return [::Gapic::Config::Method] + # + attr_reader :get_backup + ## + # RPC-specific configuration for `list_backups` + # @return [::Gapic::Config::Method] + # + attr_reader :list_backups + ## + # RPC-specific configuration for `delete_backup` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_backup + ## + # RPC-specific configuration for `restore_database` + # @return [::Gapic::Config::Method] + # + attr_reader :restore_database + ## + # RPC-specific configuration for `create_backup_schedule` + # @return [::Gapic::Config::Method] + # + attr_reader :create_backup_schedule + ## + # RPC-specific configuration for `get_backup_schedule` + # @return [::Gapic::Config::Method] + # + attr_reader :get_backup_schedule + ## + # RPC-specific configuration for `list_backup_schedules` + # @return [::Gapic::Config::Method] + # + attr_reader :list_backup_schedules + ## + # RPC-specific configuration for `update_backup_schedule` + # @return [::Gapic::Config::Method] + # + attr_reader :update_backup_schedule + ## + # RPC-specific configuration for `delete_backup_schedule` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_backup_schedule + + # @private + def initialize parent_rpcs = nil + create_index_config = parent_rpcs.create_index if parent_rpcs.respond_to? :create_index + @create_index = ::Gapic::Config::Method.new create_index_config + list_indexes_config = parent_rpcs.list_indexes if parent_rpcs.respond_to? :list_indexes + @list_indexes = ::Gapic::Config::Method.new list_indexes_config + get_index_config = parent_rpcs.get_index if parent_rpcs.respond_to? :get_index + @get_index = ::Gapic::Config::Method.new get_index_config + delete_index_config = parent_rpcs.delete_index if parent_rpcs.respond_to? :delete_index + @delete_index = ::Gapic::Config::Method.new delete_index_config + get_field_config = parent_rpcs.get_field if parent_rpcs.respond_to? :get_field + @get_field = ::Gapic::Config::Method.new get_field_config + update_field_config = parent_rpcs.update_field if parent_rpcs.respond_to? :update_field + @update_field = ::Gapic::Config::Method.new update_field_config + list_fields_config = parent_rpcs.list_fields if parent_rpcs.respond_to? :list_fields + @list_fields = ::Gapic::Config::Method.new list_fields_config + export_documents_config = parent_rpcs.export_documents if parent_rpcs.respond_to? :export_documents + @export_documents = ::Gapic::Config::Method.new export_documents_config + import_documents_config = parent_rpcs.import_documents if parent_rpcs.respond_to? :import_documents + @import_documents = ::Gapic::Config::Method.new import_documents_config + create_database_config = parent_rpcs.create_database if parent_rpcs.respond_to? :create_database + @create_database = ::Gapic::Config::Method.new create_database_config + get_database_config = parent_rpcs.get_database if parent_rpcs.respond_to? :get_database + @get_database = ::Gapic::Config::Method.new get_database_config + list_databases_config = parent_rpcs.list_databases if parent_rpcs.respond_to? :list_databases + @list_databases = ::Gapic::Config::Method.new list_databases_config + update_database_config = parent_rpcs.update_database if parent_rpcs.respond_to? :update_database + @update_database = ::Gapic::Config::Method.new update_database_config + delete_database_config = parent_rpcs.delete_database if parent_rpcs.respond_to? :delete_database + @delete_database = ::Gapic::Config::Method.new delete_database_config + get_backup_config = parent_rpcs.get_backup if parent_rpcs.respond_to? :get_backup + @get_backup = ::Gapic::Config::Method.new get_backup_config + list_backups_config = parent_rpcs.list_backups if parent_rpcs.respond_to? :list_backups + @list_backups = ::Gapic::Config::Method.new list_backups_config + delete_backup_config = parent_rpcs.delete_backup if parent_rpcs.respond_to? :delete_backup + @delete_backup = ::Gapic::Config::Method.new delete_backup_config + restore_database_config = parent_rpcs.restore_database if parent_rpcs.respond_to? :restore_database + @restore_database = ::Gapic::Config::Method.new restore_database_config + create_backup_schedule_config = parent_rpcs.create_backup_schedule if parent_rpcs.respond_to? :create_backup_schedule + @create_backup_schedule = ::Gapic::Config::Method.new create_backup_schedule_config + get_backup_schedule_config = parent_rpcs.get_backup_schedule if parent_rpcs.respond_to? :get_backup_schedule + @get_backup_schedule = ::Gapic::Config::Method.new get_backup_schedule_config + list_backup_schedules_config = parent_rpcs.list_backup_schedules if parent_rpcs.respond_to? :list_backup_schedules + @list_backup_schedules = ::Gapic::Config::Method.new list_backup_schedules_config + update_backup_schedule_config = parent_rpcs.update_backup_schedule if parent_rpcs.respond_to? :update_backup_schedule + @update_backup_schedule = ::Gapic::Config::Method.new update_backup_schedule_config + delete_backup_schedule_config = parent_rpcs.delete_backup_schedule if parent_rpcs.respond_to? :delete_backup_schedule + @delete_backup_schedule = ::Gapic::Config::Method.new delete_backup_schedule_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-firestore-admin-v1/lib/google/cloud/firestore/admin/v1/firestore_admin/rest/operations.rb b/owl-bot-staging/google-cloud-firestore-admin-v1/lib/google/cloud/firestore/admin/v1/firestore_admin/rest/operations.rb new file mode 100644 index 000000000000..af21a955d2d1 --- /dev/null +++ b/owl-bot-staging/google-cloud-firestore-admin-v1/lib/google/cloud/firestore/admin/v1/firestore_admin/rest/operations.rb @@ -0,0 +1,897 @@ +# frozen_string_literal: true + +# Copyright 2024 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 Firestore + module Admin + module V1 + module FirestoreAdmin + module Rest + # Service that implements Longrunning Operations API. + class Operations + # @private + DEFAULT_ENDPOINT_TEMPLATE = "firestore.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :operations_stub + + ## + # Configuration for the FirestoreAdmin 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 FirestoreAdmin 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`. + # + # NOTE: the `name` binding allows API services to override the binding + # to use different resource name schemes, such as `users/*/operations`. To + # override the binding, API services can add a binding such as + # `"/v1/{name=users/*}/operations"` to their service configuration. + # For backwards compatibility, the default name includes the operations + # collection id, however overriding users must ensure the name binding + # is the parent resource, without the operations collection id. + # + # @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) + # 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. + # @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 and x-goog-user-project 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::Firestore::Admin::V1::VERSION, + transports_version_send: [:rest] + + 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? + return 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 and x-goog-user-project 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::Firestore::Admin::V1::VERSION, + transports_version_send: [:rest] + + 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? + return 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 and x-goog-user-project 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::Firestore::Admin::V1::VERSION, + transports_version_send: [:rest] + + 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? + return result + 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 and x-goog-user-project 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::Firestore::Admin::V1::VERSION, + transports_version_send: [:rest] + + 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? + return result + 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 + # @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] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "firestore.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::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 + + # @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, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::ListOperationsResponse.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + 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, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + 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, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + 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, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + 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}/operations", + matches: [ + ["name", %r{^projects/[^/]+/databases/[^/]+/?$}, 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/[^/]+/databases/[^/]+/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/[^/]+/databases/[^/]+/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", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/databases/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-firestore-admin-v1/lib/google/cloud/firestore/admin/v1/firestore_admin/rest/service_stub.rb b/owl-bot-staging/google-cloud-firestore-admin-v1/lib/google/cloud/firestore/admin/v1/firestore_admin/rest/service_stub.rb new file mode 100644 index 000000000000..3e33a566578e --- /dev/null +++ b/owl-bot-staging/google-cloud-firestore-admin-v1/lib/google/cloud/firestore/admin/v1/firestore_admin/rest/service_stub.rb @@ -0,0 +1,1437 @@ +# frozen_string_literal: true + +# Copyright 2024 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/firestore/admin/v1/firestore_admin_pb" + +module Google + module Cloud + module Firestore + module Admin + module V1 + module FirestoreAdmin + module Rest + ## + # REST service stub for the FirestoreAdmin service. + # Service stub contains baseline method implementations + # including transcoding, making the REST call, and deserialing the response. + # + class ServiceStub + 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, + numeric_enums: true, + raise_faraday_errors: false + 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 + + ## + # Baseline implementation for the create_index REST call + # + # @param request_pb [::Google::Cloud::Firestore::Admin::V1::CreateIndexRequest] + # 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_index request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_index_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, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # Baseline implementation for the list_indexes REST call + # + # @param request_pb [::Google::Cloud::Firestore::Admin::V1::ListIndexesRequest] + # 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::Firestore::Admin::V1::ListIndexesResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Firestore::Admin::V1::ListIndexesResponse] + # A result object deserialized from the server's reply + def list_indexes request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_indexes_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, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Firestore::Admin::V1::ListIndexesResponse.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # Baseline implementation for the get_index REST call + # + # @param request_pb [::Google::Cloud::Firestore::Admin::V1::GetIndexRequest] + # 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::Firestore::Admin::V1::Index] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Firestore::Admin::V1::Index] + # A result object deserialized from the server's reply + def get_index request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_index_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, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Firestore::Admin::V1::Index.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # Baseline implementation for the delete_index REST call + # + # @param request_pb [::Google::Cloud::Firestore::Admin::V1::DeleteIndexRequest] + # 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_index request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_index_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, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # Baseline implementation for the get_field REST call + # + # @param request_pb [::Google::Cloud::Firestore::Admin::V1::GetFieldRequest] + # 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::Firestore::Admin::V1::Field] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Firestore::Admin::V1::Field] + # A result object deserialized from the server's reply + def get_field request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_field_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, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Firestore::Admin::V1::Field.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # Baseline implementation for the update_field REST call + # + # @param request_pb [::Google::Cloud::Firestore::Admin::V1::UpdateFieldRequest] + # 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_field request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_field_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, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # Baseline implementation for the list_fields REST call + # + # @param request_pb [::Google::Cloud::Firestore::Admin::V1::ListFieldsRequest] + # 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::Firestore::Admin::V1::ListFieldsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Firestore::Admin::V1::ListFieldsResponse] + # A result object deserialized from the server's reply + def list_fields request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_fields_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, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Firestore::Admin::V1::ListFieldsResponse.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # Baseline implementation for the export_documents REST call + # + # @param request_pb [::Google::Cloud::Firestore::Admin::V1::ExportDocumentsRequest] + # 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 export_documents request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_export_documents_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, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # Baseline implementation for the import_documents REST call + # + # @param request_pb [::Google::Cloud::Firestore::Admin::V1::ImportDocumentsRequest] + # 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 import_documents request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_import_documents_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, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # Baseline implementation for the create_database REST call + # + # @param request_pb [::Google::Cloud::Firestore::Admin::V1::CreateDatabaseRequest] + # 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_database request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_database_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, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # Baseline implementation for the get_database REST call + # + # @param request_pb [::Google::Cloud::Firestore::Admin::V1::GetDatabaseRequest] + # 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::Firestore::Admin::V1::Database] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Firestore::Admin::V1::Database] + # A result object deserialized from the server's reply + def get_database request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_database_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, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Firestore::Admin::V1::Database.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # Baseline implementation for the list_databases REST call + # + # @param request_pb [::Google::Cloud::Firestore::Admin::V1::ListDatabasesRequest] + # 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::Firestore::Admin::V1::ListDatabasesResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Firestore::Admin::V1::ListDatabasesResponse] + # A result object deserialized from the server's reply + def list_databases request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_databases_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, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Firestore::Admin::V1::ListDatabasesResponse.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # Baseline implementation for the update_database REST call + # + # @param request_pb [::Google::Cloud::Firestore::Admin::V1::UpdateDatabaseRequest] + # 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_database request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_database_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, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # Baseline implementation for the delete_database REST call + # + # @param request_pb [::Google::Cloud::Firestore::Admin::V1::DeleteDatabaseRequest] + # 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 delete_database request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_database_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, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # Baseline implementation for the get_backup REST call + # + # @param request_pb [::Google::Cloud::Firestore::Admin::V1::GetBackupRequest] + # 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::Firestore::Admin::V1::Backup] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Firestore::Admin::V1::Backup] + # A result object deserialized from the server's reply + def get_backup request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_backup_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, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Firestore::Admin::V1::Backup.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # Baseline implementation for the list_backups REST call + # + # @param request_pb [::Google::Cloud::Firestore::Admin::V1::ListBackupsRequest] + # 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::Firestore::Admin::V1::ListBackupsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Firestore::Admin::V1::ListBackupsResponse] + # A result object deserialized from the server's reply + def list_backups request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_backups_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, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Firestore::Admin::V1::ListBackupsResponse.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # Baseline implementation for the delete_backup REST call + # + # @param request_pb [::Google::Cloud::Firestore::Admin::V1::DeleteBackupRequest] + # 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_backup request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_backup_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, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # Baseline implementation for the restore_database REST call + # + # @param request_pb [::Google::Cloud::Firestore::Admin::V1::RestoreDatabaseRequest] + # 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 restore_database request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_restore_database_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, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # Baseline implementation for the create_backup_schedule REST call + # + # @param request_pb [::Google::Cloud::Firestore::Admin::V1::CreateBackupScheduleRequest] + # 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::Firestore::Admin::V1::BackupSchedule] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Firestore::Admin::V1::BackupSchedule] + # A result object deserialized from the server's reply + def create_backup_schedule request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_backup_schedule_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, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Firestore::Admin::V1::BackupSchedule.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # Baseline implementation for the get_backup_schedule REST call + # + # @param request_pb [::Google::Cloud::Firestore::Admin::V1::GetBackupScheduleRequest] + # 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::Firestore::Admin::V1::BackupSchedule] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Firestore::Admin::V1::BackupSchedule] + # A result object deserialized from the server's reply + def get_backup_schedule request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_backup_schedule_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, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Firestore::Admin::V1::BackupSchedule.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # Baseline implementation for the list_backup_schedules REST call + # + # @param request_pb [::Google::Cloud::Firestore::Admin::V1::ListBackupSchedulesRequest] + # 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::Firestore::Admin::V1::ListBackupSchedulesResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Firestore::Admin::V1::ListBackupSchedulesResponse] + # A result object deserialized from the server's reply + def list_backup_schedules request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_backup_schedules_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, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Firestore::Admin::V1::ListBackupSchedulesResponse.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # Baseline implementation for the update_backup_schedule REST call + # + # @param request_pb [::Google::Cloud::Firestore::Admin::V1::UpdateBackupScheduleRequest] + # 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::Firestore::Admin::V1::BackupSchedule] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Firestore::Admin::V1::BackupSchedule] + # A result object deserialized from the server's reply + def update_backup_schedule request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_backup_schedule_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, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Firestore::Admin::V1::BackupSchedule.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # Baseline implementation for the delete_backup_schedule REST call + # + # @param request_pb [::Google::Cloud::Firestore::Admin::V1::DeleteBackupScheduleRequest] + # 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_backup_schedule request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_backup_schedule_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, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # @private + # + # GRPC transcoding helper method for the create_index REST call + # + # @param request_pb [::Google::Cloud::Firestore::Admin::V1::CreateIndexRequest] + # 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_index_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/indexes", + body: "index", + matches: [ + ["parent", %r{^projects/[^/]+/databases/[^/]+/collectionGroups/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_indexes REST call + # + # @param request_pb [::Google::Cloud::Firestore::Admin::V1::ListIndexesRequest] + # 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_indexes_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/indexes", + matches: [ + ["parent", %r{^projects/[^/]+/databases/[^/]+/collectionGroups/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_index REST call + # + # @param request_pb [::Google::Cloud::Firestore::Admin::V1::GetIndexRequest] + # 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_index_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/databases/[^/]+/collectionGroups/[^/]+/indexes/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_index REST call + # + # @param request_pb [::Google::Cloud::Firestore::Admin::V1::DeleteIndexRequest] + # 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_index_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/databases/[^/]+/collectionGroups/[^/]+/indexes/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_field REST call + # + # @param request_pb [::Google::Cloud::Firestore::Admin::V1::GetFieldRequest] + # 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_field_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/databases/[^/]+/collectionGroups/[^/]+/fields/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_field REST call + # + # @param request_pb [::Google::Cloud::Firestore::Admin::V1::UpdateFieldRequest] + # 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_field_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v1/{field.name}", + body: "field", + matches: [ + ["field.name", %r{^projects/[^/]+/databases/[^/]+/collectionGroups/[^/]+/fields/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_fields REST call + # + # @param request_pb [::Google::Cloud::Firestore::Admin::V1::ListFieldsRequest] + # 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_fields_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/fields", + matches: [ + ["parent", %r{^projects/[^/]+/databases/[^/]+/collectionGroups/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the export_documents REST call + # + # @param request_pb [::Google::Cloud::Firestore::Admin::V1::ExportDocumentsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_export_documents_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:exportDocuments", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/databases/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the import_documents REST call + # + # @param request_pb [::Google::Cloud::Firestore::Admin::V1::ImportDocumentsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_import_documents_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:importDocuments", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/databases/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_database REST call + # + # @param request_pb [::Google::Cloud::Firestore::Admin::V1::CreateDatabaseRequest] + # 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_database_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/databases", + body: "database", + matches: [ + ["parent", %r{^projects/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_database REST call + # + # @param request_pb [::Google::Cloud::Firestore::Admin::V1::GetDatabaseRequest] + # 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_database_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/databases/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_databases REST call + # + # @param request_pb [::Google::Cloud::Firestore::Admin::V1::ListDatabasesRequest] + # 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_databases_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/databases", + matches: [ + ["parent", %r{^projects/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_database REST call + # + # @param request_pb [::Google::Cloud::Firestore::Admin::V1::UpdateDatabaseRequest] + # 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_database_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v1/{database.name}", + body: "database", + matches: [ + ["database.name", %r{^projects/[^/]+/databases/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_database REST call + # + # @param request_pb [::Google::Cloud::Firestore::Admin::V1::DeleteDatabaseRequest] + # 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_database_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/databases/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_backup REST call + # + # @param request_pb [::Google::Cloud::Firestore::Admin::V1::GetBackupRequest] + # 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_backup_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/backups/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_backups REST call + # + # @param request_pb [::Google::Cloud::Firestore::Admin::V1::ListBackupsRequest] + # 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_backups_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/backups", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_backup REST call + # + # @param request_pb [::Google::Cloud::Firestore::Admin::V1::DeleteBackupRequest] + # 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_backup_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/backups/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the restore_database REST call + # + # @param request_pb [::Google::Cloud::Firestore::Admin::V1::RestoreDatabaseRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_restore_database_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/databases:restore", + body: "*", + matches: [ + ["parent", %r{^projects/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_backup_schedule REST call + # + # @param request_pb [::Google::Cloud::Firestore::Admin::V1::CreateBackupScheduleRequest] + # 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_backup_schedule_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/backupSchedules", + body: "backup_schedule", + matches: [ + ["parent", %r{^projects/[^/]+/databases/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_backup_schedule REST call + # + # @param request_pb [::Google::Cloud::Firestore::Admin::V1::GetBackupScheduleRequest] + # 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_backup_schedule_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/databases/[^/]+/backupSchedules/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_backup_schedules REST call + # + # @param request_pb [::Google::Cloud::Firestore::Admin::V1::ListBackupSchedulesRequest] + # 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_backup_schedules_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/backupSchedules", + matches: [ + ["parent", %r{^projects/[^/]+/databases/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_backup_schedule REST call + # + # @param request_pb [::Google::Cloud::Firestore::Admin::V1::UpdateBackupScheduleRequest] + # 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_backup_schedule_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v1/{backup_schedule.name}", + body: "backup_schedule", + matches: [ + ["backup_schedule.name", %r{^projects/[^/]+/databases/[^/]+/backupSchedules/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_backup_schedule REST call + # + # @param request_pb [::Google::Cloud::Firestore::Admin::V1::DeleteBackupScheduleRequest] + # 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_backup_schedule_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/databases/[^/]+/backupSchedules/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-firestore-admin-v1/lib/google/cloud/firestore/admin/v1/rest.rb b/owl-bot-staging/google-cloud-firestore-admin-v1/lib/google/cloud/firestore/admin/v1/rest.rb new file mode 100644 index 000000000000..625b601f53b4 --- /dev/null +++ b/owl-bot-staging/google-cloud-firestore-admin-v1/lib/google/cloud/firestore/admin/v1/rest.rb @@ -0,0 +1,39 @@ +# frozen_string_literal: true + +# Copyright 2024 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/firestore/admin/v1/firestore_admin/rest" +require "google/cloud/firestore/admin/v1/version" + +module Google + module Cloud + module Firestore + module Admin + ## + # To load just the REST part of this package, including all its services, and instantiate a REST client: + # + # @example + # + # require "google/cloud/firestore/admin/v1/rest" + # client = ::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Rest::Client.new + # + module V1 + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-firestore-admin-v1/lib/google/cloud/firestore/admin/v1/version.rb b/owl-bot-staging/google-cloud-firestore-admin-v1/lib/google/cloud/firestore/admin/v1/version.rb new file mode 100644 index 000000000000..c62f1676b769 --- /dev/null +++ b/owl-bot-staging/google-cloud-firestore-admin-v1/lib/google/cloud/firestore/admin/v1/version.rb @@ -0,0 +1,30 @@ +# frozen_string_literal: true + +# Copyright 2024 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 Firestore + module Admin + module V1 + VERSION = "0.0.1" + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-firestore-admin-v1/lib/google/firestore/admin/v1/backup_pb.rb b/owl-bot-staging/google-cloud-firestore-admin-v1/lib/google/firestore/admin/v1/backup_pb.rb new file mode 100644 index 000000000000..e0ac294397fe --- /dev/null +++ b/owl-bot-staging/google-cloud-firestore-admin-v1/lib/google/firestore/admin/v1/backup_pb.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/firestore/admin/v1/backup.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/protobuf/timestamp_pb' + + +descriptor_data = "\n&google/firestore/admin/v1/backup.proto\x12\x19google.firestore.admin.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xe0\x04\n\x06\x42\x61\x63kup\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12;\n\x08\x64\x61tabase\x18\x02 \x01(\tB)\xe0\x41\x03\xfa\x41#\n!firestore.googleapis.com/Database\x12\x19\n\x0c\x64\x61tabase_uid\x18\x07 \x01(\tB\x03\xe0\x41\x03\x12\x36\n\rsnapshot_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0b\x65xpire_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12;\n\x05stats\x18\x06 \x01(\x0b\x32\'.google.firestore.admin.v1.Backup.StatsB\x03\xe0\x41\x03\x12;\n\x05state\x18\x08 \x01(\x0e\x32\'.google.firestore.admin.v1.Backup.StateB\x03\xe0\x41\x03\x1aW\n\x05Stats\x12\x17\n\nsize_bytes\x18\x01 \x01(\x03\x42\x03\xe0\x41\x03\x12\x1b\n\x0e\x64ocument_count\x18\x02 \x01(\x03\x42\x03\xe0\x41\x03\x12\x18\n\x0bindex_count\x18\x03 \x01(\x03\x42\x03\xe0\x41\x03\"J\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0c\n\x08\x43REATING\x10\x01\x12\t\n\x05READY\x10\x02\x12\x11\n\rNOT_AVAILABLE\x10\x03:^\xea\x41[\n\x1f\x66irestore.googleapis.com/Backup\x12\x38projects/{project}/locations/{location}/backups/{backup}B\xda\x01\n\x1d\x63om.google.firestore.admin.v1B\x0b\x42\x61\x63kupProtoP\x01Z9cloud.google.com/go/firestore/apiv1/admin/adminpb;adminpb\xa2\x02\x04GCFS\xaa\x02\x1fGoogle.Cloud.Firestore.Admin.V1\xca\x02\x1fGoogle\\Cloud\\Firestore\\Admin\\V1\xea\x02#Google::Cloud::Firestore::Admin::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 Firestore + module Admin + module V1 + Backup = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.firestore.admin.v1.Backup").msgclass + Backup::Stats = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.firestore.admin.v1.Backup.Stats").msgclass + Backup::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.firestore.admin.v1.Backup.State").enummodule + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-firestore-admin-v1/lib/google/firestore/admin/v1/database_pb.rb b/owl-bot-staging/google-cloud-firestore-admin-v1/lib/google/firestore/admin/v1/database_pb.rb new file mode 100644 index 000000000000..43e47b80eeaf --- /dev/null +++ b/owl-bot-staging/google-cloud-firestore-admin-v1/lib/google/firestore/admin/v1/database_pb.rb @@ -0,0 +1,56 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/firestore/admin/v1/database.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/protobuf/duration_pb' +require 'google/protobuf/timestamp_pb' + + +descriptor_data = "\n(google/firestore/admin/v1/database.proto\x12\x19google.firestore.admin.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xb9\x0b\n\x08\x44\x61tabase\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x10\n\x03uid\x18\x03 \x01(\tB\x03\xe0\x41\x03\x12\x34\n\x0b\x63reate_time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x13\n\x0blocation_id\x18\t \x01(\t\x12>\n\x04type\x18\n \x01(\x0e\x32\x30.google.firestore.admin.v1.Database.DatabaseType\x12M\n\x10\x63oncurrency_mode\x18\x0f \x01(\x0e\x32\x33.google.firestore.admin.v1.Database.ConcurrencyMode\x12@\n\x18version_retention_period\x18\x11 \x01(\x0b\x32\x19.google.protobuf.DurationB\x03\xe0\x41\x03\x12>\n\x15\x65\x61rliest_version_time\x18\x12 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12l\n!point_in_time_recovery_enablement\x18\x15 \x01(\x0e\x32\x41.google.firestore.admin.v1.Database.PointInTimeRecoveryEnablement\x12\x61\n\x1b\x61pp_engine_integration_mode\x18\x13 \x01(\x0e\x32<.google.firestore.admin.v1.Database.AppEngineIntegrationMode\x12\x17\n\nkey_prefix\x18\x14 \x01(\tB\x03\xe0\x41\x03\x12Z\n\x17\x64\x65lete_protection_state\x18\x16 \x01(\x0e\x32\x39.google.firestore.admin.v1.Database.DeleteProtectionState\x12\x0c\n\x04\x65tag\x18\x63 \x01(\t\"W\n\x0c\x44\x61tabaseType\x12\x1d\n\x19\x44\x41TABASE_TYPE_UNSPECIFIED\x10\x00\x12\x14\n\x10\x46IRESTORE_NATIVE\x10\x01\x12\x12\n\x0e\x44\x41TASTORE_MODE\x10\x02\"w\n\x0f\x43oncurrencyMode\x12 \n\x1c\x43ONCURRENCY_MODE_UNSPECIFIED\x10\x00\x12\x0e\n\nOPTIMISTIC\x10\x01\x12\x0f\n\x0bPESSIMISTIC\x10\x02\x12!\n\x1dOPTIMISTIC_WITH_ENTITY_GROUPS\x10\x03\"\x9b\x01\n\x1dPointInTimeRecoveryEnablement\x12\x31\n-POINT_IN_TIME_RECOVERY_ENABLEMENT_UNSPECIFIED\x10\x00\x12\"\n\x1ePOINT_IN_TIME_RECOVERY_ENABLED\x10\x01\x12#\n\x1fPOINT_IN_TIME_RECOVERY_DISABLED\x10\x02\"b\n\x18\x41ppEngineIntegrationMode\x12+\n\'APP_ENGINE_INTEGRATION_MODE_UNSPECIFIED\x10\x00\x12\x0b\n\x07\x45NABLED\x10\x01\x12\x0c\n\x08\x44ISABLED\x10\x02\"\x7f\n\x15\x44\x65leteProtectionState\x12\'\n#DELETE_PROTECTION_STATE_UNSPECIFIED\x10\x00\x12\x1e\n\x1a\x44\x45LETE_PROTECTION_DISABLED\x10\x01\x12\x1d\n\x19\x44\x45LETE_PROTECTION_ENABLED\x10\x02:R\xea\x41O\n!firestore.googleapis.com/Database\x12\'projects/{project}/databases/{database}R\x01\x01\x42\xdc\x01\n\x1d\x63om.google.firestore.admin.v1B\rDatabaseProtoP\x01Z9cloud.google.com/go/firestore/apiv1/admin/adminpb;adminpb\xa2\x02\x04GCFS\xaa\x02\x1fGoogle.Cloud.Firestore.Admin.V1\xca\x02\x1fGoogle\\Cloud\\Firestore\\Admin\\V1\xea\x02#Google::Cloud::Firestore::Admin::V1b\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], + ["google.protobuf.Duration", "google/protobuf/duration.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 Firestore + module Admin + module V1 + Database = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.firestore.admin.v1.Database").msgclass + Database::DatabaseType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.firestore.admin.v1.Database.DatabaseType").enummodule + Database::ConcurrencyMode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.firestore.admin.v1.Database.ConcurrencyMode").enummodule + Database::PointInTimeRecoveryEnablement = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.firestore.admin.v1.Database.PointInTimeRecoveryEnablement").enummodule + Database::AppEngineIntegrationMode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.firestore.admin.v1.Database.AppEngineIntegrationMode").enummodule + Database::DeleteProtectionState = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.firestore.admin.v1.Database.DeleteProtectionState").enummodule + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-firestore-admin-v1/lib/google/firestore/admin/v1/field_pb.rb b/owl-bot-staging/google-cloud-firestore-admin-v1/lib/google/firestore/admin/v1/field_pb.rb new file mode 100644 index 000000000000..986cb252bd7b --- /dev/null +++ b/owl-bot-staging/google-cloud-firestore-admin-v1/lib/google/firestore/admin/v1/field_pb.rb @@ -0,0 +1,52 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/firestore/admin/v1/field.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/firestore/admin/v1/index_pb' + + +descriptor_data = "\n%google/firestore/admin/v1/field.proto\x12\x19google.firestore.admin.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a%google/firestore/admin/v1/index.proto\"\xc5\x04\n\x05\x46ield\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x42\n\x0cindex_config\x18\x02 \x01(\x0b\x32,.google.firestore.admin.v1.Field.IndexConfig\x12>\n\nttl_config\x18\x03 \x01(\x0b\x32*.google.firestore.admin.v1.Field.TtlConfig\x1a\x89\x01\n\x0bIndexConfig\x12\x31\n\x07indexes\x18\x01 \x03(\x0b\x32 .google.firestore.admin.v1.Index\x12\x1c\n\x14uses_ancestor_config\x18\x02 \x01(\x08\x12\x16\n\x0e\x61ncestor_field\x18\x03 \x01(\t\x12\x11\n\treverting\x18\x04 \x01(\x08\x1a\x9d\x01\n\tTtlConfig\x12\x44\n\x05state\x18\x01 \x01(\x0e\x32\x30.google.firestore.admin.v1.Field.TtlConfig.StateB\x03\xe0\x41\x03\"J\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0c\n\x08\x43REATING\x10\x01\x12\n\n\x06\x41\x43TIVE\x10\x02\x12\x10\n\x0cNEEDS_REPAIR\x10\x03:y\xea\x41v\n\x1e\x66irestore.googleapis.com/Field\x12Tprojects/{project}/databases/{database}/collectionGroups/{collection}/fields/{field}B\xd9\x01\n\x1d\x63om.google.firestore.admin.v1B\nFieldProtoP\x01Z9cloud.google.com/go/firestore/apiv1/admin/adminpb;adminpb\xa2\x02\x04GCFS\xaa\x02\x1fGoogle.Cloud.Firestore.Admin.V1\xca\x02\x1fGoogle\\Cloud\\Firestore\\Admin\\V1\xea\x02#Google::Cloud::Firestore::Admin::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.firestore.admin.v1.Index", "google/firestore/admin/v1/index.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 Firestore + module Admin + module V1 + Field = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.firestore.admin.v1.Field").msgclass + Field::IndexConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.firestore.admin.v1.Field.IndexConfig").msgclass + Field::TtlConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.firestore.admin.v1.Field.TtlConfig").msgclass + Field::TtlConfig::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.firestore.admin.v1.Field.TtlConfig.State").enummodule + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-firestore-admin-v1/lib/google/firestore/admin/v1/firestore_admin_pb.rb b/owl-bot-staging/google-cloud-firestore-admin-v1/lib/google/firestore/admin/v1/firestore_admin_pb.rb new file mode 100644 index 000000000000..a8c094449919 --- /dev/null +++ b/owl-bot-staging/google-cloud-firestore-admin-v1/lib/google/firestore/admin/v1/firestore_admin_pb.rb @@ -0,0 +1,96 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/firestore/admin/v1/firestore_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/firestore/admin/v1/backup_pb' +require 'google/firestore/admin/v1/database_pb' +require 'google/firestore/admin/v1/field_pb' +require 'google/firestore/admin/v1/index_pb' +require 'google/firestore/admin/v1/operation_pb' +require 'google/firestore/admin/v1/schedule_pb' +require 'google/longrunning/operations_pb' +require 'google/protobuf/empty_pb' +require 'google/protobuf/field_mask_pb' +require 'google/protobuf/timestamp_pb' + + +descriptor_data = "\n/google/firestore/admin/v1/firestore_admin.proto\x12\x19google.firestore.admin.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a&google/firestore/admin/v1/backup.proto\x1a(google/firestore/admin/v1/database.proto\x1a%google/firestore/admin/v1/field.proto\x1a%google/firestore/admin/v1/index.proto\x1a)google/firestore/admin/v1/operation.proto\x1a(google/firestore/admin/v1/schedule.proto\x1a#google/longrunning/operations.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"Q\n\x14ListDatabasesRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\x12!firestore.googleapis.com/Database\"\xa8\x01\n\x15\x43reateDatabaseRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\x12!firestore.googleapis.com/Database\x12:\n\x08\x64\x61tabase\x18\x02 \x01(\x0b\x32#.google.firestore.admin.v1.DatabaseB\x03\xe0\x41\x02\x12\x18\n\x0b\x64\x61tabase_id\x18\x03 \x01(\tB\x03\xe0\x41\x02\"\x18\n\x16\x43reateDatabaseMetadata\"d\n\x15ListDatabasesResponse\x12\x36\n\tdatabases\x18\x01 \x03(\x0b\x32#.google.firestore.admin.v1.Database\x12\x13\n\x0bunreachable\x18\x03 \x03(\t\"M\n\x12GetDatabaseRequest\x12\x37\n\x04name\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!firestore.googleapis.com/Database\"\x84\x01\n\x15UpdateDatabaseRequest\x12:\n\x08\x64\x61tabase\x18\x01 \x01(\x0b\x32#.google.firestore.admin.v1.DatabaseB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"\x18\n\x16UpdateDatabaseMetadata\"^\n\x15\x44\x65leteDatabaseRequest\x12\x37\n\x04name\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!firestore.googleapis.com/Database\x12\x0c\n\x04\x65tag\x18\x03 \x01(\t\"\x18\n\x16\x44\x65leteDatabaseMetadata\"\xa1\x01\n\x1b\x43reateBackupScheduleRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!firestore.googleapis.com/Database\x12G\n\x0f\x62\x61\x63kup_schedule\x18\x02 \x01(\x0b\x32).google.firestore.admin.v1.BackupScheduleB\x03\xe0\x41\x02\"Y\n\x18GetBackupScheduleRequest\x12=\n\x04name\x18\x01 \x01(\tB/\xe0\x41\x02\xfa\x41)\n\'firestore.googleapis.com/BackupSchedule\"\x97\x01\n\x1bUpdateBackupScheduleRequest\x12G\n\x0f\x62\x61\x63kup_schedule\x18\x01 \x01(\x0b\x32).google.firestore.admin.v1.BackupScheduleB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"W\n\x1aListBackupSchedulesRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!firestore.googleapis.com/Database\"b\n\x1bListBackupSchedulesResponse\x12\x43\n\x10\x62\x61\x63kup_schedules\x18\x01 \x03(\x0b\x32).google.firestore.admin.v1.BackupSchedule\"\\\n\x1b\x44\x65leteBackupScheduleRequest\x12=\n\x04name\x18\x01 \x01(\tB/\xe0\x41\x02\xfa\x41)\n\'firestore.googleapis.com/BackupSchedule\"\x8c\x01\n\x12\x43reateIndexRequest\x12@\n\x06parent\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(firestore.googleapis.com/CollectionGroup\x12\x34\n\x05index\x18\x02 \x01(\x0b\x32 .google.firestore.admin.v1.IndexB\x03\xe0\x41\x02\"\x8d\x01\n\x12ListIndexesRequest\x12@\n\x06parent\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(firestore.googleapis.com/CollectionGroup\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\"a\n\x13ListIndexesResponse\x12\x31\n\x07indexes\x18\x01 \x03(\x0b\x32 .google.firestore.admin.v1.Index\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"G\n\x0fGetIndexRequest\x12\x34\n\x04name\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1e\x66irestore.googleapis.com/Index\"J\n\x12\x44\x65leteIndexRequest\x12\x34\n\x04name\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1e\x66irestore.googleapis.com/Index\"{\n\x12UpdateFieldRequest\x12\x34\n\x05\x66ield\x18\x01 \x01(\x0b\x32 .google.firestore.admin.v1.FieldB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"G\n\x0fGetFieldRequest\x12\x34\n\x04name\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1e\x66irestore.googleapis.com/Field\"\x8c\x01\n\x11ListFieldsRequest\x12@\n\x06parent\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(firestore.googleapis.com/CollectionGroup\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\"_\n\x12ListFieldsResponse\x12\x30\n\x06\x66ields\x18\x01 \x03(\x0b\x32 .google.firestore.admin.v1.Field\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\xce\x01\n\x16\x45xportDocumentsRequest\x12\x37\n\x04name\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!firestore.googleapis.com/Database\x12\x16\n\x0e\x63ollection_ids\x18\x02 \x03(\t\x12\x19\n\x11output_uri_prefix\x18\x03 \x01(\t\x12\x15\n\rnamespace_ids\x18\x04 \x03(\t\x12\x31\n\rsnapshot_time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"\x9a\x01\n\x16ImportDocumentsRequest\x12\x37\n\x04name\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!firestore.googleapis.com/Database\x12\x16\n\x0e\x63ollection_ids\x18\x02 \x03(\t\x12\x18\n\x10input_uri_prefix\x18\x03 \x01(\t\x12\x15\n\rnamespace_ids\x18\x04 \x03(\t\"I\n\x10GetBackupRequest\x12\x35\n\x04name\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1f\x66irestore.googleapis.com/Backup\"O\n\x12ListBackupsRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!firestore.googleapis.com/Location\"^\n\x13ListBackupsResponse\x12\x32\n\x07\x62\x61\x63kups\x18\x01 \x03(\x0b\x32!.google.firestore.admin.v1.Backup\x12\x13\n\x0bunreachable\x18\x03 \x03(\t\"L\n\x13\x44\x65leteBackupRequest\x12\x35\n\x04name\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1f\x66irestore.googleapis.com/Backup\"\xa6\x01\n\x16RestoreDatabaseRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\x12!firestore.googleapis.com/Database\x12\x18\n\x0b\x64\x61tabase_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x37\n\x06\x62\x61\x63kup\x18\x03 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1f\x66irestore.googleapis.com/Backup2\xd6#\n\x0e\x46irestoreAdmin\x12\xdb\x01\n\x0b\x43reateIndex\x12-.google.firestore.admin.v1.CreateIndexRequest\x1a\x1d.google.longrunning.Operation\"~\xca\x41\x1f\n\x05Index\x12\x16IndexOperationMetadata\xda\x41\x0cparent,index\x82\xd3\xe4\x93\x02G\">/v1/{parent=projects/*/databases/*/collectionGroups/*}/indexes:\x05index\x12\xbd\x01\n\x0bListIndexes\x12-.google.firestore.admin.v1.ListIndexesRequest\x1a..google.firestore.admin.v1.ListIndexesResponse\"O\xda\x41\x06parent\x82\xd3\xe4\x93\x02@\x12>/v1/{parent=projects/*/databases/*/collectionGroups/*}/indexes\x12\xa7\x01\n\x08GetIndex\x12*.google.firestore.admin.v1.GetIndexRequest\x1a .google.firestore.admin.v1.Index\"M\xda\x41\x04name\x82\xd3\xe4\x93\x02@\x12>/v1/{name=projects/*/databases/*/collectionGroups/*/indexes/*}\x12\xa3\x01\n\x0b\x44\x65leteIndex\x12-.google.firestore.admin.v1.DeleteIndexRequest\x1a\x16.google.protobuf.Empty\"M\xda\x41\x04name\x82\xd3\xe4\x93\x02@*>/v1/{name=projects/*/databases/*/collectionGroups/*/indexes/*}\x12\xa6\x01\n\x08GetField\x12*.google.firestore.admin.v1.GetFieldRequest\x1a .google.firestore.admin.v1.Field\"L\xda\x41\x04name\x82\xd3\xe4\x93\x02?\x12=/v1/{name=projects/*/databases/*/collectionGroups/*/fields/*}\x12\xd9\x01\n\x0bUpdateField\x12-.google.firestore.admin.v1.UpdateFieldRequest\x1a\x1d.google.longrunning.Operation\"|\xca\x41\x1f\n\x05\x46ield\x12\x16\x46ieldOperationMetadata\xda\x41\x05\x66ield\x82\xd3\xe4\x93\x02L2C/v1/{field.name=projects/*/databases/*/collectionGroups/*/fields/*}:\x05\x66ield\x12\xb9\x01\n\nListFields\x12,.google.firestore.admin.v1.ListFieldsRequest\x1a-.google.firestore.admin.v1.ListFieldsResponse\"N\xda\x41\x06parent\x82\xd3\xe4\x93\x02?\x12=/v1/{parent=projects/*/databases/*/collectionGroups/*}/fields\x12\xdd\x01\n\x0f\x45xportDocuments\x12\x31.google.firestore.admin.v1.ExportDocumentsRequest\x1a\x1d.google.longrunning.Operation\"x\xca\x41\x32\n\x17\x45xportDocumentsResponse\x12\x17\x45xportDocumentsMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02\x36\"1/v1/{name=projects/*/databases/*}:exportDocuments:\x01*\x12\xdb\x01\n\x0fImportDocuments\x12\x31.google.firestore.admin.v1.ImportDocumentsRequest\x1a\x1d.google.longrunning.Operation\"v\xca\x41\x30\n\x15google.protobuf.Empty\x12\x17ImportDocumentsMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02\x36\"1/v1/{name=projects/*/databases/*}:importDocuments:\x01*\x12\xd9\x01\n\x0e\x43reateDatabase\x12\x30.google.firestore.admin.v1.CreateDatabaseRequest\x1a\x1d.google.longrunning.Operation\"v\xca\x41\"\n\x08\x44\x61tabase\x12\x16\x43reateDatabaseMetadata\xda\x41\x1bparent,database,database_id\x82\xd3\xe4\x93\x02-\"!/v1/{parent=projects/*}/databases:\x08\x64\x61tabase\x12\x93\x01\n\x0bGetDatabase\x12-.google.firestore.admin.v1.GetDatabaseRequest\x1a#.google.firestore.admin.v1.Database\"0\xda\x41\x04name\x82\xd3\xe4\x93\x02#\x12!/v1/{name=projects/*/databases/*}\x12\xa6\x01\n\rListDatabases\x12/.google.firestore.admin.v1.ListDatabasesRequest\x1a\x30.google.firestore.admin.v1.ListDatabasesResponse\"2\xda\x41\x06parent\x82\xd3\xe4\x93\x02#\x12!/v1/{parent=projects/*}/databases\x12\xdb\x01\n\x0eUpdateDatabase\x12\x30.google.firestore.admin.v1.UpdateDatabaseRequest\x1a\x1d.google.longrunning.Operation\"x\xca\x41\"\n\x08\x44\x61tabase\x12\x16UpdateDatabaseMetadata\xda\x41\x14\x64\x61tabase,update_mask\x82\xd3\xe4\x93\x02\x36\x32*/v1/{database.name=projects/*/databases/*}:\x08\x64\x61tabase\x12\xb8\x01\n\x0e\x44\x65leteDatabase\x12\x30.google.firestore.admin.v1.DeleteDatabaseRequest\x1a\x1d.google.longrunning.Operation\"U\xca\x41\"\n\x08\x44\x61tabase\x12\x16\x44\x65leteDatabaseMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02#*!/v1/{name=projects/*/databases/*}\x12\x97\x01\n\tGetBackup\x12+.google.firestore.admin.v1.GetBackupRequest\x1a!.google.firestore.admin.v1.Backup\":\xda\x41\x04name\x82\xd3\xe4\x93\x02-\x12+/v1/{name=projects/*/locations/*/backups/*}\x12\xaa\x01\n\x0bListBackups\x12-.google.firestore.admin.v1.ListBackupsRequest\x1a..google.firestore.admin.v1.ListBackupsResponse\"<\xda\x41\x06parent\x82\xd3\xe4\x93\x02-\x12+/v1/{parent=projects/*/locations/*}/backups\x12\x92\x01\n\x0c\x44\x65leteBackup\x12..google.firestore.admin.v1.DeleteBackupRequest\x1a\x16.google.protobuf.Empty\":\xda\x41\x04name\x82\xd3\xe4\x93\x02-*+/v1/{name=projects/*/locations/*/backups/*}\x12\xbf\x01\n\x0fRestoreDatabase\x12\x31.google.firestore.admin.v1.RestoreDatabaseRequest\x1a\x1d.google.longrunning.Operation\"Z\xca\x41#\n\x08\x44\x61tabase\x12\x17RestoreDatabaseMetadata\x82\xd3\xe4\x93\x02.\")/v1/{parent=projects/*}/databases:restore:\x01*\x12\xe0\x01\n\x14\x43reateBackupSchedule\x12\x36.google.firestore.admin.v1.CreateBackupScheduleRequest\x1a).google.firestore.admin.v1.BackupSchedule\"e\xda\x41\x16parent,backup_schedule\x82\xd3\xe4\x93\x02\x46\"3/v1/{parent=projects/*/databases/*}/backupSchedules:\x0f\x62\x61\x63kup_schedule\x12\xb7\x01\n\x11GetBackupSchedule\x12\x33.google.firestore.admin.v1.GetBackupScheduleRequest\x1a).google.firestore.admin.v1.BackupSchedule\"B\xda\x41\x04name\x82\xd3\xe4\x93\x02\x35\x12\x33/v1/{name=projects/*/databases/*/backupSchedules/*}\x12\xca\x01\n\x13ListBackupSchedules\x12\x35.google.firestore.admin.v1.ListBackupSchedulesRequest\x1a\x36.google.firestore.admin.v1.ListBackupSchedulesResponse\"D\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x35\x12\x33/v1/{parent=projects/*/databases/*}/backupSchedules\x12\xf5\x01\n\x14UpdateBackupSchedule\x12\x36.google.firestore.admin.v1.UpdateBackupScheduleRequest\x1a).google.firestore.admin.v1.BackupSchedule\"z\xda\x41\x1b\x62\x61\x63kup_schedule,update_mask\x82\xd3\xe4\x93\x02V2C/v1/{backup_schedule.name=projects/*/databases/*/backupSchedules/*}:\x0f\x62\x61\x63kup_schedule\x12\xaa\x01\n\x14\x44\x65leteBackupSchedule\x12\x36.google.firestore.admin.v1.DeleteBackupScheduleRequest\x1a\x16.google.protobuf.Empty\"B\xda\x41\x04name\x82\xd3\xe4\x93\x02\x35*3/v1/{name=projects/*/databases/*/backupSchedules/*}\x1av\xca\x41\x18\x66irestore.googleapis.com\xd2\x41Xhttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/datastoreB\xa5\x03\n\x1d\x63om.google.firestore.admin.v1B\x13\x46irestoreAdminProtoP\x01Z9cloud.google.com/go/firestore/apiv1/admin/adminpb;adminpb\xa2\x02\x04GCFS\xaa\x02\x1fGoogle.Cloud.Firestore.Admin.V1\xca\x02\x1fGoogle\\Cloud\\Firestore\\Admin\\V1\xea\x02#Google::Cloud::Firestore::Admin::V1\xea\x41L\n!firestore.googleapis.com/Location\x12\'projects/{project}/locations/{location}\xea\x41q\n(firestore.googleapis.com/CollectionGroup\x12\x45projects/{project}/databases/{database}/collectionGroups/{collection}b\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.firestore.admin.v1.Database", "google/firestore/admin/v1/database.proto"], + ["google.protobuf.FieldMask", "google/protobuf/field_mask.proto"], + ["google.firestore.admin.v1.BackupSchedule", "google/firestore/admin/v1/schedule.proto"], + ["google.firestore.admin.v1.Index", "google/firestore/admin/v1/index.proto"], + ["google.firestore.admin.v1.Field", "google/firestore/admin/v1/field.proto"], + ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], + ["google.firestore.admin.v1.Backup", "google/firestore/admin/v1/backup.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 Firestore + module Admin + module V1 + ListDatabasesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.firestore.admin.v1.ListDatabasesRequest").msgclass + CreateDatabaseRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.firestore.admin.v1.CreateDatabaseRequest").msgclass + CreateDatabaseMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.firestore.admin.v1.CreateDatabaseMetadata").msgclass + ListDatabasesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.firestore.admin.v1.ListDatabasesResponse").msgclass + GetDatabaseRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.firestore.admin.v1.GetDatabaseRequest").msgclass + UpdateDatabaseRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.firestore.admin.v1.UpdateDatabaseRequest").msgclass + UpdateDatabaseMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.firestore.admin.v1.UpdateDatabaseMetadata").msgclass + DeleteDatabaseRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.firestore.admin.v1.DeleteDatabaseRequest").msgclass + DeleteDatabaseMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.firestore.admin.v1.DeleteDatabaseMetadata").msgclass + CreateBackupScheduleRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.firestore.admin.v1.CreateBackupScheduleRequest").msgclass + GetBackupScheduleRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.firestore.admin.v1.GetBackupScheduleRequest").msgclass + UpdateBackupScheduleRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.firestore.admin.v1.UpdateBackupScheduleRequest").msgclass + ListBackupSchedulesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.firestore.admin.v1.ListBackupSchedulesRequest").msgclass + ListBackupSchedulesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.firestore.admin.v1.ListBackupSchedulesResponse").msgclass + DeleteBackupScheduleRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.firestore.admin.v1.DeleteBackupScheduleRequest").msgclass + CreateIndexRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.firestore.admin.v1.CreateIndexRequest").msgclass + ListIndexesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.firestore.admin.v1.ListIndexesRequest").msgclass + ListIndexesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.firestore.admin.v1.ListIndexesResponse").msgclass + GetIndexRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.firestore.admin.v1.GetIndexRequest").msgclass + DeleteIndexRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.firestore.admin.v1.DeleteIndexRequest").msgclass + UpdateFieldRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.firestore.admin.v1.UpdateFieldRequest").msgclass + GetFieldRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.firestore.admin.v1.GetFieldRequest").msgclass + ListFieldsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.firestore.admin.v1.ListFieldsRequest").msgclass + ListFieldsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.firestore.admin.v1.ListFieldsResponse").msgclass + ExportDocumentsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.firestore.admin.v1.ExportDocumentsRequest").msgclass + ImportDocumentsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.firestore.admin.v1.ImportDocumentsRequest").msgclass + GetBackupRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.firestore.admin.v1.GetBackupRequest").msgclass + ListBackupsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.firestore.admin.v1.ListBackupsRequest").msgclass + ListBackupsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.firestore.admin.v1.ListBackupsResponse").msgclass + DeleteBackupRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.firestore.admin.v1.DeleteBackupRequest").msgclass + RestoreDatabaseRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.firestore.admin.v1.RestoreDatabaseRequest").msgclass + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-firestore-admin-v1/lib/google/firestore/admin/v1/firestore_admin_services_pb.rb b/owl-bot-staging/google-cloud-firestore-admin-v1/lib/google/firestore/admin/v1/firestore_admin_services_pb.rb new file mode 100644 index 000000000000..3110ccc0e702 --- /dev/null +++ b/owl-bot-staging/google-cloud-firestore-admin-v1/lib/google/firestore/admin/v1/firestore_admin_services_pb.rb @@ -0,0 +1,178 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/firestore/admin/v1/firestore_admin.proto for package 'Google.Cloud.Firestore.Admin.V1' +# Original file comments: +# Copyright 2023 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/firestore/admin/v1/firestore_admin_pb' + +module Google + module Cloud + module Firestore + module Admin + module V1 + module FirestoreAdmin + # The Cloud Firestore Admin API. + # + # This API provides several administrative services for Cloud Firestore. + # + # Project, Database, Namespace, Collection, Collection Group, and Document are + # used as defined in the Google Cloud Firestore API. + # + # Operation: An Operation represents work being performed in the background. + # + # The index service manages Cloud Firestore indexes. + # + # Index creation is performed asynchronously. + # An Operation resource is created for each such asynchronous operation. + # The state of the operation (including any errors encountered) + # may be queried via the Operation resource. + # + # The Operations collection provides a record of actions performed for the + # specified Project (including any Operations in progress). Operations are not + # created directly but through calls on other collections or resources. + # + # An Operation that is done may be deleted so that it is no longer listed as + # part of the Operation collection. Operations are garbage collected after + # 30 days. By default, ListOperations will only return in progress and failed + # operations. To list completed operation, issue a ListOperations request with + # the filter `done: true`. + # + # Operations are created by service `FirestoreAdmin`, but are accessed via + # service `google.longrunning.Operations`. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.firestore.admin.v1.FirestoreAdmin' + + # Creates a composite index. This returns a + # [google.longrunning.Operation][google.longrunning.Operation] which may be + # used to track the status of the creation. The metadata for the operation + # will be the type + # [IndexOperationMetadata][google.firestore.admin.v1.IndexOperationMetadata]. + rpc :CreateIndex, ::Google::Cloud::Firestore::Admin::V1::CreateIndexRequest, ::Google::Longrunning::Operation + # Lists composite indexes. + rpc :ListIndexes, ::Google::Cloud::Firestore::Admin::V1::ListIndexesRequest, ::Google::Cloud::Firestore::Admin::V1::ListIndexesResponse + # Gets a composite index. + rpc :GetIndex, ::Google::Cloud::Firestore::Admin::V1::GetIndexRequest, ::Google::Cloud::Firestore::Admin::V1::Index + # Deletes a composite index. + rpc :DeleteIndex, ::Google::Cloud::Firestore::Admin::V1::DeleteIndexRequest, ::Google::Protobuf::Empty + # Gets the metadata and configuration for a Field. + rpc :GetField, ::Google::Cloud::Firestore::Admin::V1::GetFieldRequest, ::Google::Cloud::Firestore::Admin::V1::Field + # Updates a field configuration. Currently, field updates apply only to + # single field index configuration. However, calls to + # [FirestoreAdmin.UpdateField][google.firestore.admin.v1.FirestoreAdmin.UpdateField] + # should provide a field mask to avoid changing any configuration that the + # caller isn't aware of. The field mask should be specified as: `{ paths: + # "index_config" }`. + # + # This call returns a + # [google.longrunning.Operation][google.longrunning.Operation] which may be + # used to track the status of the field update. The metadata for the + # operation will be the type + # [FieldOperationMetadata][google.firestore.admin.v1.FieldOperationMetadata]. + # + # To configure the default field settings for the database, use + # the special `Field` with resource name: + # `projects/{project_id}/databases/{database_id}/collectionGroups/__default__/fields/*`. + rpc :UpdateField, ::Google::Cloud::Firestore::Admin::V1::UpdateFieldRequest, ::Google::Longrunning::Operation + # Lists the field configuration and metadata for this database. + # + # Currently, + # [FirestoreAdmin.ListFields][google.firestore.admin.v1.FirestoreAdmin.ListFields] + # only supports listing fields that have been explicitly overridden. To issue + # this query, call + # [FirestoreAdmin.ListFields][google.firestore.admin.v1.FirestoreAdmin.ListFields] + # with the filter set to `indexConfig.usesAncestorConfig:false` or + # `ttlConfig:*`. + rpc :ListFields, ::Google::Cloud::Firestore::Admin::V1::ListFieldsRequest, ::Google::Cloud::Firestore::Admin::V1::ListFieldsResponse + # Exports a copy of all or a subset of documents from Google Cloud Firestore + # to another storage system, such as Google Cloud Storage. Recent updates to + # documents may not be reflected in the export. The export occurs in the + # background and its progress can be monitored and managed via the + # Operation resource that is created. The output of an export may only be + # used once the associated operation is done. If an export operation is + # cancelled before completion it may leave partial data behind in Google + # Cloud Storage. + # + # For more details on export behavior and output format, refer to: + # https://cloud.google.com/firestore/docs/manage-data/export-import + rpc :ExportDocuments, ::Google::Cloud::Firestore::Admin::V1::ExportDocumentsRequest, ::Google::Longrunning::Operation + # Imports documents into Google Cloud Firestore. Existing documents with the + # same name are overwritten. The import occurs in the background and its + # progress can be monitored and managed via the Operation resource that is + # created. If an ImportDocuments operation is cancelled, it is possible + # that a subset of the data has already been imported to Cloud Firestore. + rpc :ImportDocuments, ::Google::Cloud::Firestore::Admin::V1::ImportDocumentsRequest, ::Google::Longrunning::Operation + # Create a database. + rpc :CreateDatabase, ::Google::Cloud::Firestore::Admin::V1::CreateDatabaseRequest, ::Google::Longrunning::Operation + # Gets information about a database. + rpc :GetDatabase, ::Google::Cloud::Firestore::Admin::V1::GetDatabaseRequest, ::Google::Cloud::Firestore::Admin::V1::Database + # List all the databases in the project. + rpc :ListDatabases, ::Google::Cloud::Firestore::Admin::V1::ListDatabasesRequest, ::Google::Cloud::Firestore::Admin::V1::ListDatabasesResponse + # Updates a database. + rpc :UpdateDatabase, ::Google::Cloud::Firestore::Admin::V1::UpdateDatabaseRequest, ::Google::Longrunning::Operation + # Deletes a database. + rpc :DeleteDatabase, ::Google::Cloud::Firestore::Admin::V1::DeleteDatabaseRequest, ::Google::Longrunning::Operation + # Gets information about a backup. + rpc :GetBackup, ::Google::Cloud::Firestore::Admin::V1::GetBackupRequest, ::Google::Cloud::Firestore::Admin::V1::Backup + # Lists all the backups. + rpc :ListBackups, ::Google::Cloud::Firestore::Admin::V1::ListBackupsRequest, ::Google::Cloud::Firestore::Admin::V1::ListBackupsResponse + # Deletes a backup. + rpc :DeleteBackup, ::Google::Cloud::Firestore::Admin::V1::DeleteBackupRequest, ::Google::Protobuf::Empty + # Creates a new database by restoring from an existing backup. + # + # The new database must be in the same cloud region or multi-region location + # as the existing backup. This behaves similar to + # [FirestoreAdmin.CreateDatabase][google.firestore.admin.v1.CreateDatabase] + # except instead of creating a new empty database, a new database is created + # with the database type, index configuration, and documents from an existing + # backup. + # + # The [long-running operation][google.longrunning.Operation] can be used to + # track the progress of the restore, with the Operation's + # [metadata][google.longrunning.Operation.metadata] field type being the + # [RestoreDatabaseMetadata][google.firestore.admin.v1.RestoreDatabaseMetadata]. + # The [response][google.longrunning.Operation.response] type is the + # [Database][google.firestore.admin.v1.Database] if the restore was + # successful. The new database is not readable or writeable until the LRO has + # completed. + rpc :RestoreDatabase, ::Google::Cloud::Firestore::Admin::V1::RestoreDatabaseRequest, ::Google::Longrunning::Operation + # Creates a backup schedule on a database. + # At most two backup schedules can be configured on a database, one daily + # backup schedule with retention up to 7 days and one weekly backup schedule + # with retention up to 14 weeks. + rpc :CreateBackupSchedule, ::Google::Cloud::Firestore::Admin::V1::CreateBackupScheduleRequest, ::Google::Cloud::Firestore::Admin::V1::BackupSchedule + # Gets information about a backup schedule. + rpc :GetBackupSchedule, ::Google::Cloud::Firestore::Admin::V1::GetBackupScheduleRequest, ::Google::Cloud::Firestore::Admin::V1::BackupSchedule + # List backup schedules. + rpc :ListBackupSchedules, ::Google::Cloud::Firestore::Admin::V1::ListBackupSchedulesRequest, ::Google::Cloud::Firestore::Admin::V1::ListBackupSchedulesResponse + # Updates a backup schedule. + rpc :UpdateBackupSchedule, ::Google::Cloud::Firestore::Admin::V1::UpdateBackupScheduleRequest, ::Google::Cloud::Firestore::Admin::V1::BackupSchedule + # Deletes a backup schedule. + rpc :DeleteBackupSchedule, ::Google::Cloud::Firestore::Admin::V1::DeleteBackupScheduleRequest, ::Google::Protobuf::Empty + end + + Stub = Service.rpc_stub_class + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-firestore-admin-v1/lib/google/firestore/admin/v1/index_pb.rb b/owl-bot-staging/google-cloud-firestore-admin-v1/lib/google/firestore/admin/v1/index_pb.rb new file mode 100644 index 000000000000..8546b2d72ce6 --- /dev/null +++ b/owl-bot-staging/google-cloud-firestore-admin-v1/lib/google/firestore/admin/v1/index_pb.rb @@ -0,0 +1,55 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/firestore/admin/v1/index.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' + + +descriptor_data = "\n%google/firestore/admin/v1/index.proto\x12\x19google.firestore.admin.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\"\x91\t\n\x05Index\x12\x0c\n\x04name\x18\x01 \x01(\t\x12@\n\x0bquery_scope\x18\x02 \x01(\x0e\x32+.google.firestore.admin.v1.Index.QueryScope\x12<\n\tapi_scope\x18\x05 \x01(\x0e\x32).google.firestore.admin.v1.Index.ApiScope\x12;\n\x06\x66ields\x18\x03 \x03(\x0b\x32+.google.firestore.admin.v1.Index.IndexField\x12\x35\n\x05state\x18\x04 \x01(\x0e\x32&.google.firestore.admin.v1.Index.State\x1a\xa2\x04\n\nIndexField\x12\x12\n\nfield_path\x18\x01 \x01(\t\x12\x42\n\x05order\x18\x02 \x01(\x0e\x32\x31.google.firestore.admin.v1.Index.IndexField.OrderH\x00\x12O\n\x0c\x61rray_config\x18\x03 \x01(\x0e\x32\x37.google.firestore.admin.v1.Index.IndexField.ArrayConfigH\x00\x12Q\n\rvector_config\x18\x04 \x01(\x0b\x32\x38.google.firestore.admin.v1.Index.IndexField.VectorConfigH\x00\x1a\x8f\x01\n\x0cVectorConfig\x12\x16\n\tdimension\x18\x01 \x01(\x05\x42\x03\xe0\x41\x02\x12R\n\x04\x66lat\x18\x02 \x01(\x0b\x32\x42.google.firestore.admin.v1.Index.IndexField.VectorConfig.FlatIndexH\x00\x1a\x0b\n\tFlatIndexB\x06\n\x04type\"=\n\x05Order\x12\x15\n\x11ORDER_UNSPECIFIED\x10\x00\x12\r\n\tASCENDING\x10\x01\x12\x0e\n\nDESCENDING\x10\x02\"9\n\x0b\x41rrayConfig\x12\x1c\n\x18\x41RRAY_CONFIG_UNSPECIFIED\x10\x00\x12\x0c\n\x08\x43ONTAINS\x10\x01\x42\x0c\n\nvalue_mode\"i\n\nQueryScope\x12\x1b\n\x17QUERY_SCOPE_UNSPECIFIED\x10\x00\x12\x0e\n\nCOLLECTION\x10\x01\x12\x14\n\x10\x43OLLECTION_GROUP\x10\x02\x12\x18\n\x14\x43OLLECTION_RECURSIVE\x10\x03\"/\n\x08\x41piScope\x12\x0b\n\x07\x41NY_API\x10\x00\x12\x16\n\x12\x44\x41TASTORE_MODE_API\x10\x01\"I\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0c\n\x08\x43REATING\x10\x01\x12\t\n\x05READY\x10\x02\x12\x10\n\x0cNEEDS_REPAIR\x10\x03:z\xea\x41w\n\x1e\x66irestore.googleapis.com/Index\x12Uprojects/{project}/databases/{database}/collectionGroups/{collection}/indexes/{index}B\xd9\x01\n\x1d\x63om.google.firestore.admin.v1B\nIndexProtoP\x01Z9cloud.google.com/go/firestore/apiv1/admin/adminpb;adminpb\xa2\x02\x04GCFS\xaa\x02\x1fGoogle.Cloud.Firestore.Admin.V1\xca\x02\x1fGoogle\\Cloud\\Firestore\\Admin\\V1\xea\x02#Google::Cloud::Firestore::Admin::V1b\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Cloud + module Firestore + module Admin + module V1 + Index = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.firestore.admin.v1.Index").msgclass + Index::IndexField = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.firestore.admin.v1.Index.IndexField").msgclass + Index::IndexField::VectorConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.firestore.admin.v1.Index.IndexField.VectorConfig").msgclass + Index::IndexField::VectorConfig::FlatIndex = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.firestore.admin.v1.Index.IndexField.VectorConfig.FlatIndex").msgclass + Index::IndexField::Order = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.firestore.admin.v1.Index.IndexField.Order").enummodule + Index::IndexField::ArrayConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.firestore.admin.v1.Index.IndexField.ArrayConfig").enummodule + Index::QueryScope = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.firestore.admin.v1.Index.QueryScope").enummodule + Index::ApiScope = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.firestore.admin.v1.Index.ApiScope").enummodule + Index::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.firestore.admin.v1.Index.State").enummodule + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-firestore-admin-v1/lib/google/firestore/admin/v1/location_pb.rb b/owl-bot-staging/google-cloud-firestore-admin-v1/lib/google/firestore/admin/v1/location_pb.rb new file mode 100644 index 000000000000..9132e2304719 --- /dev/null +++ b/owl-bot-staging/google-cloud-firestore-admin-v1/lib/google/firestore/admin/v1/location_pb.rb @@ -0,0 +1,44 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/firestore/admin/v1/location.proto + +require 'google/protobuf' + + +descriptor_data = "\n(google/firestore/admin/v1/location.proto\x12\x19google.firestore.admin.v1\"\x12\n\x10LocationMetadataB\xdc\x01\n\x1d\x63om.google.firestore.admin.v1B\rLocationProtoP\x01Z9cloud.google.com/go/firestore/apiv1/admin/adminpb;adminpb\xa2\x02\x04GCFS\xaa\x02\x1fGoogle.Cloud.Firestore.Admin.V1\xca\x02\x1fGoogle\\Cloud\\Firestore\\Admin\\V1\xea\x02#Google::Cloud::Firestore::Admin::V1b\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Cloud + module Firestore + module Admin + module V1 + LocationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.firestore.admin.v1.LocationMetadata").msgclass + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-firestore-admin-v1/lib/google/firestore/admin/v1/operation_pb.rb b/owl-bot-staging/google-cloud-firestore-admin-v1/lib/google/firestore/admin/v1/operation_pb.rb new file mode 100644 index 000000000000..fd3457a31d41 --- /dev/null +++ b/owl-bot-staging/google-cloud-firestore-admin-v1/lib/google/firestore/admin/v1/operation_pb.rb @@ -0,0 +1,61 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/firestore/admin/v1/operation.proto + +require 'google/protobuf' + +require 'google/api/resource_pb' +require 'google/firestore/admin/v1/index_pb' +require 'google/protobuf/timestamp_pb' + + +descriptor_data = "\n)google/firestore/admin/v1/operation.proto\x12\x19google.firestore.admin.v1\x1a\x19google/api/resource.proto\x1a%google/firestore/admin/v1/index.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xbd\x02\n\x16IndexOperationMetadata\x12.\n\nstart_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12,\n\x08\x65nd_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\r\n\x05index\x18\x03 \x01(\t\x12\x38\n\x05state\x18\x04 \x01(\x0e\x32).google.firestore.admin.v1.OperationState\x12?\n\x12progress_documents\x18\x05 \x01(\x0b\x32#.google.firestore.admin.v1.Progress\x12;\n\x0eprogress_bytes\x18\x06 \x01(\x0b\x32#.google.firestore.admin.v1.Progress\"\x99\x07\n\x16\x46ieldOperationMetadata\x12.\n\nstart_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12,\n\x08\x65nd_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\r\n\x05\x66ield\x18\x03 \x01(\t\x12_\n\x13index_config_deltas\x18\x04 \x03(\x0b\x32\x42.google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta\x12\x38\n\x05state\x18\x05 \x01(\x0e\x32).google.firestore.admin.v1.OperationState\x12?\n\x12progress_documents\x18\x06 \x01(\x0b\x32#.google.firestore.admin.v1.Progress\x12;\n\x0eprogress_bytes\x18\x07 \x01(\x0b\x32#.google.firestore.admin.v1.Progress\x12Z\n\x10ttl_config_delta\x18\x08 \x01(\x0b\x32@.google.firestore.admin.v1.FieldOperationMetadata.TtlConfigDelta\x1a\xe7\x01\n\x10IndexConfigDelta\x12\x62\n\x0b\x63hange_type\x18\x01 \x01(\x0e\x32M.google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta.ChangeType\x12/\n\x05index\x18\x02 \x01(\x0b\x32 .google.firestore.admin.v1.Index\">\n\nChangeType\x12\x1b\n\x17\x43HANGE_TYPE_UNSPECIFIED\x10\x00\x12\x07\n\x03\x41\x44\x44\x10\x01\x12\n\n\x06REMOVE\x10\x02\x1a\xb2\x01\n\x0eTtlConfigDelta\x12`\n\x0b\x63hange_type\x18\x01 \x01(\x0e\x32K.google.firestore.admin.v1.FieldOperationMetadata.TtlConfigDelta.ChangeType\">\n\nChangeType\x12\x1b\n\x17\x43HANGE_TYPE_UNSPECIFIED\x10\x00\x12\x07\n\x03\x41\x44\x44\x10\x01\x12\n\n\x06REMOVE\x10\x02\"\xb6\x03\n\x17\x45xportDocumentsMetadata\x12.\n\nstart_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12,\n\x08\x65nd_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x42\n\x0foperation_state\x18\x03 \x01(\x0e\x32).google.firestore.admin.v1.OperationState\x12?\n\x12progress_documents\x18\x04 \x01(\x0b\x32#.google.firestore.admin.v1.Progress\x12;\n\x0eprogress_bytes\x18\x05 \x01(\x0b\x32#.google.firestore.admin.v1.Progress\x12\x16\n\x0e\x63ollection_ids\x18\x06 \x03(\t\x12\x19\n\x11output_uri_prefix\x18\x07 \x01(\t\x12\x15\n\rnamespace_ids\x18\x08 \x03(\t\x12\x31\n\rsnapshot_time\x18\t \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"\x82\x03\n\x17ImportDocumentsMetadata\x12.\n\nstart_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12,\n\x08\x65nd_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x42\n\x0foperation_state\x18\x03 \x01(\x0e\x32).google.firestore.admin.v1.OperationState\x12?\n\x12progress_documents\x18\x04 \x01(\x0b\x32#.google.firestore.admin.v1.Progress\x12;\n\x0eprogress_bytes\x18\x05 \x01(\x0b\x32#.google.firestore.admin.v1.Progress\x12\x16\n\x0e\x63ollection_ids\x18\x06 \x03(\t\x12\x18\n\x10input_uri_prefix\x18\x07 \x01(\t\x12\x15\n\rnamespace_ids\x18\x08 \x03(\t\"4\n\x17\x45xportDocumentsResponse\x12\x19\n\x11output_uri_prefix\x18\x01 \x01(\t\"\xed\x02\n\x17RestoreDatabaseMetadata\x12.\n\nstart_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12,\n\x08\x65nd_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x42\n\x0foperation_state\x18\x03 \x01(\x0e\x32).google.firestore.admin.v1.OperationState\x12\x38\n\x08\x64\x61tabase\x18\x04 \x01(\tB&\xfa\x41#\n!firestore.googleapis.com/Database\x12\x34\n\x06\x62\x61\x63kup\x18\x05 \x01(\tB$\xfa\x41!\n\x1f\x66irestore.googleapis.com/Backup\x12@\n\x13progress_percentage\x18\x08 \x01(\x0b\x32#.google.firestore.admin.v1.Progress\":\n\x08Progress\x12\x16\n\x0e\x65stimated_work\x18\x01 \x01(\x03\x12\x16\n\x0e\x63ompleted_work\x18\x02 \x01(\x03*\x9e\x01\n\x0eOperationState\x12\x1f\n\x1bOPERATION_STATE_UNSPECIFIED\x10\x00\x12\x10\n\x0cINITIALIZING\x10\x01\x12\x0e\n\nPROCESSING\x10\x02\x12\x0e\n\nCANCELLING\x10\x03\x12\x0e\n\nFINALIZING\x10\x04\x12\x0e\n\nSUCCESSFUL\x10\x05\x12\n\n\x06\x46\x41ILED\x10\x06\x12\r\n\tCANCELLED\x10\x07\x42\xdd\x01\n\x1d\x63om.google.firestore.admin.v1B\x0eOperationProtoP\x01Z9cloud.google.com/go/firestore/apiv1/admin/adminpb;adminpb\xa2\x02\x04GCFS\xaa\x02\x1fGoogle.Cloud.Firestore.Admin.V1\xca\x02\x1fGoogle\\Cloud\\Firestore\\Admin\\V1\xea\x02#Google::Cloud::Firestore::Admin::V1b\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], + ["google.firestore.admin.v1.Index", "google/firestore/admin/v1/index.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 Firestore + module Admin + module V1 + IndexOperationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.firestore.admin.v1.IndexOperationMetadata").msgclass + FieldOperationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.firestore.admin.v1.FieldOperationMetadata").msgclass + FieldOperationMetadata::IndexConfigDelta = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta").msgclass + FieldOperationMetadata::IndexConfigDelta::ChangeType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta.ChangeType").enummodule + FieldOperationMetadata::TtlConfigDelta = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.firestore.admin.v1.FieldOperationMetadata.TtlConfigDelta").msgclass + FieldOperationMetadata::TtlConfigDelta::ChangeType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.firestore.admin.v1.FieldOperationMetadata.TtlConfigDelta.ChangeType").enummodule + ExportDocumentsMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.firestore.admin.v1.ExportDocumentsMetadata").msgclass + ImportDocumentsMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.firestore.admin.v1.ImportDocumentsMetadata").msgclass + ExportDocumentsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.firestore.admin.v1.ExportDocumentsResponse").msgclass + RestoreDatabaseMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.firestore.admin.v1.RestoreDatabaseMetadata").msgclass + Progress = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.firestore.admin.v1.Progress").msgclass + OperationState = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.firestore.admin.v1.OperationState").enummodule + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-firestore-admin-v1/lib/google/firestore/admin/v1/schedule_pb.rb b/owl-bot-staging/google-cloud-firestore-admin-v1/lib/google/firestore/admin/v1/schedule_pb.rb new file mode 100644 index 000000000000..9ce18f3264f8 --- /dev/null +++ b/owl-bot-staging/google-cloud-firestore-admin-v1/lib/google/firestore/admin/v1/schedule_pb.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/firestore/admin/v1/schedule.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/protobuf/duration_pb' +require 'google/protobuf/timestamp_pb' +require 'google/type/dayofweek_pb' + + +descriptor_data = "\n(google/firestore/admin/v1/schedule.proto\x12\x19google.firestore.admin.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x1bgoogle/type/dayofweek.proto\"\xd6\x03\n\x0e\x42\x61\x63kupSchedule\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x34\n\x0b\x63reate_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\n \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12,\n\tretention\x18\x06 \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x46\n\x10\x64\x61ily_recurrence\x18\x07 \x01(\x0b\x32*.google.firestore.admin.v1.DailyRecurrenceH\x00\x12H\n\x11weekly_recurrence\x18\x08 \x01(\x0b\x32+.google.firestore.admin.v1.WeeklyRecurrenceH\x00:w\xea\x41t\n\'firestore.googleapis.com/BackupSchedule\x12Iprojects/{project}/databases/{database}/backupSchedules/{backup_schedule}B\x0c\n\nrecurrence\"\x11\n\x0f\x44\x61ilyRecurrence\"7\n\x10WeeklyRecurrence\x12#\n\x03\x64\x61y\x18\x02 \x01(\x0e\x32\x16.google.type.DayOfWeekB\xdc\x01\n\x1d\x63om.google.firestore.admin.v1B\rScheduleProtoP\x01Z9cloud.google.com/go/firestore/apiv1/admin/adminpb;adminpb\xa2\x02\x04GCFS\xaa\x02\x1fGoogle.Cloud.Firestore.Admin.V1\xca\x02\x1fGoogle\\Cloud\\Firestore\\Admin\\V1\xea\x02#Google::Cloud::Firestore::Admin::V1b\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], + ["google.protobuf.Duration", "google/protobuf/duration.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 Firestore + module Admin + module V1 + BackupSchedule = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.firestore.admin.v1.BackupSchedule").msgclass + DailyRecurrence = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.firestore.admin.v1.DailyRecurrence").msgclass + WeeklyRecurrence = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.firestore.admin.v1.WeeklyRecurrence").msgclass + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-firestore-admin-v1/proto_docs/README.md b/owl-bot-staging/google-cloud-firestore-admin-v1/proto_docs/README.md new file mode 100644 index 000000000000..8973d7337b3b --- /dev/null +++ b/owl-bot-staging/google-cloud-firestore-admin-v1/proto_docs/README.md @@ -0,0 +1,4 @@ +# Cloud Firestore 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-firestore-admin-v1/proto_docs/google/api/client.rb b/owl-bot-staging/google-cloud-firestore-admin-v1/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..934c39849a6a --- /dev/null +++ b/owl-bot-staging/google-cloud-firestore-admin-v1/proto_docs/google/api/client.rb @@ -0,0 +1,399 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + 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. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + 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. + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + 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. + # @!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: + # seconds: 60 # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: + # seconds: 360 # 6 minutes + # total_poll_timeout: + # seconds: 54000 # 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 + + # 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-firestore-admin-v1/proto_docs/google/api/field_behavior.rb b/owl-bot-staging/google-cloud-firestore-admin-v1/proto_docs/google/api/field_behavior.rb new file mode 100644 index 000000000000..b03587481349 --- /dev/null +++ b/owl-bot-staging/google-cloud-firestore-admin-v1/proto_docs/google/api/field_behavior.rb @@ -0,0 +1,85 @@ +# frozen_string_literal: true + +# Copyright 2024 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-firestore-admin-v1/proto_docs/google/api/launch_stage.rb b/owl-bot-staging/google-cloud-firestore-admin-v1/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..38b4b61e6061 --- /dev/null +++ b/owl-bot-staging/google-cloud-firestore-admin-v1/proto_docs/google/api/launch_stage.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2024 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-firestore-admin-v1/proto_docs/google/api/resource.rb b/owl-bot-staging/google-cloud-firestore-admin-v1/proto_docs/google/api/resource.rb new file mode 100644 index 000000000000..6497ebc78dc1 --- /dev/null +++ b/owl-bot-staging/google-cloud-firestore-admin-v1/proto_docs/google/api/resource.rb @@ -0,0 +1,222 @@ +# frozen_string_literal: true + +# Copyright 2024 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'. 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-firestore-admin-v1/proto_docs/google/firestore/admin/v1/backup.rb b/owl-bot-staging/google-cloud-firestore-admin-v1/proto_docs/google/firestore/admin/v1/backup.rb new file mode 100644 index 000000000000..b0aa36fc40b7 --- /dev/null +++ b/owl-bot-staging/google-cloud-firestore-admin-v1/proto_docs/google/firestore/admin/v1/backup.rb @@ -0,0 +1,99 @@ +# frozen_string_literal: true + +# Copyright 2024 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 Firestore + module Admin + module V1 + # A Backup of a Cloud Firestore Database. + # + # The backup contains all documents and index configurations for the given + # database at a specific point in time. + # @!attribute [r] name + # @return [::String] + # Output only. The unique resource name of the Backup. + # + # Format is `projects/{project}/locations/{location}/backups/{backup}`. + # @!attribute [r] database + # @return [::String] + # Output only. Name of the Firestore database that the backup is from. + # + # Format is `projects/{project}/databases/{database}`. + # @!attribute [r] database_uid + # @return [::String] + # Output only. The system-generated UUID4 for the Firestore database that the + # backup is from. + # @!attribute [r] snapshot_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The backup contains an externally consistent copy of the + # database at this time. + # @!attribute [r] expire_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The timestamp at which this backup expires. + # @!attribute [r] stats + # @return [::Google::Cloud::Firestore::Admin::V1::Backup::Stats] + # Output only. Statistics about the backup. + # + # This data only becomes available after the backup is fully materialized to + # secondary storage. This field will be empty till then. + # @!attribute [r] state + # @return [::Google::Cloud::Firestore::Admin::V1::Backup::State] + # Output only. The current state of the backup. + class Backup + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Backup specific statistics. + # @!attribute [r] size_bytes + # @return [::Integer] + # Output only. Summation of the size of all documents and index entries in + # the backup, measured in bytes. + # @!attribute [r] document_count + # @return [::Integer] + # Output only. The total number of documents contained in the backup. + # @!attribute [r] index_count + # @return [::Integer] + # Output only. The total number of index entries contained in the backup. + class Stats + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Indicate the current state of the backup. + module State + # The state is unspecified. + STATE_UNSPECIFIED = 0 + + # The pending backup is still being created. Operations on the + # backup will be rejected in this state. + CREATING = 1 + + # The backup is complete and ready to use. + READY = 2 + + # The backup is not available at this moment. + NOT_AVAILABLE = 3 + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-firestore-admin-v1/proto_docs/google/firestore/admin/v1/database.rb b/owl-bot-staging/google-cloud-firestore-admin-v1/proto_docs/google/firestore/admin/v1/database.rb new file mode 100644 index 000000000000..c225168d2859 --- /dev/null +++ b/owl-bot-staging/google-cloud-firestore-admin-v1/proto_docs/google/firestore/admin/v1/database.rb @@ -0,0 +1,197 @@ +# frozen_string_literal: true + +# Copyright 2024 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 Firestore + module Admin + module V1 + # A Cloud Firestore Database. + # @!attribute [rw] name + # @return [::String] + # The resource name of the Database. + # Format: `projects/{project}/databases/{database}` + # @!attribute [r] uid + # @return [::String] + # Output only. The system-generated UUID4 for this Database. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The timestamp at which this database was created. Databases + # created before 2016 do not populate create_time. + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The timestamp at which this database was most recently + # updated. Note this only includes updates to the database resource and not + # data contained by the database. + # @!attribute [rw] location_id + # @return [::String] + # The location of the database. Available locations are listed at + # https://cloud.google.com/firestore/docs/locations. + # @!attribute [rw] type + # @return [::Google::Cloud::Firestore::Admin::V1::Database::DatabaseType] + # The type of the database. + # See https://cloud.google.com/datastore/docs/firestore-or-datastore for + # information about how to choose. + # @!attribute [rw] concurrency_mode + # @return [::Google::Cloud::Firestore::Admin::V1::Database::ConcurrencyMode] + # The concurrency control mode to use for this database. + # @!attribute [r] version_retention_period + # @return [::Google::Protobuf::Duration] + # Output only. The period during which past versions of data are retained in + # the database. + # + # Any [read][google.firestore.v1.GetDocumentRequest.read_time] + # or [query][google.firestore.v1.ListDocumentsRequest.read_time] can specify + # a `read_time` within this window, and will read the state of the database + # at that time. + # + # If the PITR feature is enabled, the retention period is 7 days. Otherwise, + # the retention period is 1 hour. + # @!attribute [r] earliest_version_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The earliest timestamp at which older versions of the data can + # be read from the database. See [version_retention_period] above; this field + # is populated with `now - version_retention_period`. + # + # This value is continuously updated, and becomes stale the moment it is + # queried. If you are using this value to recover data, make sure to account + # for the time from the moment when the value is queried to the moment when + # you initiate the recovery. + # @!attribute [rw] point_in_time_recovery_enablement + # @return [::Google::Cloud::Firestore::Admin::V1::Database::PointInTimeRecoveryEnablement] + # Whether to enable the PITR feature on this database. + # @!attribute [rw] app_engine_integration_mode + # @return [::Google::Cloud::Firestore::Admin::V1::Database::AppEngineIntegrationMode] + # The App Engine integration mode to use for this database. + # @!attribute [r] key_prefix + # @return [::String] + # Output only. The key_prefix for this database. This key_prefix is used, in + # combination with the project id ("~") to construct + # the application id that is returned from the Cloud Datastore APIs in Google + # App Engine first generation runtimes. + # + # This value may be empty in which case the appid to use for URL-encoded keys + # is the project_id (eg: foo instead of v~foo). + # @!attribute [rw] delete_protection_state + # @return [::Google::Cloud::Firestore::Admin::V1::Database::DeleteProtectionState] + # State of delete protection for the database. + # @!attribute [rw] etag + # @return [::String] + # This checksum is computed by the server based on the value of other + # fields, and may be sent on update and delete requests to ensure the + # client has an up-to-date value before proceeding. + class Database + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The type of the database. + # See https://cloud.google.com/datastore/docs/firestore-or-datastore for + # information about how to choose. + # + # Mode changes are only allowed if the database is empty. + module DatabaseType + # The default value. This value is used if the database type is omitted. + DATABASE_TYPE_UNSPECIFIED = 0 + + # Firestore Native Mode + FIRESTORE_NATIVE = 1 + + # Firestore in Datastore Mode. + DATASTORE_MODE = 2 + end + + # The type of concurrency control mode for transactions. + module ConcurrencyMode + # Not used. + CONCURRENCY_MODE_UNSPECIFIED = 0 + + # Use optimistic concurrency control by default. This mode is available + # for Cloud Firestore databases. + OPTIMISTIC = 1 + + # Use pessimistic concurrency control by default. This mode is available + # for Cloud Firestore databases. + # + # This is the default setting for Cloud Firestore. + PESSIMISTIC = 2 + + # Use optimistic concurrency control with entity groups by default. + # + # This is the only available mode for Cloud Datastore. + # + # This mode is also available for Cloud Firestore with Datastore Mode but + # is not recommended. + OPTIMISTIC_WITH_ENTITY_GROUPS = 3 + end + + # Point In Time Recovery feature enablement. + module PointInTimeRecoveryEnablement + # Not used. + POINT_IN_TIME_RECOVERY_ENABLEMENT_UNSPECIFIED = 0 + + # Reads are supported on selected versions of the data from within the past + # 7 days: + # + # * Reads against any timestamp within the past hour + # * Reads against 1-minute snapshots beyond 1 hour and within 7 days + # + # `version_retention_period` and `earliest_version_time` can be + # used to determine the supported versions. + POINT_IN_TIME_RECOVERY_ENABLED = 1 + + # Reads are supported on any version of the data from within the past 1 + # hour. + POINT_IN_TIME_RECOVERY_DISABLED = 2 + end + + # The type of App Engine integration mode. + module AppEngineIntegrationMode + # Not used. + APP_ENGINE_INTEGRATION_MODE_UNSPECIFIED = 0 + + # If an App Engine application exists in the same region as this database, + # App Engine configuration will impact this database. This includes + # disabling of the application & database, as well as disabling writes to + # the database. + ENABLED = 1 + + # App Engine has no effect on the ability of this database to serve + # requests. + # + # This is the default setting for databases created with the Firestore API. + DISABLED = 2 + end + + # The delete protection state of the database. + module DeleteProtectionState + # The default value. Delete protection type is not specified + DELETE_PROTECTION_STATE_UNSPECIFIED = 0 + + # Delete protection is disabled + DELETE_PROTECTION_DISABLED = 1 + + # Delete protection is enabled + DELETE_PROTECTION_ENABLED = 2 + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-firestore-admin-v1/proto_docs/google/firestore/admin/v1/field.rb b/owl-bot-staging/google-cloud-firestore-admin-v1/proto_docs/google/firestore/admin/v1/field.rb new file mode 100644 index 000000000000..974162a79b2b --- /dev/null +++ b/owl-bot-staging/google-cloud-firestore-admin-v1/proto_docs/google/firestore/admin/v1/field.rb @@ -0,0 +1,138 @@ +# frozen_string_literal: true + +# Copyright 2024 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 Firestore + module Admin + module V1 + # Represents a single field in the database. + # + # Fields are grouped by their "Collection Group", which represent all + # collections in the database with the same id. + # @!attribute [rw] name + # @return [::String] + # Required. A field name of the form + # `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/fields/{field_path}` + # + # A field path may be a simple field name, e.g. `address` or a path to fields + # within map_value , e.g. `address.city`, + # or a special field path. The only valid special field is `*`, which + # represents any field. + # + # Field paths may be quoted using ` (backtick). The only character that needs + # to be escaped within a quoted field path is the backtick character itself, + # escaped using a backslash. Special characters in field paths that + # must be quoted include: `*`, `.`, + # ``` (backtick), `[`, `]`, as well as any ascii symbolic characters. + # + # Examples: + # (Note: Comments here are written in markdown syntax, so there is an + # additional layer of backticks to represent a code block) + # `\`address.city\`` represents a field named `address.city`, not the map key + # `city` in the field `address`. + # `\`*\`` represents a field named `*`, not any field. + # + # A special `Field` contains the default indexing settings for all fields. + # This field's resource name is: + # `projects/{project_id}/databases/{database_id}/collectionGroups/__default__/fields/*` + # Indexes defined on this `Field` will be applied to all fields which do not + # have their own `Field` index configuration. + # @!attribute [rw] index_config + # @return [::Google::Cloud::Firestore::Admin::V1::Field::IndexConfig] + # The index configuration for this field. If unset, field indexing will + # revert to the configuration defined by the `ancestor_field`. To + # explicitly remove all indexes for this field, specify an index config + # with an empty list of indexes. + # @!attribute [rw] ttl_config + # @return [::Google::Cloud::Firestore::Admin::V1::Field::TtlConfig] + # The TTL configuration for this `Field`. + # Setting or unsetting this will enable or disable the TTL for + # documents that have this `Field`. + class Field + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The index configuration for this field. + # @!attribute [rw] indexes + # @return [::Array<::Google::Cloud::Firestore::Admin::V1::Index>] + # The indexes supported for this field. + # @!attribute [rw] uses_ancestor_config + # @return [::Boolean] + # Output only. When true, the `Field`'s index configuration is set from the + # configuration specified by the `ancestor_field`. + # When false, the `Field`'s index configuration is defined explicitly. + # @!attribute [rw] ancestor_field + # @return [::String] + # Output only. Specifies the resource name of the `Field` from which this field's + # index configuration is set (when `uses_ancestor_config` is true), + # or from which it *would* be set if this field had no index configuration + # (when `uses_ancestor_config` is false). + # @!attribute [rw] reverting + # @return [::Boolean] + # Output only + # When true, the `Field`'s index configuration is in the process of being + # reverted. Once complete, the index config will transition to the same + # state as the field specified by `ancestor_field`, at which point + # `uses_ancestor_config` will be `true` and `reverting` will be `false`. + class IndexConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The TTL (time-to-live) configuration for documents that have this `Field` + # set. + # Storing a timestamp value into a TTL-enabled field will be treated as + # the document's absolute expiration time. Using any other data type or + # leaving the field absent will disable the TTL for the individual document. + # @!attribute [r] state + # @return [::Google::Cloud::Firestore::Admin::V1::Field::TtlConfig::State] + # Output only. The state of the TTL configuration. + class TtlConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The state of applying the TTL configuration to all documents. + module State + # The state is unspecified or unknown. + STATE_UNSPECIFIED = 0 + + # The TTL is being applied. There is an active long-running operation to + # track the change. Newly written documents will have TTLs applied as + # requested. Requested TTLs on existing documents are still being + # processed. When TTLs on all existing documents have been processed, the + # state will move to 'ACTIVE'. + CREATING = 1 + + # The TTL is active for all documents. + ACTIVE = 2 + + # The TTL configuration could not be enabled for all existing documents. + # Newly written documents will continue to have their TTL applied. + # The LRO returned when last attempting to enable TTL for this `Field` + # has failed, and may have more details. + NEEDS_REPAIR = 3 + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-firestore-admin-v1/proto_docs/google/firestore/admin/v1/firestore_admin.rb b/owl-bot-staging/google-cloud-firestore-admin-v1/proto_docs/google/firestore/admin/v1/firestore_admin.rb new file mode 100644 index 000000000000..fa18c112d626 --- /dev/null +++ b/owl-bot-staging/google-cloud-firestore-admin-v1/proto_docs/google/firestore/admin/v1/firestore_admin.rb @@ -0,0 +1,509 @@ +# frozen_string_literal: true + +# Copyright 2024 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 Firestore + module Admin + module V1 + # A request to list the Firestore Databases in all locations for a project. + # @!attribute [rw] parent + # @return [::String] + # Required. A parent name of the form + # `projects/{project_id}` + class ListDatabasesRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request for + # {::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client#create_database FirestoreAdmin.CreateDatabase}. + # @!attribute [rw] parent + # @return [::String] + # Required. A parent name of the form + # `projects/{project_id}` + # @!attribute [rw] database + # @return [::Google::Cloud::Firestore::Admin::V1::Database] + # Required. The Database to create. + # @!attribute [rw] database_id + # @return [::String] + # Required. The ID to use for the database, which will become the final + # component of the database's resource name. + # + # This value should be 4-63 characters. Valid characters are /[a-z][0-9]-/ + # with first character a letter and the last a letter or a number. Must not + # be UUID-like /[0-9a-f]\\{8}(-[0-9a-f]\\{4})\\{3}-[0-9a-f]\\{12}/. + # + # "(default)" database id is also valid. + class CreateDatabaseRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Metadata related to the create database operation. + class CreateDatabaseMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The list of databases for a project. + # @!attribute [rw] databases + # @return [::Array<::Google::Cloud::Firestore::Admin::V1::Database>] + # The databases in the project. + # @!attribute [rw] unreachable + # @return [::Array<::String>] + # In the event that data about individual databases cannot be listed they + # will be recorded here. + # + # An example entry might be: projects/some_project/locations/some_location + # This can happen if the Cloud Region that the Database resides in is + # currently unavailable. In this case we can't fetch all the details about + # the database. You may be able to get a more detailed error message + # (or possibly fetch the resource) by sending a 'Get' request for the + # resource or a 'List' request for the specific location. + class ListDatabasesResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request for + # {::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client#get_database FirestoreAdmin.GetDatabase}. + # @!attribute [rw] name + # @return [::String] + # Required. A name of the form + # `projects/{project_id}/databases/{database_id}` + class GetDatabaseRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request for + # {::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client#update_database FirestoreAdmin.UpdateDatabase}. + # @!attribute [rw] database + # @return [::Google::Cloud::Firestore::Admin::V1::Database] + # Required. The database to update. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # The list of fields to be updated. + class UpdateDatabaseRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Metadata related to the update database operation. + class UpdateDatabaseMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request for + # {::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client#delete_database FirestoreAdmin.DeleteDatabase}. + # @!attribute [rw] name + # @return [::String] + # Required. A name of the form + # `projects/{project_id}/databases/{database_id}` + # @!attribute [rw] etag + # @return [::String] + # The current etag of the Database. + # If an etag is provided and does not match the current etag of the database, + # deletion will be blocked and a FAILED_PRECONDITION error will be returned. + class DeleteDatabaseRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Metadata related to the delete database operation. + class DeleteDatabaseMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request for + # {::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client#create_backup_schedule FirestoreAdmin.CreateBackupSchedule}. + # @!attribute [rw] parent + # @return [::String] + # Required. The parent database. + # + # Format `projects/{project}/databases/{database}` + # @!attribute [rw] backup_schedule + # @return [::Google::Cloud::Firestore::Admin::V1::BackupSchedule] + # Required. The backup schedule to create. + class CreateBackupScheduleRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request for + # {::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client#get_backup_schedule FirestoreAdmin.GetBackupSchedule}. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the backup schedule. + # + # Format + # `projects/{project}/databases/{database}/backupSchedules/{backup_schedule}` + class GetBackupScheduleRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request for + # {::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client#update_backup_schedule FirestoreAdmin.UpdateBackupSchedule}. + # @!attribute [rw] backup_schedule + # @return [::Google::Cloud::Firestore::Admin::V1::BackupSchedule] + # Required. The backup schedule to update. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # The list of fields to be updated. + class UpdateBackupScheduleRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request for + # {::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client#list_backup_schedules FirestoreAdmin.ListBackupSchedules}. + # @!attribute [rw] parent + # @return [::String] + # Required. The parent database. + # + # Format is `projects/{project}/databases/{database}`. + class ListBackupSchedulesRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The response for + # {::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client#list_backup_schedules FirestoreAdmin.ListBackupSchedules}. + # @!attribute [rw] backup_schedules + # @return [::Array<::Google::Cloud::Firestore::Admin::V1::BackupSchedule>] + # List of all backup schedules. + class ListBackupSchedulesResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request for [FirestoreAdmin.DeleteBackupSchedules][]. + # @!attribute [rw] name + # @return [::String] + # Required. The name of backup schedule. + # + # Format + # `projects/{project}/databases/{database}/backupSchedules/{backup_schedule}` + class DeleteBackupScheduleRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request for + # {::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client#create_index FirestoreAdmin.CreateIndex}. + # @!attribute [rw] parent + # @return [::String] + # Required. A parent name of the form + # `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}` + # @!attribute [rw] index + # @return [::Google::Cloud::Firestore::Admin::V1::Index] + # Required. The composite index to create. + class CreateIndexRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request for + # {::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client#list_indexes FirestoreAdmin.ListIndexes}. + # @!attribute [rw] parent + # @return [::String] + # Required. A parent name of the form + # `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}` + # @!attribute [rw] filter + # @return [::String] + # The filter to apply to list results. + # @!attribute [rw] page_size + # @return [::Integer] + # The number of results to return. + # @!attribute [rw] page_token + # @return [::String] + # A page token, returned from a previous call to + # {::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client#list_indexes FirestoreAdmin.ListIndexes}, + # that may be used to get the next page of results. + class ListIndexesRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The response for + # {::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client#list_indexes FirestoreAdmin.ListIndexes}. + # @!attribute [rw] indexes + # @return [::Array<::Google::Cloud::Firestore::Admin::V1::Index>] + # The requested indexes. + # @!attribute [rw] next_page_token + # @return [::String] + # A page token that may be used to request another page of results. If blank, + # this is the last page. + class ListIndexesResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request for + # {::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client#get_index FirestoreAdmin.GetIndex}. + # @!attribute [rw] name + # @return [::String] + # Required. A name of the form + # `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/indexes/{index_id}` + class GetIndexRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request for + # {::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client#delete_index FirestoreAdmin.DeleteIndex}. + # @!attribute [rw] name + # @return [::String] + # Required. A name of the form + # `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/indexes/{index_id}` + class DeleteIndexRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request for + # {::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client#update_field FirestoreAdmin.UpdateField}. + # @!attribute [rw] field + # @return [::Google::Cloud::Firestore::Admin::V1::Field] + # Required. The field to be updated. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # A mask, relative to the field. If specified, only configuration specified + # by this field_mask will be updated in the field. + class UpdateFieldRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request for + # {::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client#get_field FirestoreAdmin.GetField}. + # @!attribute [rw] name + # @return [::String] + # Required. A name of the form + # `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/fields/{field_id}` + class GetFieldRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request for + # {::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client#list_fields FirestoreAdmin.ListFields}. + # @!attribute [rw] parent + # @return [::String] + # Required. A parent name of the form + # `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}` + # @!attribute [rw] filter + # @return [::String] + # The filter to apply to list results. Currently, + # {::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client#list_fields FirestoreAdmin.ListFields} + # only supports listing fields that have been explicitly overridden. To issue + # this query, call + # {::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client#list_fields FirestoreAdmin.ListFields} + # with a filter that includes `indexConfig.usesAncestorConfig:false` . + # @!attribute [rw] page_size + # @return [::Integer] + # The number of results to return. + # @!attribute [rw] page_token + # @return [::String] + # A page token, returned from a previous call to + # {::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client#list_fields FirestoreAdmin.ListFields}, + # that may be used to get the next page of results. + class ListFieldsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The response for + # {::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client#list_fields FirestoreAdmin.ListFields}. + # @!attribute [rw] fields + # @return [::Array<::Google::Cloud::Firestore::Admin::V1::Field>] + # The requested fields. + # @!attribute [rw] next_page_token + # @return [::String] + # A page token that may be used to request another page of results. If blank, + # this is the last page. + class ListFieldsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request for + # {::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client#export_documents FirestoreAdmin.ExportDocuments}. + # @!attribute [rw] name + # @return [::String] + # Required. Database to export. Should be of the form: + # `projects/{project_id}/databases/{database_id}`. + # @!attribute [rw] collection_ids + # @return [::Array<::String>] + # Which collection ids to export. Unspecified means all collections. + # @!attribute [rw] output_uri_prefix + # @return [::String] + # The output URI. Currently only supports Google Cloud Storage URIs of the + # form: `gs://BUCKET_NAME[/NAMESPACE_PATH]`, where `BUCKET_NAME` is the name + # of the Google Cloud Storage bucket and `NAMESPACE_PATH` is an optional + # Google Cloud Storage namespace path. When + # choosing a name, be sure to consider Google Cloud Storage naming + # guidelines: https://cloud.google.com/storage/docs/naming. + # If the URI is a bucket (without a namespace path), a prefix will be + # generated based on the start time. + # @!attribute [rw] namespace_ids + # @return [::Array<::String>] + # An empty list represents all namespaces. This is the preferred + # usage for databases that don't use namespaces. + # + # An empty string element represents the default namespace. This should be + # used if the database has data in non-default namespaces, but doesn't want + # to include them. Each namespace in this list must be unique. + # @!attribute [rw] snapshot_time + # @return [::Google::Protobuf::Timestamp] + # The timestamp that corresponds to the version of the database to be + # exported. The timestamp must be in the past, rounded to the minute and not + # older than + # {::Google::Cloud::Firestore::Admin::V1::Database#earliest_version_time earliestVersionTime}. + # If specified, then the exported documents will represent a consistent view + # of the database at the provided time. Otherwise, there are no guarantees + # about the consistency of the exported documents. + class ExportDocumentsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request for + # {::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client#import_documents FirestoreAdmin.ImportDocuments}. + # @!attribute [rw] name + # @return [::String] + # Required. Database to import into. Should be of the form: + # `projects/{project_id}/databases/{database_id}`. + # @!attribute [rw] collection_ids + # @return [::Array<::String>] + # Which collection ids to import. Unspecified means all collections included + # in the import. + # @!attribute [rw] input_uri_prefix + # @return [::String] + # Location of the exported files. + # This must match the output_uri_prefix of an ExportDocumentsResponse from + # an export that has completed successfully. + # See: + # {::Google::Cloud::Firestore::Admin::V1::ExportDocumentsResponse#output_uri_prefix google.firestore.admin.v1.ExportDocumentsResponse.output_uri_prefix}. + # @!attribute [rw] namespace_ids + # @return [::Array<::String>] + # An empty list represents all namespaces. This is the preferred + # usage for databases that don't use namespaces. + # + # An empty string element represents the default namespace. This should be + # used if the database has data in non-default namespaces, but doesn't want + # to include them. Each namespace in this list must be unique. + class ImportDocumentsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request for + # {::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client#get_backup FirestoreAdmin.GetBackup}. + # @!attribute [rw] name + # @return [::String] + # Required. Name of the backup to fetch. + # + # Format is `projects/{project}/locations/{location}/backups/{backup}`. + class GetBackupRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request for + # {::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client#list_backups FirestoreAdmin.ListBackups}. + # @!attribute [rw] parent + # @return [::String] + # Required. The location to list backups from. + # + # Format is `projects/{project}/locations/{location}`. + # Use `{location} = '-'` to list backups from all locations for the given + # project. This allows listing backups from a single location or from all + # locations. + class ListBackupsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The response for + # {::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client#list_backups FirestoreAdmin.ListBackups}. + # @!attribute [rw] backups + # @return [::Array<::Google::Cloud::Firestore::Admin::V1::Backup>] + # List of all backups for the project. + # @!attribute [rw] unreachable + # @return [::Array<::String>] + # List of locations that existing backups were not able to be fetched from. + # + # Instead of failing the entire requests when a single location is + # unreachable, this response returns a partial result set and list of + # locations unable to be reached here. The request can be retried against a + # single location to get a concrete error. + class ListBackupsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request for + # {::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client#delete_backup FirestoreAdmin.DeleteBackup}. + # @!attribute [rw] name + # @return [::String] + # Required. Name of the backup to delete. + # + # format is `projects/{project}/locations/{location}/backups/{backup}`. + class DeleteBackupRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # [FirestoreAdmin.RestoreDatabase][google.firestore.admin.v1.RestoreDatabase]. + # @!attribute [rw] parent + # @return [::String] + # Required. The project to restore the database in. Format is + # `projects/{project_id}`. + # @!attribute [rw] database_id + # @return [::String] + # Required. The ID to use for the database, which will become the final + # component of the database's resource name. This database id must not be + # associated with an existing database. + # + # This value should be 4-63 characters. Valid characters are /[a-z][0-9]-/ + # with first character a letter and the last a letter or a number. Must not + # be UUID-like /[0-9a-f]\\{8}(-[0-9a-f]\\{4})\\{3}-[0-9a-f]\\{12}/. + # + # "(default)" database id is also valid. + # @!attribute [rw] backup + # @return [::String] + # Required. Backup to restore from. Must be from the same project as the + # parent. + # + # Format is: `projects/{project_id}/locations/{location}/backups/{backup}` + class RestoreDatabaseRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-firestore-admin-v1/proto_docs/google/firestore/admin/v1/index.rb b/owl-bot-staging/google-cloud-firestore-admin-v1/proto_docs/google/firestore/admin/v1/index.rb new file mode 100644 index 000000000000..5147d57eda49 --- /dev/null +++ b/owl-bot-staging/google-cloud-firestore-admin-v1/proto_docs/google/firestore/admin/v1/index.rb @@ -0,0 +1,198 @@ +# frozen_string_literal: true + +# Copyright 2024 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 Firestore + module Admin + module V1 + # Cloud Firestore indexes enable simple and complex queries against + # documents in a database. + # @!attribute [rw] name + # @return [::String] + # Output only. A server defined name for this index. + # The form of this name for composite indexes will be: + # `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/indexes/{composite_index_id}` + # For single field indexes, this field will be empty. + # @!attribute [rw] query_scope + # @return [::Google::Cloud::Firestore::Admin::V1::Index::QueryScope] + # Indexes with a collection query scope specified allow queries + # against a collection that is the child of a specific document, specified at + # query time, and that has the same collection id. + # + # Indexes with a collection group query scope specified allow queries against + # all collections descended from a specific document, specified at query + # time, and that have the same collection id as this index. + # @!attribute [rw] api_scope + # @return [::Google::Cloud::Firestore::Admin::V1::Index::ApiScope] + # The API scope supported by this index. + # @!attribute [rw] fields + # @return [::Array<::Google::Cloud::Firestore::Admin::V1::Index::IndexField>] + # The fields supported by this index. + # + # For composite indexes, this requires a minimum of 2 and a maximum of 100 + # fields. The last field entry is always for the field path `__name__`. If, + # on creation, `__name__` was not specified as the last field, it will be + # added automatically with the same direction as that of the last field + # defined. If the final field in a composite index is not directional, the + # `__name__` will be ordered ASCENDING (unless explicitly specified). + # + # For single field indexes, this will always be exactly one entry with a + # field path equal to the field path of the associated field. + # @!attribute [rw] state + # @return [::Google::Cloud::Firestore::Admin::V1::Index::State] + # Output only. The serving state of the index. + class Index + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # A field in an index. + # The field_path describes which field is indexed, the value_mode describes + # how the field value is indexed. + # @!attribute [rw] field_path + # @return [::String] + # Can be __name__. + # For single field indexes, this must match the name of the field or may + # be omitted. + # @!attribute [rw] order + # @return [::Google::Cloud::Firestore::Admin::V1::Index::IndexField::Order] + # Indicates that this field supports ordering by the specified order or + # comparing using =, !=, <, <=, >, >=. + # @!attribute [rw] array_config + # @return [::Google::Cloud::Firestore::Admin::V1::Index::IndexField::ArrayConfig] + # Indicates that this field supports operations on `array_value`s. + # @!attribute [rw] vector_config + # @return [::Google::Cloud::Firestore::Admin::V1::Index::IndexField::VectorConfig] + # Indicates that this field supports nearest neighbors and distance + # operations on vector. + class IndexField + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The index configuration to support vector search operations + # @!attribute [rw] dimension + # @return [::Integer] + # Required. The vector dimension this configuration applies to. + # + # The resulting index will only include vectors of this dimension, and + # can be used for vector search with the same dimension. + # @!attribute [rw] flat + # @return [::Google::Cloud::Firestore::Admin::V1::Index::IndexField::VectorConfig::FlatIndex] + # Indicates the vector index is a flat index. + class VectorConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # An index that stores vectors in a flat data structure, and supports + # exhaustive search. + class FlatIndex + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The supported orderings. + module Order + # The ordering is unspecified. Not a valid option. + ORDER_UNSPECIFIED = 0 + + # The field is ordered by ascending field value. + ASCENDING = 1 + + # The field is ordered by descending field value. + DESCENDING = 2 + end + + # The supported array value configurations. + module ArrayConfig + # The index does not support additional array queries. + ARRAY_CONFIG_UNSPECIFIED = 0 + + # The index supports array containment queries. + CONTAINS = 1 + end + end + + # Query Scope defines the scope at which a query is run. This is specified on + # a StructuredQuery's `from` field. + module QueryScope + # The query scope is unspecified. Not a valid option. + QUERY_SCOPE_UNSPECIFIED = 0 + + # Indexes with a collection query scope specified allow queries + # against a collection that is the child of a specific document, specified + # at query time, and that has the collection id specified by the index. + COLLECTION = 1 + + # Indexes with a collection group query scope specified allow queries + # against all collections that has the collection id specified by the + # index. + COLLECTION_GROUP = 2 + + # Include all the collections's ancestor in the index. Only available for + # Datastore Mode databases. + COLLECTION_RECURSIVE = 3 + end + + # API Scope defines the APIs (Firestore Native, or Firestore in + # Datastore Mode) that are supported for queries. + module ApiScope + # The index can only be used by the Firestore Native query API. + # This is the default. + ANY_API = 0 + + # The index can only be used by the Firestore in Datastore Mode query API. + DATASTORE_MODE_API = 1 + end + + # The state of an index. During index creation, an index will be in the + # `CREATING` state. If the index is created successfully, it will transition + # to the `READY` state. If the index creation encounters a problem, the index + # will transition to the `NEEDS_REPAIR` state. + module State + # The state is unspecified. + STATE_UNSPECIFIED = 0 + + # The index is being created. + # There is an active long-running operation for the index. + # The index is updated when writing a document. + # Some index data may exist. + CREATING = 1 + + # The index is ready to be used. + # The index is updated when writing a document. + # The index is fully populated from all stored documents it applies to. + READY = 2 + + # The index was being created, but something went wrong. + # There is no active long-running operation for the index, + # and the most recently finished long-running operation failed. + # The index is not updated when writing a document. + # Some index data may exist. + # Use the google.longrunning.Operations API to determine why the operation + # that last attempted to create this index failed, then re-create the + # index. + NEEDS_REPAIR = 3 + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-firestore-admin-v1/proto_docs/google/firestore/admin/v1/location.rb b/owl-bot-staging/google-cloud-firestore-admin-v1/proto_docs/google/firestore/admin/v1/location.rb new file mode 100644 index 000000000000..78ec0f3f16e2 --- /dev/null +++ b/owl-bot-staging/google-cloud-firestore-admin-v1/proto_docs/google/firestore/admin/v1/location.rb @@ -0,0 +1,35 @@ +# frozen_string_literal: true + +# Copyright 2024 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 Firestore + module Admin + module V1 + # The metadata message for + # {::Google::Cloud::Location::Location#metadata google.cloud.location.Location.metadata}. + class LocationMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-firestore-admin-v1/proto_docs/google/firestore/admin/v1/operation.rb b/owl-bot-staging/google-cloud-firestore-admin-v1/proto_docs/google/firestore/admin/v1/operation.rb new file mode 100644 index 000000000000..440016d674d9 --- /dev/null +++ b/owl-bot-staging/google-cloud-firestore-admin-v1/proto_docs/google/firestore/admin/v1/operation.rb @@ -0,0 +1,288 @@ +# frozen_string_literal: true + +# Copyright 2024 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 Firestore + module Admin + module V1 + # Metadata for {::Google::Longrunning::Operation google.longrunning.Operation} + # results from + # {::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client#create_index FirestoreAdmin.CreateIndex}. + # @!attribute [rw] start_time + # @return [::Google::Protobuf::Timestamp] + # The time this operation started. + # @!attribute [rw] end_time + # @return [::Google::Protobuf::Timestamp] + # The time this operation completed. Will be unset if operation still in + # progress. + # @!attribute [rw] index + # @return [::String] + # The index resource that this operation is acting on. For example: + # `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/indexes/{index_id}` + # @!attribute [rw] state + # @return [::Google::Cloud::Firestore::Admin::V1::OperationState] + # The state of the operation. + # @!attribute [rw] progress_documents + # @return [::Google::Cloud::Firestore::Admin::V1::Progress] + # The progress, in documents, of this operation. + # @!attribute [rw] progress_bytes + # @return [::Google::Cloud::Firestore::Admin::V1::Progress] + # The progress, in bytes, of this operation. + class IndexOperationMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Metadata for {::Google::Longrunning::Operation google.longrunning.Operation} + # results from + # {::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client#update_field FirestoreAdmin.UpdateField}. + # @!attribute [rw] start_time + # @return [::Google::Protobuf::Timestamp] + # The time this operation started. + # @!attribute [rw] end_time + # @return [::Google::Protobuf::Timestamp] + # The time this operation completed. Will be unset if operation still in + # progress. + # @!attribute [rw] field + # @return [::String] + # The field resource that this operation is acting on. For example: + # `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/fields/{field_path}` + # @!attribute [rw] index_config_deltas + # @return [::Array<::Google::Cloud::Firestore::Admin::V1::FieldOperationMetadata::IndexConfigDelta>] + # A list of + # {::Google::Cloud::Firestore::Admin::V1::FieldOperationMetadata::IndexConfigDelta IndexConfigDelta}, + # which describe the intent of this operation. + # @!attribute [rw] state + # @return [::Google::Cloud::Firestore::Admin::V1::OperationState] + # The state of the operation. + # @!attribute [rw] progress_documents + # @return [::Google::Cloud::Firestore::Admin::V1::Progress] + # The progress, in documents, of this operation. + # @!attribute [rw] progress_bytes + # @return [::Google::Cloud::Firestore::Admin::V1::Progress] + # The progress, in bytes, of this operation. + # @!attribute [rw] ttl_config_delta + # @return [::Google::Cloud::Firestore::Admin::V1::FieldOperationMetadata::TtlConfigDelta] + # Describes the deltas of TTL configuration. + class FieldOperationMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Information about an index configuration change. + # @!attribute [rw] change_type + # @return [::Google::Cloud::Firestore::Admin::V1::FieldOperationMetadata::IndexConfigDelta::ChangeType] + # Specifies how the index is changing. + # @!attribute [rw] index + # @return [::Google::Cloud::Firestore::Admin::V1::Index] + # The index being changed. + class IndexConfigDelta + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Specifies how the index is changing. + module ChangeType + # The type of change is not specified or known. + CHANGE_TYPE_UNSPECIFIED = 0 + + # The single field index is being added. + ADD = 1 + + # The single field index is being removed. + REMOVE = 2 + end + end + + # Information about a TTL configuration change. + # @!attribute [rw] change_type + # @return [::Google::Cloud::Firestore::Admin::V1::FieldOperationMetadata::TtlConfigDelta::ChangeType] + # Specifies how the TTL configuration is changing. + class TtlConfigDelta + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Specifies how the TTL config is changing. + module ChangeType + # The type of change is not specified or known. + CHANGE_TYPE_UNSPECIFIED = 0 + + # The TTL config is being added. + ADD = 1 + + # The TTL config is being removed. + REMOVE = 2 + end + end + end + + # Metadata for {::Google::Longrunning::Operation google.longrunning.Operation} + # results from + # {::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client#export_documents FirestoreAdmin.ExportDocuments}. + # @!attribute [rw] start_time + # @return [::Google::Protobuf::Timestamp] + # The time this operation started. + # @!attribute [rw] end_time + # @return [::Google::Protobuf::Timestamp] + # The time this operation completed. Will be unset if operation still in + # progress. + # @!attribute [rw] operation_state + # @return [::Google::Cloud::Firestore::Admin::V1::OperationState] + # The state of the export operation. + # @!attribute [rw] progress_documents + # @return [::Google::Cloud::Firestore::Admin::V1::Progress] + # The progress, in documents, of this operation. + # @!attribute [rw] progress_bytes + # @return [::Google::Cloud::Firestore::Admin::V1::Progress] + # The progress, in bytes, of this operation. + # @!attribute [rw] collection_ids + # @return [::Array<::String>] + # Which collection ids are being exported. + # @!attribute [rw] output_uri_prefix + # @return [::String] + # Where the documents are being exported to. + # @!attribute [rw] namespace_ids + # @return [::Array<::String>] + # Which namespace ids are being exported. + # @!attribute [rw] snapshot_time + # @return [::Google::Protobuf::Timestamp] + # The timestamp that corresponds to the version of the database that is being + # exported. If unspecified, there are no guarantees about the consistency of + # the documents being exported. + class ExportDocumentsMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Metadata for {::Google::Longrunning::Operation google.longrunning.Operation} + # results from + # {::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client#import_documents FirestoreAdmin.ImportDocuments}. + # @!attribute [rw] start_time + # @return [::Google::Protobuf::Timestamp] + # The time this operation started. + # @!attribute [rw] end_time + # @return [::Google::Protobuf::Timestamp] + # The time this operation completed. Will be unset if operation still in + # progress. + # @!attribute [rw] operation_state + # @return [::Google::Cloud::Firestore::Admin::V1::OperationState] + # The state of the import operation. + # @!attribute [rw] progress_documents + # @return [::Google::Cloud::Firestore::Admin::V1::Progress] + # The progress, in documents, of this operation. + # @!attribute [rw] progress_bytes + # @return [::Google::Cloud::Firestore::Admin::V1::Progress] + # The progress, in bytes, of this operation. + # @!attribute [rw] collection_ids + # @return [::Array<::String>] + # Which collection ids are being imported. + # @!attribute [rw] input_uri_prefix + # @return [::String] + # The location of the documents being imported. + # @!attribute [rw] namespace_ids + # @return [::Array<::String>] + # Which namespace ids are being imported. + class ImportDocumentsMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Returned in the {::Google::Longrunning::Operation google.longrunning.Operation} + # response field. + # @!attribute [rw] output_uri_prefix + # @return [::String] + # Location of the output files. This can be used to begin an import + # into Cloud Firestore (this project or another project) after the operation + # completes successfully. + class ExportDocumentsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Metadata for the {::Google::Longrunning::Operation long-running operation} from + # the [RestoreDatabase][google.firestore.admin.v1.RestoreDatabase] request. + # @!attribute [rw] start_time + # @return [::Google::Protobuf::Timestamp] + # The time the restore was started. + # @!attribute [rw] end_time + # @return [::Google::Protobuf::Timestamp] + # The time the restore finished, unset for ongoing restores. + # @!attribute [rw] operation_state + # @return [::Google::Cloud::Firestore::Admin::V1::OperationState] + # The operation state of the restore. + # @!attribute [rw] database + # @return [::String] + # The name of the database being restored to. + # @!attribute [rw] backup + # @return [::String] + # The name of the backup restoring from. + # @!attribute [rw] progress_percentage + # @return [::Google::Cloud::Firestore::Admin::V1::Progress] + # How far along the restore is as an estimated percentage of remaining time. + class RestoreDatabaseMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes the progress of the operation. + # Unit of work is generic and must be interpreted based on where + # {::Google::Cloud::Firestore::Admin::V1::Progress Progress} is used. + # @!attribute [rw] estimated_work + # @return [::Integer] + # The amount of work estimated. + # @!attribute [rw] completed_work + # @return [::Integer] + # The amount of work completed. + class Progress + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes the state of the operation. + module OperationState + # Unspecified. + OPERATION_STATE_UNSPECIFIED = 0 + + # Request is being prepared for processing. + INITIALIZING = 1 + + # Request is actively being processed. + PROCESSING = 2 + + # Request is in the process of being cancelled after user called + # google.longrunning.Operations.CancelOperation on the operation. + CANCELLING = 3 + + # Request has been processed and is in its finalization stage. + FINALIZING = 4 + + # Request has completed successfully. + SUCCESSFUL = 5 + + # Request has finished being processed, but encountered an error. + FAILED = 6 + + # Request has finished being cancelled after user called + # google.longrunning.Operations.CancelOperation. + CANCELLED = 7 + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-firestore-admin-v1/proto_docs/google/firestore/admin/v1/schedule.rb b/owl-bot-staging/google-cloud-firestore-admin-v1/proto_docs/google/firestore/admin/v1/schedule.rb new file mode 100644 index 000000000000..017774fd36d9 --- /dev/null +++ b/owl-bot-staging/google-cloud-firestore-admin-v1/proto_docs/google/firestore/admin/v1/schedule.rb @@ -0,0 +1,88 @@ +# frozen_string_literal: true + +# Copyright 2024 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 Firestore + module Admin + module V1 + # A backup schedule for a Cloud Firestore Database. + # + # This resource is owned by the database it is backing up, and is deleted along + # with the database. The actual backups are not though. + # @!attribute [r] name + # @return [::String] + # Output only. The unique backup schedule identifier across all locations and + # databases for the given project. + # + # This will be auto-assigned. + # + # Format is + # `projects/{project}/databases/{database}/backupSchedules/{backup_schedule}` + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The timestamp at which this backup schedule was created and + # effective since. + # + # No backups will be created for this schedule before this time. + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The timestamp at which this backup schedule was most recently + # updated. When a backup schedule is first created, this is the same as + # create_time. + # @!attribute [rw] retention + # @return [::Google::Protobuf::Duration] + # At what relative time in the future, compared to its creation time, + # the backup should be deleted, e.g. keep backups for 7 days. + # @!attribute [rw] daily_recurrence + # @return [::Google::Cloud::Firestore::Admin::V1::DailyRecurrence] + # For a schedule that runs daily at a specified time. + # @!attribute [rw] weekly_recurrence + # @return [::Google::Cloud::Firestore::Admin::V1::WeeklyRecurrence] + # For a schedule that runs weekly on a specific day and time. + class BackupSchedule + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Represent a recurring schedule that runs at a specific time every day. + # + # The time zone is UTC. + class DailyRecurrence + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Represents a recurring schedule that runs on a specified day of the week. + # + # The time zone is UTC. + # @!attribute [rw] day + # @return [::Google::Type::DayOfWeek] + # The day of week to run. + # + # DAY_OF_WEEK_UNSPECIFIED is not allowed. + class WeeklyRecurrence + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-firestore-admin-v1/proto_docs/google/longrunning/operations.rb b/owl-bot-staging/google-cloud-firestore-admin-v1/proto_docs/google/longrunning/operations.rb new file mode 100644 index 000000000000..54b83fb82b7d --- /dev/null +++ b/owl-bot-staging/google-cloud-firestore-admin-v1/proto_docs/google/longrunning/operations.rb @@ -0,0 +1,164 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + # @!attribute [rw] response + # @return [::Google::Protobuf::Any] + # The normal response of the operation in case of success. 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`. + 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. + 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. + 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 LongRunningRecognize(LongRunningRecognizeRequest) + # returns (google.longrunning.Operation) { + # option (google.longrunning.operation_info) = { + # response_type: "LongRunningRecognizeResponse" + # metadata_type: "LongRunningRecognizeMetadata" + # }; + # } + # @!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-firestore-admin-v1/proto_docs/google/protobuf/any.rb b/owl-bot-staging/google-cloud-firestore-admin-v1/proto_docs/google/protobuf/any.rb new file mode 100644 index 000000000000..fb4d6862eac9 --- /dev/null +++ b/owl-bot-staging/google-cloud-firestore-admin-v1/proto_docs/google/protobuf/any.rb @@ -0,0 +1,145 @@ +# frozen_string_literal: true + +# Copyright 2024 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-firestore-admin-v1/proto_docs/google/protobuf/duration.rb b/owl-bot-staging/google-cloud-firestore-admin-v1/proto_docs/google/protobuf/duration.rb new file mode 100644 index 000000000000..b5731a824060 --- /dev/null +++ b/owl-bot-staging/google-cloud-firestore-admin-v1/proto_docs/google/protobuf/duration.rb @@ -0,0 +1,98 @@ +# frozen_string_literal: true + +# Copyright 2024 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-firestore-admin-v1/proto_docs/google/protobuf/empty.rb b/owl-bot-staging/google-cloud-firestore-admin-v1/proto_docs/google/protobuf/empty.rb new file mode 100644 index 000000000000..8c6b19d52e3d --- /dev/null +++ b/owl-bot-staging/google-cloud-firestore-admin-v1/proto_docs/google/protobuf/empty.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +# Copyright 2024 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-firestore-admin-v1/proto_docs/google/protobuf/field_mask.rb b/owl-bot-staging/google-cloud-firestore-admin-v1/proto_docs/google/protobuf/field_mask.rb new file mode 100644 index 000000000000..8e7abcf8f052 --- /dev/null +++ b/owl-bot-staging/google-cloud-firestore-admin-v1/proto_docs/google/protobuf/field_mask.rb @@ -0,0 +1,229 @@ +# frozen_string_literal: true + +# Copyright 2024 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-firestore-admin-v1/proto_docs/google/protobuf/timestamp.rb b/owl-bot-staging/google-cloud-firestore-admin-v1/proto_docs/google/protobuf/timestamp.rb new file mode 100644 index 000000000000..4ac9c4801a3f --- /dev/null +++ b/owl-bot-staging/google-cloud-firestore-admin-v1/proto_docs/google/protobuf/timestamp.rb @@ -0,0 +1,127 @@ +# frozen_string_literal: true + +# Copyright 2024 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-firestore-admin-v1/proto_docs/google/rpc/status.rb b/owl-bot-staging/google-cloud-firestore-admin-v1/proto_docs/google/rpc/status.rb new file mode 100644 index 000000000000..09acc69b6125 --- /dev/null +++ b/owl-bot-staging/google-cloud-firestore-admin-v1/proto_docs/google/rpc/status.rb @@ -0,0 +1,48 @@ +# frozen_string_literal: true + +# Copyright 2024 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-firestore-admin-v1/proto_docs/google/type/dayofweek.rb b/owl-bot-staging/google-cloud-firestore-admin-v1/proto_docs/google/type/dayofweek.rb new file mode 100644 index 000000000000..4fd080d9b331 --- /dev/null +++ b/owl-bot-staging/google-cloud-firestore-admin-v1/proto_docs/google/type/dayofweek.rb @@ -0,0 +1,49 @@ +# frozen_string_literal: true + +# Copyright 2024 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 day of the week. + module DayOfWeek + # The day of the week is unspecified. + DAY_OF_WEEK_UNSPECIFIED = 0 + + # Monday + MONDAY = 1 + + # Tuesday + TUESDAY = 2 + + # Wednesday + WEDNESDAY = 3 + + # Thursday + THURSDAY = 4 + + # Friday + FRIDAY = 5 + + # Saturday + SATURDAY = 6 + + # Sunday + SUNDAY = 7 + end + end +end diff --git a/owl-bot-staging/google-cloud-firestore-admin-v1/snippets/Gemfile b/owl-bot-staging/google-cloud-firestore-admin-v1/snippets/Gemfile new file mode 100644 index 000000000000..d4e15e1a636e --- /dev/null +++ b/owl-bot-staging/google-cloud-firestore-admin-v1/snippets/Gemfile @@ -0,0 +1,32 @@ +# frozen_string_literal: true + +# Copyright 2024 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-firestore-admin-v1", path: "../" +else + gem "google-cloud-firestore-admin-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-firestore-admin-v1/snippets/firestore_admin/create_backup_schedule.rb b/owl-bot-staging/google-cloud-firestore-admin-v1/snippets/firestore_admin/create_backup_schedule.rb new file mode 100644 index 000000000000..d732e062ff17 --- /dev/null +++ b/owl-bot-staging/google-cloud-firestore-admin-v1/snippets/firestore_admin/create_backup_schedule.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2024 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 firestore_v1_generated_FirestoreAdmin_CreateBackupSchedule_sync] +require "google/cloud/firestore/admin/v1" + +## +# Snippet for the create_backup_schedule call in the FirestoreAdmin 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::Firestore::Admin::V1::FirestoreAdmin::Client#create_backup_schedule. +# +def create_backup_schedule + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Firestore::Admin::V1::CreateBackupScheduleRequest.new + + # Call the create_backup_schedule method. + result = client.create_backup_schedule request + + # The returned object is of type Google::Cloud::Firestore::Admin::V1::BackupSchedule. + p result +end +# [END firestore_v1_generated_FirestoreAdmin_CreateBackupSchedule_sync] diff --git a/owl-bot-staging/google-cloud-firestore-admin-v1/snippets/firestore_admin/create_database.rb b/owl-bot-staging/google-cloud-firestore-admin-v1/snippets/firestore_admin/create_database.rb new file mode 100644 index 000000000000..a03e1c2a9bf9 --- /dev/null +++ b/owl-bot-staging/google-cloud-firestore-admin-v1/snippets/firestore_admin/create_database.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2024 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 firestore_v1_generated_FirestoreAdmin_CreateDatabase_sync] +require "google/cloud/firestore/admin/v1" + +## +# Snippet for the create_database call in the FirestoreAdmin 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::Firestore::Admin::V1::FirestoreAdmin::Client#create_database. +# +def create_database + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Firestore::Admin::V1::CreateDatabaseRequest.new + + # Call the create_database method. + result = client.create_database 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 firestore_v1_generated_FirestoreAdmin_CreateDatabase_sync] diff --git a/owl-bot-staging/google-cloud-firestore-admin-v1/snippets/firestore_admin/create_index.rb b/owl-bot-staging/google-cloud-firestore-admin-v1/snippets/firestore_admin/create_index.rb new file mode 100644 index 000000000000..4d8a3bb79ad3 --- /dev/null +++ b/owl-bot-staging/google-cloud-firestore-admin-v1/snippets/firestore_admin/create_index.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2024 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 firestore_v1_generated_FirestoreAdmin_CreateIndex_sync] +require "google/cloud/firestore/admin/v1" + +## +# Snippet for the create_index call in the FirestoreAdmin 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::Firestore::Admin::V1::FirestoreAdmin::Client#create_index. +# +def create_index + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Firestore::Admin::V1::CreateIndexRequest.new + + # Call the create_index method. + result = client.create_index 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 firestore_v1_generated_FirestoreAdmin_CreateIndex_sync] diff --git a/owl-bot-staging/google-cloud-firestore-admin-v1/snippets/firestore_admin/delete_backup.rb b/owl-bot-staging/google-cloud-firestore-admin-v1/snippets/firestore_admin/delete_backup.rb new file mode 100644 index 000000000000..2e6a9f4959b2 --- /dev/null +++ b/owl-bot-staging/google-cloud-firestore-admin-v1/snippets/firestore_admin/delete_backup.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2024 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 firestore_v1_generated_FirestoreAdmin_DeleteBackup_sync] +require "google/cloud/firestore/admin/v1" + +## +# Snippet for the delete_backup call in the FirestoreAdmin 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::Firestore::Admin::V1::FirestoreAdmin::Client#delete_backup. +# +def delete_backup + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Firestore::Admin::V1::DeleteBackupRequest.new + + # Call the delete_backup method. + result = client.delete_backup request + + # The returned object is of type Google::Protobuf::Empty. + p result +end +# [END firestore_v1_generated_FirestoreAdmin_DeleteBackup_sync] diff --git a/owl-bot-staging/google-cloud-firestore-admin-v1/snippets/firestore_admin/delete_backup_schedule.rb b/owl-bot-staging/google-cloud-firestore-admin-v1/snippets/firestore_admin/delete_backup_schedule.rb new file mode 100644 index 000000000000..482ceec579bf --- /dev/null +++ b/owl-bot-staging/google-cloud-firestore-admin-v1/snippets/firestore_admin/delete_backup_schedule.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2024 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 firestore_v1_generated_FirestoreAdmin_DeleteBackupSchedule_sync] +require "google/cloud/firestore/admin/v1" + +## +# Snippet for the delete_backup_schedule call in the FirestoreAdmin 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::Firestore::Admin::V1::FirestoreAdmin::Client#delete_backup_schedule. +# +def delete_backup_schedule + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Firestore::Admin::V1::DeleteBackupScheduleRequest.new + + # Call the delete_backup_schedule method. + result = client.delete_backup_schedule request + + # The returned object is of type Google::Protobuf::Empty. + p result +end +# [END firestore_v1_generated_FirestoreAdmin_DeleteBackupSchedule_sync] diff --git a/owl-bot-staging/google-cloud-firestore-admin-v1/snippets/firestore_admin/delete_database.rb b/owl-bot-staging/google-cloud-firestore-admin-v1/snippets/firestore_admin/delete_database.rb new file mode 100644 index 000000000000..0c92a9c85ced --- /dev/null +++ b/owl-bot-staging/google-cloud-firestore-admin-v1/snippets/firestore_admin/delete_database.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2024 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 firestore_v1_generated_FirestoreAdmin_DeleteDatabase_sync] +require "google/cloud/firestore/admin/v1" + +## +# Snippet for the delete_database call in the FirestoreAdmin 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::Firestore::Admin::V1::FirestoreAdmin::Client#delete_database. +# +def delete_database + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Firestore::Admin::V1::DeleteDatabaseRequest.new + + # Call the delete_database method. + result = client.delete_database 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 firestore_v1_generated_FirestoreAdmin_DeleteDatabase_sync] diff --git a/owl-bot-staging/google-cloud-firestore-admin-v1/snippets/firestore_admin/delete_index.rb b/owl-bot-staging/google-cloud-firestore-admin-v1/snippets/firestore_admin/delete_index.rb new file mode 100644 index 000000000000..159fe0d02b9d --- /dev/null +++ b/owl-bot-staging/google-cloud-firestore-admin-v1/snippets/firestore_admin/delete_index.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2024 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 firestore_v1_generated_FirestoreAdmin_DeleteIndex_sync] +require "google/cloud/firestore/admin/v1" + +## +# Snippet for the delete_index call in the FirestoreAdmin 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::Firestore::Admin::V1::FirestoreAdmin::Client#delete_index. +# +def delete_index + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Firestore::Admin::V1::DeleteIndexRequest.new + + # Call the delete_index method. + result = client.delete_index request + + # The returned object is of type Google::Protobuf::Empty. + p result +end +# [END firestore_v1_generated_FirestoreAdmin_DeleteIndex_sync] diff --git a/owl-bot-staging/google-cloud-firestore-admin-v1/snippets/firestore_admin/export_documents.rb b/owl-bot-staging/google-cloud-firestore-admin-v1/snippets/firestore_admin/export_documents.rb new file mode 100644 index 000000000000..d34ca4ae05a9 --- /dev/null +++ b/owl-bot-staging/google-cloud-firestore-admin-v1/snippets/firestore_admin/export_documents.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2024 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 firestore_v1_generated_FirestoreAdmin_ExportDocuments_sync] +require "google/cloud/firestore/admin/v1" + +## +# Snippet for the export_documents call in the FirestoreAdmin 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::Firestore::Admin::V1::FirestoreAdmin::Client#export_documents. +# +def export_documents + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Firestore::Admin::V1::ExportDocumentsRequest.new + + # Call the export_documents method. + result = client.export_documents 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 firestore_v1_generated_FirestoreAdmin_ExportDocuments_sync] diff --git a/owl-bot-staging/google-cloud-firestore-admin-v1/snippets/firestore_admin/get_backup.rb b/owl-bot-staging/google-cloud-firestore-admin-v1/snippets/firestore_admin/get_backup.rb new file mode 100644 index 000000000000..ec77761e6957 --- /dev/null +++ b/owl-bot-staging/google-cloud-firestore-admin-v1/snippets/firestore_admin/get_backup.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2024 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 firestore_v1_generated_FirestoreAdmin_GetBackup_sync] +require "google/cloud/firestore/admin/v1" + +## +# Snippet for the get_backup call in the FirestoreAdmin 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::Firestore::Admin::V1::FirestoreAdmin::Client#get_backup. +# +def get_backup + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Firestore::Admin::V1::GetBackupRequest.new + + # Call the get_backup method. + result = client.get_backup request + + # The returned object is of type Google::Cloud::Firestore::Admin::V1::Backup. + p result +end +# [END firestore_v1_generated_FirestoreAdmin_GetBackup_sync] diff --git a/owl-bot-staging/google-cloud-firestore-admin-v1/snippets/firestore_admin/get_backup_schedule.rb b/owl-bot-staging/google-cloud-firestore-admin-v1/snippets/firestore_admin/get_backup_schedule.rb new file mode 100644 index 000000000000..15d5fc931e89 --- /dev/null +++ b/owl-bot-staging/google-cloud-firestore-admin-v1/snippets/firestore_admin/get_backup_schedule.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2024 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 firestore_v1_generated_FirestoreAdmin_GetBackupSchedule_sync] +require "google/cloud/firestore/admin/v1" + +## +# Snippet for the get_backup_schedule call in the FirestoreAdmin 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::Firestore::Admin::V1::FirestoreAdmin::Client#get_backup_schedule. +# +def get_backup_schedule + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Firestore::Admin::V1::GetBackupScheduleRequest.new + + # Call the get_backup_schedule method. + result = client.get_backup_schedule request + + # The returned object is of type Google::Cloud::Firestore::Admin::V1::BackupSchedule. + p result +end +# [END firestore_v1_generated_FirestoreAdmin_GetBackupSchedule_sync] diff --git a/owl-bot-staging/google-cloud-firestore-admin-v1/snippets/firestore_admin/get_database.rb b/owl-bot-staging/google-cloud-firestore-admin-v1/snippets/firestore_admin/get_database.rb new file mode 100644 index 000000000000..876a658ec4af --- /dev/null +++ b/owl-bot-staging/google-cloud-firestore-admin-v1/snippets/firestore_admin/get_database.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2024 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 firestore_v1_generated_FirestoreAdmin_GetDatabase_sync] +require "google/cloud/firestore/admin/v1" + +## +# Snippet for the get_database call in the FirestoreAdmin 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::Firestore::Admin::V1::FirestoreAdmin::Client#get_database. +# +def get_database + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Firestore::Admin::V1::GetDatabaseRequest.new + + # Call the get_database method. + result = client.get_database request + + # The returned object is of type Google::Cloud::Firestore::Admin::V1::Database. + p result +end +# [END firestore_v1_generated_FirestoreAdmin_GetDatabase_sync] diff --git a/owl-bot-staging/google-cloud-firestore-admin-v1/snippets/firestore_admin/get_field.rb b/owl-bot-staging/google-cloud-firestore-admin-v1/snippets/firestore_admin/get_field.rb new file mode 100644 index 000000000000..22ecc9d699c8 --- /dev/null +++ b/owl-bot-staging/google-cloud-firestore-admin-v1/snippets/firestore_admin/get_field.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2024 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 firestore_v1_generated_FirestoreAdmin_GetField_sync] +require "google/cloud/firestore/admin/v1" + +## +# Snippet for the get_field call in the FirestoreAdmin 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::Firestore::Admin::V1::FirestoreAdmin::Client#get_field. +# +def get_field + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Firestore::Admin::V1::GetFieldRequest.new + + # Call the get_field method. + result = client.get_field request + + # The returned object is of type Google::Cloud::Firestore::Admin::V1::Field. + p result +end +# [END firestore_v1_generated_FirestoreAdmin_GetField_sync] diff --git a/owl-bot-staging/google-cloud-firestore-admin-v1/snippets/firestore_admin/get_index.rb b/owl-bot-staging/google-cloud-firestore-admin-v1/snippets/firestore_admin/get_index.rb new file mode 100644 index 000000000000..093dd8a99ea9 --- /dev/null +++ b/owl-bot-staging/google-cloud-firestore-admin-v1/snippets/firestore_admin/get_index.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2024 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 firestore_v1_generated_FirestoreAdmin_GetIndex_sync] +require "google/cloud/firestore/admin/v1" + +## +# Snippet for the get_index call in the FirestoreAdmin 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::Firestore::Admin::V1::FirestoreAdmin::Client#get_index. +# +def get_index + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Firestore::Admin::V1::GetIndexRequest.new + + # Call the get_index method. + result = client.get_index request + + # The returned object is of type Google::Cloud::Firestore::Admin::V1::Index. + p result +end +# [END firestore_v1_generated_FirestoreAdmin_GetIndex_sync] diff --git a/owl-bot-staging/google-cloud-firestore-admin-v1/snippets/firestore_admin/import_documents.rb b/owl-bot-staging/google-cloud-firestore-admin-v1/snippets/firestore_admin/import_documents.rb new file mode 100644 index 000000000000..82a98315b198 --- /dev/null +++ b/owl-bot-staging/google-cloud-firestore-admin-v1/snippets/firestore_admin/import_documents.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2024 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 firestore_v1_generated_FirestoreAdmin_ImportDocuments_sync] +require "google/cloud/firestore/admin/v1" + +## +# Snippet for the import_documents call in the FirestoreAdmin 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::Firestore::Admin::V1::FirestoreAdmin::Client#import_documents. +# +def import_documents + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Firestore::Admin::V1::ImportDocumentsRequest.new + + # Call the import_documents method. + result = client.import_documents 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 firestore_v1_generated_FirestoreAdmin_ImportDocuments_sync] diff --git a/owl-bot-staging/google-cloud-firestore-admin-v1/snippets/firestore_admin/list_backup_schedules.rb b/owl-bot-staging/google-cloud-firestore-admin-v1/snippets/firestore_admin/list_backup_schedules.rb new file mode 100644 index 000000000000..22ea176afb83 --- /dev/null +++ b/owl-bot-staging/google-cloud-firestore-admin-v1/snippets/firestore_admin/list_backup_schedules.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2024 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 firestore_v1_generated_FirestoreAdmin_ListBackupSchedules_sync] +require "google/cloud/firestore/admin/v1" + +## +# Snippet for the list_backup_schedules call in the FirestoreAdmin 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::Firestore::Admin::V1::FirestoreAdmin::Client#list_backup_schedules. +# +def list_backup_schedules + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Firestore::Admin::V1::ListBackupSchedulesRequest.new + + # Call the list_backup_schedules method. + result = client.list_backup_schedules request + + # The returned object is of type Google::Cloud::Firestore::Admin::V1::ListBackupSchedulesResponse. + p result +end +# [END firestore_v1_generated_FirestoreAdmin_ListBackupSchedules_sync] diff --git a/owl-bot-staging/google-cloud-firestore-admin-v1/snippets/firestore_admin/list_backups.rb b/owl-bot-staging/google-cloud-firestore-admin-v1/snippets/firestore_admin/list_backups.rb new file mode 100644 index 000000000000..f4811fd036ff --- /dev/null +++ b/owl-bot-staging/google-cloud-firestore-admin-v1/snippets/firestore_admin/list_backups.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2024 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 firestore_v1_generated_FirestoreAdmin_ListBackups_sync] +require "google/cloud/firestore/admin/v1" + +## +# Snippet for the list_backups call in the FirestoreAdmin 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::Firestore::Admin::V1::FirestoreAdmin::Client#list_backups. +# +def list_backups + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Firestore::Admin::V1::ListBackupsRequest.new + + # Call the list_backups method. + result = client.list_backups request + + # The returned object is of type Google::Cloud::Firestore::Admin::V1::ListBackupsResponse. + p result +end +# [END firestore_v1_generated_FirestoreAdmin_ListBackups_sync] diff --git a/owl-bot-staging/google-cloud-firestore-admin-v1/snippets/firestore_admin/list_databases.rb b/owl-bot-staging/google-cloud-firestore-admin-v1/snippets/firestore_admin/list_databases.rb new file mode 100644 index 000000000000..2da8e6ba9a18 --- /dev/null +++ b/owl-bot-staging/google-cloud-firestore-admin-v1/snippets/firestore_admin/list_databases.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2024 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 firestore_v1_generated_FirestoreAdmin_ListDatabases_sync] +require "google/cloud/firestore/admin/v1" + +## +# Snippet for the list_databases call in the FirestoreAdmin 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::Firestore::Admin::V1::FirestoreAdmin::Client#list_databases. +# +def list_databases + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Firestore::Admin::V1::ListDatabasesRequest.new + + # Call the list_databases method. + result = client.list_databases request + + # The returned object is of type Google::Cloud::Firestore::Admin::V1::ListDatabasesResponse. + p result +end +# [END firestore_v1_generated_FirestoreAdmin_ListDatabases_sync] diff --git a/owl-bot-staging/google-cloud-firestore-admin-v1/snippets/firestore_admin/list_fields.rb b/owl-bot-staging/google-cloud-firestore-admin-v1/snippets/firestore_admin/list_fields.rb new file mode 100644 index 000000000000..269b06842b5c --- /dev/null +++ b/owl-bot-staging/google-cloud-firestore-admin-v1/snippets/firestore_admin/list_fields.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2024 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 firestore_v1_generated_FirestoreAdmin_ListFields_sync] +require "google/cloud/firestore/admin/v1" + +## +# Snippet for the list_fields call in the FirestoreAdmin 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::Firestore::Admin::V1::FirestoreAdmin::Client#list_fields. +# +def list_fields + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Firestore::Admin::V1::ListFieldsRequest.new + + # Call the list_fields method. + result = client.list_fields 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::Firestore::Admin::V1::Field. + p item + end +end +# [END firestore_v1_generated_FirestoreAdmin_ListFields_sync] diff --git a/owl-bot-staging/google-cloud-firestore-admin-v1/snippets/firestore_admin/list_indexes.rb b/owl-bot-staging/google-cloud-firestore-admin-v1/snippets/firestore_admin/list_indexes.rb new file mode 100644 index 000000000000..4ca35db2edbf --- /dev/null +++ b/owl-bot-staging/google-cloud-firestore-admin-v1/snippets/firestore_admin/list_indexes.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2024 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 firestore_v1_generated_FirestoreAdmin_ListIndexes_sync] +require "google/cloud/firestore/admin/v1" + +## +# Snippet for the list_indexes call in the FirestoreAdmin 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::Firestore::Admin::V1::FirestoreAdmin::Client#list_indexes. +# +def list_indexes + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Firestore::Admin::V1::ListIndexesRequest.new + + # Call the list_indexes method. + result = client.list_indexes 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::Firestore::Admin::V1::Index. + p item + end +end +# [END firestore_v1_generated_FirestoreAdmin_ListIndexes_sync] diff --git a/owl-bot-staging/google-cloud-firestore-admin-v1/snippets/firestore_admin/restore_database.rb b/owl-bot-staging/google-cloud-firestore-admin-v1/snippets/firestore_admin/restore_database.rb new file mode 100644 index 000000000000..2b5373706864 --- /dev/null +++ b/owl-bot-staging/google-cloud-firestore-admin-v1/snippets/firestore_admin/restore_database.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2024 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 firestore_v1_generated_FirestoreAdmin_RestoreDatabase_sync] +require "google/cloud/firestore/admin/v1" + +## +# Snippet for the restore_database call in the FirestoreAdmin 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::Firestore::Admin::V1::FirestoreAdmin::Client#restore_database. +# +def restore_database + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Firestore::Admin::V1::RestoreDatabaseRequest.new + + # Call the restore_database method. + result = client.restore_database 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 firestore_v1_generated_FirestoreAdmin_RestoreDatabase_sync] diff --git a/owl-bot-staging/google-cloud-firestore-admin-v1/snippets/firestore_admin/update_backup_schedule.rb b/owl-bot-staging/google-cloud-firestore-admin-v1/snippets/firestore_admin/update_backup_schedule.rb new file mode 100644 index 000000000000..0667ac816a99 --- /dev/null +++ b/owl-bot-staging/google-cloud-firestore-admin-v1/snippets/firestore_admin/update_backup_schedule.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2024 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 firestore_v1_generated_FirestoreAdmin_UpdateBackupSchedule_sync] +require "google/cloud/firestore/admin/v1" + +## +# Snippet for the update_backup_schedule call in the FirestoreAdmin 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::Firestore::Admin::V1::FirestoreAdmin::Client#update_backup_schedule. +# +def update_backup_schedule + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Firestore::Admin::V1::UpdateBackupScheduleRequest.new + + # Call the update_backup_schedule method. + result = client.update_backup_schedule request + + # The returned object is of type Google::Cloud::Firestore::Admin::V1::BackupSchedule. + p result +end +# [END firestore_v1_generated_FirestoreAdmin_UpdateBackupSchedule_sync] diff --git a/owl-bot-staging/google-cloud-firestore-admin-v1/snippets/firestore_admin/update_database.rb b/owl-bot-staging/google-cloud-firestore-admin-v1/snippets/firestore_admin/update_database.rb new file mode 100644 index 000000000000..9adc30368321 --- /dev/null +++ b/owl-bot-staging/google-cloud-firestore-admin-v1/snippets/firestore_admin/update_database.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2024 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 firestore_v1_generated_FirestoreAdmin_UpdateDatabase_sync] +require "google/cloud/firestore/admin/v1" + +## +# Snippet for the update_database call in the FirestoreAdmin 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::Firestore::Admin::V1::FirestoreAdmin::Client#update_database. +# +def update_database + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Firestore::Admin::V1::UpdateDatabaseRequest.new + + # Call the update_database method. + result = client.update_database 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 firestore_v1_generated_FirestoreAdmin_UpdateDatabase_sync] diff --git a/owl-bot-staging/google-cloud-firestore-admin-v1/snippets/firestore_admin/update_field.rb b/owl-bot-staging/google-cloud-firestore-admin-v1/snippets/firestore_admin/update_field.rb new file mode 100644 index 000000000000..dc94f2ad4ea4 --- /dev/null +++ b/owl-bot-staging/google-cloud-firestore-admin-v1/snippets/firestore_admin/update_field.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2024 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 firestore_v1_generated_FirestoreAdmin_UpdateField_sync] +require "google/cloud/firestore/admin/v1" + +## +# Snippet for the update_field call in the FirestoreAdmin 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::Firestore::Admin::V1::FirestoreAdmin::Client#update_field. +# +def update_field + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Firestore::Admin::V1::UpdateFieldRequest.new + + # Call the update_field method. + result = client.update_field 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 firestore_v1_generated_FirestoreAdmin_UpdateField_sync] diff --git a/owl-bot-staging/google-cloud-firestore-admin-v1/snippets/snippet_metadata_google.firestore.admin.v1.json b/owl-bot-staging/google-cloud-firestore-admin-v1/snippets/snippet_metadata_google.firestore.admin.v1.json new file mode 100644 index 000000000000..72e8d2a952ca --- /dev/null +++ b/owl-bot-staging/google-cloud-firestore-admin-v1/snippets/snippet_metadata_google.firestore.admin.v1.json @@ -0,0 +1,935 @@ +{ + "client_library": { + "name": "google-cloud-firestore-admin-v1", + "version": "", + "language": "RUBY", + "apis": [ + { + "id": "google.firestore.admin.v1", + "version": "v1" + } + ] + }, + "snippets": [ + { + "region_tag": "firestore_v1_generated_FirestoreAdmin_CreateIndex_sync", + "title": "Snippet for the create_index call in the FirestoreAdmin service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client#create_index.", + "file": "firestore_admin/create_index.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_index", + "full_name": "::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client#create_index", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Firestore::Admin::V1::CreateIndexRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "FirestoreAdmin::Client", + "full_name": "::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client" + }, + "method": { + "short_name": "CreateIndex", + "full_name": "google.firestore.admin.v1.FirestoreAdmin.CreateIndex", + "service": { + "short_name": "FirestoreAdmin", + "full_name": "google.firestore.admin.v1.FirestoreAdmin" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "firestore_v1_generated_FirestoreAdmin_ListIndexes_sync", + "title": "Snippet for the list_indexes call in the FirestoreAdmin service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client#list_indexes.", + "file": "firestore_admin/list_indexes.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_indexes", + "full_name": "::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client#list_indexes", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Firestore::Admin::V1::ListIndexesRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Firestore::Admin::V1::ListIndexesResponse", + "client": { + "short_name": "FirestoreAdmin::Client", + "full_name": "::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client" + }, + "method": { + "short_name": "ListIndexes", + "full_name": "google.firestore.admin.v1.FirestoreAdmin.ListIndexes", + "service": { + "short_name": "FirestoreAdmin", + "full_name": "google.firestore.admin.v1.FirestoreAdmin" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "firestore_v1_generated_FirestoreAdmin_GetIndex_sync", + "title": "Snippet for the get_index call in the FirestoreAdmin service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client#get_index.", + "file": "firestore_admin/get_index.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_index", + "full_name": "::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client#get_index", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Firestore::Admin::V1::GetIndexRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Firestore::Admin::V1::Index", + "client": { + "short_name": "FirestoreAdmin::Client", + "full_name": "::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client" + }, + "method": { + "short_name": "GetIndex", + "full_name": "google.firestore.admin.v1.FirestoreAdmin.GetIndex", + "service": { + "short_name": "FirestoreAdmin", + "full_name": "google.firestore.admin.v1.FirestoreAdmin" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "firestore_v1_generated_FirestoreAdmin_DeleteIndex_sync", + "title": "Snippet for the delete_index call in the FirestoreAdmin service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client#delete_index.", + "file": "firestore_admin/delete_index.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_index", + "full_name": "::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client#delete_index", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Firestore::Admin::V1::DeleteIndexRequest", + "name": "request" + } + ], + "result_type": "::Google::Protobuf::Empty", + "client": { + "short_name": "FirestoreAdmin::Client", + "full_name": "::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client" + }, + "method": { + "short_name": "DeleteIndex", + "full_name": "google.firestore.admin.v1.FirestoreAdmin.DeleteIndex", + "service": { + "short_name": "FirestoreAdmin", + "full_name": "google.firestore.admin.v1.FirestoreAdmin" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "firestore_v1_generated_FirestoreAdmin_GetField_sync", + "title": "Snippet for the get_field call in the FirestoreAdmin service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client#get_field.", + "file": "firestore_admin/get_field.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_field", + "full_name": "::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client#get_field", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Firestore::Admin::V1::GetFieldRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Firestore::Admin::V1::Field", + "client": { + "short_name": "FirestoreAdmin::Client", + "full_name": "::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client" + }, + "method": { + "short_name": "GetField", + "full_name": "google.firestore.admin.v1.FirestoreAdmin.GetField", + "service": { + "short_name": "FirestoreAdmin", + "full_name": "google.firestore.admin.v1.FirestoreAdmin" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "firestore_v1_generated_FirestoreAdmin_UpdateField_sync", + "title": "Snippet for the update_field call in the FirestoreAdmin service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client#update_field.", + "file": "firestore_admin/update_field.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_field", + "full_name": "::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client#update_field", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Firestore::Admin::V1::UpdateFieldRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "FirestoreAdmin::Client", + "full_name": "::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client" + }, + "method": { + "short_name": "UpdateField", + "full_name": "google.firestore.admin.v1.FirestoreAdmin.UpdateField", + "service": { + "short_name": "FirestoreAdmin", + "full_name": "google.firestore.admin.v1.FirestoreAdmin" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "firestore_v1_generated_FirestoreAdmin_ListFields_sync", + "title": "Snippet for the list_fields call in the FirestoreAdmin service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client#list_fields.", + "file": "firestore_admin/list_fields.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_fields", + "full_name": "::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client#list_fields", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Firestore::Admin::V1::ListFieldsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Firestore::Admin::V1::ListFieldsResponse", + "client": { + "short_name": "FirestoreAdmin::Client", + "full_name": "::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client" + }, + "method": { + "short_name": "ListFields", + "full_name": "google.firestore.admin.v1.FirestoreAdmin.ListFields", + "service": { + "short_name": "FirestoreAdmin", + "full_name": "google.firestore.admin.v1.FirestoreAdmin" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "firestore_v1_generated_FirestoreAdmin_ExportDocuments_sync", + "title": "Snippet for the export_documents call in the FirestoreAdmin service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client#export_documents.", + "file": "firestore_admin/export_documents.rb", + "language": "RUBY", + "client_method": { + "short_name": "export_documents", + "full_name": "::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client#export_documents", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Firestore::Admin::V1::ExportDocumentsRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "FirestoreAdmin::Client", + "full_name": "::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client" + }, + "method": { + "short_name": "ExportDocuments", + "full_name": "google.firestore.admin.v1.FirestoreAdmin.ExportDocuments", + "service": { + "short_name": "FirestoreAdmin", + "full_name": "google.firestore.admin.v1.FirestoreAdmin" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "firestore_v1_generated_FirestoreAdmin_ImportDocuments_sync", + "title": "Snippet for the import_documents call in the FirestoreAdmin service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client#import_documents.", + "file": "firestore_admin/import_documents.rb", + "language": "RUBY", + "client_method": { + "short_name": "import_documents", + "full_name": "::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client#import_documents", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Firestore::Admin::V1::ImportDocumentsRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "FirestoreAdmin::Client", + "full_name": "::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client" + }, + "method": { + "short_name": "ImportDocuments", + "full_name": "google.firestore.admin.v1.FirestoreAdmin.ImportDocuments", + "service": { + "short_name": "FirestoreAdmin", + "full_name": "google.firestore.admin.v1.FirestoreAdmin" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "firestore_v1_generated_FirestoreAdmin_CreateDatabase_sync", + "title": "Snippet for the create_database call in the FirestoreAdmin service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client#create_database.", + "file": "firestore_admin/create_database.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_database", + "full_name": "::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client#create_database", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Firestore::Admin::V1::CreateDatabaseRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "FirestoreAdmin::Client", + "full_name": "::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client" + }, + "method": { + "short_name": "CreateDatabase", + "full_name": "google.firestore.admin.v1.FirestoreAdmin.CreateDatabase", + "service": { + "short_name": "FirestoreAdmin", + "full_name": "google.firestore.admin.v1.FirestoreAdmin" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "firestore_v1_generated_FirestoreAdmin_GetDatabase_sync", + "title": "Snippet for the get_database call in the FirestoreAdmin service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client#get_database.", + "file": "firestore_admin/get_database.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_database", + "full_name": "::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client#get_database", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Firestore::Admin::V1::GetDatabaseRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Firestore::Admin::V1::Database", + "client": { + "short_name": "FirestoreAdmin::Client", + "full_name": "::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client" + }, + "method": { + "short_name": "GetDatabase", + "full_name": "google.firestore.admin.v1.FirestoreAdmin.GetDatabase", + "service": { + "short_name": "FirestoreAdmin", + "full_name": "google.firestore.admin.v1.FirestoreAdmin" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "firestore_v1_generated_FirestoreAdmin_ListDatabases_sync", + "title": "Snippet for the list_databases call in the FirestoreAdmin service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client#list_databases.", + "file": "firestore_admin/list_databases.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_databases", + "full_name": "::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client#list_databases", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Firestore::Admin::V1::ListDatabasesRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Firestore::Admin::V1::ListDatabasesResponse", + "client": { + "short_name": "FirestoreAdmin::Client", + "full_name": "::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client" + }, + "method": { + "short_name": "ListDatabases", + "full_name": "google.firestore.admin.v1.FirestoreAdmin.ListDatabases", + "service": { + "short_name": "FirestoreAdmin", + "full_name": "google.firestore.admin.v1.FirestoreAdmin" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "firestore_v1_generated_FirestoreAdmin_UpdateDatabase_sync", + "title": "Snippet for the update_database call in the FirestoreAdmin service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client#update_database.", + "file": "firestore_admin/update_database.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_database", + "full_name": "::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client#update_database", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Firestore::Admin::V1::UpdateDatabaseRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "FirestoreAdmin::Client", + "full_name": "::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client" + }, + "method": { + "short_name": "UpdateDatabase", + "full_name": "google.firestore.admin.v1.FirestoreAdmin.UpdateDatabase", + "service": { + "short_name": "FirestoreAdmin", + "full_name": "google.firestore.admin.v1.FirestoreAdmin" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "firestore_v1_generated_FirestoreAdmin_DeleteDatabase_sync", + "title": "Snippet for the delete_database call in the FirestoreAdmin service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client#delete_database.", + "file": "firestore_admin/delete_database.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_database", + "full_name": "::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client#delete_database", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Firestore::Admin::V1::DeleteDatabaseRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "FirestoreAdmin::Client", + "full_name": "::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client" + }, + "method": { + "short_name": "DeleteDatabase", + "full_name": "google.firestore.admin.v1.FirestoreAdmin.DeleteDatabase", + "service": { + "short_name": "FirestoreAdmin", + "full_name": "google.firestore.admin.v1.FirestoreAdmin" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "firestore_v1_generated_FirestoreAdmin_GetBackup_sync", + "title": "Snippet for the get_backup call in the FirestoreAdmin service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client#get_backup.", + "file": "firestore_admin/get_backup.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_backup", + "full_name": "::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client#get_backup", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Firestore::Admin::V1::GetBackupRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Firestore::Admin::V1::Backup", + "client": { + "short_name": "FirestoreAdmin::Client", + "full_name": "::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client" + }, + "method": { + "short_name": "GetBackup", + "full_name": "google.firestore.admin.v1.FirestoreAdmin.GetBackup", + "service": { + "short_name": "FirestoreAdmin", + "full_name": "google.firestore.admin.v1.FirestoreAdmin" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "firestore_v1_generated_FirestoreAdmin_ListBackups_sync", + "title": "Snippet for the list_backups call in the FirestoreAdmin service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client#list_backups.", + "file": "firestore_admin/list_backups.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_backups", + "full_name": "::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client#list_backups", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Firestore::Admin::V1::ListBackupsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Firestore::Admin::V1::ListBackupsResponse", + "client": { + "short_name": "FirestoreAdmin::Client", + "full_name": "::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client" + }, + "method": { + "short_name": "ListBackups", + "full_name": "google.firestore.admin.v1.FirestoreAdmin.ListBackups", + "service": { + "short_name": "FirestoreAdmin", + "full_name": "google.firestore.admin.v1.FirestoreAdmin" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "firestore_v1_generated_FirestoreAdmin_DeleteBackup_sync", + "title": "Snippet for the delete_backup call in the FirestoreAdmin service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client#delete_backup.", + "file": "firestore_admin/delete_backup.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_backup", + "full_name": "::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client#delete_backup", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Firestore::Admin::V1::DeleteBackupRequest", + "name": "request" + } + ], + "result_type": "::Google::Protobuf::Empty", + "client": { + "short_name": "FirestoreAdmin::Client", + "full_name": "::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client" + }, + "method": { + "short_name": "DeleteBackup", + "full_name": "google.firestore.admin.v1.FirestoreAdmin.DeleteBackup", + "service": { + "short_name": "FirestoreAdmin", + "full_name": "google.firestore.admin.v1.FirestoreAdmin" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "firestore_v1_generated_FirestoreAdmin_RestoreDatabase_sync", + "title": "Snippet for the restore_database call in the FirestoreAdmin service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client#restore_database.", + "file": "firestore_admin/restore_database.rb", + "language": "RUBY", + "client_method": { + "short_name": "restore_database", + "full_name": "::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client#restore_database", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Firestore::Admin::V1::RestoreDatabaseRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "FirestoreAdmin::Client", + "full_name": "::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client" + }, + "method": { + "short_name": "RestoreDatabase", + "full_name": "google.firestore.admin.v1.FirestoreAdmin.RestoreDatabase", + "service": { + "short_name": "FirestoreAdmin", + "full_name": "google.firestore.admin.v1.FirestoreAdmin" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "firestore_v1_generated_FirestoreAdmin_CreateBackupSchedule_sync", + "title": "Snippet for the create_backup_schedule call in the FirestoreAdmin service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client#create_backup_schedule.", + "file": "firestore_admin/create_backup_schedule.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_backup_schedule", + "full_name": "::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client#create_backup_schedule", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Firestore::Admin::V1::CreateBackupScheduleRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Firestore::Admin::V1::BackupSchedule", + "client": { + "short_name": "FirestoreAdmin::Client", + "full_name": "::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client" + }, + "method": { + "short_name": "CreateBackupSchedule", + "full_name": "google.firestore.admin.v1.FirestoreAdmin.CreateBackupSchedule", + "service": { + "short_name": "FirestoreAdmin", + "full_name": "google.firestore.admin.v1.FirestoreAdmin" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "firestore_v1_generated_FirestoreAdmin_GetBackupSchedule_sync", + "title": "Snippet for the get_backup_schedule call in the FirestoreAdmin service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client#get_backup_schedule.", + "file": "firestore_admin/get_backup_schedule.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_backup_schedule", + "full_name": "::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client#get_backup_schedule", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Firestore::Admin::V1::GetBackupScheduleRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Firestore::Admin::V1::BackupSchedule", + "client": { + "short_name": "FirestoreAdmin::Client", + "full_name": "::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client" + }, + "method": { + "short_name": "GetBackupSchedule", + "full_name": "google.firestore.admin.v1.FirestoreAdmin.GetBackupSchedule", + "service": { + "short_name": "FirestoreAdmin", + "full_name": "google.firestore.admin.v1.FirestoreAdmin" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "firestore_v1_generated_FirestoreAdmin_ListBackupSchedules_sync", + "title": "Snippet for the list_backup_schedules call in the FirestoreAdmin service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client#list_backup_schedules.", + "file": "firestore_admin/list_backup_schedules.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_backup_schedules", + "full_name": "::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client#list_backup_schedules", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Firestore::Admin::V1::ListBackupSchedulesRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Firestore::Admin::V1::ListBackupSchedulesResponse", + "client": { + "short_name": "FirestoreAdmin::Client", + "full_name": "::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client" + }, + "method": { + "short_name": "ListBackupSchedules", + "full_name": "google.firestore.admin.v1.FirestoreAdmin.ListBackupSchedules", + "service": { + "short_name": "FirestoreAdmin", + "full_name": "google.firestore.admin.v1.FirestoreAdmin" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "firestore_v1_generated_FirestoreAdmin_UpdateBackupSchedule_sync", + "title": "Snippet for the update_backup_schedule call in the FirestoreAdmin service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client#update_backup_schedule.", + "file": "firestore_admin/update_backup_schedule.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_backup_schedule", + "full_name": "::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client#update_backup_schedule", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Firestore::Admin::V1::UpdateBackupScheduleRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Firestore::Admin::V1::BackupSchedule", + "client": { + "short_name": "FirestoreAdmin::Client", + "full_name": "::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client" + }, + "method": { + "short_name": "UpdateBackupSchedule", + "full_name": "google.firestore.admin.v1.FirestoreAdmin.UpdateBackupSchedule", + "service": { + "short_name": "FirestoreAdmin", + "full_name": "google.firestore.admin.v1.FirestoreAdmin" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "firestore_v1_generated_FirestoreAdmin_DeleteBackupSchedule_sync", + "title": "Snippet for the delete_backup_schedule call in the FirestoreAdmin service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client#delete_backup_schedule.", + "file": "firestore_admin/delete_backup_schedule.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_backup_schedule", + "full_name": "::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client#delete_backup_schedule", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Firestore::Admin::V1::DeleteBackupScheduleRequest", + "name": "request" + } + ], + "result_type": "::Google::Protobuf::Empty", + "client": { + "short_name": "FirestoreAdmin::Client", + "full_name": "::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client" + }, + "method": { + "short_name": "DeleteBackupSchedule", + "full_name": "google.firestore.admin.v1.FirestoreAdmin.DeleteBackupSchedule", + "service": { + "short_name": "FirestoreAdmin", + "full_name": "google.firestore.admin.v1.FirestoreAdmin" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + } + ] +} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-firestore-admin-v1/test/google/cloud/firestore/admin/v1/firestore_admin_operations_test.rb b/owl-bot-staging/google-cloud-firestore-admin-v1/test/google/cloud/firestore/admin/v1/firestore_admin_operations_test.rb new file mode 100644 index 000000000000..e6f566485be8 --- /dev/null +++ b/owl-bot-staging/google-cloud-firestore-admin-v1/test/google/cloud/firestore/admin/v1/firestore_admin_operations_test.rb @@ -0,0 +1,389 @@ +# frozen_string_literal: true + +# Copyright 2024 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/firestore/admin/v1/firestore_admin_pb" +require "google/firestore/admin/v1/firestore_admin_services_pb" +require "google/cloud/firestore/admin/v1/firestore_admin" + +class ::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::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) + + yield @response, @operation if block_given? + + @response + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + 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" + + 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"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_operations_client_stub do + # Create client + client = ::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::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 }) 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 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) 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 }, 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), 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::Firestore::Admin::V1::FirestoreAdmin::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::Firestore::Admin::V1::FirestoreAdmin::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::Firestore::Admin::V1::FirestoreAdmin::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::Firestore::Admin::V1::FirestoreAdmin::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::Firestore::Admin::V1::FirestoreAdmin::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::Firestore::Admin::V1::FirestoreAdmin::Operations::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-firestore-admin-v1/test/google/cloud/firestore/admin/v1/firestore_admin_paths_test.rb b/owl-bot-staging/google-cloud-firestore-admin-v1/test/google/cloud/firestore/admin/v1/firestore_admin_paths_test.rb new file mode 100644 index 000000000000..44328fb6465a --- /dev/null +++ b/owl-bot-staging/google-cloud-firestore-admin-v1/test/google/cloud/firestore/admin/v1/firestore_admin_paths_test.rb @@ -0,0 +1,131 @@ +# frozen_string_literal: true + +# Copyright 2024 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/firestore/admin/v1/firestore_admin" + +class ::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + + def test_backup_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.backup_path project: "value0", location: "value1", backup: "value2" + assert_equal "projects/value0/locations/value1/backups/value2", path + end + end + + def test_backup_schedule_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.backup_schedule_path project: "value0", database: "value1", backup_schedule: "value2" + assert_equal "projects/value0/databases/value1/backupSchedules/value2", path + end + end + + def test_collection_group_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.collection_group_path project: "value0", database: "value1", collection: "value2" + assert_equal "projects/value0/databases/value1/collectionGroups/value2", path + end + end + + def test_database_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.database_path project: "value0", database: "value1" + assert_equal "projects/value0/databases/value1", path + end + end + + def test_field_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.field_path project: "value0", database: "value1", collection: "value2", field: "value3" + assert_equal "projects/value0/databases/value1/collectionGroups/value2/fields/value3", path + end + end + + def test_index_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.index_path project: "value0", database: "value1", collection: "value2", index: "value3" + assert_equal "projects/value0/databases/value1/collectionGroups/value2/indexes/value3", path + end + end + + def test_location_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.location_path project: "value0", location: "value1" + assert_equal "projects/value0/locations/value1", 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::Firestore::Admin::V1::FirestoreAdmin::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-firestore-admin-v1/test/google/cloud/firestore/admin/v1/firestore_admin_rest_test.rb b/owl-bot-staging/google-cloud-firestore-admin-v1/test/google/cloud/firestore/admin/v1/firestore_admin_rest_test.rb new file mode 100644 index 000000000000..b9a8591631cd --- /dev/null +++ b/owl-bot-staging/google-cloud-firestore-admin-v1/test/google/cloud/firestore/admin/v1/firestore_admin_rest_test.rb @@ -0,0 +1,1356 @@ +# frozen_string_literal: true + +# Copyright 2024 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/firestore/admin/v1/firestore_admin_pb" +require "google/cloud/firestore/admin/v1/firestore_admin/rest" + + +class ::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::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: {} + make_http_request :get, uri: uri, body: nil, params: params, options: options + end + + def make_delete_request uri:, params: {}, options: {} + make_http_request :delete, uri: uri, body: nil, params: params, options: options + end + + def make_post_request uri:, body: nil, params: {}, options: {} + make_http_request :post, uri: uri, body: body, params: params, options: options + end + + def make_patch_request uri:, body:, params: {}, options: {} + make_http_request :patch, uri: uri, body: body, params: params, options: options + end + + def make_put_request uri:, body:, params: {}, options: {} + make_http_request :put, uri: uri, body: body, params: params, options: options + 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 + end + + def test_create_index + # 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" + index = {} + + create_index_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| + 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::Firestore::Admin::V1::FirestoreAdmin::Rest::ServiceStub.stub :transcode_create_index_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_index_client_stub do + # Create client + client = ::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_index({ parent: parent, index: index }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_index parent: parent, index: index do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_index ::Google::Cloud::Firestore::Admin::V1::CreateIndexRequest.new(parent: parent, index: index) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_index({ parent: parent, index: index }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_index(::Google::Cloud::Firestore::Admin::V1::CreateIndexRequest.new(parent: parent, index: index), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_index_client_stub.call_count + end + end + end + + def test_list_indexes + # Create test objects. + client_result = ::Google::Cloud::Firestore::Admin::V1::ListIndexesResponse.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_indexes_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| + 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::Firestore::Admin::V1::FirestoreAdmin::Rest::ServiceStub.stub :transcode_list_indexes_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_indexes_client_stub do + # Create client + client = ::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_indexes({ 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_indexes 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_indexes ::Google::Cloud::Firestore::Admin::V1::ListIndexesRequest.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_indexes({ 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_indexes(::Google::Cloud::Firestore::Admin::V1::ListIndexesRequest.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_indexes_client_stub.call_count + end + end + end + + def test_get_index + # Create test objects. + client_result = ::Google::Cloud::Firestore::Admin::V1::Index.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_index_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| + 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::Firestore::Admin::V1::FirestoreAdmin::Rest::ServiceStub.stub :transcode_get_index_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_index_client_stub do + # Create client + client = ::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_index({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_index name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_index ::Google::Cloud::Firestore::Admin::V1::GetIndexRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_index({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_index(::Google::Cloud::Firestore::Admin::V1::GetIndexRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_index_client_stub.call_count + end + end + end + + def test_delete_index + # 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_index_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| + 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::Firestore::Admin::V1::FirestoreAdmin::Rest::ServiceStub.stub :transcode_delete_index_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_index_client_stub do + # Create client + client = ::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_index({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_index name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_index ::Google::Cloud::Firestore::Admin::V1::DeleteIndexRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_index({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_index(::Google::Cloud::Firestore::Admin::V1::DeleteIndexRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_index_client_stub.call_count + end + end + end + + def test_get_field + # Create test objects. + client_result = ::Google::Cloud::Firestore::Admin::V1::Field.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_field_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| + 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::Firestore::Admin::V1::FirestoreAdmin::Rest::ServiceStub.stub :transcode_get_field_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_field_client_stub do + # Create client + client = ::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_field({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_field name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_field ::Google::Cloud::Firestore::Admin::V1::GetFieldRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_field({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_field(::Google::Cloud::Firestore::Admin::V1::GetFieldRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_field_client_stub.call_count + end + end + end + + def test_update_field + # 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. + field = {} + update_mask = {} + + update_field_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| + 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::Firestore::Admin::V1::FirestoreAdmin::Rest::ServiceStub.stub :transcode_update_field_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_field_client_stub do + # Create client + client = ::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_field({ field: field, update_mask: update_mask }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_field field: field, update_mask: update_mask do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_field ::Google::Cloud::Firestore::Admin::V1::UpdateFieldRequest.new(field: field, update_mask: update_mask) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_field({ field: field, update_mask: update_mask }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_field(::Google::Cloud::Firestore::Admin::V1::UpdateFieldRequest.new(field: field, update_mask: update_mask), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_field_client_stub.call_count + end + end + end + + def test_list_fields + # Create test objects. + client_result = ::Google::Cloud::Firestore::Admin::V1::ListFieldsResponse.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_fields_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| + 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::Firestore::Admin::V1::FirestoreAdmin::Rest::ServiceStub.stub :transcode_list_fields_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_fields_client_stub do + # Create client + client = ::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_fields({ 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_fields 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_fields ::Google::Cloud::Firestore::Admin::V1::ListFieldsRequest.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_fields({ 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_fields(::Google::Cloud::Firestore::Admin::V1::ListFieldsRequest.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_fields_client_stub.call_count + end + end + end + + def test_export_documents + # 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" + collection_ids = ["hello world"] + output_uri_prefix = "hello world" + namespace_ids = ["hello world"] + snapshot_time = {} + + export_documents_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| + 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::Firestore::Admin::V1::FirestoreAdmin::Rest::ServiceStub.stub :transcode_export_documents_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, export_documents_client_stub do + # Create client + client = ::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.export_documents({ name: name, collection_ids: collection_ids, output_uri_prefix: output_uri_prefix, namespace_ids: namespace_ids, snapshot_time: snapshot_time }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.export_documents name: name, collection_ids: collection_ids, output_uri_prefix: output_uri_prefix, namespace_ids: namespace_ids, snapshot_time: snapshot_time do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.export_documents ::Google::Cloud::Firestore::Admin::V1::ExportDocumentsRequest.new(name: name, collection_ids: collection_ids, output_uri_prefix: output_uri_prefix, namespace_ids: namespace_ids, snapshot_time: snapshot_time) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.export_documents({ name: name, collection_ids: collection_ids, output_uri_prefix: output_uri_prefix, namespace_ids: namespace_ids, snapshot_time: snapshot_time }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.export_documents(::Google::Cloud::Firestore::Admin::V1::ExportDocumentsRequest.new(name: name, collection_ids: collection_ids, output_uri_prefix: output_uri_prefix, namespace_ids: namespace_ids, snapshot_time: snapshot_time), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, export_documents_client_stub.call_count + end + end + end + + def test_import_documents + # 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" + collection_ids = ["hello world"] + input_uri_prefix = "hello world" + namespace_ids = ["hello world"] + + import_documents_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| + 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::Firestore::Admin::V1::FirestoreAdmin::Rest::ServiceStub.stub :transcode_import_documents_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, import_documents_client_stub do + # Create client + client = ::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.import_documents({ name: name, collection_ids: collection_ids, input_uri_prefix: input_uri_prefix, namespace_ids: namespace_ids }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.import_documents name: name, collection_ids: collection_ids, input_uri_prefix: input_uri_prefix, namespace_ids: namespace_ids do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.import_documents ::Google::Cloud::Firestore::Admin::V1::ImportDocumentsRequest.new(name: name, collection_ids: collection_ids, input_uri_prefix: input_uri_prefix, namespace_ids: namespace_ids) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.import_documents({ name: name, collection_ids: collection_ids, input_uri_prefix: input_uri_prefix, namespace_ids: namespace_ids }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.import_documents(::Google::Cloud::Firestore::Admin::V1::ImportDocumentsRequest.new(name: name, collection_ids: collection_ids, input_uri_prefix: input_uri_prefix, namespace_ids: namespace_ids), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, import_documents_client_stub.call_count + end + end + end + + def test_create_database + # 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" + database = {} + database_id = "hello world" + + create_database_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| + 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::Firestore::Admin::V1::FirestoreAdmin::Rest::ServiceStub.stub :transcode_create_database_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_database_client_stub do + # Create client + client = ::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_database({ parent: parent, database: database, database_id: database_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_database parent: parent, database: database, database_id: database_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_database ::Google::Cloud::Firestore::Admin::V1::CreateDatabaseRequest.new(parent: parent, database: database, database_id: database_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_database({ parent: parent, database: database, database_id: database_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_database(::Google::Cloud::Firestore::Admin::V1::CreateDatabaseRequest.new(parent: parent, database: database, database_id: database_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_database_client_stub.call_count + end + end + end + + def test_get_database + # Create test objects. + client_result = ::Google::Cloud::Firestore::Admin::V1::Database.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_database_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| + 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::Firestore::Admin::V1::FirestoreAdmin::Rest::ServiceStub.stub :transcode_get_database_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_database_client_stub do + # Create client + client = ::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_database({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_database name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_database ::Google::Cloud::Firestore::Admin::V1::GetDatabaseRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_database({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_database(::Google::Cloud::Firestore::Admin::V1::GetDatabaseRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_database_client_stub.call_count + end + end + end + + def test_list_databases + # Create test objects. + client_result = ::Google::Cloud::Firestore::Admin::V1::ListDatabasesResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + + list_databases_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| + 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::Firestore::Admin::V1::FirestoreAdmin::Rest::ServiceStub.stub :transcode_list_databases_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_databases_client_stub do + # Create client + client = ::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_databases({ parent: parent }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.list_databases parent: parent do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.list_databases ::Google::Cloud::Firestore::Admin::V1::ListDatabasesRequest.new(parent: parent) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.list_databases({ parent: parent }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.list_databases(::Google::Cloud::Firestore::Admin::V1::ListDatabasesRequest.new(parent: parent), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, list_databases_client_stub.call_count + end + end + end + + def test_update_database + # 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. + database = {} + update_mask = {} + + update_database_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| + 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::Firestore::Admin::V1::FirestoreAdmin::Rest::ServiceStub.stub :transcode_update_database_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_database_client_stub do + # Create client + client = ::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_database({ database: database, update_mask: update_mask }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_database database: database, update_mask: update_mask do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_database ::Google::Cloud::Firestore::Admin::V1::UpdateDatabaseRequest.new(database: database, update_mask: update_mask) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_database({ database: database, update_mask: update_mask }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_database(::Google::Cloud::Firestore::Admin::V1::UpdateDatabaseRequest.new(database: database, update_mask: update_mask), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_database_client_stub.call_count + end + end + end + + def test_delete_database + # 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" + etag = "hello world" + + delete_database_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| + 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::Firestore::Admin::V1::FirestoreAdmin::Rest::ServiceStub.stub :transcode_delete_database_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_database_client_stub do + # Create client + client = ::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_database({ name: name, etag: etag }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_database name: name, etag: etag do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_database ::Google::Cloud::Firestore::Admin::V1::DeleteDatabaseRequest.new(name: name, etag: etag) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_database({ name: name, etag: etag }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_database(::Google::Cloud::Firestore::Admin::V1::DeleteDatabaseRequest.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_database_client_stub.call_count + end + end + end + + def test_get_backup + # Create test objects. + client_result = ::Google::Cloud::Firestore::Admin::V1::Backup.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_backup_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| + 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::Firestore::Admin::V1::FirestoreAdmin::Rest::ServiceStub.stub :transcode_get_backup_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_backup_client_stub do + # Create client + client = ::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_backup({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_backup name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_backup ::Google::Cloud::Firestore::Admin::V1::GetBackupRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_backup({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_backup(::Google::Cloud::Firestore::Admin::V1::GetBackupRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_backup_client_stub.call_count + end + end + end + + def test_list_backups + # Create test objects. + client_result = ::Google::Cloud::Firestore::Admin::V1::ListBackupsResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + + list_backups_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| + 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::Firestore::Admin::V1::FirestoreAdmin::Rest::ServiceStub.stub :transcode_list_backups_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_backups_client_stub do + # Create client + client = ::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_backups({ parent: parent }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.list_backups parent: parent do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.list_backups ::Google::Cloud::Firestore::Admin::V1::ListBackupsRequest.new(parent: parent) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.list_backups({ parent: parent }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.list_backups(::Google::Cloud::Firestore::Admin::V1::ListBackupsRequest.new(parent: parent), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, list_backups_client_stub.call_count + end + end + end + + def test_delete_backup + # 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_backup_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| + 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::Firestore::Admin::V1::FirestoreAdmin::Rest::ServiceStub.stub :transcode_delete_backup_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_backup_client_stub do + # Create client + client = ::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_backup({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_backup name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_backup ::Google::Cloud::Firestore::Admin::V1::DeleteBackupRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_backup({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_backup(::Google::Cloud::Firestore::Admin::V1::DeleteBackupRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_backup_client_stub.call_count + end + end + end + + def test_restore_database + # 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" + database_id = "hello world" + backup = "hello world" + + restore_database_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| + 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::Firestore::Admin::V1::FirestoreAdmin::Rest::ServiceStub.stub :transcode_restore_database_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, restore_database_client_stub do + # Create client + client = ::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.restore_database({ parent: parent, database_id: database_id, backup: backup }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.restore_database parent: parent, database_id: database_id, backup: backup do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.restore_database ::Google::Cloud::Firestore::Admin::V1::RestoreDatabaseRequest.new(parent: parent, database_id: database_id, backup: backup) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.restore_database({ parent: parent, database_id: database_id, backup: backup }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.restore_database(::Google::Cloud::Firestore::Admin::V1::RestoreDatabaseRequest.new(parent: parent, database_id: database_id, backup: backup), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, restore_database_client_stub.call_count + end + end + end + + def test_create_backup_schedule + # Create test objects. + client_result = ::Google::Cloud::Firestore::Admin::V1::BackupSchedule.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + backup_schedule = {} + + create_backup_schedule_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| + 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::Firestore::Admin::V1::FirestoreAdmin::Rest::ServiceStub.stub :transcode_create_backup_schedule_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_backup_schedule_client_stub do + # Create client + client = ::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_backup_schedule({ parent: parent, backup_schedule: backup_schedule }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_backup_schedule parent: parent, backup_schedule: backup_schedule do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_backup_schedule ::Google::Cloud::Firestore::Admin::V1::CreateBackupScheduleRequest.new(parent: parent, backup_schedule: backup_schedule) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_backup_schedule({ parent: parent, backup_schedule: backup_schedule }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_backup_schedule(::Google::Cloud::Firestore::Admin::V1::CreateBackupScheduleRequest.new(parent: parent, backup_schedule: backup_schedule), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_backup_schedule_client_stub.call_count + end + end + end + + def test_get_backup_schedule + # Create test objects. + client_result = ::Google::Cloud::Firestore::Admin::V1::BackupSchedule.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_backup_schedule_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| + 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::Firestore::Admin::V1::FirestoreAdmin::Rest::ServiceStub.stub :transcode_get_backup_schedule_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_backup_schedule_client_stub do + # Create client + client = ::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_backup_schedule({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_backup_schedule name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_backup_schedule ::Google::Cloud::Firestore::Admin::V1::GetBackupScheduleRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_backup_schedule({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_backup_schedule(::Google::Cloud::Firestore::Admin::V1::GetBackupScheduleRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_backup_schedule_client_stub.call_count + end + end + end + + def test_list_backup_schedules + # Create test objects. + client_result = ::Google::Cloud::Firestore::Admin::V1::ListBackupSchedulesResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + + list_backup_schedules_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| + 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::Firestore::Admin::V1::FirestoreAdmin::Rest::ServiceStub.stub :transcode_list_backup_schedules_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_backup_schedules_client_stub do + # Create client + client = ::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_backup_schedules({ parent: parent }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.list_backup_schedules parent: parent do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.list_backup_schedules ::Google::Cloud::Firestore::Admin::V1::ListBackupSchedulesRequest.new(parent: parent) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.list_backup_schedules({ parent: parent }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.list_backup_schedules(::Google::Cloud::Firestore::Admin::V1::ListBackupSchedulesRequest.new(parent: parent), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, list_backup_schedules_client_stub.call_count + end + end + end + + def test_update_backup_schedule + # Create test objects. + client_result = ::Google::Cloud::Firestore::Admin::V1::BackupSchedule.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + backup_schedule = {} + update_mask = {} + + update_backup_schedule_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| + 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::Firestore::Admin::V1::FirestoreAdmin::Rest::ServiceStub.stub :transcode_update_backup_schedule_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_backup_schedule_client_stub do + # Create client + client = ::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_backup_schedule({ backup_schedule: backup_schedule, update_mask: update_mask }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_backup_schedule backup_schedule: backup_schedule, update_mask: update_mask do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_backup_schedule ::Google::Cloud::Firestore::Admin::V1::UpdateBackupScheduleRequest.new(backup_schedule: backup_schedule, update_mask: update_mask) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_backup_schedule({ backup_schedule: backup_schedule, update_mask: update_mask }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_backup_schedule(::Google::Cloud::Firestore::Admin::V1::UpdateBackupScheduleRequest.new(backup_schedule: backup_schedule, update_mask: update_mask), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_backup_schedule_client_stub.call_count + end + end + end + + def test_delete_backup_schedule + # 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_backup_schedule_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| + 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::Firestore::Admin::V1::FirestoreAdmin::Rest::ServiceStub.stub :transcode_delete_backup_schedule_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_backup_schedule_client_stub do + # Create client + client = ::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_backup_schedule({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_backup_schedule name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_backup_schedule ::Google::Cloud::Firestore::Admin::V1::DeleteBackupScheduleRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_backup_schedule({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_backup_schedule(::Google::Cloud::Firestore::Admin::V1::DeleteBackupScheduleRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_backup_schedule_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::Firestore::Admin::V1::FirestoreAdmin::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::Firestore::Admin::V1::FirestoreAdmin::Rest::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-firestore-admin-v1/test/google/cloud/firestore/admin/v1/firestore_admin_test.rb b/owl-bot-staging/google-cloud-firestore-admin-v1/test/google/cloud/firestore/admin/v1/firestore_admin_test.rb new file mode 100644 index 000000000000..9e95cdb8406e --- /dev/null +++ b/owl-bot-staging/google-cloud-firestore-admin-v1/test/google/cloud/firestore/admin/v1/firestore_admin_test.rb @@ -0,0 +1,1520 @@ +# frozen_string_literal: true + +# Copyright 2024 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/firestore/admin/v1/firestore_admin_pb" +require "google/firestore/admin/v1/firestore_admin_services_pb" +require "google/cloud/firestore/admin/v1/firestore_admin" + +class ::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::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) + + yield @response, @operation if block_given? + + @response + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + + def test_create_index + # 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" + index = {} + + create_index_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_index, name + assert_kind_of ::Google::Cloud::Firestore::Admin::V1::CreateIndexRequest, request + assert_equal "hello world", request["parent"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Firestore::Admin::V1::Index), request["index"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_index_client_stub do + # Create client + client = ::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_index({ parent: parent, index: index }) 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_index parent: parent, index: index 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_index ::Google::Cloud::Firestore::Admin::V1::CreateIndexRequest.new(parent: parent, index: index) 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_index({ parent: parent, index: index }, 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_index(::Google::Cloud::Firestore::Admin::V1::CreateIndexRequest.new(parent: parent, index: index), 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_index_client_stub.call_rpc_count + end + end + + def test_list_indexes + # Create GRPC objects. + grpc_response = ::Google::Cloud::Firestore::Admin::V1::ListIndexesResponse.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_indexes_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_indexes, name + assert_kind_of ::Google::Cloud::Firestore::Admin::V1::ListIndexesRequest, 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_indexes_client_stub do + # Create client + client = ::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_indexes({ 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_indexes 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_indexes ::Google::Cloud::Firestore::Admin::V1::ListIndexesRequest.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_indexes({ 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_indexes(::Google::Cloud::Firestore::Admin::V1::ListIndexesRequest.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_indexes_client_stub.call_rpc_count + end + end + + def test_get_index + # Create GRPC objects. + grpc_response = ::Google::Cloud::Firestore::Admin::V1::Index.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_index_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_index, name + assert_kind_of ::Google::Cloud::Firestore::Admin::V1::GetIndexRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_index_client_stub do + # Create client + client = ::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_index({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_index name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_index ::Google::Cloud::Firestore::Admin::V1::GetIndexRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_index({ 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_index(::Google::Cloud::Firestore::Admin::V1::GetIndexRequest.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_index_client_stub.call_rpc_count + end + end + + def test_delete_index + # 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_index_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_index, name + assert_kind_of ::Google::Cloud::Firestore::Admin::V1::DeleteIndexRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_index_client_stub do + # Create client + client = ::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_index({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_index name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_index ::Google::Cloud::Firestore::Admin::V1::DeleteIndexRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_index({ 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_index(::Google::Cloud::Firestore::Admin::V1::DeleteIndexRequest.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_index_client_stub.call_rpc_count + end + end + + def test_get_field + # Create GRPC objects. + grpc_response = ::Google::Cloud::Firestore::Admin::V1::Field.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_field_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_field, name + assert_kind_of ::Google::Cloud::Firestore::Admin::V1::GetFieldRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_field_client_stub do + # Create client + client = ::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_field({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_field name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_field ::Google::Cloud::Firestore::Admin::V1::GetFieldRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_field({ 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_field(::Google::Cloud::Firestore::Admin::V1::GetFieldRequest.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_field_client_stub.call_rpc_count + end + end + + def test_update_field + # 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. + field = {} + update_mask = {} + + update_field_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_field, name + assert_kind_of ::Google::Cloud::Firestore::Admin::V1::UpdateFieldRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Firestore::Admin::V1::Field), request["field"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_field_client_stub do + # Create client + client = ::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_field({ field: field, update_mask: update_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_field field: field, update_mask: update_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_field ::Google::Cloud::Firestore::Admin::V1::UpdateFieldRequest.new(field: field, update_mask: update_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_field({ field: field, update_mask: update_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_field(::Google::Cloud::Firestore::Admin::V1::UpdateFieldRequest.new(field: field, update_mask: update_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_field_client_stub.call_rpc_count + end + end + + def test_list_fields + # Create GRPC objects. + grpc_response = ::Google::Cloud::Firestore::Admin::V1::ListFieldsResponse.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_fields_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_fields, name + assert_kind_of ::Google::Cloud::Firestore::Admin::V1::ListFieldsRequest, 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_fields_client_stub do + # Create client + client = ::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_fields({ 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_fields 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_fields ::Google::Cloud::Firestore::Admin::V1::ListFieldsRequest.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_fields({ 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_fields(::Google::Cloud::Firestore::Admin::V1::ListFieldsRequest.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_fields_client_stub.call_rpc_count + end + end + + def test_export_documents + # 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" + collection_ids = ["hello world"] + output_uri_prefix = "hello world" + namespace_ids = ["hello world"] + snapshot_time = {} + + export_documents_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :export_documents, name + assert_kind_of ::Google::Cloud::Firestore::Admin::V1::ExportDocumentsRequest, request + assert_equal "hello world", request["name"] + assert_equal ["hello world"], request["collection_ids"] + assert_equal "hello world", request["output_uri_prefix"] + assert_equal ["hello world"], request["namespace_ids"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Timestamp), request["snapshot_time"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, export_documents_client_stub do + # Create client + client = ::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.export_documents({ name: name, collection_ids: collection_ids, output_uri_prefix: output_uri_prefix, namespace_ids: namespace_ids, snapshot_time: snapshot_time }) 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.export_documents name: name, collection_ids: collection_ids, output_uri_prefix: output_uri_prefix, namespace_ids: namespace_ids, snapshot_time: snapshot_time 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.export_documents ::Google::Cloud::Firestore::Admin::V1::ExportDocumentsRequest.new(name: name, collection_ids: collection_ids, output_uri_prefix: output_uri_prefix, namespace_ids: namespace_ids, snapshot_time: snapshot_time) 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.export_documents({ name: name, collection_ids: collection_ids, output_uri_prefix: output_uri_prefix, namespace_ids: namespace_ids, snapshot_time: snapshot_time }, 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.export_documents(::Google::Cloud::Firestore::Admin::V1::ExportDocumentsRequest.new(name: name, collection_ids: collection_ids, output_uri_prefix: output_uri_prefix, namespace_ids: namespace_ids, snapshot_time: snapshot_time), 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, export_documents_client_stub.call_rpc_count + end + end + + def test_import_documents + # 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" + collection_ids = ["hello world"] + input_uri_prefix = "hello world" + namespace_ids = ["hello world"] + + import_documents_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :import_documents, name + assert_kind_of ::Google::Cloud::Firestore::Admin::V1::ImportDocumentsRequest, request + assert_equal "hello world", request["name"] + assert_equal ["hello world"], request["collection_ids"] + assert_equal "hello world", request["input_uri_prefix"] + assert_equal ["hello world"], request["namespace_ids"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, import_documents_client_stub do + # Create client + client = ::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.import_documents({ name: name, collection_ids: collection_ids, input_uri_prefix: input_uri_prefix, namespace_ids: namespace_ids }) 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.import_documents name: name, collection_ids: collection_ids, input_uri_prefix: input_uri_prefix, namespace_ids: namespace_ids 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.import_documents ::Google::Cloud::Firestore::Admin::V1::ImportDocumentsRequest.new(name: name, collection_ids: collection_ids, input_uri_prefix: input_uri_prefix, namespace_ids: namespace_ids) 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.import_documents({ name: name, collection_ids: collection_ids, input_uri_prefix: input_uri_prefix, namespace_ids: namespace_ids }, 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.import_documents(::Google::Cloud::Firestore::Admin::V1::ImportDocumentsRequest.new(name: name, collection_ids: collection_ids, input_uri_prefix: input_uri_prefix, namespace_ids: namespace_ids), 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, import_documents_client_stub.call_rpc_count + end + end + + def test_create_database + # 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" + database = {} + database_id = "hello world" + + create_database_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_database, name + assert_kind_of ::Google::Cloud::Firestore::Admin::V1::CreateDatabaseRequest, request + assert_equal "hello world", request["parent"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Firestore::Admin::V1::Database), request["database"] + assert_equal "hello world", request["database_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_database_client_stub do + # Create client + client = ::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_database({ parent: parent, database: database, database_id: database_id }) 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_database parent: parent, database: database, database_id: database_id 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_database ::Google::Cloud::Firestore::Admin::V1::CreateDatabaseRequest.new(parent: parent, database: database, database_id: database_id) 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_database({ parent: parent, database: database, database_id: database_id }, 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_database(::Google::Cloud::Firestore::Admin::V1::CreateDatabaseRequest.new(parent: parent, database: database, database_id: database_id), 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_database_client_stub.call_rpc_count + end + end + + def test_get_database + # Create GRPC objects. + grpc_response = ::Google::Cloud::Firestore::Admin::V1::Database.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_database_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_database, name + assert_kind_of ::Google::Cloud::Firestore::Admin::V1::GetDatabaseRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_database_client_stub do + # Create client + client = ::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_database({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_database name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_database ::Google::Cloud::Firestore::Admin::V1::GetDatabaseRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_database({ 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_database(::Google::Cloud::Firestore::Admin::V1::GetDatabaseRequest.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_database_client_stub.call_rpc_count + end + end + + def test_list_databases + # Create GRPC objects. + grpc_response = ::Google::Cloud::Firestore::Admin::V1::ListDatabasesResponse.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" + + list_databases_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_databases, name + assert_kind_of ::Google::Cloud::Firestore::Admin::V1::ListDatabasesRequest, request + assert_equal "hello world", request["parent"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_databases_client_stub do + # Create client + client = ::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_databases({ parent: parent }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.list_databases parent: parent do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.list_databases ::Google::Cloud::Firestore::Admin::V1::ListDatabasesRequest.new(parent: parent) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.list_databases({ parent: parent }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.list_databases(::Google::Cloud::Firestore::Admin::V1::ListDatabasesRequest.new(parent: parent), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, list_databases_client_stub.call_rpc_count + end + end + + def test_update_database + # 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. + database = {} + update_mask = {} + + update_database_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_database, name + assert_kind_of ::Google::Cloud::Firestore::Admin::V1::UpdateDatabaseRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Firestore::Admin::V1::Database), request["database"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_database_client_stub do + # Create client + client = ::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_database({ database: database, update_mask: update_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_database database: database, update_mask: update_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_database ::Google::Cloud::Firestore::Admin::V1::UpdateDatabaseRequest.new(database: database, update_mask: update_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_database({ database: database, update_mask: update_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_database(::Google::Cloud::Firestore::Admin::V1::UpdateDatabaseRequest.new(database: database, update_mask: update_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_database_client_stub.call_rpc_count + end + end + + def test_delete_database + # 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" + etag = "hello world" + + delete_database_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_database, name + assert_kind_of ::Google::Cloud::Firestore::Admin::V1::DeleteDatabaseRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["etag"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_database_client_stub do + # Create client + client = ::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_database({ name: name, etag: etag }) 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.delete_database name: name, etag: etag 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.delete_database ::Google::Cloud::Firestore::Admin::V1::DeleteDatabaseRequest.new(name: name, etag: etag) 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.delete_database({ name: name, etag: etag }, 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.delete_database(::Google::Cloud::Firestore::Admin::V1::DeleteDatabaseRequest.new(name: name, etag: etag), 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, delete_database_client_stub.call_rpc_count + end + end + + def test_get_backup + # Create GRPC objects. + grpc_response = ::Google::Cloud::Firestore::Admin::V1::Backup.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_backup_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_backup, name + assert_kind_of ::Google::Cloud::Firestore::Admin::V1::GetBackupRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_backup_client_stub do + # Create client + client = ::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_backup({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_backup name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_backup ::Google::Cloud::Firestore::Admin::V1::GetBackupRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_backup({ 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_backup(::Google::Cloud::Firestore::Admin::V1::GetBackupRequest.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_backup_client_stub.call_rpc_count + end + end + + def test_list_backups + # Create GRPC objects. + grpc_response = ::Google::Cloud::Firestore::Admin::V1::ListBackupsResponse.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" + + list_backups_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_backups, name + assert_kind_of ::Google::Cloud::Firestore::Admin::V1::ListBackupsRequest, request + assert_equal "hello world", request["parent"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_backups_client_stub do + # Create client + client = ::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_backups({ parent: parent }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.list_backups parent: parent do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.list_backups ::Google::Cloud::Firestore::Admin::V1::ListBackupsRequest.new(parent: parent) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.list_backups({ parent: parent }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.list_backups(::Google::Cloud::Firestore::Admin::V1::ListBackupsRequest.new(parent: parent), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, list_backups_client_stub.call_rpc_count + end + end + + def test_delete_backup + # 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_backup_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_backup, name + assert_kind_of ::Google::Cloud::Firestore::Admin::V1::DeleteBackupRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_backup_client_stub do + # Create client + client = ::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_backup({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_backup name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_backup ::Google::Cloud::Firestore::Admin::V1::DeleteBackupRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_backup({ 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_backup(::Google::Cloud::Firestore::Admin::V1::DeleteBackupRequest.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_backup_client_stub.call_rpc_count + end + end + + def test_restore_database + # 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" + database_id = "hello world" + backup = "hello world" + + restore_database_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :restore_database, name + assert_kind_of ::Google::Cloud::Firestore::Admin::V1::RestoreDatabaseRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["database_id"] + assert_equal "hello world", request["backup"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, restore_database_client_stub do + # Create client + client = ::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.restore_database({ parent: parent, database_id: database_id, backup: backup }) 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.restore_database parent: parent, database_id: database_id, backup: backup 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.restore_database ::Google::Cloud::Firestore::Admin::V1::RestoreDatabaseRequest.new(parent: parent, database_id: database_id, backup: backup) 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.restore_database({ parent: parent, database_id: database_id, backup: backup }, 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.restore_database(::Google::Cloud::Firestore::Admin::V1::RestoreDatabaseRequest.new(parent: parent, database_id: database_id, backup: backup), 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, restore_database_client_stub.call_rpc_count + end + end + + def test_create_backup_schedule + # Create GRPC objects. + grpc_response = ::Google::Cloud::Firestore::Admin::V1::BackupSchedule.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" + backup_schedule = {} + + create_backup_schedule_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_backup_schedule, name + assert_kind_of ::Google::Cloud::Firestore::Admin::V1::CreateBackupScheduleRequest, request + assert_equal "hello world", request["parent"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Firestore::Admin::V1::BackupSchedule), request["backup_schedule"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_backup_schedule_client_stub do + # Create client + client = ::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_backup_schedule({ parent: parent, backup_schedule: backup_schedule }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.create_backup_schedule parent: parent, backup_schedule: backup_schedule do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.create_backup_schedule ::Google::Cloud::Firestore::Admin::V1::CreateBackupScheduleRequest.new(parent: parent, backup_schedule: backup_schedule) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.create_backup_schedule({ parent: parent, backup_schedule: backup_schedule }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.create_backup_schedule(::Google::Cloud::Firestore::Admin::V1::CreateBackupScheduleRequest.new(parent: parent, backup_schedule: backup_schedule), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, create_backup_schedule_client_stub.call_rpc_count + end + end + + def test_get_backup_schedule + # Create GRPC objects. + grpc_response = ::Google::Cloud::Firestore::Admin::V1::BackupSchedule.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_backup_schedule_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_backup_schedule, name + assert_kind_of ::Google::Cloud::Firestore::Admin::V1::GetBackupScheduleRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_backup_schedule_client_stub do + # Create client + client = ::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_backup_schedule({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_backup_schedule name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_backup_schedule ::Google::Cloud::Firestore::Admin::V1::GetBackupScheduleRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_backup_schedule({ 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_backup_schedule(::Google::Cloud::Firestore::Admin::V1::GetBackupScheduleRequest.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_backup_schedule_client_stub.call_rpc_count + end + end + + def test_list_backup_schedules + # Create GRPC objects. + grpc_response = ::Google::Cloud::Firestore::Admin::V1::ListBackupSchedulesResponse.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" + + list_backup_schedules_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_backup_schedules, name + assert_kind_of ::Google::Cloud::Firestore::Admin::V1::ListBackupSchedulesRequest, request + assert_equal "hello world", request["parent"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_backup_schedules_client_stub do + # Create client + client = ::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_backup_schedules({ parent: parent }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.list_backup_schedules parent: parent do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.list_backup_schedules ::Google::Cloud::Firestore::Admin::V1::ListBackupSchedulesRequest.new(parent: parent) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.list_backup_schedules({ parent: parent }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.list_backup_schedules(::Google::Cloud::Firestore::Admin::V1::ListBackupSchedulesRequest.new(parent: parent), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, list_backup_schedules_client_stub.call_rpc_count + end + end + + def test_update_backup_schedule + # Create GRPC objects. + grpc_response = ::Google::Cloud::Firestore::Admin::V1::BackupSchedule.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. + backup_schedule = {} + update_mask = {} + + update_backup_schedule_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_backup_schedule, name + assert_kind_of ::Google::Cloud::Firestore::Admin::V1::UpdateBackupScheduleRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Firestore::Admin::V1::BackupSchedule), request["backup_schedule"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_backup_schedule_client_stub do + # Create client + client = ::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_backup_schedule({ backup_schedule: backup_schedule, update_mask: update_mask }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.update_backup_schedule backup_schedule: backup_schedule, update_mask: update_mask do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.update_backup_schedule ::Google::Cloud::Firestore::Admin::V1::UpdateBackupScheduleRequest.new(backup_schedule: backup_schedule, update_mask: update_mask) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.update_backup_schedule({ backup_schedule: backup_schedule, 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.update_backup_schedule(::Google::Cloud::Firestore::Admin::V1::UpdateBackupScheduleRequest.new(backup_schedule: backup_schedule, 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, update_backup_schedule_client_stub.call_rpc_count + end + end + + def test_delete_backup_schedule + # 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_backup_schedule_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_backup_schedule, name + assert_kind_of ::Google::Cloud::Firestore::Admin::V1::DeleteBackupScheduleRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_backup_schedule_client_stub do + # Create client + client = ::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_backup_schedule({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_backup_schedule name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_backup_schedule ::Google::Cloud::Firestore::Admin::V1::DeleteBackupScheduleRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_backup_schedule({ 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_backup_schedule(::Google::Cloud::Firestore::Admin::V1::DeleteBackupScheduleRequest.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_backup_schedule_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::Firestore::Admin::V1::FirestoreAdmin::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::Firestore::Admin::V1::FirestoreAdmin::Client::Configuration, config + 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::Firestore::Admin::V1::FirestoreAdmin::Client.new do |config| + config.credentials = grpc_channel + end + end + + assert_kind_of ::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Operations, client.operations_client + end +end diff --git a/owl-bot-staging/google-cloud-firestore-admin-v1/test/helper.rb b/owl-bot-staging/google-cloud-firestore-admin-v1/test/helper.rb new file mode 100644 index 000000000000..2d25cd69b685 --- /dev/null +++ b/owl-bot-staging/google-cloud-firestore-admin-v1/test/helper.rb @@ -0,0 +1,23 @@ +# frozen_string_literal: true + +# Copyright 2024 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" From 3d5c80491f3df44227a7d52ce0bf51d7633a88c7 Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Mon, 25 Mar 2024 18:59:29 +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 --- .../lib/google/firestore/admin/v1/index_pb.rb | 5 +- .../google/firestore/admin/v1/index.rb | 26 + .../.gitignore | 22 - .../.repo-metadata.json | 18 - .../.rubocop.yml | 33 - .../google-cloud-firestore-admin-v1/.toys.rb | 28 - .../google-cloud-firestore-admin-v1/.yardopts | 12 - .../AUTHENTICATION.md | 122 - .../CHANGELOG.md | 2 - .../google-cloud-firestore-admin-v1/Gemfile | 11 - .../LICENSE.md | 201 -- .../google-cloud-firestore-admin-v1/README.md | 144 - .../google-cloud-firestore-admin-v1/Rakefile | 169 - .../gapic_metadata.json | 133 - .../google-cloud-firestore-admin-v1.gemspec | 29 - .../lib/google-cloud-firestore-admin-v1.rb | 21 - .../lib/google/cloud/firestore/admin/v1.rb | 47 - .../firestore/admin/v1/firestore_admin.rb | 85 - .../admin/v1/firestore_admin/client.rb | 2806 ----------------- .../admin/v1/firestore_admin/credentials.rb | 54 - .../admin/v1/firestore_admin/operations.rb | 803 ----- .../admin/v1/firestore_admin/paths.rb | 182 -- .../admin/v1/firestore_admin/rest.rb | 82 - .../admin/v1/firestore_admin/rest/client.rb | 2619 --------------- .../v1/firestore_admin/rest/operations.rb | 897 ------ .../v1/firestore_admin/rest/service_stub.rb | 1437 --------- .../google/cloud/firestore/admin/v1/rest.rb | 39 - .../cloud/firestore/admin/v1/version.rb | 30 - .../google/firestore/admin/v1/backup_pb.rb | 51 - .../google/firestore/admin/v1/database_pb.rb | 56 - .../lib/google/firestore/admin/v1/field_pb.rb | 52 - .../firestore/admin/v1/firestore_admin_pb.rb | 96 - .../admin/v1/firestore_admin_services_pb.rb | 178 -- .../lib/google/firestore/admin/v1/index_pb.rb | 55 - .../google/firestore/admin/v1/location_pb.rb | 44 - .../google/firestore/admin/v1/operation_pb.rb | 61 - .../google/firestore/admin/v1/schedule_pb.rb | 54 - .../proto_docs/README.md | 4 - .../proto_docs/google/api/client.rb | 399 --- .../proto_docs/google/api/field_behavior.rb | 85 - .../proto_docs/google/api/launch_stage.rb | 71 - .../proto_docs/google/api/resource.rb | 222 -- .../google/firestore/admin/v1/backup.rb | 99 - .../google/firestore/admin/v1/database.rb | 197 -- .../google/firestore/admin/v1/field.rb | 138 - .../firestore/admin/v1/firestore_admin.rb | 509 --- .../google/firestore/admin/v1/index.rb | 198 -- .../google/firestore/admin/v1/location.rb | 35 - .../google/firestore/admin/v1/operation.rb | 288 -- .../google/firestore/admin/v1/schedule.rb | 88 - .../google/longrunning/operations.rb | 164 - .../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 - .../proto_docs/google/type/dayofweek.rb | 49 - .../snippets/Gemfile | 32 - .../firestore_admin/create_backup_schedule.rb | 47 - .../firestore_admin/create_database.rb | 54 - .../snippets/firestore_admin/create_index.rb | 54 - .../snippets/firestore_admin/delete_backup.rb | 47 - .../firestore_admin/delete_backup_schedule.rb | 47 - .../firestore_admin/delete_database.rb | 54 - .../snippets/firestore_admin/delete_index.rb | 47 - .../firestore_admin/export_documents.rb | 54 - .../snippets/firestore_admin/get_backup.rb | 47 - .../firestore_admin/get_backup_schedule.rb | 47 - .../snippets/firestore_admin/get_database.rb | 47 - .../snippets/firestore_admin/get_field.rb | 47 - .../snippets/firestore_admin/get_index.rb | 47 - .../firestore_admin/import_documents.rb | 54 - .../firestore_admin/list_backup_schedules.rb | 47 - .../snippets/firestore_admin/list_backups.rb | 47 - .../firestore_admin/list_databases.rb | 47 - .../snippets/firestore_admin/list_fields.rb | 51 - .../snippets/firestore_admin/list_indexes.rb | 51 - .../firestore_admin/restore_database.rb | 54 - .../firestore_admin/update_backup_schedule.rb | 47 - .../firestore_admin/update_database.rb | 54 - .../snippets/firestore_admin/update_field.rb | 54 - ...et_metadata_google.firestore.admin.v1.json | 935 ------ .../v1/firestore_admin_operations_test.rb | 389 --- .../admin/v1/firestore_admin_paths_test.rb | 131 - .../admin/v1/firestore_admin_rest_test.rb | 1356 -------- .../admin/v1/firestore_admin_test.rb | 1520 --------- .../test/helper.rb | 23 - 88 files changed, 30 insertions(+), 19432 deletions(-) delete mode 100644 owl-bot-staging/google-cloud-firestore-admin-v1/.gitignore delete mode 100644 owl-bot-staging/google-cloud-firestore-admin-v1/.repo-metadata.json delete mode 100644 owl-bot-staging/google-cloud-firestore-admin-v1/.rubocop.yml delete mode 100644 owl-bot-staging/google-cloud-firestore-admin-v1/.toys.rb delete mode 100644 owl-bot-staging/google-cloud-firestore-admin-v1/.yardopts delete mode 100644 owl-bot-staging/google-cloud-firestore-admin-v1/AUTHENTICATION.md delete mode 100644 owl-bot-staging/google-cloud-firestore-admin-v1/CHANGELOG.md delete mode 100644 owl-bot-staging/google-cloud-firestore-admin-v1/Gemfile delete mode 100644 owl-bot-staging/google-cloud-firestore-admin-v1/LICENSE.md delete mode 100644 owl-bot-staging/google-cloud-firestore-admin-v1/README.md delete mode 100644 owl-bot-staging/google-cloud-firestore-admin-v1/Rakefile delete mode 100644 owl-bot-staging/google-cloud-firestore-admin-v1/gapic_metadata.json delete mode 100644 owl-bot-staging/google-cloud-firestore-admin-v1/google-cloud-firestore-admin-v1.gemspec delete mode 100644 owl-bot-staging/google-cloud-firestore-admin-v1/lib/google-cloud-firestore-admin-v1.rb delete mode 100644 owl-bot-staging/google-cloud-firestore-admin-v1/lib/google/cloud/firestore/admin/v1.rb delete mode 100644 owl-bot-staging/google-cloud-firestore-admin-v1/lib/google/cloud/firestore/admin/v1/firestore_admin.rb delete mode 100644 owl-bot-staging/google-cloud-firestore-admin-v1/lib/google/cloud/firestore/admin/v1/firestore_admin/client.rb delete mode 100644 owl-bot-staging/google-cloud-firestore-admin-v1/lib/google/cloud/firestore/admin/v1/firestore_admin/credentials.rb delete mode 100644 owl-bot-staging/google-cloud-firestore-admin-v1/lib/google/cloud/firestore/admin/v1/firestore_admin/operations.rb delete mode 100644 owl-bot-staging/google-cloud-firestore-admin-v1/lib/google/cloud/firestore/admin/v1/firestore_admin/paths.rb delete mode 100644 owl-bot-staging/google-cloud-firestore-admin-v1/lib/google/cloud/firestore/admin/v1/firestore_admin/rest.rb delete mode 100644 owl-bot-staging/google-cloud-firestore-admin-v1/lib/google/cloud/firestore/admin/v1/firestore_admin/rest/client.rb delete mode 100644 owl-bot-staging/google-cloud-firestore-admin-v1/lib/google/cloud/firestore/admin/v1/firestore_admin/rest/operations.rb delete mode 100644 owl-bot-staging/google-cloud-firestore-admin-v1/lib/google/cloud/firestore/admin/v1/firestore_admin/rest/service_stub.rb delete mode 100644 owl-bot-staging/google-cloud-firestore-admin-v1/lib/google/cloud/firestore/admin/v1/rest.rb delete mode 100644 owl-bot-staging/google-cloud-firestore-admin-v1/lib/google/cloud/firestore/admin/v1/version.rb delete mode 100644 owl-bot-staging/google-cloud-firestore-admin-v1/lib/google/firestore/admin/v1/backup_pb.rb delete mode 100644 owl-bot-staging/google-cloud-firestore-admin-v1/lib/google/firestore/admin/v1/database_pb.rb delete mode 100644 owl-bot-staging/google-cloud-firestore-admin-v1/lib/google/firestore/admin/v1/field_pb.rb delete mode 100644 owl-bot-staging/google-cloud-firestore-admin-v1/lib/google/firestore/admin/v1/firestore_admin_pb.rb delete mode 100644 owl-bot-staging/google-cloud-firestore-admin-v1/lib/google/firestore/admin/v1/firestore_admin_services_pb.rb delete mode 100644 owl-bot-staging/google-cloud-firestore-admin-v1/lib/google/firestore/admin/v1/index_pb.rb delete mode 100644 owl-bot-staging/google-cloud-firestore-admin-v1/lib/google/firestore/admin/v1/location_pb.rb delete mode 100644 owl-bot-staging/google-cloud-firestore-admin-v1/lib/google/firestore/admin/v1/operation_pb.rb delete mode 100644 owl-bot-staging/google-cloud-firestore-admin-v1/lib/google/firestore/admin/v1/schedule_pb.rb delete mode 100644 owl-bot-staging/google-cloud-firestore-admin-v1/proto_docs/README.md delete mode 100644 owl-bot-staging/google-cloud-firestore-admin-v1/proto_docs/google/api/client.rb delete mode 100644 owl-bot-staging/google-cloud-firestore-admin-v1/proto_docs/google/api/field_behavior.rb delete mode 100644 owl-bot-staging/google-cloud-firestore-admin-v1/proto_docs/google/api/launch_stage.rb delete mode 100644 owl-bot-staging/google-cloud-firestore-admin-v1/proto_docs/google/api/resource.rb delete mode 100644 owl-bot-staging/google-cloud-firestore-admin-v1/proto_docs/google/firestore/admin/v1/backup.rb delete mode 100644 owl-bot-staging/google-cloud-firestore-admin-v1/proto_docs/google/firestore/admin/v1/database.rb delete mode 100644 owl-bot-staging/google-cloud-firestore-admin-v1/proto_docs/google/firestore/admin/v1/field.rb delete mode 100644 owl-bot-staging/google-cloud-firestore-admin-v1/proto_docs/google/firestore/admin/v1/firestore_admin.rb delete mode 100644 owl-bot-staging/google-cloud-firestore-admin-v1/proto_docs/google/firestore/admin/v1/index.rb delete mode 100644 owl-bot-staging/google-cloud-firestore-admin-v1/proto_docs/google/firestore/admin/v1/location.rb delete mode 100644 owl-bot-staging/google-cloud-firestore-admin-v1/proto_docs/google/firestore/admin/v1/operation.rb delete mode 100644 owl-bot-staging/google-cloud-firestore-admin-v1/proto_docs/google/firestore/admin/v1/schedule.rb delete mode 100644 owl-bot-staging/google-cloud-firestore-admin-v1/proto_docs/google/longrunning/operations.rb delete mode 100644 owl-bot-staging/google-cloud-firestore-admin-v1/proto_docs/google/protobuf/any.rb delete mode 100644 owl-bot-staging/google-cloud-firestore-admin-v1/proto_docs/google/protobuf/duration.rb delete mode 100644 owl-bot-staging/google-cloud-firestore-admin-v1/proto_docs/google/protobuf/empty.rb delete mode 100644 owl-bot-staging/google-cloud-firestore-admin-v1/proto_docs/google/protobuf/field_mask.rb delete mode 100644 owl-bot-staging/google-cloud-firestore-admin-v1/proto_docs/google/protobuf/timestamp.rb delete mode 100644 owl-bot-staging/google-cloud-firestore-admin-v1/proto_docs/google/rpc/status.rb delete mode 100644 owl-bot-staging/google-cloud-firestore-admin-v1/proto_docs/google/type/dayofweek.rb delete mode 100644 owl-bot-staging/google-cloud-firestore-admin-v1/snippets/Gemfile delete mode 100644 owl-bot-staging/google-cloud-firestore-admin-v1/snippets/firestore_admin/create_backup_schedule.rb delete mode 100644 owl-bot-staging/google-cloud-firestore-admin-v1/snippets/firestore_admin/create_database.rb delete mode 100644 owl-bot-staging/google-cloud-firestore-admin-v1/snippets/firestore_admin/create_index.rb delete mode 100644 owl-bot-staging/google-cloud-firestore-admin-v1/snippets/firestore_admin/delete_backup.rb delete mode 100644 owl-bot-staging/google-cloud-firestore-admin-v1/snippets/firestore_admin/delete_backup_schedule.rb delete mode 100644 owl-bot-staging/google-cloud-firestore-admin-v1/snippets/firestore_admin/delete_database.rb delete mode 100644 owl-bot-staging/google-cloud-firestore-admin-v1/snippets/firestore_admin/delete_index.rb delete mode 100644 owl-bot-staging/google-cloud-firestore-admin-v1/snippets/firestore_admin/export_documents.rb delete mode 100644 owl-bot-staging/google-cloud-firestore-admin-v1/snippets/firestore_admin/get_backup.rb delete mode 100644 owl-bot-staging/google-cloud-firestore-admin-v1/snippets/firestore_admin/get_backup_schedule.rb delete mode 100644 owl-bot-staging/google-cloud-firestore-admin-v1/snippets/firestore_admin/get_database.rb delete mode 100644 owl-bot-staging/google-cloud-firestore-admin-v1/snippets/firestore_admin/get_field.rb delete mode 100644 owl-bot-staging/google-cloud-firestore-admin-v1/snippets/firestore_admin/get_index.rb delete mode 100644 owl-bot-staging/google-cloud-firestore-admin-v1/snippets/firestore_admin/import_documents.rb delete mode 100644 owl-bot-staging/google-cloud-firestore-admin-v1/snippets/firestore_admin/list_backup_schedules.rb delete mode 100644 owl-bot-staging/google-cloud-firestore-admin-v1/snippets/firestore_admin/list_backups.rb delete mode 100644 owl-bot-staging/google-cloud-firestore-admin-v1/snippets/firestore_admin/list_databases.rb delete mode 100644 owl-bot-staging/google-cloud-firestore-admin-v1/snippets/firestore_admin/list_fields.rb delete mode 100644 owl-bot-staging/google-cloud-firestore-admin-v1/snippets/firestore_admin/list_indexes.rb delete mode 100644 owl-bot-staging/google-cloud-firestore-admin-v1/snippets/firestore_admin/restore_database.rb delete mode 100644 owl-bot-staging/google-cloud-firestore-admin-v1/snippets/firestore_admin/update_backup_schedule.rb delete mode 100644 owl-bot-staging/google-cloud-firestore-admin-v1/snippets/firestore_admin/update_database.rb delete mode 100644 owl-bot-staging/google-cloud-firestore-admin-v1/snippets/firestore_admin/update_field.rb delete mode 100644 owl-bot-staging/google-cloud-firestore-admin-v1/snippets/snippet_metadata_google.firestore.admin.v1.json delete mode 100644 owl-bot-staging/google-cloud-firestore-admin-v1/test/google/cloud/firestore/admin/v1/firestore_admin_operations_test.rb delete mode 100644 owl-bot-staging/google-cloud-firestore-admin-v1/test/google/cloud/firestore/admin/v1/firestore_admin_paths_test.rb delete mode 100644 owl-bot-staging/google-cloud-firestore-admin-v1/test/google/cloud/firestore/admin/v1/firestore_admin_rest_test.rb delete mode 100644 owl-bot-staging/google-cloud-firestore-admin-v1/test/google/cloud/firestore/admin/v1/firestore_admin_test.rb delete mode 100644 owl-bot-staging/google-cloud-firestore-admin-v1/test/helper.rb diff --git a/google-cloud-firestore-admin-v1/lib/google/firestore/admin/v1/index_pb.rb b/google-cloud-firestore-admin-v1/lib/google/firestore/admin/v1/index_pb.rb index 78eb22836fbf..8546b2d72ce6 100644 --- a/google-cloud-firestore-admin-v1/lib/google/firestore/admin/v1/index_pb.rb +++ b/google-cloud-firestore-admin-v1/lib/google/firestore/admin/v1/index_pb.rb @@ -4,10 +4,11 @@ require 'google/protobuf' +require 'google/api/field_behavior_pb' require 'google/api/resource_pb' -descriptor_data = "\n%google/firestore/admin/v1/index.proto\x12\x19google.firestore.admin.v1\x1a\x19google/api/resource.proto\"\xac\x07\n\x05Index\x12\x0c\n\x04name\x18\x01 \x01(\t\x12@\n\x0bquery_scope\x18\x02 \x01(\x0e\x32+.google.firestore.admin.v1.Index.QueryScope\x12<\n\tapi_scope\x18\x05 \x01(\x0e\x32).google.firestore.admin.v1.Index.ApiScope\x12;\n\x06\x66ields\x18\x03 \x03(\x0b\x32+.google.firestore.admin.v1.Index.IndexField\x12\x35\n\x05state\x18\x04 \x01(\x0e\x32&.google.firestore.admin.v1.Index.State\x1a\xbd\x02\n\nIndexField\x12\x12\n\nfield_path\x18\x01 \x01(\t\x12\x42\n\x05order\x18\x02 \x01(\x0e\x32\x31.google.firestore.admin.v1.Index.IndexField.OrderH\x00\x12O\n\x0c\x61rray_config\x18\x03 \x01(\x0e\x32\x37.google.firestore.admin.v1.Index.IndexField.ArrayConfigH\x00\"=\n\x05Order\x12\x15\n\x11ORDER_UNSPECIFIED\x10\x00\x12\r\n\tASCENDING\x10\x01\x12\x0e\n\nDESCENDING\x10\x02\"9\n\x0b\x41rrayConfig\x12\x1c\n\x18\x41RRAY_CONFIG_UNSPECIFIED\x10\x00\x12\x0c\n\x08\x43ONTAINS\x10\x01\x42\x0c\n\nvalue_mode\"i\n\nQueryScope\x12\x1b\n\x17QUERY_SCOPE_UNSPECIFIED\x10\x00\x12\x0e\n\nCOLLECTION\x10\x01\x12\x14\n\x10\x43OLLECTION_GROUP\x10\x02\x12\x18\n\x14\x43OLLECTION_RECURSIVE\x10\x03\"/\n\x08\x41piScope\x12\x0b\n\x07\x41NY_API\x10\x00\x12\x16\n\x12\x44\x41TASTORE_MODE_API\x10\x01\"I\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0c\n\x08\x43REATING\x10\x01\x12\t\n\x05READY\x10\x02\x12\x10\n\x0cNEEDS_REPAIR\x10\x03:z\xea\x41w\n\x1e\x66irestore.googleapis.com/Index\x12Uprojects/{project}/databases/{database}/collectionGroups/{collection}/indexes/{index}B\xd9\x01\n\x1d\x63om.google.firestore.admin.v1B\nIndexProtoP\x01Z9cloud.google.com/go/firestore/apiv1/admin/adminpb;adminpb\xa2\x02\x04GCFS\xaa\x02\x1fGoogle.Cloud.Firestore.Admin.V1\xca\x02\x1fGoogle\\Cloud\\Firestore\\Admin\\V1\xea\x02#Google::Cloud::Firestore::Admin::V1b\x06proto3" +descriptor_data = "\n%google/firestore/admin/v1/index.proto\x12\x19google.firestore.admin.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\"\x91\t\n\x05Index\x12\x0c\n\x04name\x18\x01 \x01(\t\x12@\n\x0bquery_scope\x18\x02 \x01(\x0e\x32+.google.firestore.admin.v1.Index.QueryScope\x12<\n\tapi_scope\x18\x05 \x01(\x0e\x32).google.firestore.admin.v1.Index.ApiScope\x12;\n\x06\x66ields\x18\x03 \x03(\x0b\x32+.google.firestore.admin.v1.Index.IndexField\x12\x35\n\x05state\x18\x04 \x01(\x0e\x32&.google.firestore.admin.v1.Index.State\x1a\xa2\x04\n\nIndexField\x12\x12\n\nfield_path\x18\x01 \x01(\t\x12\x42\n\x05order\x18\x02 \x01(\x0e\x32\x31.google.firestore.admin.v1.Index.IndexField.OrderH\x00\x12O\n\x0c\x61rray_config\x18\x03 \x01(\x0e\x32\x37.google.firestore.admin.v1.Index.IndexField.ArrayConfigH\x00\x12Q\n\rvector_config\x18\x04 \x01(\x0b\x32\x38.google.firestore.admin.v1.Index.IndexField.VectorConfigH\x00\x1a\x8f\x01\n\x0cVectorConfig\x12\x16\n\tdimension\x18\x01 \x01(\x05\x42\x03\xe0\x41\x02\x12R\n\x04\x66lat\x18\x02 \x01(\x0b\x32\x42.google.firestore.admin.v1.Index.IndexField.VectorConfig.FlatIndexH\x00\x1a\x0b\n\tFlatIndexB\x06\n\x04type\"=\n\x05Order\x12\x15\n\x11ORDER_UNSPECIFIED\x10\x00\x12\r\n\tASCENDING\x10\x01\x12\x0e\n\nDESCENDING\x10\x02\"9\n\x0b\x41rrayConfig\x12\x1c\n\x18\x41RRAY_CONFIG_UNSPECIFIED\x10\x00\x12\x0c\n\x08\x43ONTAINS\x10\x01\x42\x0c\n\nvalue_mode\"i\n\nQueryScope\x12\x1b\n\x17QUERY_SCOPE_UNSPECIFIED\x10\x00\x12\x0e\n\nCOLLECTION\x10\x01\x12\x14\n\x10\x43OLLECTION_GROUP\x10\x02\x12\x18\n\x14\x43OLLECTION_RECURSIVE\x10\x03\"/\n\x08\x41piScope\x12\x0b\n\x07\x41NY_API\x10\x00\x12\x16\n\x12\x44\x41TASTORE_MODE_API\x10\x01\"I\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0c\n\x08\x43REATING\x10\x01\x12\t\n\x05READY\x10\x02\x12\x10\n\x0cNEEDS_REPAIR\x10\x03:z\xea\x41w\n\x1e\x66irestore.googleapis.com/Index\x12Uprojects/{project}/databases/{database}/collectionGroups/{collection}/indexes/{index}B\xd9\x01\n\x1d\x63om.google.firestore.admin.v1B\nIndexProtoP\x01Z9cloud.google.com/go/firestore/apiv1/admin/adminpb;adminpb\xa2\x02\x04GCFS\xaa\x02\x1fGoogle.Cloud.Firestore.Admin.V1\xca\x02\x1fGoogle\\Cloud\\Firestore\\Admin\\V1\xea\x02#Google::Cloud::Firestore::Admin::V1b\x06proto3" pool = Google::Protobuf::DescriptorPool.generated_pool @@ -40,6 +41,8 @@ module Admin module V1 Index = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.firestore.admin.v1.Index").msgclass Index::IndexField = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.firestore.admin.v1.Index.IndexField").msgclass + Index::IndexField::VectorConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.firestore.admin.v1.Index.IndexField.VectorConfig").msgclass + Index::IndexField::VectorConfig::FlatIndex = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.firestore.admin.v1.Index.IndexField.VectorConfig.FlatIndex").msgclass Index::IndexField::Order = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.firestore.admin.v1.Index.IndexField.Order").enummodule Index::IndexField::ArrayConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.firestore.admin.v1.Index.IndexField.ArrayConfig").enummodule Index::QueryScope = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.firestore.admin.v1.Index.QueryScope").enummodule diff --git a/google-cloud-firestore-admin-v1/proto_docs/google/firestore/admin/v1/index.rb b/google-cloud-firestore-admin-v1/proto_docs/google/firestore/admin/v1/index.rb index 59c3db7693b5..a31ddc8e9a83 100644 --- a/google-cloud-firestore-admin-v1/proto_docs/google/firestore/admin/v1/index.rb +++ b/google-cloud-firestore-admin-v1/proto_docs/google/firestore/admin/v1/index.rb @@ -77,10 +77,36 @@ class Index # @!attribute [rw] array_config # @return [::Google::Cloud::Firestore::Admin::V1::Index::IndexField::ArrayConfig] # Indicates that this field supports operations on `array_value`s. + # @!attribute [rw] vector_config + # @return [::Google::Cloud::Firestore::Admin::V1::Index::IndexField::VectorConfig] + # Indicates that this field supports nearest neighbors and distance + # operations on vector. class IndexField include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods + # The index configuration to support vector search operations + # @!attribute [rw] dimension + # @return [::Integer] + # Required. The vector dimension this configuration applies to. + # + # The resulting index will only include vectors of this dimension, and + # can be used for vector search with the same dimension. + # @!attribute [rw] flat + # @return [::Google::Cloud::Firestore::Admin::V1::Index::IndexField::VectorConfig::FlatIndex] + # Indicates the vector index is a flat index. + class VectorConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # An index that stores vectors in a flat data structure, and supports + # exhaustive search. + class FlatIndex + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + # The supported orderings. module Order # The ordering is unspecified. Not a valid option. diff --git a/owl-bot-staging/google-cloud-firestore-admin-v1/.gitignore b/owl-bot-staging/google-cloud-firestore-admin-v1/.gitignore deleted file mode 100644 index 0135b6bc6cfc..000000000000 --- a/owl-bot-staging/google-cloud-firestore-admin-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-firestore-admin-v1/.repo-metadata.json b/owl-bot-staging/google-cloud-firestore-admin-v1/.repo-metadata.json deleted file mode 100644 index 5fe9788514ab..000000000000 --- a/owl-bot-staging/google-cloud-firestore-admin-v1/.repo-metadata.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "api_id": "firestore.googleapis.com", - "api_shortname": "firestore", - "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-firestore-admin-v1/latest", - "distribution_name": "google-cloud-firestore-admin-v1", - "is_cloud": true, - "language": "ruby", - "name": "firestore", - "name_pretty": "Cloud Firestore Admin V1 API", - "product_documentation": "https://cloud.google.com/firestore", - "release_level": "unreleased", - "repo": "googleapis/google-cloud-ruby", - "requires_billing": true, - "ruby-cloud-description": "Cloud Firestore is a NoSQL document database built for automatic scaling, high performance, and ease of application development. Note that google-cloud-firestore-admin-v1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-firestore-admin instead. See the readme for more details.", - "ruby-cloud-env-prefix": "FIRESTORE", - "ruby-cloud-product-url": "https://cloud.google.com/firestore", - "library_type": "GAPIC_AUTO" -} diff --git a/owl-bot-staging/google-cloud-firestore-admin-v1/.rubocop.yml b/owl-bot-staging/google-cloud-firestore-admin-v1/.rubocop.yml deleted file mode 100644 index 8cc38d8fdd28..000000000000 --- a/owl-bot-staging/google-cloud-firestore-admin-v1/.rubocop.yml +++ /dev/null @@ -1,33 +0,0 @@ -inherit_gem: - google-style: google-style.yml - -AllCops: - Exclude: - - "google-cloud-firestore-admin-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-firestore-admin-v1.rb" diff --git a/owl-bot-staging/google-cloud-firestore-admin-v1/.toys.rb b/owl-bot-staging/google-cloud-firestore-admin-v1/.toys.rb deleted file mode 100644 index 23434bdd5d5b..000000000000 --- a/owl-bot-staging/google-cloud-firestore-admin-v1/.toys.rb +++ /dev/null @@ -1,28 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 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-firestore-admin-v1/.yardopts b/owl-bot-staging/google-cloud-firestore-admin-v1/.yardopts deleted file mode 100644 index 6eb0d4f42a37..000000000000 --- a/owl-bot-staging/google-cloud-firestore-admin-v1/.yardopts +++ /dev/null @@ -1,12 +0,0 @@ ---no-private ---title="Cloud Firestore 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-firestore-admin-v1/AUTHENTICATION.md b/owl-bot-staging/google-cloud-firestore-admin-v1/AUTHENTICATION.md deleted file mode 100644 index 8143a0bdf549..000000000000 --- a/owl-bot-staging/google-cloud-firestore-admin-v1/AUTHENTICATION.md +++ /dev/null @@ -1,122 +0,0 @@ -# Authentication - -The recommended way to authenticate to the google-cloud-firestore-admin-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-firestore-admin-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/firestore/admin/v1" - -client = ::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client.new do |config| - config.credentials = "path/to/credentialfile.json" -end -``` - -To configure a credentials file globally for all clients: - -```ruby -require "google/cloud/firestore/admin/v1" - -::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client.configure do |config| - config.credentials = "path/to/credentialfile.json" -end - -client = ::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::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-firestore-admin-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/firestore/admin/v1" - -ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" - -client = ::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::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-firestore-admin-v1/CHANGELOG.md b/owl-bot-staging/google-cloud-firestore-admin-v1/CHANGELOG.md deleted file mode 100644 index f88957a62ba2..000000000000 --- a/owl-bot-staging/google-cloud-firestore-admin-v1/CHANGELOG.md +++ /dev/null @@ -1,2 +0,0 @@ -# Release History - diff --git a/owl-bot-staging/google-cloud-firestore-admin-v1/Gemfile b/owl-bot-staging/google-cloud-firestore-admin-v1/Gemfile deleted file mode 100644 index 95163a6d11f8..000000000000 --- a/owl-bot-staging/google-cloud-firestore-admin-v1/Gemfile +++ /dev/null @@ -1,11 +0,0 @@ -source "https://rubygems.org" - -gemspec - -gem "google-style", "~> 1.27.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-firestore-admin-v1/LICENSE.md b/owl-bot-staging/google-cloud-firestore-admin-v1/LICENSE.md deleted file mode 100644 index c261857ba6ad..000000000000 --- a/owl-bot-staging/google-cloud-firestore-admin-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-firestore-admin-v1/README.md b/owl-bot-staging/google-cloud-firestore-admin-v1/README.md deleted file mode 100644 index 651048031089..000000000000 --- a/owl-bot-staging/google-cloud-firestore-admin-v1/README.md +++ /dev/null @@ -1,144 +0,0 @@ -# Ruby Client for the Cloud Firestore Admin V1 API - -Accesses the NoSQL document database built for automatic scaling, high performance, and ease of application development. - -Cloud Firestore is a NoSQL document database built for automatic scaling, high performance, and ease of application development. - -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 Firestore Admin V1 API. Most users should consider using -the main client gem, -[google-cloud-firestore-admin](https://rubygems.org/gems/google-cloud-firestore-admin). -See the section below titled *Which client should I use?* for more information. - -## Installation - -``` -$ gem install google-cloud-firestore-admin-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/firestore.googleapis.com) -1. [Set up authentication.](AUTHENTICATION.md) - -## Quick Start - -```ruby -require "google/cloud/firestore/admin/v1" - -client = ::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client.new -request = ::Google::Cloud::Firestore::Admin::V1::CreateIndexRequest.new # (request fields as keyword arguments...) -response = client.create_index request -``` - -View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-firestore-admin-v1/latest) -for class and method documentation. - -See also the [Product Documentation](https://cloud.google.com/firestore) -for general usage information. - -## Enabling Logging - -To enable logging for this library, set the logger for the underlying [gRPC](https://github.com/grpc/grpc/tree/master/src/ruby) library. -The logger that you set may be a Ruby stdlib [`Logger`](https://ruby-doc.org/current/stdlibs/logger/Logger.html) as shown below, -or a [`Google::Cloud::Logging::Logger`](https://cloud.google.com/ruby/docs/reference/google-cloud-logging/latest) -that will write logs to [Cloud Logging](https://cloud.google.com/logging/). See [grpc/logconfig.rb](https://github.com/grpc/grpc/blob/master/src/ruby/lib/grpc/logconfig.rb) -and the gRPC [spec_helper.rb](https://github.com/grpc/grpc/blob/master/src/ruby/spec/spec_helper.rb) for additional information. - -Configuring a Ruby stdlib logger: - -```ruby -require "logger" - -module MyLogger - LOGGER = Logger.new $stderr, level: Logger::WARN - def logger - LOGGER - end -end - -# Define a gRPC module-level logger method before grpc/logconfig.rb loads. -module GRPC - extend MyLogger -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 2.7+. - -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-firestore-admin`, -and lower-level _versioned_ client libraries with names such as -`google-cloud-firestore-admin-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-firestore-admin`. -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-firestore-admin-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-firestore-admin-v1/Rakefile b/owl-bot-staging/google-cloud-firestore-admin-v1/Rakefile deleted file mode 100644 index faefa4f5948c..000000000000 --- a/owl-bot-staging/google-cloud-firestore-admin-v1/Rakefile +++ /dev/null @@ -1,169 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 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-firestore-admin-v1 acceptance tests." -task :acceptance, :project, :keyfile do |t, args| - project = args[:project] - project ||= - ENV["FIRESTORE_TEST_PROJECT"] || - ENV["GCLOUD_TEST_PROJECT"] - keyfile = args[:keyfile] - keyfile ||= - ENV["FIRESTORE_TEST_KEYFILE"] || - ENV["GCLOUD_TEST_KEYFILE"] - if keyfile - keyfile = File.read keyfile - else - keyfile ||= - ENV["FIRESTORE_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 FIRESTORE_TEST_PROJECT=test123 FIRESTORE_TEST_KEYFILE=/path/to/keyfile.json rake acceptance" - end - require "google/cloud/firestore/admin/v1/firestore_admin/credentials" - ::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Credentials.env_vars.each do |path| - ENV[path] = nil - end - ENV["FIRESTORE_PROJECT"] = project - ENV["FIRESTORE_TEST_PROJECT"] = project - ENV["FIRESTORE_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-firestore-admin-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-firestore-admin-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-firestore-admin-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-firestore-admin-v1 gem does not have doctest tests." -end - -desc "Run the CI build" -task :ci do - header "BUILDING google-cloud-firestore-admin-v1" - header "google-cloud-firestore-admin-v1 rubocop", "*" - Rake::Task[:rubocop].invoke - header "google-cloud-firestore-admin-v1 yard", "*" - Rake::Task[:yard].invoke - header "google-cloud-firestore-admin-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-firestore-admin-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-firestore-admin-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-firestore-admin-v1/gapic_metadata.json b/owl-bot-staging/google-cloud-firestore-admin-v1/gapic_metadata.json deleted file mode 100644 index d03cbc67e9fe..000000000000 --- a/owl-bot-staging/google-cloud-firestore-admin-v1/gapic_metadata.json +++ /dev/null @@ -1,133 +0,0 @@ -{ - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", - "language": "ruby", - "protoPackage": "google.firestore.admin.v1", - "libraryPackage": "::Google::Cloud::Firestore::Admin::V1", - "services": { - "FirestoreAdmin": { - "clients": { - "grpc": { - "libraryClient": "::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client", - "rpcs": { - "CreateIndex": { - "methods": [ - "create_index" - ] - }, - "ListIndexes": { - "methods": [ - "list_indexes" - ] - }, - "GetIndex": { - "methods": [ - "get_index" - ] - }, - "DeleteIndex": { - "methods": [ - "delete_index" - ] - }, - "GetField": { - "methods": [ - "get_field" - ] - }, - "UpdateField": { - "methods": [ - "update_field" - ] - }, - "ListFields": { - "methods": [ - "list_fields" - ] - }, - "ExportDocuments": { - "methods": [ - "export_documents" - ] - }, - "ImportDocuments": { - "methods": [ - "import_documents" - ] - }, - "CreateDatabase": { - "methods": [ - "create_database" - ] - }, - "GetDatabase": { - "methods": [ - "get_database" - ] - }, - "ListDatabases": { - "methods": [ - "list_databases" - ] - }, - "UpdateDatabase": { - "methods": [ - "update_database" - ] - }, - "DeleteDatabase": { - "methods": [ - "delete_database" - ] - }, - "GetBackup": { - "methods": [ - "get_backup" - ] - }, - "ListBackups": { - "methods": [ - "list_backups" - ] - }, - "DeleteBackup": { - "methods": [ - "delete_backup" - ] - }, - "RestoreDatabase": { - "methods": [ - "restore_database" - ] - }, - "CreateBackupSchedule": { - "methods": [ - "create_backup_schedule" - ] - }, - "GetBackupSchedule": { - "methods": [ - "get_backup_schedule" - ] - }, - "ListBackupSchedules": { - "methods": [ - "list_backup_schedules" - ] - }, - "UpdateBackupSchedule": { - "methods": [ - "update_backup_schedule" - ] - }, - "DeleteBackupSchedule": { - "methods": [ - "delete_backup_schedule" - ] - } - } - } - } - } - } -} diff --git a/owl-bot-staging/google-cloud-firestore-admin-v1/google-cloud-firestore-admin-v1.gemspec b/owl-bot-staging/google-cloud-firestore-admin-v1/google-cloud-firestore-admin-v1.gemspec deleted file mode 100644 index 1fee7e93bf83..000000000000 --- a/owl-bot-staging/google-cloud-firestore-admin-v1/google-cloud-firestore-admin-v1.gemspec +++ /dev/null @@ -1,29 +0,0 @@ -# -*- ruby -*- -# encoding: utf-8 - -require File.expand_path("lib/google/cloud/firestore/admin/v1/version", __dir__) - -Gem::Specification.new do |gem| - gem.name = "google-cloud-firestore-admin-v1" - gem.version = Google::Cloud::Firestore::Admin::V1::VERSION - - gem.authors = ["Google LLC"] - gem.email = "googleapis-packages@google.com" - gem.description = "Cloud Firestore is a NoSQL document database built for automatic scaling, high performance, and ease of application development. Note that google-cloud-firestore-admin-v1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-firestore-admin instead. See the readme for more details." - gem.summary = "Accesses the NoSQL document database built for automatic scaling, high performance, and ease of application development." - 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 = ">= 2.7" - - gem.add_dependency "gapic-common", ">= 0.21.1", "< 2.a" - gem.add_dependency "google-cloud-errors", "~> 1.0" - gem.add_dependency "google-cloud-location", ">= 0.7", "< 2.a" -end diff --git a/owl-bot-staging/google-cloud-firestore-admin-v1/lib/google-cloud-firestore-admin-v1.rb b/owl-bot-staging/google-cloud-firestore-admin-v1/lib/google-cloud-firestore-admin-v1.rb deleted file mode 100644 index 1bfa732ab41c..000000000000 --- a/owl-bot-staging/google-cloud-firestore-admin-v1/lib/google-cloud-firestore-admin-v1.rb +++ /dev/null @@ -1,21 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 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/firestore/admin/v1" diff --git a/owl-bot-staging/google-cloud-firestore-admin-v1/lib/google/cloud/firestore/admin/v1.rb b/owl-bot-staging/google-cloud-firestore-admin-v1/lib/google/cloud/firestore/admin/v1.rb deleted file mode 100644 index e27ad19a0821..000000000000 --- a/owl-bot-staging/google-cloud-firestore-admin-v1/lib/google/cloud/firestore/admin/v1.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 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/firestore/admin/v1/firestore_admin" -require "google/cloud/firestore/admin/v1/version" - -module Google - module Cloud - module Firestore - module Admin - ## - # API client module. - # - # @example Load this package, including all its services, and instantiate a gRPC client - # - # require "google/cloud/firestore/admin/v1" - # client = ::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client.new - # - # @example Load this package, including all its services, and instantiate a REST client - # - # require "google/cloud/firestore/admin/v1" - # client = ::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Rest::Client.new - # - module V1 - end - end - end - end -end - -helper_path = ::File.join __dir__, "v1", "_helpers.rb" -require "google/cloud/firestore/admin/v1/_helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-firestore-admin-v1/lib/google/cloud/firestore/admin/v1/firestore_admin.rb b/owl-bot-staging/google-cloud-firestore-admin-v1/lib/google/cloud/firestore/admin/v1/firestore_admin.rb deleted file mode 100644 index 8e676cd49717..000000000000 --- a/owl-bot-staging/google-cloud-firestore-admin-v1/lib/google/cloud/firestore/admin/v1/firestore_admin.rb +++ /dev/null @@ -1,85 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 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/firestore/admin/v1/version" - -require "google/cloud/firestore/admin/v1/firestore_admin/credentials" -require "google/cloud/firestore/admin/v1/firestore_admin/paths" -require "google/cloud/firestore/admin/v1/firestore_admin/operations" -require "google/cloud/firestore/admin/v1/firestore_admin/client" -require "google/cloud/firestore/admin/v1/firestore_admin/rest" - -module Google - module Cloud - module Firestore - module Admin - module V1 - ## - # The Cloud Firestore Admin API. - # - # This API provides several administrative services for Cloud Firestore. - # - # Project, Database, Namespace, Collection, Collection Group, and Document are - # used as defined in the Google Cloud Firestore API. - # - # Operation: An Operation represents work being performed in the background. - # - # The index service manages Cloud Firestore indexes. - # - # Index creation is performed asynchronously. - # An Operation resource is created for each such asynchronous operation. - # The state of the operation (including any errors encountered) - # may be queried via the Operation resource. - # - # The Operations collection provides a record of actions performed for the - # specified Project (including any Operations in progress). Operations are not - # created directly but through calls on other collections or resources. - # - # An Operation that is done may be deleted so that it is no longer listed as - # part of the Operation collection. Operations are garbage collected after - # 30 days. By default, ListOperations will only return in progress and failed - # operations. To list completed operation, issue a ListOperations request with - # the filter `done: true`. - # - # Operations are created by service `FirestoreAdmin`, but are accessed via - # service `google.longrunning.Operations`. - # - # @example Load this service and instantiate a gRPC client - # - # require "google/cloud/firestore/admin/v1/firestore_admin" - # client = ::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client.new - # - # @example Load this service and instantiate a REST client - # - # require "google/cloud/firestore/admin/v1/firestore_admin/rest" - # client = ::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Rest::Client.new - # - module FirestoreAdmin - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "firestore_admin", "helpers.rb" -require "google/cloud/firestore/admin/v1/firestore_admin/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-firestore-admin-v1/lib/google/cloud/firestore/admin/v1/firestore_admin/client.rb b/owl-bot-staging/google-cloud-firestore-admin-v1/lib/google/cloud/firestore/admin/v1/firestore_admin/client.rb deleted file mode 100644 index 292eb29e51a2..000000000000 --- a/owl-bot-staging/google-cloud-firestore-admin-v1/lib/google/cloud/firestore/admin/v1/firestore_admin/client.rb +++ /dev/null @@ -1,2806 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 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/firestore/admin/v1/firestore_admin_pb" -require "google/cloud/location" - -module Google - module Cloud - module Firestore - module Admin - module V1 - module FirestoreAdmin - ## - # Client for the FirestoreAdmin service. - # - # The Cloud Firestore Admin API. - # - # This API provides several administrative services for Cloud Firestore. - # - # Project, Database, Namespace, Collection, Collection Group, and Document are - # used as defined in the Google Cloud Firestore API. - # - # Operation: An Operation represents work being performed in the background. - # - # The index service manages Cloud Firestore indexes. - # - # Index creation is performed asynchronously. - # An Operation resource is created for each such asynchronous operation. - # The state of the operation (including any errors encountered) - # may be queried via the Operation resource. - # - # The Operations collection provides a record of actions performed for the - # specified Project (including any Operations in progress). Operations are not - # created directly but through calls on other collections or resources. - # - # An Operation that is done may be deleted so that it is no longer listed as - # part of the Operation collection. Operations are garbage collected after - # 30 days. By default, ListOperations will only return in progress and failed - # operations. To list completed operation, issue a ListOperations request with - # the filter `done: true`. - # - # Operations are created by service `FirestoreAdmin`, but are accessed via - # service `google.longrunning.Operations`. - # - class Client - # @private - DEFAULT_ENDPOINT_TEMPLATE = "firestore.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :firestore_admin_stub - - ## - # Configure the FirestoreAdmin Client class. - # - # See {::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all FirestoreAdmin clients - # ::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::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", "Firestore", "Admin", "V1"] - parent_config = while namespace.any? - parent_name = namespace.join "::" - parent_const = const_get parent_name - break parent_const.configure if parent_const.respond_to? :configure - namespace.pop - end - default_config = Client::Configuration.new parent_config - - default_config.rpcs.create_index.timeout = 60.0 - - default_config.rpcs.list_indexes.timeout = 60.0 - default_config.rpcs.list_indexes.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 13, 4] - } - - default_config.rpcs.get_index.timeout = 60.0 - default_config.rpcs.get_index.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 13, 4] - } - - default_config.rpcs.delete_index.timeout = 60.0 - default_config.rpcs.delete_index.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 13, 4] - } - - default_config.rpcs.get_field.timeout = 60.0 - default_config.rpcs.get_field.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 13, 4] - } - - default_config.rpcs.update_field.timeout = 60.0 - - default_config.rpcs.list_fields.timeout = 60.0 - default_config.rpcs.list_fields.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 13, 4] - } - - default_config.rpcs.export_documents.timeout = 60.0 - - default_config.rpcs.import_documents.timeout = 60.0 - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the FirestoreAdmin 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::Firestore::Admin::V1::FirestoreAdmin::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 - @firestore_admin_stub.universe_domain - end - - ## - # Create a new FirestoreAdmin client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the FirestoreAdmin 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/firestore/admin/v1/firestore_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 - - @firestore_admin_stub = ::Gapic::ServiceStub.new( - ::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::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 - ) - - @location_client = Google::Cloud::Location::Locations::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @firestore_admin_stub.endpoint - config.universe_domain = @firestore_admin_stub.universe_domain - end - end - - ## - # Get the associated client for long-running operations. - # - # @return [::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Operations] - # - attr_reader :operations_client - - ## - # Get the associated client for mix-in of the Locations. - # - # @return [Google::Cloud::Location::Locations::Client] - # - attr_reader :location_client - - # Service calls - - ## - # Creates a composite index. This returns a - # {::Google::Longrunning::Operation google.longrunning.Operation} which may be - # used to track the status of the creation. The metadata for the operation - # will be the type - # {::Google::Cloud::Firestore::Admin::V1::IndexOperationMetadata IndexOperationMetadata}. - # - # @overload create_index(request, options = nil) - # Pass arguments to `create_index` via a request object, either of type - # {::Google::Cloud::Firestore::Admin::V1::CreateIndexRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Firestore::Admin::V1::CreateIndexRequest, ::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_index(parent: nil, index: nil) - # Pass arguments to `create_index` 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. A parent name of the form - # `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}` - # @param index [::Google::Cloud::Firestore::Admin::V1::Index, ::Hash] - # Required. The composite index to create. - # - # @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/firestore/admin/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Firestore::Admin::V1::CreateIndexRequest.new - # - # # Call the create_index method. - # result = client.create_index 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_index request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Firestore::Admin::V1::CreateIndexRequest - - # 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_index.metadata.to_h - - # Set x-goog-api-client and x-goog-user-project 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::Firestore::Admin::V1::VERSION - 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_index.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_index.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @firestore_admin_stub.call_rpc :create_index, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Lists composite indexes. - # - # @overload list_indexes(request, options = nil) - # Pass arguments to `list_indexes` via a request object, either of type - # {::Google::Cloud::Firestore::Admin::V1::ListIndexesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Firestore::Admin::V1::ListIndexesRequest, ::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_indexes(parent: nil, filter: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_indexes` 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. A parent name of the form - # `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}` - # @param filter [::String] - # The filter to apply to list results. - # @param page_size [::Integer] - # The number of results to return. - # @param page_token [::String] - # A page token, returned from a previous call to - # {::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client#list_indexes FirestoreAdmin.ListIndexes}, - # that may be used to get the next page of results. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Firestore::Admin::V1::Index>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::Firestore::Admin::V1::Index>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/firestore/admin/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Firestore::Admin::V1::ListIndexesRequest.new - # - # # Call the list_indexes method. - # result = client.list_indexes 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::Firestore::Admin::V1::Index. - # p item - # end - # - def list_indexes request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Firestore::Admin::V1::ListIndexesRequest - - # 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_indexes.metadata.to_h - - # Set x-goog-api-client and x-goog-user-project 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::Firestore::Admin::V1::VERSION - 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_indexes.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_indexes.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @firestore_admin_stub.call_rpc :list_indexes, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @firestore_admin_stub, :list_indexes, request, response, operation, options - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets a composite index. - # - # @overload get_index(request, options = nil) - # Pass arguments to `get_index` via a request object, either of type - # {::Google::Cloud::Firestore::Admin::V1::GetIndexRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Firestore::Admin::V1::GetIndexRequest, ::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_index(name: nil) - # Pass arguments to `get_index` 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. A name of the form - # `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/indexes/{index_id}` - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Firestore::Admin::V1::Index] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Firestore::Admin::V1::Index] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/firestore/admin/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Firestore::Admin::V1::GetIndexRequest.new - # - # # Call the get_index method. - # result = client.get_index request - # - # # The returned object is of type Google::Cloud::Firestore::Admin::V1::Index. - # p result - # - def get_index request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Firestore::Admin::V1::GetIndexRequest - - # 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_index.metadata.to_h - - # Set x-goog-api-client and x-goog-user-project 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::Firestore::Admin::V1::VERSION - 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_index.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_index.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @firestore_admin_stub.call_rpc :get_index, request, options: options do |response, operation| - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes a composite index. - # - # @overload delete_index(request, options = nil) - # Pass arguments to `delete_index` via a request object, either of type - # {::Google::Cloud::Firestore::Admin::V1::DeleteIndexRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Firestore::Admin::V1::DeleteIndexRequest, ::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_index(name: nil) - # Pass arguments to `delete_index` 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. A name of the form - # `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/indexes/{index_id}` - # - # @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/firestore/admin/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Firestore::Admin::V1::DeleteIndexRequest.new - # - # # Call the delete_index method. - # result = client.delete_index request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_index request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Firestore::Admin::V1::DeleteIndexRequest - - # 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_index.metadata.to_h - - # Set x-goog-api-client and x-goog-user-project 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::Firestore::Admin::V1::VERSION - 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_index.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_index.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @firestore_admin_stub.call_rpc :delete_index, request, options: options do |response, operation| - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets the metadata and configuration for a Field. - # - # @overload get_field(request, options = nil) - # Pass arguments to `get_field` via a request object, either of type - # {::Google::Cloud::Firestore::Admin::V1::GetFieldRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Firestore::Admin::V1::GetFieldRequest, ::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_field(name: nil) - # Pass arguments to `get_field` 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. A name of the form - # `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/fields/{field_id}` - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Firestore::Admin::V1::Field] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Firestore::Admin::V1::Field] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/firestore/admin/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Firestore::Admin::V1::GetFieldRequest.new - # - # # Call the get_field method. - # result = client.get_field request - # - # # The returned object is of type Google::Cloud::Firestore::Admin::V1::Field. - # p result - # - def get_field request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Firestore::Admin::V1::GetFieldRequest - - # 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_field.metadata.to_h - - # Set x-goog-api-client and x-goog-user-project 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::Firestore::Admin::V1::VERSION - 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_field.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_field.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @firestore_admin_stub.call_rpc :get_field, request, options: options do |response, operation| - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Updates a field configuration. Currently, field updates apply only to - # single field index configuration. However, calls to - # {::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client#update_field FirestoreAdmin.UpdateField} - # should provide a field mask to avoid changing any configuration that the - # caller isn't aware of. The field mask should be specified as: `{ paths: - # "index_config" }`. - # - # This call returns a - # {::Google::Longrunning::Operation google.longrunning.Operation} which may be - # used to track the status of the field update. The metadata for the - # operation will be the type - # {::Google::Cloud::Firestore::Admin::V1::FieldOperationMetadata FieldOperationMetadata}. - # - # To configure the default field settings for the database, use - # the special `Field` with resource name: - # `projects/{project_id}/databases/{database_id}/collectionGroups/__default__/fields/*`. - # - # @overload update_field(request, options = nil) - # Pass arguments to `update_field` via a request object, either of type - # {::Google::Cloud::Firestore::Admin::V1::UpdateFieldRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Firestore::Admin::V1::UpdateFieldRequest, ::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_field(field: nil, update_mask: nil) - # Pass arguments to `update_field` 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 field [::Google::Cloud::Firestore::Admin::V1::Field, ::Hash] - # Required. The field to be updated. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # A mask, relative to the field. If specified, only configuration specified - # by this field_mask will be updated in the field. - # - # @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/firestore/admin/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Firestore::Admin::V1::UpdateFieldRequest.new - # - # # Call the update_field method. - # result = client.update_field 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_field request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Firestore::Admin::V1::UpdateFieldRequest - - # 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_field.metadata.to_h - - # Set x-goog-api-client and x-goog-user-project 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::Firestore::Admin::V1::VERSION - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.field&.name - header_params["field.name"] = request.field.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_field.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_field.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @firestore_admin_stub.call_rpc :update_field, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Lists the field configuration and metadata for this database. - # - # Currently, - # {::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client#list_fields FirestoreAdmin.ListFields} - # only supports listing fields that have been explicitly overridden. To issue - # this query, call - # {::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client#list_fields FirestoreAdmin.ListFields} - # with the filter set to `indexConfig.usesAncestorConfig:false` or - # `ttlConfig:*`. - # - # @overload list_fields(request, options = nil) - # Pass arguments to `list_fields` via a request object, either of type - # {::Google::Cloud::Firestore::Admin::V1::ListFieldsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Firestore::Admin::V1::ListFieldsRequest, ::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_fields(parent: nil, filter: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_fields` 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. A parent name of the form - # `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}` - # @param filter [::String] - # The filter to apply to list results. Currently, - # {::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client#list_fields FirestoreAdmin.ListFields} - # only supports listing fields that have been explicitly overridden. To issue - # this query, call - # {::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client#list_fields FirestoreAdmin.ListFields} - # with a filter that includes `indexConfig.usesAncestorConfig:false` . - # @param page_size [::Integer] - # The number of results to return. - # @param page_token [::String] - # A page token, returned from a previous call to - # {::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client#list_fields FirestoreAdmin.ListFields}, - # that may be used to get the next page of results. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Firestore::Admin::V1::Field>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::Firestore::Admin::V1::Field>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/firestore/admin/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Firestore::Admin::V1::ListFieldsRequest.new - # - # # Call the list_fields method. - # result = client.list_fields 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::Firestore::Admin::V1::Field. - # p item - # end - # - def list_fields request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Firestore::Admin::V1::ListFieldsRequest - - # 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_fields.metadata.to_h - - # Set x-goog-api-client and x-goog-user-project 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::Firestore::Admin::V1::VERSION - 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_fields.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_fields.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @firestore_admin_stub.call_rpc :list_fields, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @firestore_admin_stub, :list_fields, request, response, operation, options - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Exports a copy of all or a subset of documents from Google Cloud Firestore - # to another storage system, such as Google Cloud Storage. Recent updates to - # documents may not be reflected in the export. The export occurs in the - # background and its progress can be monitored and managed via the - # Operation resource that is created. The output of an export may only be - # used once the associated operation is done. If an export operation is - # cancelled before completion it may leave partial data behind in Google - # Cloud Storage. - # - # For more details on export behavior and output format, refer to: - # https://cloud.google.com/firestore/docs/manage-data/export-import - # - # @overload export_documents(request, options = nil) - # Pass arguments to `export_documents` via a request object, either of type - # {::Google::Cloud::Firestore::Admin::V1::ExportDocumentsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Firestore::Admin::V1::ExportDocumentsRequest, ::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 export_documents(name: nil, collection_ids: nil, output_uri_prefix: nil, namespace_ids: nil, snapshot_time: nil) - # Pass arguments to `export_documents` 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. Database to export. Should be of the form: - # `projects/{project_id}/databases/{database_id}`. - # @param collection_ids [::Array<::String>] - # Which collection ids to export. Unspecified means all collections. - # @param output_uri_prefix [::String] - # The output URI. Currently only supports Google Cloud Storage URIs of the - # form: `gs://BUCKET_NAME[/NAMESPACE_PATH]`, where `BUCKET_NAME` is the name - # of the Google Cloud Storage bucket and `NAMESPACE_PATH` is an optional - # Google Cloud Storage namespace path. When - # choosing a name, be sure to consider Google Cloud Storage naming - # guidelines: https://cloud.google.com/storage/docs/naming. - # If the URI is a bucket (without a namespace path), a prefix will be - # generated based on the start time. - # @param namespace_ids [::Array<::String>] - # An empty list represents all namespaces. This is the preferred - # usage for databases that don't use namespaces. - # - # An empty string element represents the default namespace. This should be - # used if the database has data in non-default namespaces, but doesn't want - # to include them. Each namespace in this list must be unique. - # @param snapshot_time [::Google::Protobuf::Timestamp, ::Hash] - # The timestamp that corresponds to the version of the database to be - # exported. The timestamp must be in the past, rounded to the minute and not - # older than - # {::Google::Cloud::Firestore::Admin::V1::Database#earliest_version_time earliestVersionTime}. - # If specified, then the exported documents will represent a consistent view - # of the database at the provided time. Otherwise, there are no guarantees - # about the consistency of the exported documents. - # - # @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/firestore/admin/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Firestore::Admin::V1::ExportDocumentsRequest.new - # - # # Call the export_documents method. - # result = client.export_documents 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 export_documents request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Firestore::Admin::V1::ExportDocumentsRequest - - # 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.export_documents.metadata.to_h - - # Set x-goog-api-client and x-goog-user-project 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::Firestore::Admin::V1::VERSION - 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.export_documents.timeout, - metadata: metadata, - retry_policy: @config.rpcs.export_documents.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @firestore_admin_stub.call_rpc :export_documents, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Imports documents into Google Cloud Firestore. Existing documents with the - # same name are overwritten. The import occurs in the background and its - # progress can be monitored and managed via the Operation resource that is - # created. If an ImportDocuments operation is cancelled, it is possible - # that a subset of the data has already been imported to Cloud Firestore. - # - # @overload import_documents(request, options = nil) - # Pass arguments to `import_documents` via a request object, either of type - # {::Google::Cloud::Firestore::Admin::V1::ImportDocumentsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Firestore::Admin::V1::ImportDocumentsRequest, ::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 import_documents(name: nil, collection_ids: nil, input_uri_prefix: nil, namespace_ids: nil) - # Pass arguments to `import_documents` 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. Database to import into. Should be of the form: - # `projects/{project_id}/databases/{database_id}`. - # @param collection_ids [::Array<::String>] - # Which collection ids to import. Unspecified means all collections included - # in the import. - # @param input_uri_prefix [::String] - # Location of the exported files. - # This must match the output_uri_prefix of an ExportDocumentsResponse from - # an export that has completed successfully. - # See: - # {::Google::Cloud::Firestore::Admin::V1::ExportDocumentsResponse#output_uri_prefix google.firestore.admin.v1.ExportDocumentsResponse.output_uri_prefix}. - # @param namespace_ids [::Array<::String>] - # An empty list represents all namespaces. This is the preferred - # usage for databases that don't use namespaces. - # - # An empty string element represents the default namespace. This should be - # used if the database has data in non-default namespaces, but doesn't want - # to include them. Each namespace in this list must be unique. - # - # @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/firestore/admin/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Firestore::Admin::V1::ImportDocumentsRequest.new - # - # # Call the import_documents method. - # result = client.import_documents 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 import_documents request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Firestore::Admin::V1::ImportDocumentsRequest - - # 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.import_documents.metadata.to_h - - # Set x-goog-api-client and x-goog-user-project 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::Firestore::Admin::V1::VERSION - 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.import_documents.timeout, - metadata: metadata, - retry_policy: @config.rpcs.import_documents.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @firestore_admin_stub.call_rpc :import_documents, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Create a database. - # - # @overload create_database(request, options = nil) - # Pass arguments to `create_database` via a request object, either of type - # {::Google::Cloud::Firestore::Admin::V1::CreateDatabaseRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Firestore::Admin::V1::CreateDatabaseRequest, ::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_database(parent: nil, database: nil, database_id: nil) - # Pass arguments to `create_database` 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. A parent name of the form - # `projects/{project_id}` - # @param database [::Google::Cloud::Firestore::Admin::V1::Database, ::Hash] - # Required. The Database to create. - # @param database_id [::String] - # Required. The ID to use for the database, which will become the final - # component of the database's resource name. - # - # This value should be 4-63 characters. Valid characters are /[a-z][0-9]-/ - # with first character a letter and the last a letter or a number. Must not - # be UUID-like /[0-9a-f]\\{8}(-[0-9a-f]\\{4})\\{3}-[0-9a-f]\\{12}/. - # - # "(default)" database id is also valid. - # - # @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/firestore/admin/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Firestore::Admin::V1::CreateDatabaseRequest.new - # - # # Call the create_database method. - # result = client.create_database 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_database request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Firestore::Admin::V1::CreateDatabaseRequest - - # 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_database.metadata.to_h - - # Set x-goog-api-client and x-goog-user-project 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::Firestore::Admin::V1::VERSION - 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_database.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_database.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @firestore_admin_stub.call_rpc :create_database, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets information about a database. - # - # @overload get_database(request, options = nil) - # Pass arguments to `get_database` via a request object, either of type - # {::Google::Cloud::Firestore::Admin::V1::GetDatabaseRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Firestore::Admin::V1::GetDatabaseRequest, ::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_database(name: nil) - # Pass arguments to `get_database` 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. A name of the form - # `projects/{project_id}/databases/{database_id}` - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Firestore::Admin::V1::Database] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Firestore::Admin::V1::Database] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/firestore/admin/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Firestore::Admin::V1::GetDatabaseRequest.new - # - # # Call the get_database method. - # result = client.get_database request - # - # # The returned object is of type Google::Cloud::Firestore::Admin::V1::Database. - # p result - # - def get_database request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Firestore::Admin::V1::GetDatabaseRequest - - # 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_database.metadata.to_h - - # Set x-goog-api-client and x-goog-user-project 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::Firestore::Admin::V1::VERSION - 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_database.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_database.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @firestore_admin_stub.call_rpc :get_database, request, options: options do |response, operation| - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # List all the databases in the project. - # - # @overload list_databases(request, options = nil) - # Pass arguments to `list_databases` via a request object, either of type - # {::Google::Cloud::Firestore::Admin::V1::ListDatabasesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Firestore::Admin::V1::ListDatabasesRequest, ::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_databases(parent: nil) - # Pass arguments to `list_databases` 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. A parent name of the form - # `projects/{project_id}` - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Firestore::Admin::V1::ListDatabasesResponse] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Firestore::Admin::V1::ListDatabasesResponse] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/firestore/admin/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Firestore::Admin::V1::ListDatabasesRequest.new - # - # # Call the list_databases method. - # result = client.list_databases request - # - # # The returned object is of type Google::Cloud::Firestore::Admin::V1::ListDatabasesResponse. - # p result - # - def list_databases request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Firestore::Admin::V1::ListDatabasesRequest - - # 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_databases.metadata.to_h - - # Set x-goog-api-client and x-goog-user-project 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::Firestore::Admin::V1::VERSION - 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_databases.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_databases.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @firestore_admin_stub.call_rpc :list_databases, request, options: options do |response, operation| - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Updates a database. - # - # @overload update_database(request, options = nil) - # Pass arguments to `update_database` via a request object, either of type - # {::Google::Cloud::Firestore::Admin::V1::UpdateDatabaseRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Firestore::Admin::V1::UpdateDatabaseRequest, ::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_database(database: nil, update_mask: nil) - # Pass arguments to `update_database` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param database [::Google::Cloud::Firestore::Admin::V1::Database, ::Hash] - # Required. The database to update. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # The list of fields to be updated. - # - # @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/firestore/admin/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Firestore::Admin::V1::UpdateDatabaseRequest.new - # - # # Call the update_database method. - # result = client.update_database 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_database request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Firestore::Admin::V1::UpdateDatabaseRequest - - # 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_database.metadata.to_h - - # Set x-goog-api-client and x-goog-user-project 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::Firestore::Admin::V1::VERSION - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.database&.name - header_params["database.name"] = request.database.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_database.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_database.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @firestore_admin_stub.call_rpc :update_database, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes a database. - # - # @overload delete_database(request, options = nil) - # Pass arguments to `delete_database` via a request object, either of type - # {::Google::Cloud::Firestore::Admin::V1::DeleteDatabaseRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Firestore::Admin::V1::DeleteDatabaseRequest, ::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_database(name: nil, etag: nil) - # Pass arguments to `delete_database` 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. A name of the form - # `projects/{project_id}/databases/{database_id}` - # @param etag [::String] - # The current etag of the Database. - # If an etag is provided and does not match the current etag of the database, - # deletion will be blocked and a FAILED_PRECONDITION error will be returned. - # - # @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/firestore/admin/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Firestore::Admin::V1::DeleteDatabaseRequest.new - # - # # Call the delete_database method. - # result = client.delete_database 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 delete_database request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Firestore::Admin::V1::DeleteDatabaseRequest - - # 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_database.metadata.to_h - - # Set x-goog-api-client and x-goog-user-project 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::Firestore::Admin::V1::VERSION - 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_database.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_database.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @firestore_admin_stub.call_rpc :delete_database, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets information about a backup. - # - # @overload get_backup(request, options = nil) - # Pass arguments to `get_backup` via a request object, either of type - # {::Google::Cloud::Firestore::Admin::V1::GetBackupRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Firestore::Admin::V1::GetBackupRequest, ::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_backup(name: nil) - # Pass arguments to `get_backup` 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. Name of the backup to fetch. - # - # Format is `projects/{project}/locations/{location}/backups/{backup}`. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Firestore::Admin::V1::Backup] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Firestore::Admin::V1::Backup] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/firestore/admin/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Firestore::Admin::V1::GetBackupRequest.new - # - # # Call the get_backup method. - # result = client.get_backup request - # - # # The returned object is of type Google::Cloud::Firestore::Admin::V1::Backup. - # p result - # - def get_backup request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Firestore::Admin::V1::GetBackupRequest - - # 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_backup.metadata.to_h - - # Set x-goog-api-client and x-goog-user-project 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::Firestore::Admin::V1::VERSION - 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_backup.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_backup.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @firestore_admin_stub.call_rpc :get_backup, request, options: options do |response, operation| - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Lists all the backups. - # - # @overload list_backups(request, options = nil) - # Pass arguments to `list_backups` via a request object, either of type - # {::Google::Cloud::Firestore::Admin::V1::ListBackupsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Firestore::Admin::V1::ListBackupsRequest, ::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_backups(parent: nil) - # Pass arguments to `list_backups` 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 location to list backups from. - # - # Format is `projects/{project}/locations/{location}`. - # Use `{location} = '-'` to list backups from all locations for the given - # project. This allows listing backups from a single location or from all - # locations. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Firestore::Admin::V1::ListBackupsResponse] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Firestore::Admin::V1::ListBackupsResponse] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/firestore/admin/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Firestore::Admin::V1::ListBackupsRequest.new - # - # # Call the list_backups method. - # result = client.list_backups request - # - # # The returned object is of type Google::Cloud::Firestore::Admin::V1::ListBackupsResponse. - # p result - # - def list_backups request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Firestore::Admin::V1::ListBackupsRequest - - # 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_backups.metadata.to_h - - # Set x-goog-api-client and x-goog-user-project 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::Firestore::Admin::V1::VERSION - 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_backups.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_backups.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @firestore_admin_stub.call_rpc :list_backups, request, options: options do |response, operation| - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes a backup. - # - # @overload delete_backup(request, options = nil) - # Pass arguments to `delete_backup` via a request object, either of type - # {::Google::Cloud::Firestore::Admin::V1::DeleteBackupRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Firestore::Admin::V1::DeleteBackupRequest, ::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_backup(name: nil) - # Pass arguments to `delete_backup` 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. Name of the backup to delete. - # - # format is `projects/{project}/locations/{location}/backups/{backup}`. - # - # @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/firestore/admin/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Firestore::Admin::V1::DeleteBackupRequest.new - # - # # Call the delete_backup method. - # result = client.delete_backup request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_backup request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Firestore::Admin::V1::DeleteBackupRequest - - # 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_backup.metadata.to_h - - # Set x-goog-api-client and x-goog-user-project 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::Firestore::Admin::V1::VERSION - 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_backup.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_backup.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @firestore_admin_stub.call_rpc :delete_backup, request, options: options do |response, operation| - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Creates a new database by restoring from an existing backup. - # - # The new database must be in the same cloud region or multi-region location - # as the existing backup. This behaves similar to - # [FirestoreAdmin.CreateDatabase][google.firestore.admin.v1.CreateDatabase] - # except instead of creating a new empty database, a new database is created - # with the database type, index configuration, and documents from an existing - # backup. - # - # The {::Google::Longrunning::Operation long-running operation} can be used to - # track the progress of the restore, with the Operation's - # {::Google::Longrunning::Operation#metadata metadata} field type being the - # {::Google::Cloud::Firestore::Admin::V1::RestoreDatabaseMetadata RestoreDatabaseMetadata}. - # The {::Google::Longrunning::Operation#response response} type is the - # {::Google::Cloud::Firestore::Admin::V1::Database Database} if the restore was - # successful. The new database is not readable or writeable until the LRO has - # completed. - # - # @overload restore_database(request, options = nil) - # Pass arguments to `restore_database` via a request object, either of type - # {::Google::Cloud::Firestore::Admin::V1::RestoreDatabaseRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Firestore::Admin::V1::RestoreDatabaseRequest, ::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 restore_database(parent: nil, database_id: nil, backup: nil) - # Pass arguments to `restore_database` 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 to restore the database in. Format is - # `projects/{project_id}`. - # @param database_id [::String] - # Required. The ID to use for the database, which will become the final - # component of the database's resource name. This database id must not be - # associated with an existing database. - # - # This value should be 4-63 characters. Valid characters are /[a-z][0-9]-/ - # with first character a letter and the last a letter or a number. Must not - # be UUID-like /[0-9a-f]\\{8}(-[0-9a-f]\\{4})\\{3}-[0-9a-f]\\{12}/. - # - # "(default)" database id is also valid. - # @param backup [::String] - # Required. Backup to restore from. Must be from the same project as the - # parent. - # - # Format is: `projects/{project_id}/locations/{location}/backups/{backup}` - # - # @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/firestore/admin/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Firestore::Admin::V1::RestoreDatabaseRequest.new - # - # # Call the restore_database method. - # result = client.restore_database 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 restore_database request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Firestore::Admin::V1::RestoreDatabaseRequest - - # 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.restore_database.metadata.to_h - - # Set x-goog-api-client and x-goog-user-project 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::Firestore::Admin::V1::VERSION - 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.restore_database.timeout, - metadata: metadata, - retry_policy: @config.rpcs.restore_database.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @firestore_admin_stub.call_rpc :restore_database, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Creates a backup schedule on a database. - # At most two backup schedules can be configured on a database, one daily - # backup schedule with retention up to 7 days and one weekly backup schedule - # with retention up to 14 weeks. - # - # @overload create_backup_schedule(request, options = nil) - # Pass arguments to `create_backup_schedule` via a request object, either of type - # {::Google::Cloud::Firestore::Admin::V1::CreateBackupScheduleRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Firestore::Admin::V1::CreateBackupScheduleRequest, ::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_backup_schedule(parent: nil, backup_schedule: nil) - # Pass arguments to `create_backup_schedule` 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 database. - # - # Format `projects/{project}/databases/{database}` - # @param backup_schedule [::Google::Cloud::Firestore::Admin::V1::BackupSchedule, ::Hash] - # Required. The backup schedule to create. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Firestore::Admin::V1::BackupSchedule] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Firestore::Admin::V1::BackupSchedule] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/firestore/admin/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Firestore::Admin::V1::CreateBackupScheduleRequest.new - # - # # Call the create_backup_schedule method. - # result = client.create_backup_schedule request - # - # # The returned object is of type Google::Cloud::Firestore::Admin::V1::BackupSchedule. - # p result - # - def create_backup_schedule request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Firestore::Admin::V1::CreateBackupScheduleRequest - - # 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_backup_schedule.metadata.to_h - - # Set x-goog-api-client and x-goog-user-project 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::Firestore::Admin::V1::VERSION - 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_backup_schedule.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_backup_schedule.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @firestore_admin_stub.call_rpc :create_backup_schedule, request, options: options do |response, operation| - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets information about a backup schedule. - # - # @overload get_backup_schedule(request, options = nil) - # Pass arguments to `get_backup_schedule` via a request object, either of type - # {::Google::Cloud::Firestore::Admin::V1::GetBackupScheduleRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Firestore::Admin::V1::GetBackupScheduleRequest, ::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_backup_schedule(name: nil) - # Pass arguments to `get_backup_schedule` 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 backup schedule. - # - # Format - # `projects/{project}/databases/{database}/backupSchedules/{backup_schedule}` - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Firestore::Admin::V1::BackupSchedule] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Firestore::Admin::V1::BackupSchedule] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/firestore/admin/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Firestore::Admin::V1::GetBackupScheduleRequest.new - # - # # Call the get_backup_schedule method. - # result = client.get_backup_schedule request - # - # # The returned object is of type Google::Cloud::Firestore::Admin::V1::BackupSchedule. - # p result - # - def get_backup_schedule request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Firestore::Admin::V1::GetBackupScheduleRequest - - # 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_backup_schedule.metadata.to_h - - # Set x-goog-api-client and x-goog-user-project 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::Firestore::Admin::V1::VERSION - 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_backup_schedule.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_backup_schedule.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @firestore_admin_stub.call_rpc :get_backup_schedule, request, options: options do |response, operation| - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # List backup schedules. - # - # @overload list_backup_schedules(request, options = nil) - # Pass arguments to `list_backup_schedules` via a request object, either of type - # {::Google::Cloud::Firestore::Admin::V1::ListBackupSchedulesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Firestore::Admin::V1::ListBackupSchedulesRequest, ::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_backup_schedules(parent: nil) - # Pass arguments to `list_backup_schedules` 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 database. - # - # Format is `projects/{project}/databases/{database}`. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Firestore::Admin::V1::ListBackupSchedulesResponse] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Firestore::Admin::V1::ListBackupSchedulesResponse] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/firestore/admin/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Firestore::Admin::V1::ListBackupSchedulesRequest.new - # - # # Call the list_backup_schedules method. - # result = client.list_backup_schedules request - # - # # The returned object is of type Google::Cloud::Firestore::Admin::V1::ListBackupSchedulesResponse. - # p result - # - def list_backup_schedules request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Firestore::Admin::V1::ListBackupSchedulesRequest - - # 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_backup_schedules.metadata.to_h - - # Set x-goog-api-client and x-goog-user-project 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::Firestore::Admin::V1::VERSION - 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_backup_schedules.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_backup_schedules.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @firestore_admin_stub.call_rpc :list_backup_schedules, request, options: options do |response, operation| - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Updates a backup schedule. - # - # @overload update_backup_schedule(request, options = nil) - # Pass arguments to `update_backup_schedule` via a request object, either of type - # {::Google::Cloud::Firestore::Admin::V1::UpdateBackupScheduleRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Firestore::Admin::V1::UpdateBackupScheduleRequest, ::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_backup_schedule(backup_schedule: nil, update_mask: nil) - # Pass arguments to `update_backup_schedule` 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 backup_schedule [::Google::Cloud::Firestore::Admin::V1::BackupSchedule, ::Hash] - # Required. The backup schedule to update. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # The list of fields to be updated. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Firestore::Admin::V1::BackupSchedule] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Firestore::Admin::V1::BackupSchedule] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/firestore/admin/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Firestore::Admin::V1::UpdateBackupScheduleRequest.new - # - # # Call the update_backup_schedule method. - # result = client.update_backup_schedule request - # - # # The returned object is of type Google::Cloud::Firestore::Admin::V1::BackupSchedule. - # p result - # - def update_backup_schedule request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Firestore::Admin::V1::UpdateBackupScheduleRequest - - # 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_backup_schedule.metadata.to_h - - # Set x-goog-api-client and x-goog-user-project 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::Firestore::Admin::V1::VERSION - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.backup_schedule&.name - header_params["backup_schedule.name"] = request.backup_schedule.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_backup_schedule.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_backup_schedule.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @firestore_admin_stub.call_rpc :update_backup_schedule, request, options: options do |response, operation| - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes a backup schedule. - # - # @overload delete_backup_schedule(request, options = nil) - # Pass arguments to `delete_backup_schedule` via a request object, either of type - # {::Google::Cloud::Firestore::Admin::V1::DeleteBackupScheduleRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Firestore::Admin::V1::DeleteBackupScheduleRequest, ::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_backup_schedule(name: nil) - # Pass arguments to `delete_backup_schedule` 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 backup schedule. - # - # Format - # `projects/{project}/databases/{database}/backupSchedules/{backup_schedule}` - # - # @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/firestore/admin/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Firestore::Admin::V1::DeleteBackupScheduleRequest.new - # - # # Call the delete_backup_schedule method. - # result = client.delete_backup_schedule request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_backup_schedule request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Firestore::Admin::V1::DeleteBackupScheduleRequest - - # 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_backup_schedule.metadata.to_h - - # Set x-goog-api-client and x-goog-user-project 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::Firestore::Admin::V1::VERSION - 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_backup_schedule.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_backup_schedule.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @firestore_admin_stub.call_rpc :delete_backup_schedule, request, options: options do |response, operation| - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the FirestoreAdmin API. - # - # This class represents the configuration for FirestoreAdmin, - # 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::Firestore::Admin::V1::FirestoreAdmin::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # create_index to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.create_index.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.create_index.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)) - # * (`GRPC::Core::Channel`) a gRPC channel with included credentials - # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object - # * (`nil`) indicating no 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] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "firestore.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] - allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC - 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 - - # @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 FirestoreAdmin API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `create_index` - # @return [::Gapic::Config::Method] - # - attr_reader :create_index - ## - # RPC-specific configuration for `list_indexes` - # @return [::Gapic::Config::Method] - # - attr_reader :list_indexes - ## - # RPC-specific configuration for `get_index` - # @return [::Gapic::Config::Method] - # - attr_reader :get_index - ## - # RPC-specific configuration for `delete_index` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_index - ## - # RPC-specific configuration for `get_field` - # @return [::Gapic::Config::Method] - # - attr_reader :get_field - ## - # RPC-specific configuration for `update_field` - # @return [::Gapic::Config::Method] - # - attr_reader :update_field - ## - # RPC-specific configuration for `list_fields` - # @return [::Gapic::Config::Method] - # - attr_reader :list_fields - ## - # RPC-specific configuration for `export_documents` - # @return [::Gapic::Config::Method] - # - attr_reader :export_documents - ## - # RPC-specific configuration for `import_documents` - # @return [::Gapic::Config::Method] - # - attr_reader :import_documents - ## - # RPC-specific configuration for `create_database` - # @return [::Gapic::Config::Method] - # - attr_reader :create_database - ## - # RPC-specific configuration for `get_database` - # @return [::Gapic::Config::Method] - # - attr_reader :get_database - ## - # RPC-specific configuration for `list_databases` - # @return [::Gapic::Config::Method] - # - attr_reader :list_databases - ## - # RPC-specific configuration for `update_database` - # @return [::Gapic::Config::Method] - # - attr_reader :update_database - ## - # RPC-specific configuration for `delete_database` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_database - ## - # RPC-specific configuration for `get_backup` - # @return [::Gapic::Config::Method] - # - attr_reader :get_backup - ## - # RPC-specific configuration for `list_backups` - # @return [::Gapic::Config::Method] - # - attr_reader :list_backups - ## - # RPC-specific configuration for `delete_backup` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_backup - ## - # RPC-specific configuration for `restore_database` - # @return [::Gapic::Config::Method] - # - attr_reader :restore_database - ## - # RPC-specific configuration for `create_backup_schedule` - # @return [::Gapic::Config::Method] - # - attr_reader :create_backup_schedule - ## - # RPC-specific configuration for `get_backup_schedule` - # @return [::Gapic::Config::Method] - # - attr_reader :get_backup_schedule - ## - # RPC-specific configuration for `list_backup_schedules` - # @return [::Gapic::Config::Method] - # - attr_reader :list_backup_schedules - ## - # RPC-specific configuration for `update_backup_schedule` - # @return [::Gapic::Config::Method] - # - attr_reader :update_backup_schedule - ## - # RPC-specific configuration for `delete_backup_schedule` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_backup_schedule - - # @private - def initialize parent_rpcs = nil - create_index_config = parent_rpcs.create_index if parent_rpcs.respond_to? :create_index - @create_index = ::Gapic::Config::Method.new create_index_config - list_indexes_config = parent_rpcs.list_indexes if parent_rpcs.respond_to? :list_indexes - @list_indexes = ::Gapic::Config::Method.new list_indexes_config - get_index_config = parent_rpcs.get_index if parent_rpcs.respond_to? :get_index - @get_index = ::Gapic::Config::Method.new get_index_config - delete_index_config = parent_rpcs.delete_index if parent_rpcs.respond_to? :delete_index - @delete_index = ::Gapic::Config::Method.new delete_index_config - get_field_config = parent_rpcs.get_field if parent_rpcs.respond_to? :get_field - @get_field = ::Gapic::Config::Method.new get_field_config - update_field_config = parent_rpcs.update_field if parent_rpcs.respond_to? :update_field - @update_field = ::Gapic::Config::Method.new update_field_config - list_fields_config = parent_rpcs.list_fields if parent_rpcs.respond_to? :list_fields - @list_fields = ::Gapic::Config::Method.new list_fields_config - export_documents_config = parent_rpcs.export_documents if parent_rpcs.respond_to? :export_documents - @export_documents = ::Gapic::Config::Method.new export_documents_config - import_documents_config = parent_rpcs.import_documents if parent_rpcs.respond_to? :import_documents - @import_documents = ::Gapic::Config::Method.new import_documents_config - create_database_config = parent_rpcs.create_database if parent_rpcs.respond_to? :create_database - @create_database = ::Gapic::Config::Method.new create_database_config - get_database_config = parent_rpcs.get_database if parent_rpcs.respond_to? :get_database - @get_database = ::Gapic::Config::Method.new get_database_config - list_databases_config = parent_rpcs.list_databases if parent_rpcs.respond_to? :list_databases - @list_databases = ::Gapic::Config::Method.new list_databases_config - update_database_config = parent_rpcs.update_database if parent_rpcs.respond_to? :update_database - @update_database = ::Gapic::Config::Method.new update_database_config - delete_database_config = parent_rpcs.delete_database if parent_rpcs.respond_to? :delete_database - @delete_database = ::Gapic::Config::Method.new delete_database_config - get_backup_config = parent_rpcs.get_backup if parent_rpcs.respond_to? :get_backup - @get_backup = ::Gapic::Config::Method.new get_backup_config - list_backups_config = parent_rpcs.list_backups if parent_rpcs.respond_to? :list_backups - @list_backups = ::Gapic::Config::Method.new list_backups_config - delete_backup_config = parent_rpcs.delete_backup if parent_rpcs.respond_to? :delete_backup - @delete_backup = ::Gapic::Config::Method.new delete_backup_config - restore_database_config = parent_rpcs.restore_database if parent_rpcs.respond_to? :restore_database - @restore_database = ::Gapic::Config::Method.new restore_database_config - create_backup_schedule_config = parent_rpcs.create_backup_schedule if parent_rpcs.respond_to? :create_backup_schedule - @create_backup_schedule = ::Gapic::Config::Method.new create_backup_schedule_config - get_backup_schedule_config = parent_rpcs.get_backup_schedule if parent_rpcs.respond_to? :get_backup_schedule - @get_backup_schedule = ::Gapic::Config::Method.new get_backup_schedule_config - list_backup_schedules_config = parent_rpcs.list_backup_schedules if parent_rpcs.respond_to? :list_backup_schedules - @list_backup_schedules = ::Gapic::Config::Method.new list_backup_schedules_config - update_backup_schedule_config = parent_rpcs.update_backup_schedule if parent_rpcs.respond_to? :update_backup_schedule - @update_backup_schedule = ::Gapic::Config::Method.new update_backup_schedule_config - delete_backup_schedule_config = parent_rpcs.delete_backup_schedule if parent_rpcs.respond_to? :delete_backup_schedule - @delete_backup_schedule = ::Gapic::Config::Method.new delete_backup_schedule_config - - yield self if block_given? - end - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-firestore-admin-v1/lib/google/cloud/firestore/admin/v1/firestore_admin/credentials.rb b/owl-bot-staging/google-cloud-firestore-admin-v1/lib/google/cloud/firestore/admin/v1/firestore_admin/credentials.rb deleted file mode 100644 index 5c8dbd98ca64..000000000000 --- a/owl-bot-staging/google-cloud-firestore-admin-v1/lib/google/cloud/firestore/admin/v1/firestore_admin/credentials.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 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 Firestore - module Admin - module V1 - module FirestoreAdmin - # Credentials for the FirestoreAdmin API. - class Credentials < ::Google::Auth::Credentials - self.scope = [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/datastore" - ] - self.env_vars = [ - "FIRESTORE_CREDENTIALS", - "FIRESTORE_KEYFILE", - "GOOGLE_CLOUD_CREDENTIALS", - "GOOGLE_CLOUD_KEYFILE", - "GCLOUD_KEYFILE", - "FIRESTORE_CREDENTIALS_JSON", - "FIRESTORE_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 diff --git a/owl-bot-staging/google-cloud-firestore-admin-v1/lib/google/cloud/firestore/admin/v1/firestore_admin/operations.rb b/owl-bot-staging/google-cloud-firestore-admin-v1/lib/google/cloud/firestore/admin/v1/firestore_admin/operations.rb deleted file mode 100644 index fe6ece7518aa..000000000000 --- a/owl-bot-staging/google-cloud-firestore-admin-v1/lib/google/cloud/firestore/admin/v1/firestore_admin/operations.rb +++ /dev/null @@ -1,803 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 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 Firestore - module Admin - module V1 - module FirestoreAdmin - # Service that implements Longrunning Operations API. - class Operations - # @private - DEFAULT_ENDPOINT_TEMPLATE = "firestore.$UNIVERSE_DOMAIN$" - - # @private - attr_reader :operations_stub - - ## - # Configuration for the FirestoreAdmin 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 FirestoreAdmin 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`. - # - # NOTE: the `name` binding allows API services to override the binding - # to use different resource name schemes, such as `users/*/operations`. To - # override the binding, API services can add a binding such as - # `"/v1/{name=users/*}/operations"` to their service configuration. - # For backwards compatibility, the default name includes the operations - # collection id, however overriding users must ensure the name binding - # is the parent resource, without the operations collection id. - # - # @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) - # 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. - # - # @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 and x-goog-user-project 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::Firestore::Admin::V1::VERSION - 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? - return 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 and x-goog-user-project 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::Firestore::Admin::V1::VERSION - 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? - return 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 and x-goog-user-project 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::Firestore::Admin::V1::VERSION - 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? - return response - 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 and x-goog-user-project 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::Firestore::Admin::V1::VERSION - 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? - return response - 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 and x-goog-user-project 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::Firestore::Admin::V1::VERSION - 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? - return 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: - # * (`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)) - # * (`GRPC::Core::Channel`) a gRPC channel with included credentials - # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object - # * (`nil`) indicating no 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] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "firestore.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] - allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC - 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 - - # @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 diff --git a/owl-bot-staging/google-cloud-firestore-admin-v1/lib/google/cloud/firestore/admin/v1/firestore_admin/paths.rb b/owl-bot-staging/google-cloud-firestore-admin-v1/lib/google/cloud/firestore/admin/v1/firestore_admin/paths.rb deleted file mode 100644 index ca81de998ab2..000000000000 --- a/owl-bot-staging/google-cloud-firestore-admin-v1/lib/google/cloud/firestore/admin/v1/firestore_admin/paths.rb +++ /dev/null @@ -1,182 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 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 Firestore - module Admin - module V1 - module FirestoreAdmin - # Path helper methods for the FirestoreAdmin API. - module Paths - ## - # Create a fully-qualified Backup resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/backups/{backup}` - # - # @param project [String] - # @param location [String] - # @param backup [String] - # - # @return [::String] - def backup_path project:, location:, backup: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/backups/#{backup}" - end - - ## - # Create a fully-qualified BackupSchedule resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/databases/{database}/backupSchedules/{backup_schedule}` - # - # @param project [String] - # @param database [String] - # @param backup_schedule [String] - # - # @return [::String] - def backup_schedule_path project:, database:, backup_schedule: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "database cannot contain /" if database.to_s.include? "/" - - "projects/#{project}/databases/#{database}/backupSchedules/#{backup_schedule}" - end - - ## - # Create a fully-qualified CollectionGroup resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/databases/{database}/collectionGroups/{collection}` - # - # @param project [String] - # @param database [String] - # @param collection [String] - # - # @return [::String] - def collection_group_path project:, database:, collection: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "database cannot contain /" if database.to_s.include? "/" - - "projects/#{project}/databases/#{database}/collectionGroups/#{collection}" - end - - ## - # Create a fully-qualified Database resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/databases/{database}` - # - # @param project [String] - # @param database [String] - # - # @return [::String] - def database_path project:, database: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - - "projects/#{project}/databases/#{database}" - end - - ## - # Create a fully-qualified Field resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/databases/{database}/collectionGroups/{collection}/fields/{field}` - # - # @param project [String] - # @param database [String] - # @param collection [String] - # @param field [String] - # - # @return [::String] - def field_path project:, database:, collection:, field: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "database cannot contain /" if database.to_s.include? "/" - raise ::ArgumentError, "collection cannot contain /" if collection.to_s.include? "/" - - "projects/#{project}/databases/#{database}/collectionGroups/#{collection}/fields/#{field}" - end - - ## - # Create a fully-qualified Index resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/databases/{database}/collectionGroups/{collection}/indexes/{index}` - # - # @param project [String] - # @param database [String] - # @param collection [String] - # @param index [String] - # - # @return [::String] - def index_path project:, database:, collection:, index: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "database cannot contain /" if database.to_s.include? "/" - raise ::ArgumentError, "collection cannot contain /" if collection.to_s.include? "/" - - "projects/#{project}/databases/#{database}/collectionGroups/#{collection}/indexes/#{index}" - end - - ## - # Create a fully-qualified Location resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}` - # - # @param project [String] - # @param location [String] - # - # @return [::String] - def location_path project:, location: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - - "projects/#{project}/locations/#{location}" - 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 diff --git a/owl-bot-staging/google-cloud-firestore-admin-v1/lib/google/cloud/firestore/admin/v1/firestore_admin/rest.rb b/owl-bot-staging/google-cloud-firestore-admin-v1/lib/google/cloud/firestore/admin/v1/firestore_admin/rest.rb deleted file mode 100644 index 6372c7b142db..000000000000 --- a/owl-bot-staging/google-cloud-firestore-admin-v1/lib/google/cloud/firestore/admin/v1/firestore_admin/rest.rb +++ /dev/null @@ -1,82 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 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/firestore/admin/v1/version" - -require "google/cloud/firestore/admin/v1/firestore_admin/credentials" -require "google/cloud/firestore/admin/v1/firestore_admin/paths" -require "google/cloud/firestore/admin/v1/firestore_admin/rest/operations" -require "google/cloud/firestore/admin/v1/firestore_admin/rest/client" - -module Google - module Cloud - module Firestore - module Admin - module V1 - ## - # The Cloud Firestore Admin API. - # - # This API provides several administrative services for Cloud Firestore. - # - # Project, Database, Namespace, Collection, Collection Group, and Document are - # used as defined in the Google Cloud Firestore API. - # - # Operation: An Operation represents work being performed in the background. - # - # The index service manages Cloud Firestore indexes. - # - # Index creation is performed asynchronously. - # An Operation resource is created for each such asynchronous operation. - # The state of the operation (including any errors encountered) - # may be queried via the Operation resource. - # - # The Operations collection provides a record of actions performed for the - # specified Project (including any Operations in progress). Operations are not - # created directly but through calls on other collections or resources. - # - # An Operation that is done may be deleted so that it is no longer listed as - # part of the Operation collection. Operations are garbage collected after - # 30 days. By default, ListOperations will only return in progress and failed - # operations. To list completed operation, issue a ListOperations request with - # the filter `done: true`. - # - # Operations are created by service `FirestoreAdmin`, but are accessed via - # service `google.longrunning.Operations`. - # - # To load this service and instantiate a REST client: - # - # require "google/cloud/firestore/admin/v1/firestore_admin/rest" - # client = ::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Rest::Client.new - # - module FirestoreAdmin - # Client for the REST transport - module Rest - end - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "rest", "helpers.rb" -require "google/cloud/firestore/admin/v1/firestore_admin/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-firestore-admin-v1/lib/google/cloud/firestore/admin/v1/firestore_admin/rest/client.rb b/owl-bot-staging/google-cloud-firestore-admin-v1/lib/google/cloud/firestore/admin/v1/firestore_admin/rest/client.rb deleted file mode 100644 index e87338b923b5..000000000000 --- a/owl-bot-staging/google-cloud-firestore-admin-v1/lib/google/cloud/firestore/admin/v1/firestore_admin/rest/client.rb +++ /dev/null @@ -1,2619 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 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/firestore/admin/v1/firestore_admin_pb" -require "google/cloud/firestore/admin/v1/firestore_admin/rest/service_stub" -require "google/cloud/location/rest" - -module Google - module Cloud - module Firestore - module Admin - module V1 - module FirestoreAdmin - module Rest - ## - # REST client for the FirestoreAdmin service. - # - # The Cloud Firestore Admin API. - # - # This API provides several administrative services for Cloud Firestore. - # - # Project, Database, Namespace, Collection, Collection Group, and Document are - # used as defined in the Google Cloud Firestore API. - # - # Operation: An Operation represents work being performed in the background. - # - # The index service manages Cloud Firestore indexes. - # - # Index creation is performed asynchronously. - # An Operation resource is created for each such asynchronous operation. - # The state of the operation (including any errors encountered) - # may be queried via the Operation resource. - # - # The Operations collection provides a record of actions performed for the - # specified Project (including any Operations in progress). Operations are not - # created directly but through calls on other collections or resources. - # - # An Operation that is done may be deleted so that it is no longer listed as - # part of the Operation collection. Operations are garbage collected after - # 30 days. By default, ListOperations will only return in progress and failed - # operations. To list completed operation, issue a ListOperations request with - # the filter `done: true`. - # - # Operations are created by service `FirestoreAdmin`, but are accessed via - # service `google.longrunning.Operations`. - # - class Client - # @private - DEFAULT_ENDPOINT_TEMPLATE = "firestore.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :firestore_admin_stub - - ## - # Configure the FirestoreAdmin Client class. - # - # See {::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all FirestoreAdmin clients - # ::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::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", "Firestore", "Admin", "V1"] - parent_config = while namespace.any? - parent_name = namespace.join "::" - parent_const = const_get parent_name - break parent_const.configure if parent_const.respond_to? :configure - namespace.pop - end - default_config = Client::Configuration.new parent_config - - default_config.rpcs.create_index.timeout = 60.0 - - default_config.rpcs.list_indexes.timeout = 60.0 - default_config.rpcs.list_indexes.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 13, 4] - } - - default_config.rpcs.get_index.timeout = 60.0 - default_config.rpcs.get_index.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 13, 4] - } - - default_config.rpcs.delete_index.timeout = 60.0 - default_config.rpcs.delete_index.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 13, 4] - } - - default_config.rpcs.get_field.timeout = 60.0 - default_config.rpcs.get_field.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 13, 4] - } - - default_config.rpcs.update_field.timeout = 60.0 - - default_config.rpcs.list_fields.timeout = 60.0 - default_config.rpcs.list_fields.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 13, 4] - } - - default_config.rpcs.export_documents.timeout = 60.0 - - default_config.rpcs.import_documents.timeout = 60.0 - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the FirestoreAdmin 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::Firestore::Admin::V1::FirestoreAdmin::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 - @firestore_admin_stub.universe_domain - end - - ## - # Create a new FirestoreAdmin REST client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Rest::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Rest::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the FirestoreAdmin 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::Firestore::Admin::V1::FirestoreAdmin::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 - - @firestore_admin_stub = ::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials - ) - - @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @firestore_admin_stub.endpoint - config.universe_domain = @firestore_admin_stub.universe_domain - end - end - - ## - # Get the associated client for long-running operations. - # - # @return [::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Rest::Operations] - # - attr_reader :operations_client - - ## - # Get the associated client for mix-in of the Locations. - # - # @return [Google::Cloud::Location::Locations::Rest::Client] - # - attr_reader :location_client - - # Service calls - - ## - # Creates a composite index. This returns a - # {::Google::Longrunning::Operation google.longrunning.Operation} which may be - # used to track the status of the creation. The metadata for the operation - # will be the type - # {::Google::Cloud::Firestore::Admin::V1::IndexOperationMetadata IndexOperationMetadata}. - # - # @overload create_index(request, options = nil) - # Pass arguments to `create_index` via a request object, either of type - # {::Google::Cloud::Firestore::Admin::V1::CreateIndexRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Firestore::Admin::V1::CreateIndexRequest, ::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_index(parent: nil, index: nil) - # Pass arguments to `create_index` 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. A parent name of the form - # `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}` - # @param index [::Google::Cloud::Firestore::Admin::V1::Index, ::Hash] - # Required. The composite index to create. - # @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/firestore/admin/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Firestore::Admin::V1::CreateIndexRequest.new - # - # # Call the create_index method. - # result = client.create_index 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_index request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Firestore::Admin::V1::CreateIndexRequest - - # 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_index.metadata.to_h - - # Set x-goog-api-client and x-goog-user-project 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::Firestore::Admin::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.create_index.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_index.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @firestore_admin_stub.create_index request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - return result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Lists composite indexes. - # - # @overload list_indexes(request, options = nil) - # Pass arguments to `list_indexes` via a request object, either of type - # {::Google::Cloud::Firestore::Admin::V1::ListIndexesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Firestore::Admin::V1::ListIndexesRequest, ::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_indexes(parent: nil, filter: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_indexes` 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. A parent name of the form - # `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}` - # @param filter [::String] - # The filter to apply to list results. - # @param page_size [::Integer] - # The number of results to return. - # @param page_token [::String] - # A page token, returned from a previous call to - # {::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Rest::Client#list_indexes FirestoreAdmin.ListIndexes}, - # that may be used to get the next page of results. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Firestore::Admin::V1::Index>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Firestore::Admin::V1::Index>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/firestore/admin/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Firestore::Admin::V1::ListIndexesRequest.new - # - # # Call the list_indexes method. - # result = client.list_indexes 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::Firestore::Admin::V1::Index. - # p item - # end - # - def list_indexes request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Firestore::Admin::V1::ListIndexesRequest - - # 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_indexes.metadata.to_h - - # Set x-goog-api-client and x-goog-user-project 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::Firestore::Admin::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.list_indexes.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_indexes.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @firestore_admin_stub.list_indexes request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @firestore_admin_stub, :list_indexes, "indexes", request, result, options - yield result, operation if block_given? - return result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets a composite index. - # - # @overload get_index(request, options = nil) - # Pass arguments to `get_index` via a request object, either of type - # {::Google::Cloud::Firestore::Admin::V1::GetIndexRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Firestore::Admin::V1::GetIndexRequest, ::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_index(name: nil) - # Pass arguments to `get_index` 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. A name of the form - # `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/indexes/{index_id}` - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Firestore::Admin::V1::Index] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Firestore::Admin::V1::Index] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/firestore/admin/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Firestore::Admin::V1::GetIndexRequest.new - # - # # Call the get_index method. - # result = client.get_index request - # - # # The returned object is of type Google::Cloud::Firestore::Admin::V1::Index. - # p result - # - def get_index request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Firestore::Admin::V1::GetIndexRequest - - # 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_index.metadata.to_h - - # Set x-goog-api-client and x-goog-user-project 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::Firestore::Admin::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_index.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_index.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @firestore_admin_stub.get_index request, options do |result, operation| - yield result, operation if block_given? - return result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes a composite index. - # - # @overload delete_index(request, options = nil) - # Pass arguments to `delete_index` via a request object, either of type - # {::Google::Cloud::Firestore::Admin::V1::DeleteIndexRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Firestore::Admin::V1::DeleteIndexRequest, ::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_index(name: nil) - # Pass arguments to `delete_index` 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. A name of the form - # `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/indexes/{index_id}` - # @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/firestore/admin/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Firestore::Admin::V1::DeleteIndexRequest.new - # - # # Call the delete_index method. - # result = client.delete_index request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_index request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Firestore::Admin::V1::DeleteIndexRequest - - # 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_index.metadata.to_h - - # Set x-goog-api-client and x-goog-user-project 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::Firestore::Admin::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.delete_index.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_index.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @firestore_admin_stub.delete_index request, options do |result, operation| - yield result, operation if block_given? - return result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets the metadata and configuration for a Field. - # - # @overload get_field(request, options = nil) - # Pass arguments to `get_field` via a request object, either of type - # {::Google::Cloud::Firestore::Admin::V1::GetFieldRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Firestore::Admin::V1::GetFieldRequest, ::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_field(name: nil) - # Pass arguments to `get_field` 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. A name of the form - # `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/fields/{field_id}` - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Firestore::Admin::V1::Field] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Firestore::Admin::V1::Field] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/firestore/admin/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Firestore::Admin::V1::GetFieldRequest.new - # - # # Call the get_field method. - # result = client.get_field request - # - # # The returned object is of type Google::Cloud::Firestore::Admin::V1::Field. - # p result - # - def get_field request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Firestore::Admin::V1::GetFieldRequest - - # 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_field.metadata.to_h - - # Set x-goog-api-client and x-goog-user-project 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::Firestore::Admin::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_field.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_field.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @firestore_admin_stub.get_field request, options do |result, operation| - yield result, operation if block_given? - return result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Updates a field configuration. Currently, field updates apply only to - # single field index configuration. However, calls to - # {::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Rest::Client#update_field FirestoreAdmin.UpdateField} - # should provide a field mask to avoid changing any configuration that the - # caller isn't aware of. The field mask should be specified as: `{ paths: - # "index_config" }`. - # - # This call returns a - # {::Google::Longrunning::Operation google.longrunning.Operation} which may be - # used to track the status of the field update. The metadata for the - # operation will be the type - # {::Google::Cloud::Firestore::Admin::V1::FieldOperationMetadata FieldOperationMetadata}. - # - # To configure the default field settings for the database, use - # the special `Field` with resource name: - # `projects/{project_id}/databases/{database_id}/collectionGroups/__default__/fields/*`. - # - # @overload update_field(request, options = nil) - # Pass arguments to `update_field` via a request object, either of type - # {::Google::Cloud::Firestore::Admin::V1::UpdateFieldRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Firestore::Admin::V1::UpdateFieldRequest, ::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_field(field: nil, update_mask: nil) - # Pass arguments to `update_field` 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 field [::Google::Cloud::Firestore::Admin::V1::Field, ::Hash] - # Required. The field to be updated. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # A mask, relative to the field. If specified, only configuration specified - # by this field_mask will be updated in the field. - # @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/firestore/admin/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Firestore::Admin::V1::UpdateFieldRequest.new - # - # # Call the update_field method. - # result = client.update_field 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_field request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Firestore::Admin::V1::UpdateFieldRequest - - # 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_field.metadata.to_h - - # Set x-goog-api-client and x-goog-user-project 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::Firestore::Admin::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.update_field.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_field.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @firestore_admin_stub.update_field request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - return result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Lists the field configuration and metadata for this database. - # - # Currently, - # {::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Rest::Client#list_fields FirestoreAdmin.ListFields} - # only supports listing fields that have been explicitly overridden. To issue - # this query, call - # {::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Rest::Client#list_fields FirestoreAdmin.ListFields} - # with the filter set to `indexConfig.usesAncestorConfig:false` or - # `ttlConfig:*`. - # - # @overload list_fields(request, options = nil) - # Pass arguments to `list_fields` via a request object, either of type - # {::Google::Cloud::Firestore::Admin::V1::ListFieldsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Firestore::Admin::V1::ListFieldsRequest, ::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_fields(parent: nil, filter: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_fields` 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. A parent name of the form - # `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}` - # @param filter [::String] - # The filter to apply to list results. Currently, - # {::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Rest::Client#list_fields FirestoreAdmin.ListFields} - # only supports listing fields that have been explicitly overridden. To issue - # this query, call - # {::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Rest::Client#list_fields FirestoreAdmin.ListFields} - # with a filter that includes `indexConfig.usesAncestorConfig:false` . - # @param page_size [::Integer] - # The number of results to return. - # @param page_token [::String] - # A page token, returned from a previous call to - # {::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Rest::Client#list_fields FirestoreAdmin.ListFields}, - # that may be used to get the next page of results. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Firestore::Admin::V1::Field>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Firestore::Admin::V1::Field>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/firestore/admin/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Firestore::Admin::V1::ListFieldsRequest.new - # - # # Call the list_fields method. - # result = client.list_fields 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::Firestore::Admin::V1::Field. - # p item - # end - # - def list_fields request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Firestore::Admin::V1::ListFieldsRequest - - # 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_fields.metadata.to_h - - # Set x-goog-api-client and x-goog-user-project 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::Firestore::Admin::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.list_fields.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_fields.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @firestore_admin_stub.list_fields request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @firestore_admin_stub, :list_fields, "fields", request, result, options - yield result, operation if block_given? - return result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Exports a copy of all or a subset of documents from Google Cloud Firestore - # to another storage system, such as Google Cloud Storage. Recent updates to - # documents may not be reflected in the export. The export occurs in the - # background and its progress can be monitored and managed via the - # Operation resource that is created. The output of an export may only be - # used once the associated operation is done. If an export operation is - # cancelled before completion it may leave partial data behind in Google - # Cloud Storage. - # - # For more details on export behavior and output format, refer to: - # https://cloud.google.com/firestore/docs/manage-data/export-import - # - # @overload export_documents(request, options = nil) - # Pass arguments to `export_documents` via a request object, either of type - # {::Google::Cloud::Firestore::Admin::V1::ExportDocumentsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Firestore::Admin::V1::ExportDocumentsRequest, ::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 export_documents(name: nil, collection_ids: nil, output_uri_prefix: nil, namespace_ids: nil, snapshot_time: nil) - # Pass arguments to `export_documents` 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. Database to export. Should be of the form: - # `projects/{project_id}/databases/{database_id}`. - # @param collection_ids [::Array<::String>] - # Which collection ids to export. Unspecified means all collections. - # @param output_uri_prefix [::String] - # The output URI. Currently only supports Google Cloud Storage URIs of the - # form: `gs://BUCKET_NAME[/NAMESPACE_PATH]`, where `BUCKET_NAME` is the name - # of the Google Cloud Storage bucket and `NAMESPACE_PATH` is an optional - # Google Cloud Storage namespace path. When - # choosing a name, be sure to consider Google Cloud Storage naming - # guidelines: https://cloud.google.com/storage/docs/naming. - # If the URI is a bucket (without a namespace path), a prefix will be - # generated based on the start time. - # @param namespace_ids [::Array<::String>] - # An empty list represents all namespaces. This is the preferred - # usage for databases that don't use namespaces. - # - # An empty string element represents the default namespace. This should be - # used if the database has data in non-default namespaces, but doesn't want - # to include them. Each namespace in this list must be unique. - # @param snapshot_time [::Google::Protobuf::Timestamp, ::Hash] - # The timestamp that corresponds to the version of the database to be - # exported. The timestamp must be in the past, rounded to the minute and not - # older than - # {::Google::Cloud::Firestore::Admin::V1::Database#earliest_version_time earliestVersionTime}. - # If specified, then the exported documents will represent a consistent view - # of the database at the provided time. Otherwise, there are no guarantees - # about the consistency of the exported documents. - # @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/firestore/admin/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Firestore::Admin::V1::ExportDocumentsRequest.new - # - # # Call the export_documents method. - # result = client.export_documents 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 export_documents request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Firestore::Admin::V1::ExportDocumentsRequest - - # 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.export_documents.metadata.to_h - - # Set x-goog-api-client and x-goog-user-project 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::Firestore::Admin::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.export_documents.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.export_documents.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @firestore_admin_stub.export_documents request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - return result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Imports documents into Google Cloud Firestore. Existing documents with the - # same name are overwritten. The import occurs in the background and its - # progress can be monitored and managed via the Operation resource that is - # created. If an ImportDocuments operation is cancelled, it is possible - # that a subset of the data has already been imported to Cloud Firestore. - # - # @overload import_documents(request, options = nil) - # Pass arguments to `import_documents` via a request object, either of type - # {::Google::Cloud::Firestore::Admin::V1::ImportDocumentsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Firestore::Admin::V1::ImportDocumentsRequest, ::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 import_documents(name: nil, collection_ids: nil, input_uri_prefix: nil, namespace_ids: nil) - # Pass arguments to `import_documents` 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. Database to import into. Should be of the form: - # `projects/{project_id}/databases/{database_id}`. - # @param collection_ids [::Array<::String>] - # Which collection ids to import. Unspecified means all collections included - # in the import. - # @param input_uri_prefix [::String] - # Location of the exported files. - # This must match the output_uri_prefix of an ExportDocumentsResponse from - # an export that has completed successfully. - # See: - # {::Google::Cloud::Firestore::Admin::V1::ExportDocumentsResponse#output_uri_prefix google.firestore.admin.v1.ExportDocumentsResponse.output_uri_prefix}. - # @param namespace_ids [::Array<::String>] - # An empty list represents all namespaces. This is the preferred - # usage for databases that don't use namespaces. - # - # An empty string element represents the default namespace. This should be - # used if the database has data in non-default namespaces, but doesn't want - # to include them. Each namespace in this list must be unique. - # @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/firestore/admin/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Firestore::Admin::V1::ImportDocumentsRequest.new - # - # # Call the import_documents method. - # result = client.import_documents 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 import_documents request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Firestore::Admin::V1::ImportDocumentsRequest - - # 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.import_documents.metadata.to_h - - # Set x-goog-api-client and x-goog-user-project 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::Firestore::Admin::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.import_documents.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.import_documents.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @firestore_admin_stub.import_documents request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - return result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Create a database. - # - # @overload create_database(request, options = nil) - # Pass arguments to `create_database` via a request object, either of type - # {::Google::Cloud::Firestore::Admin::V1::CreateDatabaseRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Firestore::Admin::V1::CreateDatabaseRequest, ::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_database(parent: nil, database: nil, database_id: nil) - # Pass arguments to `create_database` 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. A parent name of the form - # `projects/{project_id}` - # @param database [::Google::Cloud::Firestore::Admin::V1::Database, ::Hash] - # Required. The Database to create. - # @param database_id [::String] - # Required. The ID to use for the database, which will become the final - # component of the database's resource name. - # - # This value should be 4-63 characters. Valid characters are /[a-z][0-9]-/ - # with first character a letter and the last a letter or a number. Must not - # be UUID-like /[0-9a-f]\\{8}(-[0-9a-f]\\{4})\\{3}-[0-9a-f]\\{12}/. - # - # "(default)" database id is also valid. - # @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/firestore/admin/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Firestore::Admin::V1::CreateDatabaseRequest.new - # - # # Call the create_database method. - # result = client.create_database 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_database request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Firestore::Admin::V1::CreateDatabaseRequest - - # 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_database.metadata.to_h - - # Set x-goog-api-client and x-goog-user-project 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::Firestore::Admin::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.create_database.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_database.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @firestore_admin_stub.create_database request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - return result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets information about a database. - # - # @overload get_database(request, options = nil) - # Pass arguments to `get_database` via a request object, either of type - # {::Google::Cloud::Firestore::Admin::V1::GetDatabaseRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Firestore::Admin::V1::GetDatabaseRequest, ::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_database(name: nil) - # Pass arguments to `get_database` 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. A name of the form - # `projects/{project_id}/databases/{database_id}` - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Firestore::Admin::V1::Database] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Firestore::Admin::V1::Database] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/firestore/admin/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Firestore::Admin::V1::GetDatabaseRequest.new - # - # # Call the get_database method. - # result = client.get_database request - # - # # The returned object is of type Google::Cloud::Firestore::Admin::V1::Database. - # p result - # - def get_database request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Firestore::Admin::V1::GetDatabaseRequest - - # 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_database.metadata.to_h - - # Set x-goog-api-client and x-goog-user-project 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::Firestore::Admin::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_database.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_database.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @firestore_admin_stub.get_database request, options do |result, operation| - yield result, operation if block_given? - return result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # List all the databases in the project. - # - # @overload list_databases(request, options = nil) - # Pass arguments to `list_databases` via a request object, either of type - # {::Google::Cloud::Firestore::Admin::V1::ListDatabasesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Firestore::Admin::V1::ListDatabasesRequest, ::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_databases(parent: nil) - # Pass arguments to `list_databases` 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. A parent name of the form - # `projects/{project_id}` - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Firestore::Admin::V1::ListDatabasesResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Firestore::Admin::V1::ListDatabasesResponse] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/firestore/admin/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Firestore::Admin::V1::ListDatabasesRequest.new - # - # # Call the list_databases method. - # result = client.list_databases request - # - # # The returned object is of type Google::Cloud::Firestore::Admin::V1::ListDatabasesResponse. - # p result - # - def list_databases request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Firestore::Admin::V1::ListDatabasesRequest - - # 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_databases.metadata.to_h - - # Set x-goog-api-client and x-goog-user-project 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::Firestore::Admin::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.list_databases.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_databases.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @firestore_admin_stub.list_databases request, options do |result, operation| - yield result, operation if block_given? - return result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Updates a database. - # - # @overload update_database(request, options = nil) - # Pass arguments to `update_database` via a request object, either of type - # {::Google::Cloud::Firestore::Admin::V1::UpdateDatabaseRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Firestore::Admin::V1::UpdateDatabaseRequest, ::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_database(database: nil, update_mask: nil) - # Pass arguments to `update_database` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param database [::Google::Cloud::Firestore::Admin::V1::Database, ::Hash] - # Required. The database to update. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # The list of fields to be updated. - # @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/firestore/admin/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Firestore::Admin::V1::UpdateDatabaseRequest.new - # - # # Call the update_database method. - # result = client.update_database 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_database request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Firestore::Admin::V1::UpdateDatabaseRequest - - # 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_database.metadata.to_h - - # Set x-goog-api-client and x-goog-user-project 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::Firestore::Admin::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.update_database.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_database.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @firestore_admin_stub.update_database request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - return result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes a database. - # - # @overload delete_database(request, options = nil) - # Pass arguments to `delete_database` via a request object, either of type - # {::Google::Cloud::Firestore::Admin::V1::DeleteDatabaseRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Firestore::Admin::V1::DeleteDatabaseRequest, ::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_database(name: nil, etag: nil) - # Pass arguments to `delete_database` 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. A name of the form - # `projects/{project_id}/databases/{database_id}` - # @param etag [::String] - # The current etag of the Database. - # If an etag is provided and does not match the current etag of the database, - # deletion will be blocked and a FAILED_PRECONDITION error will be returned. - # @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/firestore/admin/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Firestore::Admin::V1::DeleteDatabaseRequest.new - # - # # Call the delete_database method. - # result = client.delete_database 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 delete_database request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Firestore::Admin::V1::DeleteDatabaseRequest - - # 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_database.metadata.to_h - - # Set x-goog-api-client and x-goog-user-project 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::Firestore::Admin::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.delete_database.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_database.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @firestore_admin_stub.delete_database request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - return result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets information about a backup. - # - # @overload get_backup(request, options = nil) - # Pass arguments to `get_backup` via a request object, either of type - # {::Google::Cloud::Firestore::Admin::V1::GetBackupRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Firestore::Admin::V1::GetBackupRequest, ::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_backup(name: nil) - # Pass arguments to `get_backup` 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. Name of the backup to fetch. - # - # Format is `projects/{project}/locations/{location}/backups/{backup}`. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Firestore::Admin::V1::Backup] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Firestore::Admin::V1::Backup] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/firestore/admin/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Firestore::Admin::V1::GetBackupRequest.new - # - # # Call the get_backup method. - # result = client.get_backup request - # - # # The returned object is of type Google::Cloud::Firestore::Admin::V1::Backup. - # p result - # - def get_backup request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Firestore::Admin::V1::GetBackupRequest - - # 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_backup.metadata.to_h - - # Set x-goog-api-client and x-goog-user-project 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::Firestore::Admin::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_backup.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_backup.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @firestore_admin_stub.get_backup request, options do |result, operation| - yield result, operation if block_given? - return result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Lists all the backups. - # - # @overload list_backups(request, options = nil) - # Pass arguments to `list_backups` via a request object, either of type - # {::Google::Cloud::Firestore::Admin::V1::ListBackupsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Firestore::Admin::V1::ListBackupsRequest, ::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_backups(parent: nil) - # Pass arguments to `list_backups` 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 location to list backups from. - # - # Format is `projects/{project}/locations/{location}`. - # Use `{location} = '-'` to list backups from all locations for the given - # project. This allows listing backups from a single location or from all - # locations. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Firestore::Admin::V1::ListBackupsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Firestore::Admin::V1::ListBackupsResponse] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/firestore/admin/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Firestore::Admin::V1::ListBackupsRequest.new - # - # # Call the list_backups method. - # result = client.list_backups request - # - # # The returned object is of type Google::Cloud::Firestore::Admin::V1::ListBackupsResponse. - # p result - # - def list_backups request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Firestore::Admin::V1::ListBackupsRequest - - # 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_backups.metadata.to_h - - # Set x-goog-api-client and x-goog-user-project 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::Firestore::Admin::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.list_backups.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_backups.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @firestore_admin_stub.list_backups request, options do |result, operation| - yield result, operation if block_given? - return result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes a backup. - # - # @overload delete_backup(request, options = nil) - # Pass arguments to `delete_backup` via a request object, either of type - # {::Google::Cloud::Firestore::Admin::V1::DeleteBackupRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Firestore::Admin::V1::DeleteBackupRequest, ::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_backup(name: nil) - # Pass arguments to `delete_backup` 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. Name of the backup to delete. - # - # format is `projects/{project}/locations/{location}/backups/{backup}`. - # @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/firestore/admin/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Firestore::Admin::V1::DeleteBackupRequest.new - # - # # Call the delete_backup method. - # result = client.delete_backup request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_backup request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Firestore::Admin::V1::DeleteBackupRequest - - # 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_backup.metadata.to_h - - # Set x-goog-api-client and x-goog-user-project 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::Firestore::Admin::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.delete_backup.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_backup.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @firestore_admin_stub.delete_backup request, options do |result, operation| - yield result, operation if block_given? - return result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Creates a new database by restoring from an existing backup. - # - # The new database must be in the same cloud region or multi-region location - # as the existing backup. This behaves similar to - # [FirestoreAdmin.CreateDatabase][google.firestore.admin.v1.CreateDatabase] - # except instead of creating a new empty database, a new database is created - # with the database type, index configuration, and documents from an existing - # backup. - # - # The {::Google::Longrunning::Operation long-running operation} can be used to - # track the progress of the restore, with the Operation's - # {::Google::Longrunning::Operation#metadata metadata} field type being the - # {::Google::Cloud::Firestore::Admin::V1::RestoreDatabaseMetadata RestoreDatabaseMetadata}. - # The {::Google::Longrunning::Operation#response response} type is the - # {::Google::Cloud::Firestore::Admin::V1::Database Database} if the restore was - # successful. The new database is not readable or writeable until the LRO has - # completed. - # - # @overload restore_database(request, options = nil) - # Pass arguments to `restore_database` via a request object, either of type - # {::Google::Cloud::Firestore::Admin::V1::RestoreDatabaseRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Firestore::Admin::V1::RestoreDatabaseRequest, ::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 restore_database(parent: nil, database_id: nil, backup: nil) - # Pass arguments to `restore_database` 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 to restore the database in. Format is - # `projects/{project_id}`. - # @param database_id [::String] - # Required. The ID to use for the database, which will become the final - # component of the database's resource name. This database id must not be - # associated with an existing database. - # - # This value should be 4-63 characters. Valid characters are /[a-z][0-9]-/ - # with first character a letter and the last a letter or a number. Must not - # be UUID-like /[0-9a-f]\\{8}(-[0-9a-f]\\{4})\\{3}-[0-9a-f]\\{12}/. - # - # "(default)" database id is also valid. - # @param backup [::String] - # Required. Backup to restore from. Must be from the same project as the - # parent. - # - # Format is: `projects/{project_id}/locations/{location}/backups/{backup}` - # @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/firestore/admin/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Firestore::Admin::V1::RestoreDatabaseRequest.new - # - # # Call the restore_database method. - # result = client.restore_database 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 restore_database request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Firestore::Admin::V1::RestoreDatabaseRequest - - # 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.restore_database.metadata.to_h - - # Set x-goog-api-client and x-goog-user-project 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::Firestore::Admin::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.restore_database.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.restore_database.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @firestore_admin_stub.restore_database request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - return result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Creates a backup schedule on a database. - # At most two backup schedules can be configured on a database, one daily - # backup schedule with retention up to 7 days and one weekly backup schedule - # with retention up to 14 weeks. - # - # @overload create_backup_schedule(request, options = nil) - # Pass arguments to `create_backup_schedule` via a request object, either of type - # {::Google::Cloud::Firestore::Admin::V1::CreateBackupScheduleRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Firestore::Admin::V1::CreateBackupScheduleRequest, ::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_backup_schedule(parent: nil, backup_schedule: nil) - # Pass arguments to `create_backup_schedule` 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 database. - # - # Format `projects/{project}/databases/{database}` - # @param backup_schedule [::Google::Cloud::Firestore::Admin::V1::BackupSchedule, ::Hash] - # Required. The backup schedule to create. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Firestore::Admin::V1::BackupSchedule] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Firestore::Admin::V1::BackupSchedule] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/firestore/admin/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Firestore::Admin::V1::CreateBackupScheduleRequest.new - # - # # Call the create_backup_schedule method. - # result = client.create_backup_schedule request - # - # # The returned object is of type Google::Cloud::Firestore::Admin::V1::BackupSchedule. - # p result - # - def create_backup_schedule request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Firestore::Admin::V1::CreateBackupScheduleRequest - - # 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_backup_schedule.metadata.to_h - - # Set x-goog-api-client and x-goog-user-project 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::Firestore::Admin::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.create_backup_schedule.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_backup_schedule.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @firestore_admin_stub.create_backup_schedule request, options do |result, operation| - yield result, operation if block_given? - return result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets information about a backup schedule. - # - # @overload get_backup_schedule(request, options = nil) - # Pass arguments to `get_backup_schedule` via a request object, either of type - # {::Google::Cloud::Firestore::Admin::V1::GetBackupScheduleRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Firestore::Admin::V1::GetBackupScheduleRequest, ::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_backup_schedule(name: nil) - # Pass arguments to `get_backup_schedule` 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 backup schedule. - # - # Format - # `projects/{project}/databases/{database}/backupSchedules/{backup_schedule}` - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Firestore::Admin::V1::BackupSchedule] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Firestore::Admin::V1::BackupSchedule] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/firestore/admin/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Firestore::Admin::V1::GetBackupScheduleRequest.new - # - # # Call the get_backup_schedule method. - # result = client.get_backup_schedule request - # - # # The returned object is of type Google::Cloud::Firestore::Admin::V1::BackupSchedule. - # p result - # - def get_backup_schedule request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Firestore::Admin::V1::GetBackupScheduleRequest - - # 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_backup_schedule.metadata.to_h - - # Set x-goog-api-client and x-goog-user-project 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::Firestore::Admin::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_backup_schedule.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_backup_schedule.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @firestore_admin_stub.get_backup_schedule request, options do |result, operation| - yield result, operation if block_given? - return result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # List backup schedules. - # - # @overload list_backup_schedules(request, options = nil) - # Pass arguments to `list_backup_schedules` via a request object, either of type - # {::Google::Cloud::Firestore::Admin::V1::ListBackupSchedulesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Firestore::Admin::V1::ListBackupSchedulesRequest, ::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_backup_schedules(parent: nil) - # Pass arguments to `list_backup_schedules` 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 database. - # - # Format is `projects/{project}/databases/{database}`. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Firestore::Admin::V1::ListBackupSchedulesResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Firestore::Admin::V1::ListBackupSchedulesResponse] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/firestore/admin/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Firestore::Admin::V1::ListBackupSchedulesRequest.new - # - # # Call the list_backup_schedules method. - # result = client.list_backup_schedules request - # - # # The returned object is of type Google::Cloud::Firestore::Admin::V1::ListBackupSchedulesResponse. - # p result - # - def list_backup_schedules request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Firestore::Admin::V1::ListBackupSchedulesRequest - - # 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_backup_schedules.metadata.to_h - - # Set x-goog-api-client and x-goog-user-project 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::Firestore::Admin::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.list_backup_schedules.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_backup_schedules.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @firestore_admin_stub.list_backup_schedules request, options do |result, operation| - yield result, operation if block_given? - return result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Updates a backup schedule. - # - # @overload update_backup_schedule(request, options = nil) - # Pass arguments to `update_backup_schedule` via a request object, either of type - # {::Google::Cloud::Firestore::Admin::V1::UpdateBackupScheduleRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Firestore::Admin::V1::UpdateBackupScheduleRequest, ::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_backup_schedule(backup_schedule: nil, update_mask: nil) - # Pass arguments to `update_backup_schedule` 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 backup_schedule [::Google::Cloud::Firestore::Admin::V1::BackupSchedule, ::Hash] - # Required. The backup schedule to update. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # The list of fields to be updated. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Firestore::Admin::V1::BackupSchedule] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Firestore::Admin::V1::BackupSchedule] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/firestore/admin/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Firestore::Admin::V1::UpdateBackupScheduleRequest.new - # - # # Call the update_backup_schedule method. - # result = client.update_backup_schedule request - # - # # The returned object is of type Google::Cloud::Firestore::Admin::V1::BackupSchedule. - # p result - # - def update_backup_schedule request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Firestore::Admin::V1::UpdateBackupScheduleRequest - - # 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_backup_schedule.metadata.to_h - - # Set x-goog-api-client and x-goog-user-project 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::Firestore::Admin::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.update_backup_schedule.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_backup_schedule.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @firestore_admin_stub.update_backup_schedule request, options do |result, operation| - yield result, operation if block_given? - return result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes a backup schedule. - # - # @overload delete_backup_schedule(request, options = nil) - # Pass arguments to `delete_backup_schedule` via a request object, either of type - # {::Google::Cloud::Firestore::Admin::V1::DeleteBackupScheduleRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Firestore::Admin::V1::DeleteBackupScheduleRequest, ::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_backup_schedule(name: nil) - # Pass arguments to `delete_backup_schedule` 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 backup schedule. - # - # Format - # `projects/{project}/databases/{database}/backupSchedules/{backup_schedule}` - # @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/firestore/admin/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Firestore::Admin::V1::DeleteBackupScheduleRequest.new - # - # # Call the delete_backup_schedule method. - # result = client.delete_backup_schedule request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_backup_schedule request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Firestore::Admin::V1::DeleteBackupScheduleRequest - - # 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_backup_schedule.metadata.to_h - - # Set x-goog-api-client and x-goog-user-project 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::Firestore::Admin::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.delete_backup_schedule.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_backup_schedule.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @firestore_admin_stub.delete_backup_schedule request, options do |result, operation| - yield result, operation if block_given? - return result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the FirestoreAdmin REST API. - # - # This class represents the configuration for FirestoreAdmin 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::Firestore::Admin::V1::FirestoreAdmin::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 - # # create_index to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.create_index.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.create_index.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 - # @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] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "firestore.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::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 - - # @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 FirestoreAdmin 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 `create_index` - # @return [::Gapic::Config::Method] - # - attr_reader :create_index - ## - # RPC-specific configuration for `list_indexes` - # @return [::Gapic::Config::Method] - # - attr_reader :list_indexes - ## - # RPC-specific configuration for `get_index` - # @return [::Gapic::Config::Method] - # - attr_reader :get_index - ## - # RPC-specific configuration for `delete_index` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_index - ## - # RPC-specific configuration for `get_field` - # @return [::Gapic::Config::Method] - # - attr_reader :get_field - ## - # RPC-specific configuration for `update_field` - # @return [::Gapic::Config::Method] - # - attr_reader :update_field - ## - # RPC-specific configuration for `list_fields` - # @return [::Gapic::Config::Method] - # - attr_reader :list_fields - ## - # RPC-specific configuration for `export_documents` - # @return [::Gapic::Config::Method] - # - attr_reader :export_documents - ## - # RPC-specific configuration for `import_documents` - # @return [::Gapic::Config::Method] - # - attr_reader :import_documents - ## - # RPC-specific configuration for `create_database` - # @return [::Gapic::Config::Method] - # - attr_reader :create_database - ## - # RPC-specific configuration for `get_database` - # @return [::Gapic::Config::Method] - # - attr_reader :get_database - ## - # RPC-specific configuration for `list_databases` - # @return [::Gapic::Config::Method] - # - attr_reader :list_databases - ## - # RPC-specific configuration for `update_database` - # @return [::Gapic::Config::Method] - # - attr_reader :update_database - ## - # RPC-specific configuration for `delete_database` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_database - ## - # RPC-specific configuration for `get_backup` - # @return [::Gapic::Config::Method] - # - attr_reader :get_backup - ## - # RPC-specific configuration for `list_backups` - # @return [::Gapic::Config::Method] - # - attr_reader :list_backups - ## - # RPC-specific configuration for `delete_backup` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_backup - ## - # RPC-specific configuration for `restore_database` - # @return [::Gapic::Config::Method] - # - attr_reader :restore_database - ## - # RPC-specific configuration for `create_backup_schedule` - # @return [::Gapic::Config::Method] - # - attr_reader :create_backup_schedule - ## - # RPC-specific configuration for `get_backup_schedule` - # @return [::Gapic::Config::Method] - # - attr_reader :get_backup_schedule - ## - # RPC-specific configuration for `list_backup_schedules` - # @return [::Gapic::Config::Method] - # - attr_reader :list_backup_schedules - ## - # RPC-specific configuration for `update_backup_schedule` - # @return [::Gapic::Config::Method] - # - attr_reader :update_backup_schedule - ## - # RPC-specific configuration for `delete_backup_schedule` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_backup_schedule - - # @private - def initialize parent_rpcs = nil - create_index_config = parent_rpcs.create_index if parent_rpcs.respond_to? :create_index - @create_index = ::Gapic::Config::Method.new create_index_config - list_indexes_config = parent_rpcs.list_indexes if parent_rpcs.respond_to? :list_indexes - @list_indexes = ::Gapic::Config::Method.new list_indexes_config - get_index_config = parent_rpcs.get_index if parent_rpcs.respond_to? :get_index - @get_index = ::Gapic::Config::Method.new get_index_config - delete_index_config = parent_rpcs.delete_index if parent_rpcs.respond_to? :delete_index - @delete_index = ::Gapic::Config::Method.new delete_index_config - get_field_config = parent_rpcs.get_field if parent_rpcs.respond_to? :get_field - @get_field = ::Gapic::Config::Method.new get_field_config - update_field_config = parent_rpcs.update_field if parent_rpcs.respond_to? :update_field - @update_field = ::Gapic::Config::Method.new update_field_config - list_fields_config = parent_rpcs.list_fields if parent_rpcs.respond_to? :list_fields - @list_fields = ::Gapic::Config::Method.new list_fields_config - export_documents_config = parent_rpcs.export_documents if parent_rpcs.respond_to? :export_documents - @export_documents = ::Gapic::Config::Method.new export_documents_config - import_documents_config = parent_rpcs.import_documents if parent_rpcs.respond_to? :import_documents - @import_documents = ::Gapic::Config::Method.new import_documents_config - create_database_config = parent_rpcs.create_database if parent_rpcs.respond_to? :create_database - @create_database = ::Gapic::Config::Method.new create_database_config - get_database_config = parent_rpcs.get_database if parent_rpcs.respond_to? :get_database - @get_database = ::Gapic::Config::Method.new get_database_config - list_databases_config = parent_rpcs.list_databases if parent_rpcs.respond_to? :list_databases - @list_databases = ::Gapic::Config::Method.new list_databases_config - update_database_config = parent_rpcs.update_database if parent_rpcs.respond_to? :update_database - @update_database = ::Gapic::Config::Method.new update_database_config - delete_database_config = parent_rpcs.delete_database if parent_rpcs.respond_to? :delete_database - @delete_database = ::Gapic::Config::Method.new delete_database_config - get_backup_config = parent_rpcs.get_backup if parent_rpcs.respond_to? :get_backup - @get_backup = ::Gapic::Config::Method.new get_backup_config - list_backups_config = parent_rpcs.list_backups if parent_rpcs.respond_to? :list_backups - @list_backups = ::Gapic::Config::Method.new list_backups_config - delete_backup_config = parent_rpcs.delete_backup if parent_rpcs.respond_to? :delete_backup - @delete_backup = ::Gapic::Config::Method.new delete_backup_config - restore_database_config = parent_rpcs.restore_database if parent_rpcs.respond_to? :restore_database - @restore_database = ::Gapic::Config::Method.new restore_database_config - create_backup_schedule_config = parent_rpcs.create_backup_schedule if parent_rpcs.respond_to? :create_backup_schedule - @create_backup_schedule = ::Gapic::Config::Method.new create_backup_schedule_config - get_backup_schedule_config = parent_rpcs.get_backup_schedule if parent_rpcs.respond_to? :get_backup_schedule - @get_backup_schedule = ::Gapic::Config::Method.new get_backup_schedule_config - list_backup_schedules_config = parent_rpcs.list_backup_schedules if parent_rpcs.respond_to? :list_backup_schedules - @list_backup_schedules = ::Gapic::Config::Method.new list_backup_schedules_config - update_backup_schedule_config = parent_rpcs.update_backup_schedule if parent_rpcs.respond_to? :update_backup_schedule - @update_backup_schedule = ::Gapic::Config::Method.new update_backup_schedule_config - delete_backup_schedule_config = parent_rpcs.delete_backup_schedule if parent_rpcs.respond_to? :delete_backup_schedule - @delete_backup_schedule = ::Gapic::Config::Method.new delete_backup_schedule_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-firestore-admin-v1/lib/google/cloud/firestore/admin/v1/firestore_admin/rest/operations.rb b/owl-bot-staging/google-cloud-firestore-admin-v1/lib/google/cloud/firestore/admin/v1/firestore_admin/rest/operations.rb deleted file mode 100644 index af21a955d2d1..000000000000 --- a/owl-bot-staging/google-cloud-firestore-admin-v1/lib/google/cloud/firestore/admin/v1/firestore_admin/rest/operations.rb +++ /dev/null @@ -1,897 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 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 Firestore - module Admin - module V1 - module FirestoreAdmin - module Rest - # Service that implements Longrunning Operations API. - class Operations - # @private - DEFAULT_ENDPOINT_TEMPLATE = "firestore.$UNIVERSE_DOMAIN$" - - # @private - attr_reader :operations_stub - - ## - # Configuration for the FirestoreAdmin 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 FirestoreAdmin 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`. - # - # NOTE: the `name` binding allows API services to override the binding - # to use different resource name schemes, such as `users/*/operations`. To - # override the binding, API services can add a binding such as - # `"/v1/{name=users/*}/operations"` to their service configuration. - # For backwards compatibility, the default name includes the operations - # collection id, however overriding users must ensure the name binding - # is the parent resource, without the operations collection id. - # - # @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) - # 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. - # @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 and x-goog-user-project 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::Firestore::Admin::V1::VERSION, - transports_version_send: [:rest] - - 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? - return 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 and x-goog-user-project 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::Firestore::Admin::V1::VERSION, - transports_version_send: [:rest] - - 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? - return 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 and x-goog-user-project 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::Firestore::Admin::V1::VERSION, - transports_version_send: [:rest] - - 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? - return result - 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 and x-goog-user-project 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::Firestore::Admin::V1::VERSION, - transports_version_send: [:rest] - - 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? - return result - 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 - # @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] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "firestore.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::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 - - # @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, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::ListOperationsResponse.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - 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, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - 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, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - 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, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - 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}/operations", - matches: [ - ["name", %r{^projects/[^/]+/databases/[^/]+/?$}, 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/[^/]+/databases/[^/]+/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/[^/]+/databases/[^/]+/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", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/databases/[^/]+/operations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-firestore-admin-v1/lib/google/cloud/firestore/admin/v1/firestore_admin/rest/service_stub.rb b/owl-bot-staging/google-cloud-firestore-admin-v1/lib/google/cloud/firestore/admin/v1/firestore_admin/rest/service_stub.rb deleted file mode 100644 index 3e33a566578e..000000000000 --- a/owl-bot-staging/google-cloud-firestore-admin-v1/lib/google/cloud/firestore/admin/v1/firestore_admin/rest/service_stub.rb +++ /dev/null @@ -1,1437 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 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/firestore/admin/v1/firestore_admin_pb" - -module Google - module Cloud - module Firestore - module Admin - module V1 - module FirestoreAdmin - module Rest - ## - # REST service stub for the FirestoreAdmin service. - # Service stub contains baseline method implementations - # including transcoding, making the REST call, and deserialing the response. - # - class ServiceStub - 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, - numeric_enums: true, - raise_faraday_errors: false - 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 - - ## - # Baseline implementation for the create_index REST call - # - # @param request_pb [::Google::Cloud::Firestore::Admin::V1::CreateIndexRequest] - # 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_index request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_index_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, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - end - - ## - # Baseline implementation for the list_indexes REST call - # - # @param request_pb [::Google::Cloud::Firestore::Admin::V1::ListIndexesRequest] - # 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::Firestore::Admin::V1::ListIndexesResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Firestore::Admin::V1::ListIndexesResponse] - # A result object deserialized from the server's reply - def list_indexes request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_indexes_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, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Firestore::Admin::V1::ListIndexesResponse.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - end - - ## - # Baseline implementation for the get_index REST call - # - # @param request_pb [::Google::Cloud::Firestore::Admin::V1::GetIndexRequest] - # 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::Firestore::Admin::V1::Index] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Firestore::Admin::V1::Index] - # A result object deserialized from the server's reply - def get_index request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_index_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, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Firestore::Admin::V1::Index.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - end - - ## - # Baseline implementation for the delete_index REST call - # - # @param request_pb [::Google::Cloud::Firestore::Admin::V1::DeleteIndexRequest] - # 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_index request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_delete_index_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, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - end - - ## - # Baseline implementation for the get_field REST call - # - # @param request_pb [::Google::Cloud::Firestore::Admin::V1::GetFieldRequest] - # 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::Firestore::Admin::V1::Field] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Firestore::Admin::V1::Field] - # A result object deserialized from the server's reply - def get_field request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_field_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, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Firestore::Admin::V1::Field.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - end - - ## - # Baseline implementation for the update_field REST call - # - # @param request_pb [::Google::Cloud::Firestore::Admin::V1::UpdateFieldRequest] - # 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_field request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_field_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, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - end - - ## - # Baseline implementation for the list_fields REST call - # - # @param request_pb [::Google::Cloud::Firestore::Admin::V1::ListFieldsRequest] - # 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::Firestore::Admin::V1::ListFieldsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Firestore::Admin::V1::ListFieldsResponse] - # A result object deserialized from the server's reply - def list_fields request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_fields_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, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Firestore::Admin::V1::ListFieldsResponse.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - end - - ## - # Baseline implementation for the export_documents REST call - # - # @param request_pb [::Google::Cloud::Firestore::Admin::V1::ExportDocumentsRequest] - # 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 export_documents request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_export_documents_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, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - end - - ## - # Baseline implementation for the import_documents REST call - # - # @param request_pb [::Google::Cloud::Firestore::Admin::V1::ImportDocumentsRequest] - # 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 import_documents request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_import_documents_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, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - end - - ## - # Baseline implementation for the create_database REST call - # - # @param request_pb [::Google::Cloud::Firestore::Admin::V1::CreateDatabaseRequest] - # 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_database request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_database_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, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - end - - ## - # Baseline implementation for the get_database REST call - # - # @param request_pb [::Google::Cloud::Firestore::Admin::V1::GetDatabaseRequest] - # 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::Firestore::Admin::V1::Database] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Firestore::Admin::V1::Database] - # A result object deserialized from the server's reply - def get_database request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_database_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, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Firestore::Admin::V1::Database.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - end - - ## - # Baseline implementation for the list_databases REST call - # - # @param request_pb [::Google::Cloud::Firestore::Admin::V1::ListDatabasesRequest] - # 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::Firestore::Admin::V1::ListDatabasesResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Firestore::Admin::V1::ListDatabasesResponse] - # A result object deserialized from the server's reply - def list_databases request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_databases_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, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Firestore::Admin::V1::ListDatabasesResponse.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - end - - ## - # Baseline implementation for the update_database REST call - # - # @param request_pb [::Google::Cloud::Firestore::Admin::V1::UpdateDatabaseRequest] - # 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_database request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_database_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, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - end - - ## - # Baseline implementation for the delete_database REST call - # - # @param request_pb [::Google::Cloud::Firestore::Admin::V1::DeleteDatabaseRequest] - # 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 delete_database request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_delete_database_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, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - end - - ## - # Baseline implementation for the get_backup REST call - # - # @param request_pb [::Google::Cloud::Firestore::Admin::V1::GetBackupRequest] - # 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::Firestore::Admin::V1::Backup] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Firestore::Admin::V1::Backup] - # A result object deserialized from the server's reply - def get_backup request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_backup_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, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Firestore::Admin::V1::Backup.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - end - - ## - # Baseline implementation for the list_backups REST call - # - # @param request_pb [::Google::Cloud::Firestore::Admin::V1::ListBackupsRequest] - # 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::Firestore::Admin::V1::ListBackupsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Firestore::Admin::V1::ListBackupsResponse] - # A result object deserialized from the server's reply - def list_backups request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_backups_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, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Firestore::Admin::V1::ListBackupsResponse.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - end - - ## - # Baseline implementation for the delete_backup REST call - # - # @param request_pb [::Google::Cloud::Firestore::Admin::V1::DeleteBackupRequest] - # 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_backup request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_delete_backup_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, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - end - - ## - # Baseline implementation for the restore_database REST call - # - # @param request_pb [::Google::Cloud::Firestore::Admin::V1::RestoreDatabaseRequest] - # 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 restore_database request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_restore_database_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, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - end - - ## - # Baseline implementation for the create_backup_schedule REST call - # - # @param request_pb [::Google::Cloud::Firestore::Admin::V1::CreateBackupScheduleRequest] - # 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::Firestore::Admin::V1::BackupSchedule] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Firestore::Admin::V1::BackupSchedule] - # A result object deserialized from the server's reply - def create_backup_schedule request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_backup_schedule_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, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Firestore::Admin::V1::BackupSchedule.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - end - - ## - # Baseline implementation for the get_backup_schedule REST call - # - # @param request_pb [::Google::Cloud::Firestore::Admin::V1::GetBackupScheduleRequest] - # 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::Firestore::Admin::V1::BackupSchedule] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Firestore::Admin::V1::BackupSchedule] - # A result object deserialized from the server's reply - def get_backup_schedule request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_backup_schedule_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, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Firestore::Admin::V1::BackupSchedule.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - end - - ## - # Baseline implementation for the list_backup_schedules REST call - # - # @param request_pb [::Google::Cloud::Firestore::Admin::V1::ListBackupSchedulesRequest] - # 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::Firestore::Admin::V1::ListBackupSchedulesResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Firestore::Admin::V1::ListBackupSchedulesResponse] - # A result object deserialized from the server's reply - def list_backup_schedules request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_backup_schedules_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, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Firestore::Admin::V1::ListBackupSchedulesResponse.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - end - - ## - # Baseline implementation for the update_backup_schedule REST call - # - # @param request_pb [::Google::Cloud::Firestore::Admin::V1::UpdateBackupScheduleRequest] - # 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::Firestore::Admin::V1::BackupSchedule] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Firestore::Admin::V1::BackupSchedule] - # A result object deserialized from the server's reply - def update_backup_schedule request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_backup_schedule_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, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Firestore::Admin::V1::BackupSchedule.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - end - - ## - # Baseline implementation for the delete_backup_schedule REST call - # - # @param request_pb [::Google::Cloud::Firestore::Admin::V1::DeleteBackupScheduleRequest] - # 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_backup_schedule request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_delete_backup_schedule_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, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - end - - ## - # @private - # - # GRPC transcoding helper method for the create_index REST call - # - # @param request_pb [::Google::Cloud::Firestore::Admin::V1::CreateIndexRequest] - # 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_index_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/indexes", - body: "index", - matches: [ - ["parent", %r{^projects/[^/]+/databases/[^/]+/collectionGroups/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_indexes REST call - # - # @param request_pb [::Google::Cloud::Firestore::Admin::V1::ListIndexesRequest] - # 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_indexes_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/indexes", - matches: [ - ["parent", %r{^projects/[^/]+/databases/[^/]+/collectionGroups/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_index REST call - # - # @param request_pb [::Google::Cloud::Firestore::Admin::V1::GetIndexRequest] - # 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_index_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/databases/[^/]+/collectionGroups/[^/]+/indexes/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_index REST call - # - # @param request_pb [::Google::Cloud::Firestore::Admin::V1::DeleteIndexRequest] - # 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_index_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/databases/[^/]+/collectionGroups/[^/]+/indexes/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_field REST call - # - # @param request_pb [::Google::Cloud::Firestore::Admin::V1::GetFieldRequest] - # 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_field_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/databases/[^/]+/collectionGroups/[^/]+/fields/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_field REST call - # - # @param request_pb [::Google::Cloud::Firestore::Admin::V1::UpdateFieldRequest] - # 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_field_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v1/{field.name}", - body: "field", - matches: [ - ["field.name", %r{^projects/[^/]+/databases/[^/]+/collectionGroups/[^/]+/fields/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_fields REST call - # - # @param request_pb [::Google::Cloud::Firestore::Admin::V1::ListFieldsRequest] - # 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_fields_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/fields", - matches: [ - ["parent", %r{^projects/[^/]+/databases/[^/]+/collectionGroups/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the export_documents REST call - # - # @param request_pb [::Google::Cloud::Firestore::Admin::V1::ExportDocumentsRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_export_documents_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:exportDocuments", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/databases/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the import_documents REST call - # - # @param request_pb [::Google::Cloud::Firestore::Admin::V1::ImportDocumentsRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_import_documents_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:importDocuments", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/databases/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the create_database REST call - # - # @param request_pb [::Google::Cloud::Firestore::Admin::V1::CreateDatabaseRequest] - # 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_database_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/databases", - body: "database", - matches: [ - ["parent", %r{^projects/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_database REST call - # - # @param request_pb [::Google::Cloud::Firestore::Admin::V1::GetDatabaseRequest] - # 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_database_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/databases/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_databases REST call - # - # @param request_pb [::Google::Cloud::Firestore::Admin::V1::ListDatabasesRequest] - # 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_databases_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/databases", - matches: [ - ["parent", %r{^projects/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_database REST call - # - # @param request_pb [::Google::Cloud::Firestore::Admin::V1::UpdateDatabaseRequest] - # 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_database_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v1/{database.name}", - body: "database", - matches: [ - ["database.name", %r{^projects/[^/]+/databases/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_database REST call - # - # @param request_pb [::Google::Cloud::Firestore::Admin::V1::DeleteDatabaseRequest] - # 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_database_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/databases/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_backup REST call - # - # @param request_pb [::Google::Cloud::Firestore::Admin::V1::GetBackupRequest] - # 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_backup_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/backups/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_backups REST call - # - # @param request_pb [::Google::Cloud::Firestore::Admin::V1::ListBackupsRequest] - # 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_backups_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/backups", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_backup REST call - # - # @param request_pb [::Google::Cloud::Firestore::Admin::V1::DeleteBackupRequest] - # 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_backup_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/backups/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the restore_database REST call - # - # @param request_pb [::Google::Cloud::Firestore::Admin::V1::RestoreDatabaseRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_restore_database_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/databases:restore", - body: "*", - matches: [ - ["parent", %r{^projects/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the create_backup_schedule REST call - # - # @param request_pb [::Google::Cloud::Firestore::Admin::V1::CreateBackupScheduleRequest] - # 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_backup_schedule_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/backupSchedules", - body: "backup_schedule", - matches: [ - ["parent", %r{^projects/[^/]+/databases/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_backup_schedule REST call - # - # @param request_pb [::Google::Cloud::Firestore::Admin::V1::GetBackupScheduleRequest] - # 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_backup_schedule_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/databases/[^/]+/backupSchedules/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_backup_schedules REST call - # - # @param request_pb [::Google::Cloud::Firestore::Admin::V1::ListBackupSchedulesRequest] - # 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_backup_schedules_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/backupSchedules", - matches: [ - ["parent", %r{^projects/[^/]+/databases/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_backup_schedule REST call - # - # @param request_pb [::Google::Cloud::Firestore::Admin::V1::UpdateBackupScheduleRequest] - # 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_backup_schedule_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v1/{backup_schedule.name}", - body: "backup_schedule", - matches: [ - ["backup_schedule.name", %r{^projects/[^/]+/databases/[^/]+/backupSchedules/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_backup_schedule REST call - # - # @param request_pb [::Google::Cloud::Firestore::Admin::V1::DeleteBackupScheduleRequest] - # 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_backup_schedule_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/databases/[^/]+/backupSchedules/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-firestore-admin-v1/lib/google/cloud/firestore/admin/v1/rest.rb b/owl-bot-staging/google-cloud-firestore-admin-v1/lib/google/cloud/firestore/admin/v1/rest.rb deleted file mode 100644 index 625b601f53b4..000000000000 --- a/owl-bot-staging/google-cloud-firestore-admin-v1/lib/google/cloud/firestore/admin/v1/rest.rb +++ /dev/null @@ -1,39 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 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/firestore/admin/v1/firestore_admin/rest" -require "google/cloud/firestore/admin/v1/version" - -module Google - module Cloud - module Firestore - module Admin - ## - # To load just the REST part of this package, including all its services, and instantiate a REST client: - # - # @example - # - # require "google/cloud/firestore/admin/v1/rest" - # client = ::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Rest::Client.new - # - module V1 - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-firestore-admin-v1/lib/google/cloud/firestore/admin/v1/version.rb b/owl-bot-staging/google-cloud-firestore-admin-v1/lib/google/cloud/firestore/admin/v1/version.rb deleted file mode 100644 index c62f1676b769..000000000000 --- a/owl-bot-staging/google-cloud-firestore-admin-v1/lib/google/cloud/firestore/admin/v1/version.rb +++ /dev/null @@ -1,30 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 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 Firestore - module Admin - module V1 - VERSION = "0.0.1" - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-firestore-admin-v1/lib/google/firestore/admin/v1/backup_pb.rb b/owl-bot-staging/google-cloud-firestore-admin-v1/lib/google/firestore/admin/v1/backup_pb.rb deleted file mode 100644 index e0ac294397fe..000000000000 --- a/owl-bot-staging/google-cloud-firestore-admin-v1/lib/google/firestore/admin/v1/backup_pb.rb +++ /dev/null @@ -1,51 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/firestore/admin/v1/backup.proto - -require 'google/protobuf' - -require 'google/api/field_behavior_pb' -require 'google/api/resource_pb' -require 'google/protobuf/timestamp_pb' - - -descriptor_data = "\n&google/firestore/admin/v1/backup.proto\x12\x19google.firestore.admin.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xe0\x04\n\x06\x42\x61\x63kup\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12;\n\x08\x64\x61tabase\x18\x02 \x01(\tB)\xe0\x41\x03\xfa\x41#\n!firestore.googleapis.com/Database\x12\x19\n\x0c\x64\x61tabase_uid\x18\x07 \x01(\tB\x03\xe0\x41\x03\x12\x36\n\rsnapshot_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0b\x65xpire_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12;\n\x05stats\x18\x06 \x01(\x0b\x32\'.google.firestore.admin.v1.Backup.StatsB\x03\xe0\x41\x03\x12;\n\x05state\x18\x08 \x01(\x0e\x32\'.google.firestore.admin.v1.Backup.StateB\x03\xe0\x41\x03\x1aW\n\x05Stats\x12\x17\n\nsize_bytes\x18\x01 \x01(\x03\x42\x03\xe0\x41\x03\x12\x1b\n\x0e\x64ocument_count\x18\x02 \x01(\x03\x42\x03\xe0\x41\x03\x12\x18\n\x0bindex_count\x18\x03 \x01(\x03\x42\x03\xe0\x41\x03\"J\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0c\n\x08\x43REATING\x10\x01\x12\t\n\x05READY\x10\x02\x12\x11\n\rNOT_AVAILABLE\x10\x03:^\xea\x41[\n\x1f\x66irestore.googleapis.com/Backup\x12\x38projects/{project}/locations/{location}/backups/{backup}B\xda\x01\n\x1d\x63om.google.firestore.admin.v1B\x0b\x42\x61\x63kupProtoP\x01Z9cloud.google.com/go/firestore/apiv1/admin/adminpb;adminpb\xa2\x02\x04GCFS\xaa\x02\x1fGoogle.Cloud.Firestore.Admin.V1\xca\x02\x1fGoogle\\Cloud\\Firestore\\Admin\\V1\xea\x02#Google::Cloud::Firestore::Admin::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 Firestore - module Admin - module V1 - Backup = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.firestore.admin.v1.Backup").msgclass - Backup::Stats = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.firestore.admin.v1.Backup.Stats").msgclass - Backup::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.firestore.admin.v1.Backup.State").enummodule - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-firestore-admin-v1/lib/google/firestore/admin/v1/database_pb.rb b/owl-bot-staging/google-cloud-firestore-admin-v1/lib/google/firestore/admin/v1/database_pb.rb deleted file mode 100644 index 43e47b80eeaf..000000000000 --- a/owl-bot-staging/google-cloud-firestore-admin-v1/lib/google/firestore/admin/v1/database_pb.rb +++ /dev/null @@ -1,56 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/firestore/admin/v1/database.proto - -require 'google/protobuf' - -require 'google/api/field_behavior_pb' -require 'google/api/resource_pb' -require 'google/protobuf/duration_pb' -require 'google/protobuf/timestamp_pb' - - -descriptor_data = "\n(google/firestore/admin/v1/database.proto\x12\x19google.firestore.admin.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xb9\x0b\n\x08\x44\x61tabase\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x10\n\x03uid\x18\x03 \x01(\tB\x03\xe0\x41\x03\x12\x34\n\x0b\x63reate_time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x13\n\x0blocation_id\x18\t \x01(\t\x12>\n\x04type\x18\n \x01(\x0e\x32\x30.google.firestore.admin.v1.Database.DatabaseType\x12M\n\x10\x63oncurrency_mode\x18\x0f \x01(\x0e\x32\x33.google.firestore.admin.v1.Database.ConcurrencyMode\x12@\n\x18version_retention_period\x18\x11 \x01(\x0b\x32\x19.google.protobuf.DurationB\x03\xe0\x41\x03\x12>\n\x15\x65\x61rliest_version_time\x18\x12 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12l\n!point_in_time_recovery_enablement\x18\x15 \x01(\x0e\x32\x41.google.firestore.admin.v1.Database.PointInTimeRecoveryEnablement\x12\x61\n\x1b\x61pp_engine_integration_mode\x18\x13 \x01(\x0e\x32<.google.firestore.admin.v1.Database.AppEngineIntegrationMode\x12\x17\n\nkey_prefix\x18\x14 \x01(\tB\x03\xe0\x41\x03\x12Z\n\x17\x64\x65lete_protection_state\x18\x16 \x01(\x0e\x32\x39.google.firestore.admin.v1.Database.DeleteProtectionState\x12\x0c\n\x04\x65tag\x18\x63 \x01(\t\"W\n\x0c\x44\x61tabaseType\x12\x1d\n\x19\x44\x41TABASE_TYPE_UNSPECIFIED\x10\x00\x12\x14\n\x10\x46IRESTORE_NATIVE\x10\x01\x12\x12\n\x0e\x44\x41TASTORE_MODE\x10\x02\"w\n\x0f\x43oncurrencyMode\x12 \n\x1c\x43ONCURRENCY_MODE_UNSPECIFIED\x10\x00\x12\x0e\n\nOPTIMISTIC\x10\x01\x12\x0f\n\x0bPESSIMISTIC\x10\x02\x12!\n\x1dOPTIMISTIC_WITH_ENTITY_GROUPS\x10\x03\"\x9b\x01\n\x1dPointInTimeRecoveryEnablement\x12\x31\n-POINT_IN_TIME_RECOVERY_ENABLEMENT_UNSPECIFIED\x10\x00\x12\"\n\x1ePOINT_IN_TIME_RECOVERY_ENABLED\x10\x01\x12#\n\x1fPOINT_IN_TIME_RECOVERY_DISABLED\x10\x02\"b\n\x18\x41ppEngineIntegrationMode\x12+\n\'APP_ENGINE_INTEGRATION_MODE_UNSPECIFIED\x10\x00\x12\x0b\n\x07\x45NABLED\x10\x01\x12\x0c\n\x08\x44ISABLED\x10\x02\"\x7f\n\x15\x44\x65leteProtectionState\x12\'\n#DELETE_PROTECTION_STATE_UNSPECIFIED\x10\x00\x12\x1e\n\x1a\x44\x45LETE_PROTECTION_DISABLED\x10\x01\x12\x1d\n\x19\x44\x45LETE_PROTECTION_ENABLED\x10\x02:R\xea\x41O\n!firestore.googleapis.com/Database\x12\'projects/{project}/databases/{database}R\x01\x01\x42\xdc\x01\n\x1d\x63om.google.firestore.admin.v1B\rDatabaseProtoP\x01Z9cloud.google.com/go/firestore/apiv1/admin/adminpb;adminpb\xa2\x02\x04GCFS\xaa\x02\x1fGoogle.Cloud.Firestore.Admin.V1\xca\x02\x1fGoogle\\Cloud\\Firestore\\Admin\\V1\xea\x02#Google::Cloud::Firestore::Admin::V1b\x06proto3" - -pool = Google::Protobuf::DescriptorPool.generated_pool - -begin - pool.add_serialized_file(descriptor_data) -rescue TypeError - # Compatibility code: will be removed in the next major version. - require 'google/protobuf/descriptor_pb' - parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) - parsed.clear_dependency - serialized = parsed.class.encode(parsed) - file = pool.add_serialized_file(serialized) - warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" - imports = [ - ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], - ["google.protobuf.Duration", "google/protobuf/duration.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 Firestore - module Admin - module V1 - Database = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.firestore.admin.v1.Database").msgclass - Database::DatabaseType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.firestore.admin.v1.Database.DatabaseType").enummodule - Database::ConcurrencyMode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.firestore.admin.v1.Database.ConcurrencyMode").enummodule - Database::PointInTimeRecoveryEnablement = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.firestore.admin.v1.Database.PointInTimeRecoveryEnablement").enummodule - Database::AppEngineIntegrationMode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.firestore.admin.v1.Database.AppEngineIntegrationMode").enummodule - Database::DeleteProtectionState = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.firestore.admin.v1.Database.DeleteProtectionState").enummodule - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-firestore-admin-v1/lib/google/firestore/admin/v1/field_pb.rb b/owl-bot-staging/google-cloud-firestore-admin-v1/lib/google/firestore/admin/v1/field_pb.rb deleted file mode 100644 index 986cb252bd7b..000000000000 --- a/owl-bot-staging/google-cloud-firestore-admin-v1/lib/google/firestore/admin/v1/field_pb.rb +++ /dev/null @@ -1,52 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/firestore/admin/v1/field.proto - -require 'google/protobuf' - -require 'google/api/field_behavior_pb' -require 'google/api/resource_pb' -require 'google/firestore/admin/v1/index_pb' - - -descriptor_data = "\n%google/firestore/admin/v1/field.proto\x12\x19google.firestore.admin.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a%google/firestore/admin/v1/index.proto\"\xc5\x04\n\x05\x46ield\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x42\n\x0cindex_config\x18\x02 \x01(\x0b\x32,.google.firestore.admin.v1.Field.IndexConfig\x12>\n\nttl_config\x18\x03 \x01(\x0b\x32*.google.firestore.admin.v1.Field.TtlConfig\x1a\x89\x01\n\x0bIndexConfig\x12\x31\n\x07indexes\x18\x01 \x03(\x0b\x32 .google.firestore.admin.v1.Index\x12\x1c\n\x14uses_ancestor_config\x18\x02 \x01(\x08\x12\x16\n\x0e\x61ncestor_field\x18\x03 \x01(\t\x12\x11\n\treverting\x18\x04 \x01(\x08\x1a\x9d\x01\n\tTtlConfig\x12\x44\n\x05state\x18\x01 \x01(\x0e\x32\x30.google.firestore.admin.v1.Field.TtlConfig.StateB\x03\xe0\x41\x03\"J\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0c\n\x08\x43REATING\x10\x01\x12\n\n\x06\x41\x43TIVE\x10\x02\x12\x10\n\x0cNEEDS_REPAIR\x10\x03:y\xea\x41v\n\x1e\x66irestore.googleapis.com/Field\x12Tprojects/{project}/databases/{database}/collectionGroups/{collection}/fields/{field}B\xd9\x01\n\x1d\x63om.google.firestore.admin.v1B\nFieldProtoP\x01Z9cloud.google.com/go/firestore/apiv1/admin/adminpb;adminpb\xa2\x02\x04GCFS\xaa\x02\x1fGoogle.Cloud.Firestore.Admin.V1\xca\x02\x1fGoogle\\Cloud\\Firestore\\Admin\\V1\xea\x02#Google::Cloud::Firestore::Admin::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.firestore.admin.v1.Index", "google/firestore/admin/v1/index.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 Firestore - module Admin - module V1 - Field = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.firestore.admin.v1.Field").msgclass - Field::IndexConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.firestore.admin.v1.Field.IndexConfig").msgclass - Field::TtlConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.firestore.admin.v1.Field.TtlConfig").msgclass - Field::TtlConfig::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.firestore.admin.v1.Field.TtlConfig.State").enummodule - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-firestore-admin-v1/lib/google/firestore/admin/v1/firestore_admin_pb.rb b/owl-bot-staging/google-cloud-firestore-admin-v1/lib/google/firestore/admin/v1/firestore_admin_pb.rb deleted file mode 100644 index a8c094449919..000000000000 --- a/owl-bot-staging/google-cloud-firestore-admin-v1/lib/google/firestore/admin/v1/firestore_admin_pb.rb +++ /dev/null @@ -1,96 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/firestore/admin/v1/firestore_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/firestore/admin/v1/backup_pb' -require 'google/firestore/admin/v1/database_pb' -require 'google/firestore/admin/v1/field_pb' -require 'google/firestore/admin/v1/index_pb' -require 'google/firestore/admin/v1/operation_pb' -require 'google/firestore/admin/v1/schedule_pb' -require 'google/longrunning/operations_pb' -require 'google/protobuf/empty_pb' -require 'google/protobuf/field_mask_pb' -require 'google/protobuf/timestamp_pb' - - -descriptor_data = "\n/google/firestore/admin/v1/firestore_admin.proto\x12\x19google.firestore.admin.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a&google/firestore/admin/v1/backup.proto\x1a(google/firestore/admin/v1/database.proto\x1a%google/firestore/admin/v1/field.proto\x1a%google/firestore/admin/v1/index.proto\x1a)google/firestore/admin/v1/operation.proto\x1a(google/firestore/admin/v1/schedule.proto\x1a#google/longrunning/operations.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"Q\n\x14ListDatabasesRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\x12!firestore.googleapis.com/Database\"\xa8\x01\n\x15\x43reateDatabaseRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\x12!firestore.googleapis.com/Database\x12:\n\x08\x64\x61tabase\x18\x02 \x01(\x0b\x32#.google.firestore.admin.v1.DatabaseB\x03\xe0\x41\x02\x12\x18\n\x0b\x64\x61tabase_id\x18\x03 \x01(\tB\x03\xe0\x41\x02\"\x18\n\x16\x43reateDatabaseMetadata\"d\n\x15ListDatabasesResponse\x12\x36\n\tdatabases\x18\x01 \x03(\x0b\x32#.google.firestore.admin.v1.Database\x12\x13\n\x0bunreachable\x18\x03 \x03(\t\"M\n\x12GetDatabaseRequest\x12\x37\n\x04name\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!firestore.googleapis.com/Database\"\x84\x01\n\x15UpdateDatabaseRequest\x12:\n\x08\x64\x61tabase\x18\x01 \x01(\x0b\x32#.google.firestore.admin.v1.DatabaseB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"\x18\n\x16UpdateDatabaseMetadata\"^\n\x15\x44\x65leteDatabaseRequest\x12\x37\n\x04name\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!firestore.googleapis.com/Database\x12\x0c\n\x04\x65tag\x18\x03 \x01(\t\"\x18\n\x16\x44\x65leteDatabaseMetadata\"\xa1\x01\n\x1b\x43reateBackupScheduleRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!firestore.googleapis.com/Database\x12G\n\x0f\x62\x61\x63kup_schedule\x18\x02 \x01(\x0b\x32).google.firestore.admin.v1.BackupScheduleB\x03\xe0\x41\x02\"Y\n\x18GetBackupScheduleRequest\x12=\n\x04name\x18\x01 \x01(\tB/\xe0\x41\x02\xfa\x41)\n\'firestore.googleapis.com/BackupSchedule\"\x97\x01\n\x1bUpdateBackupScheduleRequest\x12G\n\x0f\x62\x61\x63kup_schedule\x18\x01 \x01(\x0b\x32).google.firestore.admin.v1.BackupScheduleB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"W\n\x1aListBackupSchedulesRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!firestore.googleapis.com/Database\"b\n\x1bListBackupSchedulesResponse\x12\x43\n\x10\x62\x61\x63kup_schedules\x18\x01 \x03(\x0b\x32).google.firestore.admin.v1.BackupSchedule\"\\\n\x1b\x44\x65leteBackupScheduleRequest\x12=\n\x04name\x18\x01 \x01(\tB/\xe0\x41\x02\xfa\x41)\n\'firestore.googleapis.com/BackupSchedule\"\x8c\x01\n\x12\x43reateIndexRequest\x12@\n\x06parent\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(firestore.googleapis.com/CollectionGroup\x12\x34\n\x05index\x18\x02 \x01(\x0b\x32 .google.firestore.admin.v1.IndexB\x03\xe0\x41\x02\"\x8d\x01\n\x12ListIndexesRequest\x12@\n\x06parent\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(firestore.googleapis.com/CollectionGroup\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\"a\n\x13ListIndexesResponse\x12\x31\n\x07indexes\x18\x01 \x03(\x0b\x32 .google.firestore.admin.v1.Index\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"G\n\x0fGetIndexRequest\x12\x34\n\x04name\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1e\x66irestore.googleapis.com/Index\"J\n\x12\x44\x65leteIndexRequest\x12\x34\n\x04name\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1e\x66irestore.googleapis.com/Index\"{\n\x12UpdateFieldRequest\x12\x34\n\x05\x66ield\x18\x01 \x01(\x0b\x32 .google.firestore.admin.v1.FieldB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"G\n\x0fGetFieldRequest\x12\x34\n\x04name\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1e\x66irestore.googleapis.com/Field\"\x8c\x01\n\x11ListFieldsRequest\x12@\n\x06parent\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(firestore.googleapis.com/CollectionGroup\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\"_\n\x12ListFieldsResponse\x12\x30\n\x06\x66ields\x18\x01 \x03(\x0b\x32 .google.firestore.admin.v1.Field\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\xce\x01\n\x16\x45xportDocumentsRequest\x12\x37\n\x04name\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!firestore.googleapis.com/Database\x12\x16\n\x0e\x63ollection_ids\x18\x02 \x03(\t\x12\x19\n\x11output_uri_prefix\x18\x03 \x01(\t\x12\x15\n\rnamespace_ids\x18\x04 \x03(\t\x12\x31\n\rsnapshot_time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"\x9a\x01\n\x16ImportDocumentsRequest\x12\x37\n\x04name\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!firestore.googleapis.com/Database\x12\x16\n\x0e\x63ollection_ids\x18\x02 \x03(\t\x12\x18\n\x10input_uri_prefix\x18\x03 \x01(\t\x12\x15\n\rnamespace_ids\x18\x04 \x03(\t\"I\n\x10GetBackupRequest\x12\x35\n\x04name\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1f\x66irestore.googleapis.com/Backup\"O\n\x12ListBackupsRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!firestore.googleapis.com/Location\"^\n\x13ListBackupsResponse\x12\x32\n\x07\x62\x61\x63kups\x18\x01 \x03(\x0b\x32!.google.firestore.admin.v1.Backup\x12\x13\n\x0bunreachable\x18\x03 \x03(\t\"L\n\x13\x44\x65leteBackupRequest\x12\x35\n\x04name\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1f\x66irestore.googleapis.com/Backup\"\xa6\x01\n\x16RestoreDatabaseRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\x12!firestore.googleapis.com/Database\x12\x18\n\x0b\x64\x61tabase_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x37\n\x06\x62\x61\x63kup\x18\x03 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1f\x66irestore.googleapis.com/Backup2\xd6#\n\x0e\x46irestoreAdmin\x12\xdb\x01\n\x0b\x43reateIndex\x12-.google.firestore.admin.v1.CreateIndexRequest\x1a\x1d.google.longrunning.Operation\"~\xca\x41\x1f\n\x05Index\x12\x16IndexOperationMetadata\xda\x41\x0cparent,index\x82\xd3\xe4\x93\x02G\">/v1/{parent=projects/*/databases/*/collectionGroups/*}/indexes:\x05index\x12\xbd\x01\n\x0bListIndexes\x12-.google.firestore.admin.v1.ListIndexesRequest\x1a..google.firestore.admin.v1.ListIndexesResponse\"O\xda\x41\x06parent\x82\xd3\xe4\x93\x02@\x12>/v1/{parent=projects/*/databases/*/collectionGroups/*}/indexes\x12\xa7\x01\n\x08GetIndex\x12*.google.firestore.admin.v1.GetIndexRequest\x1a .google.firestore.admin.v1.Index\"M\xda\x41\x04name\x82\xd3\xe4\x93\x02@\x12>/v1/{name=projects/*/databases/*/collectionGroups/*/indexes/*}\x12\xa3\x01\n\x0b\x44\x65leteIndex\x12-.google.firestore.admin.v1.DeleteIndexRequest\x1a\x16.google.protobuf.Empty\"M\xda\x41\x04name\x82\xd3\xe4\x93\x02@*>/v1/{name=projects/*/databases/*/collectionGroups/*/indexes/*}\x12\xa6\x01\n\x08GetField\x12*.google.firestore.admin.v1.GetFieldRequest\x1a .google.firestore.admin.v1.Field\"L\xda\x41\x04name\x82\xd3\xe4\x93\x02?\x12=/v1/{name=projects/*/databases/*/collectionGroups/*/fields/*}\x12\xd9\x01\n\x0bUpdateField\x12-.google.firestore.admin.v1.UpdateFieldRequest\x1a\x1d.google.longrunning.Operation\"|\xca\x41\x1f\n\x05\x46ield\x12\x16\x46ieldOperationMetadata\xda\x41\x05\x66ield\x82\xd3\xe4\x93\x02L2C/v1/{field.name=projects/*/databases/*/collectionGroups/*/fields/*}:\x05\x66ield\x12\xb9\x01\n\nListFields\x12,.google.firestore.admin.v1.ListFieldsRequest\x1a-.google.firestore.admin.v1.ListFieldsResponse\"N\xda\x41\x06parent\x82\xd3\xe4\x93\x02?\x12=/v1/{parent=projects/*/databases/*/collectionGroups/*}/fields\x12\xdd\x01\n\x0f\x45xportDocuments\x12\x31.google.firestore.admin.v1.ExportDocumentsRequest\x1a\x1d.google.longrunning.Operation\"x\xca\x41\x32\n\x17\x45xportDocumentsResponse\x12\x17\x45xportDocumentsMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02\x36\"1/v1/{name=projects/*/databases/*}:exportDocuments:\x01*\x12\xdb\x01\n\x0fImportDocuments\x12\x31.google.firestore.admin.v1.ImportDocumentsRequest\x1a\x1d.google.longrunning.Operation\"v\xca\x41\x30\n\x15google.protobuf.Empty\x12\x17ImportDocumentsMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02\x36\"1/v1/{name=projects/*/databases/*}:importDocuments:\x01*\x12\xd9\x01\n\x0e\x43reateDatabase\x12\x30.google.firestore.admin.v1.CreateDatabaseRequest\x1a\x1d.google.longrunning.Operation\"v\xca\x41\"\n\x08\x44\x61tabase\x12\x16\x43reateDatabaseMetadata\xda\x41\x1bparent,database,database_id\x82\xd3\xe4\x93\x02-\"!/v1/{parent=projects/*}/databases:\x08\x64\x61tabase\x12\x93\x01\n\x0bGetDatabase\x12-.google.firestore.admin.v1.GetDatabaseRequest\x1a#.google.firestore.admin.v1.Database\"0\xda\x41\x04name\x82\xd3\xe4\x93\x02#\x12!/v1/{name=projects/*/databases/*}\x12\xa6\x01\n\rListDatabases\x12/.google.firestore.admin.v1.ListDatabasesRequest\x1a\x30.google.firestore.admin.v1.ListDatabasesResponse\"2\xda\x41\x06parent\x82\xd3\xe4\x93\x02#\x12!/v1/{parent=projects/*}/databases\x12\xdb\x01\n\x0eUpdateDatabase\x12\x30.google.firestore.admin.v1.UpdateDatabaseRequest\x1a\x1d.google.longrunning.Operation\"x\xca\x41\"\n\x08\x44\x61tabase\x12\x16UpdateDatabaseMetadata\xda\x41\x14\x64\x61tabase,update_mask\x82\xd3\xe4\x93\x02\x36\x32*/v1/{database.name=projects/*/databases/*}:\x08\x64\x61tabase\x12\xb8\x01\n\x0e\x44\x65leteDatabase\x12\x30.google.firestore.admin.v1.DeleteDatabaseRequest\x1a\x1d.google.longrunning.Operation\"U\xca\x41\"\n\x08\x44\x61tabase\x12\x16\x44\x65leteDatabaseMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02#*!/v1/{name=projects/*/databases/*}\x12\x97\x01\n\tGetBackup\x12+.google.firestore.admin.v1.GetBackupRequest\x1a!.google.firestore.admin.v1.Backup\":\xda\x41\x04name\x82\xd3\xe4\x93\x02-\x12+/v1/{name=projects/*/locations/*/backups/*}\x12\xaa\x01\n\x0bListBackups\x12-.google.firestore.admin.v1.ListBackupsRequest\x1a..google.firestore.admin.v1.ListBackupsResponse\"<\xda\x41\x06parent\x82\xd3\xe4\x93\x02-\x12+/v1/{parent=projects/*/locations/*}/backups\x12\x92\x01\n\x0c\x44\x65leteBackup\x12..google.firestore.admin.v1.DeleteBackupRequest\x1a\x16.google.protobuf.Empty\":\xda\x41\x04name\x82\xd3\xe4\x93\x02-*+/v1/{name=projects/*/locations/*/backups/*}\x12\xbf\x01\n\x0fRestoreDatabase\x12\x31.google.firestore.admin.v1.RestoreDatabaseRequest\x1a\x1d.google.longrunning.Operation\"Z\xca\x41#\n\x08\x44\x61tabase\x12\x17RestoreDatabaseMetadata\x82\xd3\xe4\x93\x02.\")/v1/{parent=projects/*}/databases:restore:\x01*\x12\xe0\x01\n\x14\x43reateBackupSchedule\x12\x36.google.firestore.admin.v1.CreateBackupScheduleRequest\x1a).google.firestore.admin.v1.BackupSchedule\"e\xda\x41\x16parent,backup_schedule\x82\xd3\xe4\x93\x02\x46\"3/v1/{parent=projects/*/databases/*}/backupSchedules:\x0f\x62\x61\x63kup_schedule\x12\xb7\x01\n\x11GetBackupSchedule\x12\x33.google.firestore.admin.v1.GetBackupScheduleRequest\x1a).google.firestore.admin.v1.BackupSchedule\"B\xda\x41\x04name\x82\xd3\xe4\x93\x02\x35\x12\x33/v1/{name=projects/*/databases/*/backupSchedules/*}\x12\xca\x01\n\x13ListBackupSchedules\x12\x35.google.firestore.admin.v1.ListBackupSchedulesRequest\x1a\x36.google.firestore.admin.v1.ListBackupSchedulesResponse\"D\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x35\x12\x33/v1/{parent=projects/*/databases/*}/backupSchedules\x12\xf5\x01\n\x14UpdateBackupSchedule\x12\x36.google.firestore.admin.v1.UpdateBackupScheduleRequest\x1a).google.firestore.admin.v1.BackupSchedule\"z\xda\x41\x1b\x62\x61\x63kup_schedule,update_mask\x82\xd3\xe4\x93\x02V2C/v1/{backup_schedule.name=projects/*/databases/*/backupSchedules/*}:\x0f\x62\x61\x63kup_schedule\x12\xaa\x01\n\x14\x44\x65leteBackupSchedule\x12\x36.google.firestore.admin.v1.DeleteBackupScheduleRequest\x1a\x16.google.protobuf.Empty\"B\xda\x41\x04name\x82\xd3\xe4\x93\x02\x35*3/v1/{name=projects/*/databases/*/backupSchedules/*}\x1av\xca\x41\x18\x66irestore.googleapis.com\xd2\x41Xhttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/datastoreB\xa5\x03\n\x1d\x63om.google.firestore.admin.v1B\x13\x46irestoreAdminProtoP\x01Z9cloud.google.com/go/firestore/apiv1/admin/adminpb;adminpb\xa2\x02\x04GCFS\xaa\x02\x1fGoogle.Cloud.Firestore.Admin.V1\xca\x02\x1fGoogle\\Cloud\\Firestore\\Admin\\V1\xea\x02#Google::Cloud::Firestore::Admin::V1\xea\x41L\n!firestore.googleapis.com/Location\x12\'projects/{project}/locations/{location}\xea\x41q\n(firestore.googleapis.com/CollectionGroup\x12\x45projects/{project}/databases/{database}/collectionGroups/{collection}b\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.firestore.admin.v1.Database", "google/firestore/admin/v1/database.proto"], - ["google.protobuf.FieldMask", "google/protobuf/field_mask.proto"], - ["google.firestore.admin.v1.BackupSchedule", "google/firestore/admin/v1/schedule.proto"], - ["google.firestore.admin.v1.Index", "google/firestore/admin/v1/index.proto"], - ["google.firestore.admin.v1.Field", "google/firestore/admin/v1/field.proto"], - ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], - ["google.firestore.admin.v1.Backup", "google/firestore/admin/v1/backup.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 Firestore - module Admin - module V1 - ListDatabasesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.firestore.admin.v1.ListDatabasesRequest").msgclass - CreateDatabaseRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.firestore.admin.v1.CreateDatabaseRequest").msgclass - CreateDatabaseMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.firestore.admin.v1.CreateDatabaseMetadata").msgclass - ListDatabasesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.firestore.admin.v1.ListDatabasesResponse").msgclass - GetDatabaseRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.firestore.admin.v1.GetDatabaseRequest").msgclass - UpdateDatabaseRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.firestore.admin.v1.UpdateDatabaseRequest").msgclass - UpdateDatabaseMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.firestore.admin.v1.UpdateDatabaseMetadata").msgclass - DeleteDatabaseRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.firestore.admin.v1.DeleteDatabaseRequest").msgclass - DeleteDatabaseMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.firestore.admin.v1.DeleteDatabaseMetadata").msgclass - CreateBackupScheduleRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.firestore.admin.v1.CreateBackupScheduleRequest").msgclass - GetBackupScheduleRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.firestore.admin.v1.GetBackupScheduleRequest").msgclass - UpdateBackupScheduleRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.firestore.admin.v1.UpdateBackupScheduleRequest").msgclass - ListBackupSchedulesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.firestore.admin.v1.ListBackupSchedulesRequest").msgclass - ListBackupSchedulesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.firestore.admin.v1.ListBackupSchedulesResponse").msgclass - DeleteBackupScheduleRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.firestore.admin.v1.DeleteBackupScheduleRequest").msgclass - CreateIndexRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.firestore.admin.v1.CreateIndexRequest").msgclass - ListIndexesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.firestore.admin.v1.ListIndexesRequest").msgclass - ListIndexesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.firestore.admin.v1.ListIndexesResponse").msgclass - GetIndexRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.firestore.admin.v1.GetIndexRequest").msgclass - DeleteIndexRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.firestore.admin.v1.DeleteIndexRequest").msgclass - UpdateFieldRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.firestore.admin.v1.UpdateFieldRequest").msgclass - GetFieldRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.firestore.admin.v1.GetFieldRequest").msgclass - ListFieldsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.firestore.admin.v1.ListFieldsRequest").msgclass - ListFieldsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.firestore.admin.v1.ListFieldsResponse").msgclass - ExportDocumentsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.firestore.admin.v1.ExportDocumentsRequest").msgclass - ImportDocumentsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.firestore.admin.v1.ImportDocumentsRequest").msgclass - GetBackupRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.firestore.admin.v1.GetBackupRequest").msgclass - ListBackupsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.firestore.admin.v1.ListBackupsRequest").msgclass - ListBackupsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.firestore.admin.v1.ListBackupsResponse").msgclass - DeleteBackupRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.firestore.admin.v1.DeleteBackupRequest").msgclass - RestoreDatabaseRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.firestore.admin.v1.RestoreDatabaseRequest").msgclass - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-firestore-admin-v1/lib/google/firestore/admin/v1/firestore_admin_services_pb.rb b/owl-bot-staging/google-cloud-firestore-admin-v1/lib/google/firestore/admin/v1/firestore_admin_services_pb.rb deleted file mode 100644 index 3110ccc0e702..000000000000 --- a/owl-bot-staging/google-cloud-firestore-admin-v1/lib/google/firestore/admin/v1/firestore_admin_services_pb.rb +++ /dev/null @@ -1,178 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# Source: google/firestore/admin/v1/firestore_admin.proto for package 'Google.Cloud.Firestore.Admin.V1' -# Original file comments: -# Copyright 2023 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/firestore/admin/v1/firestore_admin_pb' - -module Google - module Cloud - module Firestore - module Admin - module V1 - module FirestoreAdmin - # The Cloud Firestore Admin API. - # - # This API provides several administrative services for Cloud Firestore. - # - # Project, Database, Namespace, Collection, Collection Group, and Document are - # used as defined in the Google Cloud Firestore API. - # - # Operation: An Operation represents work being performed in the background. - # - # The index service manages Cloud Firestore indexes. - # - # Index creation is performed asynchronously. - # An Operation resource is created for each such asynchronous operation. - # The state of the operation (including any errors encountered) - # may be queried via the Operation resource. - # - # The Operations collection provides a record of actions performed for the - # specified Project (including any Operations in progress). Operations are not - # created directly but through calls on other collections or resources. - # - # An Operation that is done may be deleted so that it is no longer listed as - # part of the Operation collection. Operations are garbage collected after - # 30 days. By default, ListOperations will only return in progress and failed - # operations. To list completed operation, issue a ListOperations request with - # the filter `done: true`. - # - # Operations are created by service `FirestoreAdmin`, but are accessed via - # service `google.longrunning.Operations`. - class Service - - include ::GRPC::GenericService - - self.marshal_class_method = :encode - self.unmarshal_class_method = :decode - self.service_name = 'google.firestore.admin.v1.FirestoreAdmin' - - # Creates a composite index. This returns a - # [google.longrunning.Operation][google.longrunning.Operation] which may be - # used to track the status of the creation. The metadata for the operation - # will be the type - # [IndexOperationMetadata][google.firestore.admin.v1.IndexOperationMetadata]. - rpc :CreateIndex, ::Google::Cloud::Firestore::Admin::V1::CreateIndexRequest, ::Google::Longrunning::Operation - # Lists composite indexes. - rpc :ListIndexes, ::Google::Cloud::Firestore::Admin::V1::ListIndexesRequest, ::Google::Cloud::Firestore::Admin::V1::ListIndexesResponse - # Gets a composite index. - rpc :GetIndex, ::Google::Cloud::Firestore::Admin::V1::GetIndexRequest, ::Google::Cloud::Firestore::Admin::V1::Index - # Deletes a composite index. - rpc :DeleteIndex, ::Google::Cloud::Firestore::Admin::V1::DeleteIndexRequest, ::Google::Protobuf::Empty - # Gets the metadata and configuration for a Field. - rpc :GetField, ::Google::Cloud::Firestore::Admin::V1::GetFieldRequest, ::Google::Cloud::Firestore::Admin::V1::Field - # Updates a field configuration. Currently, field updates apply only to - # single field index configuration. However, calls to - # [FirestoreAdmin.UpdateField][google.firestore.admin.v1.FirestoreAdmin.UpdateField] - # should provide a field mask to avoid changing any configuration that the - # caller isn't aware of. The field mask should be specified as: `{ paths: - # "index_config" }`. - # - # This call returns a - # [google.longrunning.Operation][google.longrunning.Operation] which may be - # used to track the status of the field update. The metadata for the - # operation will be the type - # [FieldOperationMetadata][google.firestore.admin.v1.FieldOperationMetadata]. - # - # To configure the default field settings for the database, use - # the special `Field` with resource name: - # `projects/{project_id}/databases/{database_id}/collectionGroups/__default__/fields/*`. - rpc :UpdateField, ::Google::Cloud::Firestore::Admin::V1::UpdateFieldRequest, ::Google::Longrunning::Operation - # Lists the field configuration and metadata for this database. - # - # Currently, - # [FirestoreAdmin.ListFields][google.firestore.admin.v1.FirestoreAdmin.ListFields] - # only supports listing fields that have been explicitly overridden. To issue - # this query, call - # [FirestoreAdmin.ListFields][google.firestore.admin.v1.FirestoreAdmin.ListFields] - # with the filter set to `indexConfig.usesAncestorConfig:false` or - # `ttlConfig:*`. - rpc :ListFields, ::Google::Cloud::Firestore::Admin::V1::ListFieldsRequest, ::Google::Cloud::Firestore::Admin::V1::ListFieldsResponse - # Exports a copy of all or a subset of documents from Google Cloud Firestore - # to another storage system, such as Google Cloud Storage. Recent updates to - # documents may not be reflected in the export. The export occurs in the - # background and its progress can be monitored and managed via the - # Operation resource that is created. The output of an export may only be - # used once the associated operation is done. If an export operation is - # cancelled before completion it may leave partial data behind in Google - # Cloud Storage. - # - # For more details on export behavior and output format, refer to: - # https://cloud.google.com/firestore/docs/manage-data/export-import - rpc :ExportDocuments, ::Google::Cloud::Firestore::Admin::V1::ExportDocumentsRequest, ::Google::Longrunning::Operation - # Imports documents into Google Cloud Firestore. Existing documents with the - # same name are overwritten. The import occurs in the background and its - # progress can be monitored and managed via the Operation resource that is - # created. If an ImportDocuments operation is cancelled, it is possible - # that a subset of the data has already been imported to Cloud Firestore. - rpc :ImportDocuments, ::Google::Cloud::Firestore::Admin::V1::ImportDocumentsRequest, ::Google::Longrunning::Operation - # Create a database. - rpc :CreateDatabase, ::Google::Cloud::Firestore::Admin::V1::CreateDatabaseRequest, ::Google::Longrunning::Operation - # Gets information about a database. - rpc :GetDatabase, ::Google::Cloud::Firestore::Admin::V1::GetDatabaseRequest, ::Google::Cloud::Firestore::Admin::V1::Database - # List all the databases in the project. - rpc :ListDatabases, ::Google::Cloud::Firestore::Admin::V1::ListDatabasesRequest, ::Google::Cloud::Firestore::Admin::V1::ListDatabasesResponse - # Updates a database. - rpc :UpdateDatabase, ::Google::Cloud::Firestore::Admin::V1::UpdateDatabaseRequest, ::Google::Longrunning::Operation - # Deletes a database. - rpc :DeleteDatabase, ::Google::Cloud::Firestore::Admin::V1::DeleteDatabaseRequest, ::Google::Longrunning::Operation - # Gets information about a backup. - rpc :GetBackup, ::Google::Cloud::Firestore::Admin::V1::GetBackupRequest, ::Google::Cloud::Firestore::Admin::V1::Backup - # Lists all the backups. - rpc :ListBackups, ::Google::Cloud::Firestore::Admin::V1::ListBackupsRequest, ::Google::Cloud::Firestore::Admin::V1::ListBackupsResponse - # Deletes a backup. - rpc :DeleteBackup, ::Google::Cloud::Firestore::Admin::V1::DeleteBackupRequest, ::Google::Protobuf::Empty - # Creates a new database by restoring from an existing backup. - # - # The new database must be in the same cloud region or multi-region location - # as the existing backup. This behaves similar to - # [FirestoreAdmin.CreateDatabase][google.firestore.admin.v1.CreateDatabase] - # except instead of creating a new empty database, a new database is created - # with the database type, index configuration, and documents from an existing - # backup. - # - # The [long-running operation][google.longrunning.Operation] can be used to - # track the progress of the restore, with the Operation's - # [metadata][google.longrunning.Operation.metadata] field type being the - # [RestoreDatabaseMetadata][google.firestore.admin.v1.RestoreDatabaseMetadata]. - # The [response][google.longrunning.Operation.response] type is the - # [Database][google.firestore.admin.v1.Database] if the restore was - # successful. The new database is not readable or writeable until the LRO has - # completed. - rpc :RestoreDatabase, ::Google::Cloud::Firestore::Admin::V1::RestoreDatabaseRequest, ::Google::Longrunning::Operation - # Creates a backup schedule on a database. - # At most two backup schedules can be configured on a database, one daily - # backup schedule with retention up to 7 days and one weekly backup schedule - # with retention up to 14 weeks. - rpc :CreateBackupSchedule, ::Google::Cloud::Firestore::Admin::V1::CreateBackupScheduleRequest, ::Google::Cloud::Firestore::Admin::V1::BackupSchedule - # Gets information about a backup schedule. - rpc :GetBackupSchedule, ::Google::Cloud::Firestore::Admin::V1::GetBackupScheduleRequest, ::Google::Cloud::Firestore::Admin::V1::BackupSchedule - # List backup schedules. - rpc :ListBackupSchedules, ::Google::Cloud::Firestore::Admin::V1::ListBackupSchedulesRequest, ::Google::Cloud::Firestore::Admin::V1::ListBackupSchedulesResponse - # Updates a backup schedule. - rpc :UpdateBackupSchedule, ::Google::Cloud::Firestore::Admin::V1::UpdateBackupScheduleRequest, ::Google::Cloud::Firestore::Admin::V1::BackupSchedule - # Deletes a backup schedule. - rpc :DeleteBackupSchedule, ::Google::Cloud::Firestore::Admin::V1::DeleteBackupScheduleRequest, ::Google::Protobuf::Empty - end - - Stub = Service.rpc_stub_class - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-firestore-admin-v1/lib/google/firestore/admin/v1/index_pb.rb b/owl-bot-staging/google-cloud-firestore-admin-v1/lib/google/firestore/admin/v1/index_pb.rb deleted file mode 100644 index 8546b2d72ce6..000000000000 --- a/owl-bot-staging/google-cloud-firestore-admin-v1/lib/google/firestore/admin/v1/index_pb.rb +++ /dev/null @@ -1,55 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/firestore/admin/v1/index.proto - -require 'google/protobuf' - -require 'google/api/field_behavior_pb' -require 'google/api/resource_pb' - - -descriptor_data = "\n%google/firestore/admin/v1/index.proto\x12\x19google.firestore.admin.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\"\x91\t\n\x05Index\x12\x0c\n\x04name\x18\x01 \x01(\t\x12@\n\x0bquery_scope\x18\x02 \x01(\x0e\x32+.google.firestore.admin.v1.Index.QueryScope\x12<\n\tapi_scope\x18\x05 \x01(\x0e\x32).google.firestore.admin.v1.Index.ApiScope\x12;\n\x06\x66ields\x18\x03 \x03(\x0b\x32+.google.firestore.admin.v1.Index.IndexField\x12\x35\n\x05state\x18\x04 \x01(\x0e\x32&.google.firestore.admin.v1.Index.State\x1a\xa2\x04\n\nIndexField\x12\x12\n\nfield_path\x18\x01 \x01(\t\x12\x42\n\x05order\x18\x02 \x01(\x0e\x32\x31.google.firestore.admin.v1.Index.IndexField.OrderH\x00\x12O\n\x0c\x61rray_config\x18\x03 \x01(\x0e\x32\x37.google.firestore.admin.v1.Index.IndexField.ArrayConfigH\x00\x12Q\n\rvector_config\x18\x04 \x01(\x0b\x32\x38.google.firestore.admin.v1.Index.IndexField.VectorConfigH\x00\x1a\x8f\x01\n\x0cVectorConfig\x12\x16\n\tdimension\x18\x01 \x01(\x05\x42\x03\xe0\x41\x02\x12R\n\x04\x66lat\x18\x02 \x01(\x0b\x32\x42.google.firestore.admin.v1.Index.IndexField.VectorConfig.FlatIndexH\x00\x1a\x0b\n\tFlatIndexB\x06\n\x04type\"=\n\x05Order\x12\x15\n\x11ORDER_UNSPECIFIED\x10\x00\x12\r\n\tASCENDING\x10\x01\x12\x0e\n\nDESCENDING\x10\x02\"9\n\x0b\x41rrayConfig\x12\x1c\n\x18\x41RRAY_CONFIG_UNSPECIFIED\x10\x00\x12\x0c\n\x08\x43ONTAINS\x10\x01\x42\x0c\n\nvalue_mode\"i\n\nQueryScope\x12\x1b\n\x17QUERY_SCOPE_UNSPECIFIED\x10\x00\x12\x0e\n\nCOLLECTION\x10\x01\x12\x14\n\x10\x43OLLECTION_GROUP\x10\x02\x12\x18\n\x14\x43OLLECTION_RECURSIVE\x10\x03\"/\n\x08\x41piScope\x12\x0b\n\x07\x41NY_API\x10\x00\x12\x16\n\x12\x44\x41TASTORE_MODE_API\x10\x01\"I\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0c\n\x08\x43REATING\x10\x01\x12\t\n\x05READY\x10\x02\x12\x10\n\x0cNEEDS_REPAIR\x10\x03:z\xea\x41w\n\x1e\x66irestore.googleapis.com/Index\x12Uprojects/{project}/databases/{database}/collectionGroups/{collection}/indexes/{index}B\xd9\x01\n\x1d\x63om.google.firestore.admin.v1B\nIndexProtoP\x01Z9cloud.google.com/go/firestore/apiv1/admin/adminpb;adminpb\xa2\x02\x04GCFS\xaa\x02\x1fGoogle.Cloud.Firestore.Admin.V1\xca\x02\x1fGoogle\\Cloud\\Firestore\\Admin\\V1\xea\x02#Google::Cloud::Firestore::Admin::V1b\x06proto3" - -pool = Google::Protobuf::DescriptorPool.generated_pool - -begin - pool.add_serialized_file(descriptor_data) -rescue TypeError - # Compatibility code: will be removed in the next major version. - require 'google/protobuf/descriptor_pb' - parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) - parsed.clear_dependency - serialized = parsed.class.encode(parsed) - file = pool.add_serialized_file(serialized) - warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" - imports = [ - ] - imports.each do |type_name, expected_filename| - import_file = pool.lookup(type_name).file_descriptor - if import_file.name != expected_filename - warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" - end - end - warn "Each proto file must use a consistent fully-qualified name." - warn "This will become an error in the next major version." -end - -module Google - module Cloud - module Firestore - module Admin - module V1 - Index = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.firestore.admin.v1.Index").msgclass - Index::IndexField = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.firestore.admin.v1.Index.IndexField").msgclass - Index::IndexField::VectorConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.firestore.admin.v1.Index.IndexField.VectorConfig").msgclass - Index::IndexField::VectorConfig::FlatIndex = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.firestore.admin.v1.Index.IndexField.VectorConfig.FlatIndex").msgclass - Index::IndexField::Order = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.firestore.admin.v1.Index.IndexField.Order").enummodule - Index::IndexField::ArrayConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.firestore.admin.v1.Index.IndexField.ArrayConfig").enummodule - Index::QueryScope = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.firestore.admin.v1.Index.QueryScope").enummodule - Index::ApiScope = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.firestore.admin.v1.Index.ApiScope").enummodule - Index::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.firestore.admin.v1.Index.State").enummodule - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-firestore-admin-v1/lib/google/firestore/admin/v1/location_pb.rb b/owl-bot-staging/google-cloud-firestore-admin-v1/lib/google/firestore/admin/v1/location_pb.rb deleted file mode 100644 index 9132e2304719..000000000000 --- a/owl-bot-staging/google-cloud-firestore-admin-v1/lib/google/firestore/admin/v1/location_pb.rb +++ /dev/null @@ -1,44 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/firestore/admin/v1/location.proto - -require 'google/protobuf' - - -descriptor_data = "\n(google/firestore/admin/v1/location.proto\x12\x19google.firestore.admin.v1\"\x12\n\x10LocationMetadataB\xdc\x01\n\x1d\x63om.google.firestore.admin.v1B\rLocationProtoP\x01Z9cloud.google.com/go/firestore/apiv1/admin/adminpb;adminpb\xa2\x02\x04GCFS\xaa\x02\x1fGoogle.Cloud.Firestore.Admin.V1\xca\x02\x1fGoogle\\Cloud\\Firestore\\Admin\\V1\xea\x02#Google::Cloud::Firestore::Admin::V1b\x06proto3" - -pool = Google::Protobuf::DescriptorPool.generated_pool - -begin - pool.add_serialized_file(descriptor_data) -rescue TypeError - # Compatibility code: will be removed in the next major version. - require 'google/protobuf/descriptor_pb' - parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) - parsed.clear_dependency - serialized = parsed.class.encode(parsed) - file = pool.add_serialized_file(serialized) - warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" - imports = [ - ] - imports.each do |type_name, expected_filename| - import_file = pool.lookup(type_name).file_descriptor - if import_file.name != expected_filename - warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" - end - end - warn "Each proto file must use a consistent fully-qualified name." - warn "This will become an error in the next major version." -end - -module Google - module Cloud - module Firestore - module Admin - module V1 - LocationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.firestore.admin.v1.LocationMetadata").msgclass - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-firestore-admin-v1/lib/google/firestore/admin/v1/operation_pb.rb b/owl-bot-staging/google-cloud-firestore-admin-v1/lib/google/firestore/admin/v1/operation_pb.rb deleted file mode 100644 index fd3457a31d41..000000000000 --- a/owl-bot-staging/google-cloud-firestore-admin-v1/lib/google/firestore/admin/v1/operation_pb.rb +++ /dev/null @@ -1,61 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/firestore/admin/v1/operation.proto - -require 'google/protobuf' - -require 'google/api/resource_pb' -require 'google/firestore/admin/v1/index_pb' -require 'google/protobuf/timestamp_pb' - - -descriptor_data = "\n)google/firestore/admin/v1/operation.proto\x12\x19google.firestore.admin.v1\x1a\x19google/api/resource.proto\x1a%google/firestore/admin/v1/index.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xbd\x02\n\x16IndexOperationMetadata\x12.\n\nstart_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12,\n\x08\x65nd_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\r\n\x05index\x18\x03 \x01(\t\x12\x38\n\x05state\x18\x04 \x01(\x0e\x32).google.firestore.admin.v1.OperationState\x12?\n\x12progress_documents\x18\x05 \x01(\x0b\x32#.google.firestore.admin.v1.Progress\x12;\n\x0eprogress_bytes\x18\x06 \x01(\x0b\x32#.google.firestore.admin.v1.Progress\"\x99\x07\n\x16\x46ieldOperationMetadata\x12.\n\nstart_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12,\n\x08\x65nd_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\r\n\x05\x66ield\x18\x03 \x01(\t\x12_\n\x13index_config_deltas\x18\x04 \x03(\x0b\x32\x42.google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta\x12\x38\n\x05state\x18\x05 \x01(\x0e\x32).google.firestore.admin.v1.OperationState\x12?\n\x12progress_documents\x18\x06 \x01(\x0b\x32#.google.firestore.admin.v1.Progress\x12;\n\x0eprogress_bytes\x18\x07 \x01(\x0b\x32#.google.firestore.admin.v1.Progress\x12Z\n\x10ttl_config_delta\x18\x08 \x01(\x0b\x32@.google.firestore.admin.v1.FieldOperationMetadata.TtlConfigDelta\x1a\xe7\x01\n\x10IndexConfigDelta\x12\x62\n\x0b\x63hange_type\x18\x01 \x01(\x0e\x32M.google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta.ChangeType\x12/\n\x05index\x18\x02 \x01(\x0b\x32 .google.firestore.admin.v1.Index\">\n\nChangeType\x12\x1b\n\x17\x43HANGE_TYPE_UNSPECIFIED\x10\x00\x12\x07\n\x03\x41\x44\x44\x10\x01\x12\n\n\x06REMOVE\x10\x02\x1a\xb2\x01\n\x0eTtlConfigDelta\x12`\n\x0b\x63hange_type\x18\x01 \x01(\x0e\x32K.google.firestore.admin.v1.FieldOperationMetadata.TtlConfigDelta.ChangeType\">\n\nChangeType\x12\x1b\n\x17\x43HANGE_TYPE_UNSPECIFIED\x10\x00\x12\x07\n\x03\x41\x44\x44\x10\x01\x12\n\n\x06REMOVE\x10\x02\"\xb6\x03\n\x17\x45xportDocumentsMetadata\x12.\n\nstart_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12,\n\x08\x65nd_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x42\n\x0foperation_state\x18\x03 \x01(\x0e\x32).google.firestore.admin.v1.OperationState\x12?\n\x12progress_documents\x18\x04 \x01(\x0b\x32#.google.firestore.admin.v1.Progress\x12;\n\x0eprogress_bytes\x18\x05 \x01(\x0b\x32#.google.firestore.admin.v1.Progress\x12\x16\n\x0e\x63ollection_ids\x18\x06 \x03(\t\x12\x19\n\x11output_uri_prefix\x18\x07 \x01(\t\x12\x15\n\rnamespace_ids\x18\x08 \x03(\t\x12\x31\n\rsnapshot_time\x18\t \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"\x82\x03\n\x17ImportDocumentsMetadata\x12.\n\nstart_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12,\n\x08\x65nd_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x42\n\x0foperation_state\x18\x03 \x01(\x0e\x32).google.firestore.admin.v1.OperationState\x12?\n\x12progress_documents\x18\x04 \x01(\x0b\x32#.google.firestore.admin.v1.Progress\x12;\n\x0eprogress_bytes\x18\x05 \x01(\x0b\x32#.google.firestore.admin.v1.Progress\x12\x16\n\x0e\x63ollection_ids\x18\x06 \x03(\t\x12\x18\n\x10input_uri_prefix\x18\x07 \x01(\t\x12\x15\n\rnamespace_ids\x18\x08 \x03(\t\"4\n\x17\x45xportDocumentsResponse\x12\x19\n\x11output_uri_prefix\x18\x01 \x01(\t\"\xed\x02\n\x17RestoreDatabaseMetadata\x12.\n\nstart_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12,\n\x08\x65nd_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x42\n\x0foperation_state\x18\x03 \x01(\x0e\x32).google.firestore.admin.v1.OperationState\x12\x38\n\x08\x64\x61tabase\x18\x04 \x01(\tB&\xfa\x41#\n!firestore.googleapis.com/Database\x12\x34\n\x06\x62\x61\x63kup\x18\x05 \x01(\tB$\xfa\x41!\n\x1f\x66irestore.googleapis.com/Backup\x12@\n\x13progress_percentage\x18\x08 \x01(\x0b\x32#.google.firestore.admin.v1.Progress\":\n\x08Progress\x12\x16\n\x0e\x65stimated_work\x18\x01 \x01(\x03\x12\x16\n\x0e\x63ompleted_work\x18\x02 \x01(\x03*\x9e\x01\n\x0eOperationState\x12\x1f\n\x1bOPERATION_STATE_UNSPECIFIED\x10\x00\x12\x10\n\x0cINITIALIZING\x10\x01\x12\x0e\n\nPROCESSING\x10\x02\x12\x0e\n\nCANCELLING\x10\x03\x12\x0e\n\nFINALIZING\x10\x04\x12\x0e\n\nSUCCESSFUL\x10\x05\x12\n\n\x06\x46\x41ILED\x10\x06\x12\r\n\tCANCELLED\x10\x07\x42\xdd\x01\n\x1d\x63om.google.firestore.admin.v1B\x0eOperationProtoP\x01Z9cloud.google.com/go/firestore/apiv1/admin/adminpb;adminpb\xa2\x02\x04GCFS\xaa\x02\x1fGoogle.Cloud.Firestore.Admin.V1\xca\x02\x1fGoogle\\Cloud\\Firestore\\Admin\\V1\xea\x02#Google::Cloud::Firestore::Admin::V1b\x06proto3" - -pool = Google::Protobuf::DescriptorPool.generated_pool - -begin - pool.add_serialized_file(descriptor_data) -rescue TypeError - # Compatibility code: will be removed in the next major version. - require 'google/protobuf/descriptor_pb' - parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) - parsed.clear_dependency - serialized = parsed.class.encode(parsed) - file = pool.add_serialized_file(serialized) - warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" - imports = [ - ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], - ["google.firestore.admin.v1.Index", "google/firestore/admin/v1/index.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 Firestore - module Admin - module V1 - IndexOperationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.firestore.admin.v1.IndexOperationMetadata").msgclass - FieldOperationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.firestore.admin.v1.FieldOperationMetadata").msgclass - FieldOperationMetadata::IndexConfigDelta = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta").msgclass - FieldOperationMetadata::IndexConfigDelta::ChangeType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta.ChangeType").enummodule - FieldOperationMetadata::TtlConfigDelta = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.firestore.admin.v1.FieldOperationMetadata.TtlConfigDelta").msgclass - FieldOperationMetadata::TtlConfigDelta::ChangeType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.firestore.admin.v1.FieldOperationMetadata.TtlConfigDelta.ChangeType").enummodule - ExportDocumentsMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.firestore.admin.v1.ExportDocumentsMetadata").msgclass - ImportDocumentsMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.firestore.admin.v1.ImportDocumentsMetadata").msgclass - ExportDocumentsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.firestore.admin.v1.ExportDocumentsResponse").msgclass - RestoreDatabaseMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.firestore.admin.v1.RestoreDatabaseMetadata").msgclass - Progress = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.firestore.admin.v1.Progress").msgclass - OperationState = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.firestore.admin.v1.OperationState").enummodule - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-firestore-admin-v1/lib/google/firestore/admin/v1/schedule_pb.rb b/owl-bot-staging/google-cloud-firestore-admin-v1/lib/google/firestore/admin/v1/schedule_pb.rb deleted file mode 100644 index 9ce18f3264f8..000000000000 --- a/owl-bot-staging/google-cloud-firestore-admin-v1/lib/google/firestore/admin/v1/schedule_pb.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/firestore/admin/v1/schedule.proto - -require 'google/protobuf' - -require 'google/api/field_behavior_pb' -require 'google/api/resource_pb' -require 'google/protobuf/duration_pb' -require 'google/protobuf/timestamp_pb' -require 'google/type/dayofweek_pb' - - -descriptor_data = "\n(google/firestore/admin/v1/schedule.proto\x12\x19google.firestore.admin.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x1bgoogle/type/dayofweek.proto\"\xd6\x03\n\x0e\x42\x61\x63kupSchedule\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x34\n\x0b\x63reate_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\n \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12,\n\tretention\x18\x06 \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x46\n\x10\x64\x61ily_recurrence\x18\x07 \x01(\x0b\x32*.google.firestore.admin.v1.DailyRecurrenceH\x00\x12H\n\x11weekly_recurrence\x18\x08 \x01(\x0b\x32+.google.firestore.admin.v1.WeeklyRecurrenceH\x00:w\xea\x41t\n\'firestore.googleapis.com/BackupSchedule\x12Iprojects/{project}/databases/{database}/backupSchedules/{backup_schedule}B\x0c\n\nrecurrence\"\x11\n\x0f\x44\x61ilyRecurrence\"7\n\x10WeeklyRecurrence\x12#\n\x03\x64\x61y\x18\x02 \x01(\x0e\x32\x16.google.type.DayOfWeekB\xdc\x01\n\x1d\x63om.google.firestore.admin.v1B\rScheduleProtoP\x01Z9cloud.google.com/go/firestore/apiv1/admin/adminpb;adminpb\xa2\x02\x04GCFS\xaa\x02\x1fGoogle.Cloud.Firestore.Admin.V1\xca\x02\x1fGoogle\\Cloud\\Firestore\\Admin\\V1\xea\x02#Google::Cloud::Firestore::Admin::V1b\x06proto3" - -pool = Google::Protobuf::DescriptorPool.generated_pool - -begin - pool.add_serialized_file(descriptor_data) -rescue TypeError - # Compatibility code: will be removed in the next major version. - require 'google/protobuf/descriptor_pb' - parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) - parsed.clear_dependency - serialized = parsed.class.encode(parsed) - file = pool.add_serialized_file(serialized) - warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" - imports = [ - ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], - ["google.protobuf.Duration", "google/protobuf/duration.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 Firestore - module Admin - module V1 - BackupSchedule = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.firestore.admin.v1.BackupSchedule").msgclass - DailyRecurrence = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.firestore.admin.v1.DailyRecurrence").msgclass - WeeklyRecurrence = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.firestore.admin.v1.WeeklyRecurrence").msgclass - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-firestore-admin-v1/proto_docs/README.md b/owl-bot-staging/google-cloud-firestore-admin-v1/proto_docs/README.md deleted file mode 100644 index 8973d7337b3b..000000000000 --- a/owl-bot-staging/google-cloud-firestore-admin-v1/proto_docs/README.md +++ /dev/null @@ -1,4 +0,0 @@ -# Cloud Firestore 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-firestore-admin-v1/proto_docs/google/api/client.rb b/owl-bot-staging/google-cloud-firestore-admin-v1/proto_docs/google/api/client.rb deleted file mode 100644 index 934c39849a6a..000000000000 --- a/owl-bot-staging/google-cloud-firestore-admin-v1/proto_docs/google/api/client.rb +++ /dev/null @@ -1,399 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 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. - 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. - class PythonSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - 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. - class GoSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - 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. - # @!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: - # seconds: 60 # 1 minute - # poll_delay_multiplier: 1.5 - # max_poll_delay: - # seconds: 360 # 6 minutes - # total_poll_timeout: - # seconds: 54000 # 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 - - # 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-firestore-admin-v1/proto_docs/google/api/field_behavior.rb b/owl-bot-staging/google-cloud-firestore-admin-v1/proto_docs/google/api/field_behavior.rb deleted file mode 100644 index b03587481349..000000000000 --- a/owl-bot-staging/google-cloud-firestore-admin-v1/proto_docs/google/api/field_behavior.rb +++ /dev/null @@ -1,85 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 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-firestore-admin-v1/proto_docs/google/api/launch_stage.rb b/owl-bot-staging/google-cloud-firestore-admin-v1/proto_docs/google/api/launch_stage.rb deleted file mode 100644 index 38b4b61e6061..000000000000 --- a/owl-bot-staging/google-cloud-firestore-admin-v1/proto_docs/google/api/launch_stage.rb +++ /dev/null @@ -1,71 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 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-firestore-admin-v1/proto_docs/google/api/resource.rb b/owl-bot-staging/google-cloud-firestore-admin-v1/proto_docs/google/api/resource.rb deleted file mode 100644 index 6497ebc78dc1..000000000000 --- a/owl-bot-staging/google-cloud-firestore-admin-v1/proto_docs/google/api/resource.rb +++ /dev/null @@ -1,222 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 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'. 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-firestore-admin-v1/proto_docs/google/firestore/admin/v1/backup.rb b/owl-bot-staging/google-cloud-firestore-admin-v1/proto_docs/google/firestore/admin/v1/backup.rb deleted file mode 100644 index b0aa36fc40b7..000000000000 --- a/owl-bot-staging/google-cloud-firestore-admin-v1/proto_docs/google/firestore/admin/v1/backup.rb +++ /dev/null @@ -1,99 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 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 Firestore - module Admin - module V1 - # A Backup of a Cloud Firestore Database. - # - # The backup contains all documents and index configurations for the given - # database at a specific point in time. - # @!attribute [r] name - # @return [::String] - # Output only. The unique resource name of the Backup. - # - # Format is `projects/{project}/locations/{location}/backups/{backup}`. - # @!attribute [r] database - # @return [::String] - # Output only. Name of the Firestore database that the backup is from. - # - # Format is `projects/{project}/databases/{database}`. - # @!attribute [r] database_uid - # @return [::String] - # Output only. The system-generated UUID4 for the Firestore database that the - # backup is from. - # @!attribute [r] snapshot_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The backup contains an externally consistent copy of the - # database at this time. - # @!attribute [r] expire_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The timestamp at which this backup expires. - # @!attribute [r] stats - # @return [::Google::Cloud::Firestore::Admin::V1::Backup::Stats] - # Output only. Statistics about the backup. - # - # This data only becomes available after the backup is fully materialized to - # secondary storage. This field will be empty till then. - # @!attribute [r] state - # @return [::Google::Cloud::Firestore::Admin::V1::Backup::State] - # Output only. The current state of the backup. - class Backup - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Backup specific statistics. - # @!attribute [r] size_bytes - # @return [::Integer] - # Output only. Summation of the size of all documents and index entries in - # the backup, measured in bytes. - # @!attribute [r] document_count - # @return [::Integer] - # Output only. The total number of documents contained in the backup. - # @!attribute [r] index_count - # @return [::Integer] - # Output only. The total number of index entries contained in the backup. - class Stats - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Indicate the current state of the backup. - module State - # The state is unspecified. - STATE_UNSPECIFIED = 0 - - # The pending backup is still being created. Operations on the - # backup will be rejected in this state. - CREATING = 1 - - # The backup is complete and ready to use. - READY = 2 - - # The backup is not available at this moment. - NOT_AVAILABLE = 3 - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-firestore-admin-v1/proto_docs/google/firestore/admin/v1/database.rb b/owl-bot-staging/google-cloud-firestore-admin-v1/proto_docs/google/firestore/admin/v1/database.rb deleted file mode 100644 index c225168d2859..000000000000 --- a/owl-bot-staging/google-cloud-firestore-admin-v1/proto_docs/google/firestore/admin/v1/database.rb +++ /dev/null @@ -1,197 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 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 Firestore - module Admin - module V1 - # A Cloud Firestore Database. - # @!attribute [rw] name - # @return [::String] - # The resource name of the Database. - # Format: `projects/{project}/databases/{database}` - # @!attribute [r] uid - # @return [::String] - # Output only. The system-generated UUID4 for this Database. - # @!attribute [r] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The timestamp at which this database was created. Databases - # created before 2016 do not populate create_time. - # @!attribute [r] update_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The timestamp at which this database was most recently - # updated. Note this only includes updates to the database resource and not - # data contained by the database. - # @!attribute [rw] location_id - # @return [::String] - # The location of the database. Available locations are listed at - # https://cloud.google.com/firestore/docs/locations. - # @!attribute [rw] type - # @return [::Google::Cloud::Firestore::Admin::V1::Database::DatabaseType] - # The type of the database. - # See https://cloud.google.com/datastore/docs/firestore-or-datastore for - # information about how to choose. - # @!attribute [rw] concurrency_mode - # @return [::Google::Cloud::Firestore::Admin::V1::Database::ConcurrencyMode] - # The concurrency control mode to use for this database. - # @!attribute [r] version_retention_period - # @return [::Google::Protobuf::Duration] - # Output only. The period during which past versions of data are retained in - # the database. - # - # Any [read][google.firestore.v1.GetDocumentRequest.read_time] - # or [query][google.firestore.v1.ListDocumentsRequest.read_time] can specify - # a `read_time` within this window, and will read the state of the database - # at that time. - # - # If the PITR feature is enabled, the retention period is 7 days. Otherwise, - # the retention period is 1 hour. - # @!attribute [r] earliest_version_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The earliest timestamp at which older versions of the data can - # be read from the database. See [version_retention_period] above; this field - # is populated with `now - version_retention_period`. - # - # This value is continuously updated, and becomes stale the moment it is - # queried. If you are using this value to recover data, make sure to account - # for the time from the moment when the value is queried to the moment when - # you initiate the recovery. - # @!attribute [rw] point_in_time_recovery_enablement - # @return [::Google::Cloud::Firestore::Admin::V1::Database::PointInTimeRecoveryEnablement] - # Whether to enable the PITR feature on this database. - # @!attribute [rw] app_engine_integration_mode - # @return [::Google::Cloud::Firestore::Admin::V1::Database::AppEngineIntegrationMode] - # The App Engine integration mode to use for this database. - # @!attribute [r] key_prefix - # @return [::String] - # Output only. The key_prefix for this database. This key_prefix is used, in - # combination with the project id ("~") to construct - # the application id that is returned from the Cloud Datastore APIs in Google - # App Engine first generation runtimes. - # - # This value may be empty in which case the appid to use for URL-encoded keys - # is the project_id (eg: foo instead of v~foo). - # @!attribute [rw] delete_protection_state - # @return [::Google::Cloud::Firestore::Admin::V1::Database::DeleteProtectionState] - # State of delete protection for the database. - # @!attribute [rw] etag - # @return [::String] - # This checksum is computed by the server based on the value of other - # fields, and may be sent on update and delete requests to ensure the - # client has an up-to-date value before proceeding. - class Database - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The type of the database. - # See https://cloud.google.com/datastore/docs/firestore-or-datastore for - # information about how to choose. - # - # Mode changes are only allowed if the database is empty. - module DatabaseType - # The default value. This value is used if the database type is omitted. - DATABASE_TYPE_UNSPECIFIED = 0 - - # Firestore Native Mode - FIRESTORE_NATIVE = 1 - - # Firestore in Datastore Mode. - DATASTORE_MODE = 2 - end - - # The type of concurrency control mode for transactions. - module ConcurrencyMode - # Not used. - CONCURRENCY_MODE_UNSPECIFIED = 0 - - # Use optimistic concurrency control by default. This mode is available - # for Cloud Firestore databases. - OPTIMISTIC = 1 - - # Use pessimistic concurrency control by default. This mode is available - # for Cloud Firestore databases. - # - # This is the default setting for Cloud Firestore. - PESSIMISTIC = 2 - - # Use optimistic concurrency control with entity groups by default. - # - # This is the only available mode for Cloud Datastore. - # - # This mode is also available for Cloud Firestore with Datastore Mode but - # is not recommended. - OPTIMISTIC_WITH_ENTITY_GROUPS = 3 - end - - # Point In Time Recovery feature enablement. - module PointInTimeRecoveryEnablement - # Not used. - POINT_IN_TIME_RECOVERY_ENABLEMENT_UNSPECIFIED = 0 - - # Reads are supported on selected versions of the data from within the past - # 7 days: - # - # * Reads against any timestamp within the past hour - # * Reads against 1-minute snapshots beyond 1 hour and within 7 days - # - # `version_retention_period` and `earliest_version_time` can be - # used to determine the supported versions. - POINT_IN_TIME_RECOVERY_ENABLED = 1 - - # Reads are supported on any version of the data from within the past 1 - # hour. - POINT_IN_TIME_RECOVERY_DISABLED = 2 - end - - # The type of App Engine integration mode. - module AppEngineIntegrationMode - # Not used. - APP_ENGINE_INTEGRATION_MODE_UNSPECIFIED = 0 - - # If an App Engine application exists in the same region as this database, - # App Engine configuration will impact this database. This includes - # disabling of the application & database, as well as disabling writes to - # the database. - ENABLED = 1 - - # App Engine has no effect on the ability of this database to serve - # requests. - # - # This is the default setting for databases created with the Firestore API. - DISABLED = 2 - end - - # The delete protection state of the database. - module DeleteProtectionState - # The default value. Delete protection type is not specified - DELETE_PROTECTION_STATE_UNSPECIFIED = 0 - - # Delete protection is disabled - DELETE_PROTECTION_DISABLED = 1 - - # Delete protection is enabled - DELETE_PROTECTION_ENABLED = 2 - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-firestore-admin-v1/proto_docs/google/firestore/admin/v1/field.rb b/owl-bot-staging/google-cloud-firestore-admin-v1/proto_docs/google/firestore/admin/v1/field.rb deleted file mode 100644 index 974162a79b2b..000000000000 --- a/owl-bot-staging/google-cloud-firestore-admin-v1/proto_docs/google/firestore/admin/v1/field.rb +++ /dev/null @@ -1,138 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 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 Firestore - module Admin - module V1 - # Represents a single field in the database. - # - # Fields are grouped by their "Collection Group", which represent all - # collections in the database with the same id. - # @!attribute [rw] name - # @return [::String] - # Required. A field name of the form - # `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/fields/{field_path}` - # - # A field path may be a simple field name, e.g. `address` or a path to fields - # within map_value , e.g. `address.city`, - # or a special field path. The only valid special field is `*`, which - # represents any field. - # - # Field paths may be quoted using ` (backtick). The only character that needs - # to be escaped within a quoted field path is the backtick character itself, - # escaped using a backslash. Special characters in field paths that - # must be quoted include: `*`, `.`, - # ``` (backtick), `[`, `]`, as well as any ascii symbolic characters. - # - # Examples: - # (Note: Comments here are written in markdown syntax, so there is an - # additional layer of backticks to represent a code block) - # `\`address.city\`` represents a field named `address.city`, not the map key - # `city` in the field `address`. - # `\`*\`` represents a field named `*`, not any field. - # - # A special `Field` contains the default indexing settings for all fields. - # This field's resource name is: - # `projects/{project_id}/databases/{database_id}/collectionGroups/__default__/fields/*` - # Indexes defined on this `Field` will be applied to all fields which do not - # have their own `Field` index configuration. - # @!attribute [rw] index_config - # @return [::Google::Cloud::Firestore::Admin::V1::Field::IndexConfig] - # The index configuration for this field. If unset, field indexing will - # revert to the configuration defined by the `ancestor_field`. To - # explicitly remove all indexes for this field, specify an index config - # with an empty list of indexes. - # @!attribute [rw] ttl_config - # @return [::Google::Cloud::Firestore::Admin::V1::Field::TtlConfig] - # The TTL configuration for this `Field`. - # Setting or unsetting this will enable or disable the TTL for - # documents that have this `Field`. - class Field - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The index configuration for this field. - # @!attribute [rw] indexes - # @return [::Array<::Google::Cloud::Firestore::Admin::V1::Index>] - # The indexes supported for this field. - # @!attribute [rw] uses_ancestor_config - # @return [::Boolean] - # Output only. When true, the `Field`'s index configuration is set from the - # configuration specified by the `ancestor_field`. - # When false, the `Field`'s index configuration is defined explicitly. - # @!attribute [rw] ancestor_field - # @return [::String] - # Output only. Specifies the resource name of the `Field` from which this field's - # index configuration is set (when `uses_ancestor_config` is true), - # or from which it *would* be set if this field had no index configuration - # (when `uses_ancestor_config` is false). - # @!attribute [rw] reverting - # @return [::Boolean] - # Output only - # When true, the `Field`'s index configuration is in the process of being - # reverted. Once complete, the index config will transition to the same - # state as the field specified by `ancestor_field`, at which point - # `uses_ancestor_config` will be `true` and `reverting` will be `false`. - class IndexConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The TTL (time-to-live) configuration for documents that have this `Field` - # set. - # Storing a timestamp value into a TTL-enabled field will be treated as - # the document's absolute expiration time. Using any other data type or - # leaving the field absent will disable the TTL for the individual document. - # @!attribute [r] state - # @return [::Google::Cloud::Firestore::Admin::V1::Field::TtlConfig::State] - # Output only. The state of the TTL configuration. - class TtlConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The state of applying the TTL configuration to all documents. - module State - # The state is unspecified or unknown. - STATE_UNSPECIFIED = 0 - - # The TTL is being applied. There is an active long-running operation to - # track the change. Newly written documents will have TTLs applied as - # requested. Requested TTLs on existing documents are still being - # processed. When TTLs on all existing documents have been processed, the - # state will move to 'ACTIVE'. - CREATING = 1 - - # The TTL is active for all documents. - ACTIVE = 2 - - # The TTL configuration could not be enabled for all existing documents. - # Newly written documents will continue to have their TTL applied. - # The LRO returned when last attempting to enable TTL for this `Field` - # has failed, and may have more details. - NEEDS_REPAIR = 3 - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-firestore-admin-v1/proto_docs/google/firestore/admin/v1/firestore_admin.rb b/owl-bot-staging/google-cloud-firestore-admin-v1/proto_docs/google/firestore/admin/v1/firestore_admin.rb deleted file mode 100644 index fa18c112d626..000000000000 --- a/owl-bot-staging/google-cloud-firestore-admin-v1/proto_docs/google/firestore/admin/v1/firestore_admin.rb +++ /dev/null @@ -1,509 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 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 Firestore - module Admin - module V1 - # A request to list the Firestore Databases in all locations for a project. - # @!attribute [rw] parent - # @return [::String] - # Required. A parent name of the form - # `projects/{project_id}` - class ListDatabasesRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request for - # {::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client#create_database FirestoreAdmin.CreateDatabase}. - # @!attribute [rw] parent - # @return [::String] - # Required. A parent name of the form - # `projects/{project_id}` - # @!attribute [rw] database - # @return [::Google::Cloud::Firestore::Admin::V1::Database] - # Required. The Database to create. - # @!attribute [rw] database_id - # @return [::String] - # Required. The ID to use for the database, which will become the final - # component of the database's resource name. - # - # This value should be 4-63 characters. Valid characters are /[a-z][0-9]-/ - # with first character a letter and the last a letter or a number. Must not - # be UUID-like /[0-9a-f]\\{8}(-[0-9a-f]\\{4})\\{3}-[0-9a-f]\\{12}/. - # - # "(default)" database id is also valid. - class CreateDatabaseRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Metadata related to the create database operation. - class CreateDatabaseMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The list of databases for a project. - # @!attribute [rw] databases - # @return [::Array<::Google::Cloud::Firestore::Admin::V1::Database>] - # The databases in the project. - # @!attribute [rw] unreachable - # @return [::Array<::String>] - # In the event that data about individual databases cannot be listed they - # will be recorded here. - # - # An example entry might be: projects/some_project/locations/some_location - # This can happen if the Cloud Region that the Database resides in is - # currently unavailable. In this case we can't fetch all the details about - # the database. You may be able to get a more detailed error message - # (or possibly fetch the resource) by sending a 'Get' request for the - # resource or a 'List' request for the specific location. - class ListDatabasesResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request for - # {::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client#get_database FirestoreAdmin.GetDatabase}. - # @!attribute [rw] name - # @return [::String] - # Required. A name of the form - # `projects/{project_id}/databases/{database_id}` - class GetDatabaseRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request for - # {::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client#update_database FirestoreAdmin.UpdateDatabase}. - # @!attribute [rw] database - # @return [::Google::Cloud::Firestore::Admin::V1::Database] - # Required. The database to update. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # The list of fields to be updated. - class UpdateDatabaseRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Metadata related to the update database operation. - class UpdateDatabaseMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request for - # {::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client#delete_database FirestoreAdmin.DeleteDatabase}. - # @!attribute [rw] name - # @return [::String] - # Required. A name of the form - # `projects/{project_id}/databases/{database_id}` - # @!attribute [rw] etag - # @return [::String] - # The current etag of the Database. - # If an etag is provided and does not match the current etag of the database, - # deletion will be blocked and a FAILED_PRECONDITION error will be returned. - class DeleteDatabaseRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Metadata related to the delete database operation. - class DeleteDatabaseMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request for - # {::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client#create_backup_schedule FirestoreAdmin.CreateBackupSchedule}. - # @!attribute [rw] parent - # @return [::String] - # Required. The parent database. - # - # Format `projects/{project}/databases/{database}` - # @!attribute [rw] backup_schedule - # @return [::Google::Cloud::Firestore::Admin::V1::BackupSchedule] - # Required. The backup schedule to create. - class CreateBackupScheduleRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request for - # {::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client#get_backup_schedule FirestoreAdmin.GetBackupSchedule}. - # @!attribute [rw] name - # @return [::String] - # Required. The name of the backup schedule. - # - # Format - # `projects/{project}/databases/{database}/backupSchedules/{backup_schedule}` - class GetBackupScheduleRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request for - # {::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client#update_backup_schedule FirestoreAdmin.UpdateBackupSchedule}. - # @!attribute [rw] backup_schedule - # @return [::Google::Cloud::Firestore::Admin::V1::BackupSchedule] - # Required. The backup schedule to update. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # The list of fields to be updated. - class UpdateBackupScheduleRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request for - # {::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client#list_backup_schedules FirestoreAdmin.ListBackupSchedules}. - # @!attribute [rw] parent - # @return [::String] - # Required. The parent database. - # - # Format is `projects/{project}/databases/{database}`. - class ListBackupSchedulesRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The response for - # {::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client#list_backup_schedules FirestoreAdmin.ListBackupSchedules}. - # @!attribute [rw] backup_schedules - # @return [::Array<::Google::Cloud::Firestore::Admin::V1::BackupSchedule>] - # List of all backup schedules. - class ListBackupSchedulesResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request for [FirestoreAdmin.DeleteBackupSchedules][]. - # @!attribute [rw] name - # @return [::String] - # Required. The name of backup schedule. - # - # Format - # `projects/{project}/databases/{database}/backupSchedules/{backup_schedule}` - class DeleteBackupScheduleRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request for - # {::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client#create_index FirestoreAdmin.CreateIndex}. - # @!attribute [rw] parent - # @return [::String] - # Required. A parent name of the form - # `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}` - # @!attribute [rw] index - # @return [::Google::Cloud::Firestore::Admin::V1::Index] - # Required. The composite index to create. - class CreateIndexRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request for - # {::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client#list_indexes FirestoreAdmin.ListIndexes}. - # @!attribute [rw] parent - # @return [::String] - # Required. A parent name of the form - # `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}` - # @!attribute [rw] filter - # @return [::String] - # The filter to apply to list results. - # @!attribute [rw] page_size - # @return [::Integer] - # The number of results to return. - # @!attribute [rw] page_token - # @return [::String] - # A page token, returned from a previous call to - # {::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client#list_indexes FirestoreAdmin.ListIndexes}, - # that may be used to get the next page of results. - class ListIndexesRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The response for - # {::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client#list_indexes FirestoreAdmin.ListIndexes}. - # @!attribute [rw] indexes - # @return [::Array<::Google::Cloud::Firestore::Admin::V1::Index>] - # The requested indexes. - # @!attribute [rw] next_page_token - # @return [::String] - # A page token that may be used to request another page of results. If blank, - # this is the last page. - class ListIndexesResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request for - # {::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client#get_index FirestoreAdmin.GetIndex}. - # @!attribute [rw] name - # @return [::String] - # Required. A name of the form - # `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/indexes/{index_id}` - class GetIndexRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request for - # {::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client#delete_index FirestoreAdmin.DeleteIndex}. - # @!attribute [rw] name - # @return [::String] - # Required. A name of the form - # `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/indexes/{index_id}` - class DeleteIndexRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request for - # {::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client#update_field FirestoreAdmin.UpdateField}. - # @!attribute [rw] field - # @return [::Google::Cloud::Firestore::Admin::V1::Field] - # Required. The field to be updated. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # A mask, relative to the field. If specified, only configuration specified - # by this field_mask will be updated in the field. - class UpdateFieldRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request for - # {::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client#get_field FirestoreAdmin.GetField}. - # @!attribute [rw] name - # @return [::String] - # Required. A name of the form - # `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/fields/{field_id}` - class GetFieldRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request for - # {::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client#list_fields FirestoreAdmin.ListFields}. - # @!attribute [rw] parent - # @return [::String] - # Required. A parent name of the form - # `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}` - # @!attribute [rw] filter - # @return [::String] - # The filter to apply to list results. Currently, - # {::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client#list_fields FirestoreAdmin.ListFields} - # only supports listing fields that have been explicitly overridden. To issue - # this query, call - # {::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client#list_fields FirestoreAdmin.ListFields} - # with a filter that includes `indexConfig.usesAncestorConfig:false` . - # @!attribute [rw] page_size - # @return [::Integer] - # The number of results to return. - # @!attribute [rw] page_token - # @return [::String] - # A page token, returned from a previous call to - # {::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client#list_fields FirestoreAdmin.ListFields}, - # that may be used to get the next page of results. - class ListFieldsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The response for - # {::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client#list_fields FirestoreAdmin.ListFields}. - # @!attribute [rw] fields - # @return [::Array<::Google::Cloud::Firestore::Admin::V1::Field>] - # The requested fields. - # @!attribute [rw] next_page_token - # @return [::String] - # A page token that may be used to request another page of results. If blank, - # this is the last page. - class ListFieldsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request for - # {::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client#export_documents FirestoreAdmin.ExportDocuments}. - # @!attribute [rw] name - # @return [::String] - # Required. Database to export. Should be of the form: - # `projects/{project_id}/databases/{database_id}`. - # @!attribute [rw] collection_ids - # @return [::Array<::String>] - # Which collection ids to export. Unspecified means all collections. - # @!attribute [rw] output_uri_prefix - # @return [::String] - # The output URI. Currently only supports Google Cloud Storage URIs of the - # form: `gs://BUCKET_NAME[/NAMESPACE_PATH]`, where `BUCKET_NAME` is the name - # of the Google Cloud Storage bucket and `NAMESPACE_PATH` is an optional - # Google Cloud Storage namespace path. When - # choosing a name, be sure to consider Google Cloud Storage naming - # guidelines: https://cloud.google.com/storage/docs/naming. - # If the URI is a bucket (without a namespace path), a prefix will be - # generated based on the start time. - # @!attribute [rw] namespace_ids - # @return [::Array<::String>] - # An empty list represents all namespaces. This is the preferred - # usage for databases that don't use namespaces. - # - # An empty string element represents the default namespace. This should be - # used if the database has data in non-default namespaces, but doesn't want - # to include them. Each namespace in this list must be unique. - # @!attribute [rw] snapshot_time - # @return [::Google::Protobuf::Timestamp] - # The timestamp that corresponds to the version of the database to be - # exported. The timestamp must be in the past, rounded to the minute and not - # older than - # {::Google::Cloud::Firestore::Admin::V1::Database#earliest_version_time earliestVersionTime}. - # If specified, then the exported documents will represent a consistent view - # of the database at the provided time. Otherwise, there are no guarantees - # about the consistency of the exported documents. - class ExportDocumentsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request for - # {::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client#import_documents FirestoreAdmin.ImportDocuments}. - # @!attribute [rw] name - # @return [::String] - # Required. Database to import into. Should be of the form: - # `projects/{project_id}/databases/{database_id}`. - # @!attribute [rw] collection_ids - # @return [::Array<::String>] - # Which collection ids to import. Unspecified means all collections included - # in the import. - # @!attribute [rw] input_uri_prefix - # @return [::String] - # Location of the exported files. - # This must match the output_uri_prefix of an ExportDocumentsResponse from - # an export that has completed successfully. - # See: - # {::Google::Cloud::Firestore::Admin::V1::ExportDocumentsResponse#output_uri_prefix google.firestore.admin.v1.ExportDocumentsResponse.output_uri_prefix}. - # @!attribute [rw] namespace_ids - # @return [::Array<::String>] - # An empty list represents all namespaces. This is the preferred - # usage for databases that don't use namespaces. - # - # An empty string element represents the default namespace. This should be - # used if the database has data in non-default namespaces, but doesn't want - # to include them. Each namespace in this list must be unique. - class ImportDocumentsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request for - # {::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client#get_backup FirestoreAdmin.GetBackup}. - # @!attribute [rw] name - # @return [::String] - # Required. Name of the backup to fetch. - # - # Format is `projects/{project}/locations/{location}/backups/{backup}`. - class GetBackupRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request for - # {::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client#list_backups FirestoreAdmin.ListBackups}. - # @!attribute [rw] parent - # @return [::String] - # Required. The location to list backups from. - # - # Format is `projects/{project}/locations/{location}`. - # Use `{location} = '-'` to list backups from all locations for the given - # project. This allows listing backups from a single location or from all - # locations. - class ListBackupsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The response for - # {::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client#list_backups FirestoreAdmin.ListBackups}. - # @!attribute [rw] backups - # @return [::Array<::Google::Cloud::Firestore::Admin::V1::Backup>] - # List of all backups for the project. - # @!attribute [rw] unreachable - # @return [::Array<::String>] - # List of locations that existing backups were not able to be fetched from. - # - # Instead of failing the entire requests when a single location is - # unreachable, this response returns a partial result set and list of - # locations unable to be reached here. The request can be retried against a - # single location to get a concrete error. - class ListBackupsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request for - # {::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client#delete_backup FirestoreAdmin.DeleteBackup}. - # @!attribute [rw] name - # @return [::String] - # Required. Name of the backup to delete. - # - # format is `projects/{project}/locations/{location}/backups/{backup}`. - class DeleteBackupRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # [FirestoreAdmin.RestoreDatabase][google.firestore.admin.v1.RestoreDatabase]. - # @!attribute [rw] parent - # @return [::String] - # Required. The project to restore the database in. Format is - # `projects/{project_id}`. - # @!attribute [rw] database_id - # @return [::String] - # Required. The ID to use for the database, which will become the final - # component of the database's resource name. This database id must not be - # associated with an existing database. - # - # This value should be 4-63 characters. Valid characters are /[a-z][0-9]-/ - # with first character a letter and the last a letter or a number. Must not - # be UUID-like /[0-9a-f]\\{8}(-[0-9a-f]\\{4})\\{3}-[0-9a-f]\\{12}/. - # - # "(default)" database id is also valid. - # @!attribute [rw] backup - # @return [::String] - # Required. Backup to restore from. Must be from the same project as the - # parent. - # - # Format is: `projects/{project_id}/locations/{location}/backups/{backup}` - class RestoreDatabaseRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-firestore-admin-v1/proto_docs/google/firestore/admin/v1/index.rb b/owl-bot-staging/google-cloud-firestore-admin-v1/proto_docs/google/firestore/admin/v1/index.rb deleted file mode 100644 index 5147d57eda49..000000000000 --- a/owl-bot-staging/google-cloud-firestore-admin-v1/proto_docs/google/firestore/admin/v1/index.rb +++ /dev/null @@ -1,198 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 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 Firestore - module Admin - module V1 - # Cloud Firestore indexes enable simple and complex queries against - # documents in a database. - # @!attribute [rw] name - # @return [::String] - # Output only. A server defined name for this index. - # The form of this name for composite indexes will be: - # `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/indexes/{composite_index_id}` - # For single field indexes, this field will be empty. - # @!attribute [rw] query_scope - # @return [::Google::Cloud::Firestore::Admin::V1::Index::QueryScope] - # Indexes with a collection query scope specified allow queries - # against a collection that is the child of a specific document, specified at - # query time, and that has the same collection id. - # - # Indexes with a collection group query scope specified allow queries against - # all collections descended from a specific document, specified at query - # time, and that have the same collection id as this index. - # @!attribute [rw] api_scope - # @return [::Google::Cloud::Firestore::Admin::V1::Index::ApiScope] - # The API scope supported by this index. - # @!attribute [rw] fields - # @return [::Array<::Google::Cloud::Firestore::Admin::V1::Index::IndexField>] - # The fields supported by this index. - # - # For composite indexes, this requires a minimum of 2 and a maximum of 100 - # fields. The last field entry is always for the field path `__name__`. If, - # on creation, `__name__` was not specified as the last field, it will be - # added automatically with the same direction as that of the last field - # defined. If the final field in a composite index is not directional, the - # `__name__` will be ordered ASCENDING (unless explicitly specified). - # - # For single field indexes, this will always be exactly one entry with a - # field path equal to the field path of the associated field. - # @!attribute [rw] state - # @return [::Google::Cloud::Firestore::Admin::V1::Index::State] - # Output only. The serving state of the index. - class Index - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # A field in an index. - # The field_path describes which field is indexed, the value_mode describes - # how the field value is indexed. - # @!attribute [rw] field_path - # @return [::String] - # Can be __name__. - # For single field indexes, this must match the name of the field or may - # be omitted. - # @!attribute [rw] order - # @return [::Google::Cloud::Firestore::Admin::V1::Index::IndexField::Order] - # Indicates that this field supports ordering by the specified order or - # comparing using =, !=, <, <=, >, >=. - # @!attribute [rw] array_config - # @return [::Google::Cloud::Firestore::Admin::V1::Index::IndexField::ArrayConfig] - # Indicates that this field supports operations on `array_value`s. - # @!attribute [rw] vector_config - # @return [::Google::Cloud::Firestore::Admin::V1::Index::IndexField::VectorConfig] - # Indicates that this field supports nearest neighbors and distance - # operations on vector. - class IndexField - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The index configuration to support vector search operations - # @!attribute [rw] dimension - # @return [::Integer] - # Required. The vector dimension this configuration applies to. - # - # The resulting index will only include vectors of this dimension, and - # can be used for vector search with the same dimension. - # @!attribute [rw] flat - # @return [::Google::Cloud::Firestore::Admin::V1::Index::IndexField::VectorConfig::FlatIndex] - # Indicates the vector index is a flat index. - class VectorConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # An index that stores vectors in a flat data structure, and supports - # exhaustive search. - class FlatIndex - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # The supported orderings. - module Order - # The ordering is unspecified. Not a valid option. - ORDER_UNSPECIFIED = 0 - - # The field is ordered by ascending field value. - ASCENDING = 1 - - # The field is ordered by descending field value. - DESCENDING = 2 - end - - # The supported array value configurations. - module ArrayConfig - # The index does not support additional array queries. - ARRAY_CONFIG_UNSPECIFIED = 0 - - # The index supports array containment queries. - CONTAINS = 1 - end - end - - # Query Scope defines the scope at which a query is run. This is specified on - # a StructuredQuery's `from` field. - module QueryScope - # The query scope is unspecified. Not a valid option. - QUERY_SCOPE_UNSPECIFIED = 0 - - # Indexes with a collection query scope specified allow queries - # against a collection that is the child of a specific document, specified - # at query time, and that has the collection id specified by the index. - COLLECTION = 1 - - # Indexes with a collection group query scope specified allow queries - # against all collections that has the collection id specified by the - # index. - COLLECTION_GROUP = 2 - - # Include all the collections's ancestor in the index. Only available for - # Datastore Mode databases. - COLLECTION_RECURSIVE = 3 - end - - # API Scope defines the APIs (Firestore Native, or Firestore in - # Datastore Mode) that are supported for queries. - module ApiScope - # The index can only be used by the Firestore Native query API. - # This is the default. - ANY_API = 0 - - # The index can only be used by the Firestore in Datastore Mode query API. - DATASTORE_MODE_API = 1 - end - - # The state of an index. During index creation, an index will be in the - # `CREATING` state. If the index is created successfully, it will transition - # to the `READY` state. If the index creation encounters a problem, the index - # will transition to the `NEEDS_REPAIR` state. - module State - # The state is unspecified. - STATE_UNSPECIFIED = 0 - - # The index is being created. - # There is an active long-running operation for the index. - # The index is updated when writing a document. - # Some index data may exist. - CREATING = 1 - - # The index is ready to be used. - # The index is updated when writing a document. - # The index is fully populated from all stored documents it applies to. - READY = 2 - - # The index was being created, but something went wrong. - # There is no active long-running operation for the index, - # and the most recently finished long-running operation failed. - # The index is not updated when writing a document. - # Some index data may exist. - # Use the google.longrunning.Operations API to determine why the operation - # that last attempted to create this index failed, then re-create the - # index. - NEEDS_REPAIR = 3 - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-firestore-admin-v1/proto_docs/google/firestore/admin/v1/location.rb b/owl-bot-staging/google-cloud-firestore-admin-v1/proto_docs/google/firestore/admin/v1/location.rb deleted file mode 100644 index 78ec0f3f16e2..000000000000 --- a/owl-bot-staging/google-cloud-firestore-admin-v1/proto_docs/google/firestore/admin/v1/location.rb +++ /dev/null @@ -1,35 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 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 Firestore - module Admin - module V1 - # The metadata message for - # {::Google::Cloud::Location::Location#metadata google.cloud.location.Location.metadata}. - class LocationMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-firestore-admin-v1/proto_docs/google/firestore/admin/v1/operation.rb b/owl-bot-staging/google-cloud-firestore-admin-v1/proto_docs/google/firestore/admin/v1/operation.rb deleted file mode 100644 index 440016d674d9..000000000000 --- a/owl-bot-staging/google-cloud-firestore-admin-v1/proto_docs/google/firestore/admin/v1/operation.rb +++ /dev/null @@ -1,288 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 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 Firestore - module Admin - module V1 - # Metadata for {::Google::Longrunning::Operation google.longrunning.Operation} - # results from - # {::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client#create_index FirestoreAdmin.CreateIndex}. - # @!attribute [rw] start_time - # @return [::Google::Protobuf::Timestamp] - # The time this operation started. - # @!attribute [rw] end_time - # @return [::Google::Protobuf::Timestamp] - # The time this operation completed. Will be unset if operation still in - # progress. - # @!attribute [rw] index - # @return [::String] - # The index resource that this operation is acting on. For example: - # `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/indexes/{index_id}` - # @!attribute [rw] state - # @return [::Google::Cloud::Firestore::Admin::V1::OperationState] - # The state of the operation. - # @!attribute [rw] progress_documents - # @return [::Google::Cloud::Firestore::Admin::V1::Progress] - # The progress, in documents, of this operation. - # @!attribute [rw] progress_bytes - # @return [::Google::Cloud::Firestore::Admin::V1::Progress] - # The progress, in bytes, of this operation. - class IndexOperationMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Metadata for {::Google::Longrunning::Operation google.longrunning.Operation} - # results from - # {::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client#update_field FirestoreAdmin.UpdateField}. - # @!attribute [rw] start_time - # @return [::Google::Protobuf::Timestamp] - # The time this operation started. - # @!attribute [rw] end_time - # @return [::Google::Protobuf::Timestamp] - # The time this operation completed. Will be unset if operation still in - # progress. - # @!attribute [rw] field - # @return [::String] - # The field resource that this operation is acting on. For example: - # `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/fields/{field_path}` - # @!attribute [rw] index_config_deltas - # @return [::Array<::Google::Cloud::Firestore::Admin::V1::FieldOperationMetadata::IndexConfigDelta>] - # A list of - # {::Google::Cloud::Firestore::Admin::V1::FieldOperationMetadata::IndexConfigDelta IndexConfigDelta}, - # which describe the intent of this operation. - # @!attribute [rw] state - # @return [::Google::Cloud::Firestore::Admin::V1::OperationState] - # The state of the operation. - # @!attribute [rw] progress_documents - # @return [::Google::Cloud::Firestore::Admin::V1::Progress] - # The progress, in documents, of this operation. - # @!attribute [rw] progress_bytes - # @return [::Google::Cloud::Firestore::Admin::V1::Progress] - # The progress, in bytes, of this operation. - # @!attribute [rw] ttl_config_delta - # @return [::Google::Cloud::Firestore::Admin::V1::FieldOperationMetadata::TtlConfigDelta] - # Describes the deltas of TTL configuration. - class FieldOperationMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Information about an index configuration change. - # @!attribute [rw] change_type - # @return [::Google::Cloud::Firestore::Admin::V1::FieldOperationMetadata::IndexConfigDelta::ChangeType] - # Specifies how the index is changing. - # @!attribute [rw] index - # @return [::Google::Cloud::Firestore::Admin::V1::Index] - # The index being changed. - class IndexConfigDelta - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Specifies how the index is changing. - module ChangeType - # The type of change is not specified or known. - CHANGE_TYPE_UNSPECIFIED = 0 - - # The single field index is being added. - ADD = 1 - - # The single field index is being removed. - REMOVE = 2 - end - end - - # Information about a TTL configuration change. - # @!attribute [rw] change_type - # @return [::Google::Cloud::Firestore::Admin::V1::FieldOperationMetadata::TtlConfigDelta::ChangeType] - # Specifies how the TTL configuration is changing. - class TtlConfigDelta - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Specifies how the TTL config is changing. - module ChangeType - # The type of change is not specified or known. - CHANGE_TYPE_UNSPECIFIED = 0 - - # The TTL config is being added. - ADD = 1 - - # The TTL config is being removed. - REMOVE = 2 - end - end - end - - # Metadata for {::Google::Longrunning::Operation google.longrunning.Operation} - # results from - # {::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client#export_documents FirestoreAdmin.ExportDocuments}. - # @!attribute [rw] start_time - # @return [::Google::Protobuf::Timestamp] - # The time this operation started. - # @!attribute [rw] end_time - # @return [::Google::Protobuf::Timestamp] - # The time this operation completed. Will be unset if operation still in - # progress. - # @!attribute [rw] operation_state - # @return [::Google::Cloud::Firestore::Admin::V1::OperationState] - # The state of the export operation. - # @!attribute [rw] progress_documents - # @return [::Google::Cloud::Firestore::Admin::V1::Progress] - # The progress, in documents, of this operation. - # @!attribute [rw] progress_bytes - # @return [::Google::Cloud::Firestore::Admin::V1::Progress] - # The progress, in bytes, of this operation. - # @!attribute [rw] collection_ids - # @return [::Array<::String>] - # Which collection ids are being exported. - # @!attribute [rw] output_uri_prefix - # @return [::String] - # Where the documents are being exported to. - # @!attribute [rw] namespace_ids - # @return [::Array<::String>] - # Which namespace ids are being exported. - # @!attribute [rw] snapshot_time - # @return [::Google::Protobuf::Timestamp] - # The timestamp that corresponds to the version of the database that is being - # exported. If unspecified, there are no guarantees about the consistency of - # the documents being exported. - class ExportDocumentsMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Metadata for {::Google::Longrunning::Operation google.longrunning.Operation} - # results from - # {::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client#import_documents FirestoreAdmin.ImportDocuments}. - # @!attribute [rw] start_time - # @return [::Google::Protobuf::Timestamp] - # The time this operation started. - # @!attribute [rw] end_time - # @return [::Google::Protobuf::Timestamp] - # The time this operation completed. Will be unset if operation still in - # progress. - # @!attribute [rw] operation_state - # @return [::Google::Cloud::Firestore::Admin::V1::OperationState] - # The state of the import operation. - # @!attribute [rw] progress_documents - # @return [::Google::Cloud::Firestore::Admin::V1::Progress] - # The progress, in documents, of this operation. - # @!attribute [rw] progress_bytes - # @return [::Google::Cloud::Firestore::Admin::V1::Progress] - # The progress, in bytes, of this operation. - # @!attribute [rw] collection_ids - # @return [::Array<::String>] - # Which collection ids are being imported. - # @!attribute [rw] input_uri_prefix - # @return [::String] - # The location of the documents being imported. - # @!attribute [rw] namespace_ids - # @return [::Array<::String>] - # Which namespace ids are being imported. - class ImportDocumentsMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Returned in the {::Google::Longrunning::Operation google.longrunning.Operation} - # response field. - # @!attribute [rw] output_uri_prefix - # @return [::String] - # Location of the output files. This can be used to begin an import - # into Cloud Firestore (this project or another project) after the operation - # completes successfully. - class ExportDocumentsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Metadata for the {::Google::Longrunning::Operation long-running operation} from - # the [RestoreDatabase][google.firestore.admin.v1.RestoreDatabase] request. - # @!attribute [rw] start_time - # @return [::Google::Protobuf::Timestamp] - # The time the restore was started. - # @!attribute [rw] end_time - # @return [::Google::Protobuf::Timestamp] - # The time the restore finished, unset for ongoing restores. - # @!attribute [rw] operation_state - # @return [::Google::Cloud::Firestore::Admin::V1::OperationState] - # The operation state of the restore. - # @!attribute [rw] database - # @return [::String] - # The name of the database being restored to. - # @!attribute [rw] backup - # @return [::String] - # The name of the backup restoring from. - # @!attribute [rw] progress_percentage - # @return [::Google::Cloud::Firestore::Admin::V1::Progress] - # How far along the restore is as an estimated percentage of remaining time. - class RestoreDatabaseMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Describes the progress of the operation. - # Unit of work is generic and must be interpreted based on where - # {::Google::Cloud::Firestore::Admin::V1::Progress Progress} is used. - # @!attribute [rw] estimated_work - # @return [::Integer] - # The amount of work estimated. - # @!attribute [rw] completed_work - # @return [::Integer] - # The amount of work completed. - class Progress - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Describes the state of the operation. - module OperationState - # Unspecified. - OPERATION_STATE_UNSPECIFIED = 0 - - # Request is being prepared for processing. - INITIALIZING = 1 - - # Request is actively being processed. - PROCESSING = 2 - - # Request is in the process of being cancelled after user called - # google.longrunning.Operations.CancelOperation on the operation. - CANCELLING = 3 - - # Request has been processed and is in its finalization stage. - FINALIZING = 4 - - # Request has completed successfully. - SUCCESSFUL = 5 - - # Request has finished being processed, but encountered an error. - FAILED = 6 - - # Request has finished being cancelled after user called - # google.longrunning.Operations.CancelOperation. - CANCELLED = 7 - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-firestore-admin-v1/proto_docs/google/firestore/admin/v1/schedule.rb b/owl-bot-staging/google-cloud-firestore-admin-v1/proto_docs/google/firestore/admin/v1/schedule.rb deleted file mode 100644 index 017774fd36d9..000000000000 --- a/owl-bot-staging/google-cloud-firestore-admin-v1/proto_docs/google/firestore/admin/v1/schedule.rb +++ /dev/null @@ -1,88 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 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 Firestore - module Admin - module V1 - # A backup schedule for a Cloud Firestore Database. - # - # This resource is owned by the database it is backing up, and is deleted along - # with the database. The actual backups are not though. - # @!attribute [r] name - # @return [::String] - # Output only. The unique backup schedule identifier across all locations and - # databases for the given project. - # - # This will be auto-assigned. - # - # Format is - # `projects/{project}/databases/{database}/backupSchedules/{backup_schedule}` - # @!attribute [r] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The timestamp at which this backup schedule was created and - # effective since. - # - # No backups will be created for this schedule before this time. - # @!attribute [r] update_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The timestamp at which this backup schedule was most recently - # updated. When a backup schedule is first created, this is the same as - # create_time. - # @!attribute [rw] retention - # @return [::Google::Protobuf::Duration] - # At what relative time in the future, compared to its creation time, - # the backup should be deleted, e.g. keep backups for 7 days. - # @!attribute [rw] daily_recurrence - # @return [::Google::Cloud::Firestore::Admin::V1::DailyRecurrence] - # For a schedule that runs daily at a specified time. - # @!attribute [rw] weekly_recurrence - # @return [::Google::Cloud::Firestore::Admin::V1::WeeklyRecurrence] - # For a schedule that runs weekly on a specific day and time. - class BackupSchedule - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Represent a recurring schedule that runs at a specific time every day. - # - # The time zone is UTC. - class DailyRecurrence - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Represents a recurring schedule that runs on a specified day of the week. - # - # The time zone is UTC. - # @!attribute [rw] day - # @return [::Google::Type::DayOfWeek] - # The day of week to run. - # - # DAY_OF_WEEK_UNSPECIFIED is not allowed. - class WeeklyRecurrence - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-firestore-admin-v1/proto_docs/google/longrunning/operations.rb b/owl-bot-staging/google-cloud-firestore-admin-v1/proto_docs/google/longrunning/operations.rb deleted file mode 100644 index 54b83fb82b7d..000000000000 --- a/owl-bot-staging/google-cloud-firestore-admin-v1/proto_docs/google/longrunning/operations.rb +++ /dev/null @@ -1,164 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 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. - # @!attribute [rw] response - # @return [::Google::Protobuf::Any] - # The normal response of the operation in case of success. 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`. - 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. - 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. - 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 LongRunningRecognize(LongRunningRecognizeRequest) - # returns (google.longrunning.Operation) { - # option (google.longrunning.operation_info) = { - # response_type: "LongRunningRecognizeResponse" - # metadata_type: "LongRunningRecognizeMetadata" - # }; - # } - # @!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-firestore-admin-v1/proto_docs/google/protobuf/any.rb b/owl-bot-staging/google-cloud-firestore-admin-v1/proto_docs/google/protobuf/any.rb deleted file mode 100644 index fb4d6862eac9..000000000000 --- a/owl-bot-staging/google-cloud-firestore-admin-v1/proto_docs/google/protobuf/any.rb +++ /dev/null @@ -1,145 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 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-firestore-admin-v1/proto_docs/google/protobuf/duration.rb b/owl-bot-staging/google-cloud-firestore-admin-v1/proto_docs/google/protobuf/duration.rb deleted file mode 100644 index b5731a824060..000000000000 --- a/owl-bot-staging/google-cloud-firestore-admin-v1/proto_docs/google/protobuf/duration.rb +++ /dev/null @@ -1,98 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 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-firestore-admin-v1/proto_docs/google/protobuf/empty.rb b/owl-bot-staging/google-cloud-firestore-admin-v1/proto_docs/google/protobuf/empty.rb deleted file mode 100644 index 8c6b19d52e3d..000000000000 --- a/owl-bot-staging/google-cloud-firestore-admin-v1/proto_docs/google/protobuf/empty.rb +++ /dev/null @@ -1,34 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 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-firestore-admin-v1/proto_docs/google/protobuf/field_mask.rb b/owl-bot-staging/google-cloud-firestore-admin-v1/proto_docs/google/protobuf/field_mask.rb deleted file mode 100644 index 8e7abcf8f052..000000000000 --- a/owl-bot-staging/google-cloud-firestore-admin-v1/proto_docs/google/protobuf/field_mask.rb +++ /dev/null @@ -1,229 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 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-firestore-admin-v1/proto_docs/google/protobuf/timestamp.rb b/owl-bot-staging/google-cloud-firestore-admin-v1/proto_docs/google/protobuf/timestamp.rb deleted file mode 100644 index 4ac9c4801a3f..000000000000 --- a/owl-bot-staging/google-cloud-firestore-admin-v1/proto_docs/google/protobuf/timestamp.rb +++ /dev/null @@ -1,127 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 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-firestore-admin-v1/proto_docs/google/rpc/status.rb b/owl-bot-staging/google-cloud-firestore-admin-v1/proto_docs/google/rpc/status.rb deleted file mode 100644 index 09acc69b6125..000000000000 --- a/owl-bot-staging/google-cloud-firestore-admin-v1/proto_docs/google/rpc/status.rb +++ /dev/null @@ -1,48 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 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-firestore-admin-v1/proto_docs/google/type/dayofweek.rb b/owl-bot-staging/google-cloud-firestore-admin-v1/proto_docs/google/type/dayofweek.rb deleted file mode 100644 index 4fd080d9b331..000000000000 --- a/owl-bot-staging/google-cloud-firestore-admin-v1/proto_docs/google/type/dayofweek.rb +++ /dev/null @@ -1,49 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 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 day of the week. - module DayOfWeek - # The day of the week is unspecified. - DAY_OF_WEEK_UNSPECIFIED = 0 - - # Monday - MONDAY = 1 - - # Tuesday - TUESDAY = 2 - - # Wednesday - WEDNESDAY = 3 - - # Thursday - THURSDAY = 4 - - # Friday - FRIDAY = 5 - - # Saturday - SATURDAY = 6 - - # Sunday - SUNDAY = 7 - end - end -end diff --git a/owl-bot-staging/google-cloud-firestore-admin-v1/snippets/Gemfile b/owl-bot-staging/google-cloud-firestore-admin-v1/snippets/Gemfile deleted file mode 100644 index d4e15e1a636e..000000000000 --- a/owl-bot-staging/google-cloud-firestore-admin-v1/snippets/Gemfile +++ /dev/null @@ -1,32 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 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-firestore-admin-v1", path: "../" -else - gem "google-cloud-firestore-admin-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-firestore-admin-v1/snippets/firestore_admin/create_backup_schedule.rb b/owl-bot-staging/google-cloud-firestore-admin-v1/snippets/firestore_admin/create_backup_schedule.rb deleted file mode 100644 index d732e062ff17..000000000000 --- a/owl-bot-staging/google-cloud-firestore-admin-v1/snippets/firestore_admin/create_backup_schedule.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 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 firestore_v1_generated_FirestoreAdmin_CreateBackupSchedule_sync] -require "google/cloud/firestore/admin/v1" - -## -# Snippet for the create_backup_schedule call in the FirestoreAdmin 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::Firestore::Admin::V1::FirestoreAdmin::Client#create_backup_schedule. -# -def create_backup_schedule - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Firestore::Admin::V1::CreateBackupScheduleRequest.new - - # Call the create_backup_schedule method. - result = client.create_backup_schedule request - - # The returned object is of type Google::Cloud::Firestore::Admin::V1::BackupSchedule. - p result -end -# [END firestore_v1_generated_FirestoreAdmin_CreateBackupSchedule_sync] diff --git a/owl-bot-staging/google-cloud-firestore-admin-v1/snippets/firestore_admin/create_database.rb b/owl-bot-staging/google-cloud-firestore-admin-v1/snippets/firestore_admin/create_database.rb deleted file mode 100644 index a03e1c2a9bf9..000000000000 --- a/owl-bot-staging/google-cloud-firestore-admin-v1/snippets/firestore_admin/create_database.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 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 firestore_v1_generated_FirestoreAdmin_CreateDatabase_sync] -require "google/cloud/firestore/admin/v1" - -## -# Snippet for the create_database call in the FirestoreAdmin 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::Firestore::Admin::V1::FirestoreAdmin::Client#create_database. -# -def create_database - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Firestore::Admin::V1::CreateDatabaseRequest.new - - # Call the create_database method. - result = client.create_database 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 firestore_v1_generated_FirestoreAdmin_CreateDatabase_sync] diff --git a/owl-bot-staging/google-cloud-firestore-admin-v1/snippets/firestore_admin/create_index.rb b/owl-bot-staging/google-cloud-firestore-admin-v1/snippets/firestore_admin/create_index.rb deleted file mode 100644 index 4d8a3bb79ad3..000000000000 --- a/owl-bot-staging/google-cloud-firestore-admin-v1/snippets/firestore_admin/create_index.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 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 firestore_v1_generated_FirestoreAdmin_CreateIndex_sync] -require "google/cloud/firestore/admin/v1" - -## -# Snippet for the create_index call in the FirestoreAdmin 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::Firestore::Admin::V1::FirestoreAdmin::Client#create_index. -# -def create_index - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Firestore::Admin::V1::CreateIndexRequest.new - - # Call the create_index method. - result = client.create_index 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 firestore_v1_generated_FirestoreAdmin_CreateIndex_sync] diff --git a/owl-bot-staging/google-cloud-firestore-admin-v1/snippets/firestore_admin/delete_backup.rb b/owl-bot-staging/google-cloud-firestore-admin-v1/snippets/firestore_admin/delete_backup.rb deleted file mode 100644 index 2e6a9f4959b2..000000000000 --- a/owl-bot-staging/google-cloud-firestore-admin-v1/snippets/firestore_admin/delete_backup.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 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 firestore_v1_generated_FirestoreAdmin_DeleteBackup_sync] -require "google/cloud/firestore/admin/v1" - -## -# Snippet for the delete_backup call in the FirestoreAdmin 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::Firestore::Admin::V1::FirestoreAdmin::Client#delete_backup. -# -def delete_backup - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Firestore::Admin::V1::DeleteBackupRequest.new - - # Call the delete_backup method. - result = client.delete_backup request - - # The returned object is of type Google::Protobuf::Empty. - p result -end -# [END firestore_v1_generated_FirestoreAdmin_DeleteBackup_sync] diff --git a/owl-bot-staging/google-cloud-firestore-admin-v1/snippets/firestore_admin/delete_backup_schedule.rb b/owl-bot-staging/google-cloud-firestore-admin-v1/snippets/firestore_admin/delete_backup_schedule.rb deleted file mode 100644 index 482ceec579bf..000000000000 --- a/owl-bot-staging/google-cloud-firestore-admin-v1/snippets/firestore_admin/delete_backup_schedule.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 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 firestore_v1_generated_FirestoreAdmin_DeleteBackupSchedule_sync] -require "google/cloud/firestore/admin/v1" - -## -# Snippet for the delete_backup_schedule call in the FirestoreAdmin 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::Firestore::Admin::V1::FirestoreAdmin::Client#delete_backup_schedule. -# -def delete_backup_schedule - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Firestore::Admin::V1::DeleteBackupScheduleRequest.new - - # Call the delete_backup_schedule method. - result = client.delete_backup_schedule request - - # The returned object is of type Google::Protobuf::Empty. - p result -end -# [END firestore_v1_generated_FirestoreAdmin_DeleteBackupSchedule_sync] diff --git a/owl-bot-staging/google-cloud-firestore-admin-v1/snippets/firestore_admin/delete_database.rb b/owl-bot-staging/google-cloud-firestore-admin-v1/snippets/firestore_admin/delete_database.rb deleted file mode 100644 index 0c92a9c85ced..000000000000 --- a/owl-bot-staging/google-cloud-firestore-admin-v1/snippets/firestore_admin/delete_database.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 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 firestore_v1_generated_FirestoreAdmin_DeleteDatabase_sync] -require "google/cloud/firestore/admin/v1" - -## -# Snippet for the delete_database call in the FirestoreAdmin 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::Firestore::Admin::V1::FirestoreAdmin::Client#delete_database. -# -def delete_database - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Firestore::Admin::V1::DeleteDatabaseRequest.new - - # Call the delete_database method. - result = client.delete_database 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 firestore_v1_generated_FirestoreAdmin_DeleteDatabase_sync] diff --git a/owl-bot-staging/google-cloud-firestore-admin-v1/snippets/firestore_admin/delete_index.rb b/owl-bot-staging/google-cloud-firestore-admin-v1/snippets/firestore_admin/delete_index.rb deleted file mode 100644 index 159fe0d02b9d..000000000000 --- a/owl-bot-staging/google-cloud-firestore-admin-v1/snippets/firestore_admin/delete_index.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 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 firestore_v1_generated_FirestoreAdmin_DeleteIndex_sync] -require "google/cloud/firestore/admin/v1" - -## -# Snippet for the delete_index call in the FirestoreAdmin 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::Firestore::Admin::V1::FirestoreAdmin::Client#delete_index. -# -def delete_index - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Firestore::Admin::V1::DeleteIndexRequest.new - - # Call the delete_index method. - result = client.delete_index request - - # The returned object is of type Google::Protobuf::Empty. - p result -end -# [END firestore_v1_generated_FirestoreAdmin_DeleteIndex_sync] diff --git a/owl-bot-staging/google-cloud-firestore-admin-v1/snippets/firestore_admin/export_documents.rb b/owl-bot-staging/google-cloud-firestore-admin-v1/snippets/firestore_admin/export_documents.rb deleted file mode 100644 index d34ca4ae05a9..000000000000 --- a/owl-bot-staging/google-cloud-firestore-admin-v1/snippets/firestore_admin/export_documents.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 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 firestore_v1_generated_FirestoreAdmin_ExportDocuments_sync] -require "google/cloud/firestore/admin/v1" - -## -# Snippet for the export_documents call in the FirestoreAdmin 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::Firestore::Admin::V1::FirestoreAdmin::Client#export_documents. -# -def export_documents - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Firestore::Admin::V1::ExportDocumentsRequest.new - - # Call the export_documents method. - result = client.export_documents 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 firestore_v1_generated_FirestoreAdmin_ExportDocuments_sync] diff --git a/owl-bot-staging/google-cloud-firestore-admin-v1/snippets/firestore_admin/get_backup.rb b/owl-bot-staging/google-cloud-firestore-admin-v1/snippets/firestore_admin/get_backup.rb deleted file mode 100644 index ec77761e6957..000000000000 --- a/owl-bot-staging/google-cloud-firestore-admin-v1/snippets/firestore_admin/get_backup.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 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 firestore_v1_generated_FirestoreAdmin_GetBackup_sync] -require "google/cloud/firestore/admin/v1" - -## -# Snippet for the get_backup call in the FirestoreAdmin 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::Firestore::Admin::V1::FirestoreAdmin::Client#get_backup. -# -def get_backup - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Firestore::Admin::V1::GetBackupRequest.new - - # Call the get_backup method. - result = client.get_backup request - - # The returned object is of type Google::Cloud::Firestore::Admin::V1::Backup. - p result -end -# [END firestore_v1_generated_FirestoreAdmin_GetBackup_sync] diff --git a/owl-bot-staging/google-cloud-firestore-admin-v1/snippets/firestore_admin/get_backup_schedule.rb b/owl-bot-staging/google-cloud-firestore-admin-v1/snippets/firestore_admin/get_backup_schedule.rb deleted file mode 100644 index 15d5fc931e89..000000000000 --- a/owl-bot-staging/google-cloud-firestore-admin-v1/snippets/firestore_admin/get_backup_schedule.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 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 firestore_v1_generated_FirestoreAdmin_GetBackupSchedule_sync] -require "google/cloud/firestore/admin/v1" - -## -# Snippet for the get_backup_schedule call in the FirestoreAdmin 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::Firestore::Admin::V1::FirestoreAdmin::Client#get_backup_schedule. -# -def get_backup_schedule - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Firestore::Admin::V1::GetBackupScheduleRequest.new - - # Call the get_backup_schedule method. - result = client.get_backup_schedule request - - # The returned object is of type Google::Cloud::Firestore::Admin::V1::BackupSchedule. - p result -end -# [END firestore_v1_generated_FirestoreAdmin_GetBackupSchedule_sync] diff --git a/owl-bot-staging/google-cloud-firestore-admin-v1/snippets/firestore_admin/get_database.rb b/owl-bot-staging/google-cloud-firestore-admin-v1/snippets/firestore_admin/get_database.rb deleted file mode 100644 index 876a658ec4af..000000000000 --- a/owl-bot-staging/google-cloud-firestore-admin-v1/snippets/firestore_admin/get_database.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 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 firestore_v1_generated_FirestoreAdmin_GetDatabase_sync] -require "google/cloud/firestore/admin/v1" - -## -# Snippet for the get_database call in the FirestoreAdmin 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::Firestore::Admin::V1::FirestoreAdmin::Client#get_database. -# -def get_database - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Firestore::Admin::V1::GetDatabaseRequest.new - - # Call the get_database method. - result = client.get_database request - - # The returned object is of type Google::Cloud::Firestore::Admin::V1::Database. - p result -end -# [END firestore_v1_generated_FirestoreAdmin_GetDatabase_sync] diff --git a/owl-bot-staging/google-cloud-firestore-admin-v1/snippets/firestore_admin/get_field.rb b/owl-bot-staging/google-cloud-firestore-admin-v1/snippets/firestore_admin/get_field.rb deleted file mode 100644 index 22ecc9d699c8..000000000000 --- a/owl-bot-staging/google-cloud-firestore-admin-v1/snippets/firestore_admin/get_field.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 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 firestore_v1_generated_FirestoreAdmin_GetField_sync] -require "google/cloud/firestore/admin/v1" - -## -# Snippet for the get_field call in the FirestoreAdmin 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::Firestore::Admin::V1::FirestoreAdmin::Client#get_field. -# -def get_field - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Firestore::Admin::V1::GetFieldRequest.new - - # Call the get_field method. - result = client.get_field request - - # The returned object is of type Google::Cloud::Firestore::Admin::V1::Field. - p result -end -# [END firestore_v1_generated_FirestoreAdmin_GetField_sync] diff --git a/owl-bot-staging/google-cloud-firestore-admin-v1/snippets/firestore_admin/get_index.rb b/owl-bot-staging/google-cloud-firestore-admin-v1/snippets/firestore_admin/get_index.rb deleted file mode 100644 index 093dd8a99ea9..000000000000 --- a/owl-bot-staging/google-cloud-firestore-admin-v1/snippets/firestore_admin/get_index.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 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 firestore_v1_generated_FirestoreAdmin_GetIndex_sync] -require "google/cloud/firestore/admin/v1" - -## -# Snippet for the get_index call in the FirestoreAdmin 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::Firestore::Admin::V1::FirestoreAdmin::Client#get_index. -# -def get_index - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Firestore::Admin::V1::GetIndexRequest.new - - # Call the get_index method. - result = client.get_index request - - # The returned object is of type Google::Cloud::Firestore::Admin::V1::Index. - p result -end -# [END firestore_v1_generated_FirestoreAdmin_GetIndex_sync] diff --git a/owl-bot-staging/google-cloud-firestore-admin-v1/snippets/firestore_admin/import_documents.rb b/owl-bot-staging/google-cloud-firestore-admin-v1/snippets/firestore_admin/import_documents.rb deleted file mode 100644 index 82a98315b198..000000000000 --- a/owl-bot-staging/google-cloud-firestore-admin-v1/snippets/firestore_admin/import_documents.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 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 firestore_v1_generated_FirestoreAdmin_ImportDocuments_sync] -require "google/cloud/firestore/admin/v1" - -## -# Snippet for the import_documents call in the FirestoreAdmin 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::Firestore::Admin::V1::FirestoreAdmin::Client#import_documents. -# -def import_documents - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Firestore::Admin::V1::ImportDocumentsRequest.new - - # Call the import_documents method. - result = client.import_documents 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 firestore_v1_generated_FirestoreAdmin_ImportDocuments_sync] diff --git a/owl-bot-staging/google-cloud-firestore-admin-v1/snippets/firestore_admin/list_backup_schedules.rb b/owl-bot-staging/google-cloud-firestore-admin-v1/snippets/firestore_admin/list_backup_schedules.rb deleted file mode 100644 index 22ea176afb83..000000000000 --- a/owl-bot-staging/google-cloud-firestore-admin-v1/snippets/firestore_admin/list_backup_schedules.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 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 firestore_v1_generated_FirestoreAdmin_ListBackupSchedules_sync] -require "google/cloud/firestore/admin/v1" - -## -# Snippet for the list_backup_schedules call in the FirestoreAdmin 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::Firestore::Admin::V1::FirestoreAdmin::Client#list_backup_schedules. -# -def list_backup_schedules - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Firestore::Admin::V1::ListBackupSchedulesRequest.new - - # Call the list_backup_schedules method. - result = client.list_backup_schedules request - - # The returned object is of type Google::Cloud::Firestore::Admin::V1::ListBackupSchedulesResponse. - p result -end -# [END firestore_v1_generated_FirestoreAdmin_ListBackupSchedules_sync] diff --git a/owl-bot-staging/google-cloud-firestore-admin-v1/snippets/firestore_admin/list_backups.rb b/owl-bot-staging/google-cloud-firestore-admin-v1/snippets/firestore_admin/list_backups.rb deleted file mode 100644 index f4811fd036ff..000000000000 --- a/owl-bot-staging/google-cloud-firestore-admin-v1/snippets/firestore_admin/list_backups.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 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 firestore_v1_generated_FirestoreAdmin_ListBackups_sync] -require "google/cloud/firestore/admin/v1" - -## -# Snippet for the list_backups call in the FirestoreAdmin 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::Firestore::Admin::V1::FirestoreAdmin::Client#list_backups. -# -def list_backups - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Firestore::Admin::V1::ListBackupsRequest.new - - # Call the list_backups method. - result = client.list_backups request - - # The returned object is of type Google::Cloud::Firestore::Admin::V1::ListBackupsResponse. - p result -end -# [END firestore_v1_generated_FirestoreAdmin_ListBackups_sync] diff --git a/owl-bot-staging/google-cloud-firestore-admin-v1/snippets/firestore_admin/list_databases.rb b/owl-bot-staging/google-cloud-firestore-admin-v1/snippets/firestore_admin/list_databases.rb deleted file mode 100644 index 2da8e6ba9a18..000000000000 --- a/owl-bot-staging/google-cloud-firestore-admin-v1/snippets/firestore_admin/list_databases.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 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 firestore_v1_generated_FirestoreAdmin_ListDatabases_sync] -require "google/cloud/firestore/admin/v1" - -## -# Snippet for the list_databases call in the FirestoreAdmin 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::Firestore::Admin::V1::FirestoreAdmin::Client#list_databases. -# -def list_databases - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Firestore::Admin::V1::ListDatabasesRequest.new - - # Call the list_databases method. - result = client.list_databases request - - # The returned object is of type Google::Cloud::Firestore::Admin::V1::ListDatabasesResponse. - p result -end -# [END firestore_v1_generated_FirestoreAdmin_ListDatabases_sync] diff --git a/owl-bot-staging/google-cloud-firestore-admin-v1/snippets/firestore_admin/list_fields.rb b/owl-bot-staging/google-cloud-firestore-admin-v1/snippets/firestore_admin/list_fields.rb deleted file mode 100644 index 269b06842b5c..000000000000 --- a/owl-bot-staging/google-cloud-firestore-admin-v1/snippets/firestore_admin/list_fields.rb +++ /dev/null @@ -1,51 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 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 firestore_v1_generated_FirestoreAdmin_ListFields_sync] -require "google/cloud/firestore/admin/v1" - -## -# Snippet for the list_fields call in the FirestoreAdmin 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::Firestore::Admin::V1::FirestoreAdmin::Client#list_fields. -# -def list_fields - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Firestore::Admin::V1::ListFieldsRequest.new - - # Call the list_fields method. - result = client.list_fields 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::Firestore::Admin::V1::Field. - p item - end -end -# [END firestore_v1_generated_FirestoreAdmin_ListFields_sync] diff --git a/owl-bot-staging/google-cloud-firestore-admin-v1/snippets/firestore_admin/list_indexes.rb b/owl-bot-staging/google-cloud-firestore-admin-v1/snippets/firestore_admin/list_indexes.rb deleted file mode 100644 index 4ca35db2edbf..000000000000 --- a/owl-bot-staging/google-cloud-firestore-admin-v1/snippets/firestore_admin/list_indexes.rb +++ /dev/null @@ -1,51 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 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 firestore_v1_generated_FirestoreAdmin_ListIndexes_sync] -require "google/cloud/firestore/admin/v1" - -## -# Snippet for the list_indexes call in the FirestoreAdmin 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::Firestore::Admin::V1::FirestoreAdmin::Client#list_indexes. -# -def list_indexes - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Firestore::Admin::V1::ListIndexesRequest.new - - # Call the list_indexes method. - result = client.list_indexes 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::Firestore::Admin::V1::Index. - p item - end -end -# [END firestore_v1_generated_FirestoreAdmin_ListIndexes_sync] diff --git a/owl-bot-staging/google-cloud-firestore-admin-v1/snippets/firestore_admin/restore_database.rb b/owl-bot-staging/google-cloud-firestore-admin-v1/snippets/firestore_admin/restore_database.rb deleted file mode 100644 index 2b5373706864..000000000000 --- a/owl-bot-staging/google-cloud-firestore-admin-v1/snippets/firestore_admin/restore_database.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 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 firestore_v1_generated_FirestoreAdmin_RestoreDatabase_sync] -require "google/cloud/firestore/admin/v1" - -## -# Snippet for the restore_database call in the FirestoreAdmin 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::Firestore::Admin::V1::FirestoreAdmin::Client#restore_database. -# -def restore_database - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Firestore::Admin::V1::RestoreDatabaseRequest.new - - # Call the restore_database method. - result = client.restore_database 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 firestore_v1_generated_FirestoreAdmin_RestoreDatabase_sync] diff --git a/owl-bot-staging/google-cloud-firestore-admin-v1/snippets/firestore_admin/update_backup_schedule.rb b/owl-bot-staging/google-cloud-firestore-admin-v1/snippets/firestore_admin/update_backup_schedule.rb deleted file mode 100644 index 0667ac816a99..000000000000 --- a/owl-bot-staging/google-cloud-firestore-admin-v1/snippets/firestore_admin/update_backup_schedule.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 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 firestore_v1_generated_FirestoreAdmin_UpdateBackupSchedule_sync] -require "google/cloud/firestore/admin/v1" - -## -# Snippet for the update_backup_schedule call in the FirestoreAdmin 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::Firestore::Admin::V1::FirestoreAdmin::Client#update_backup_schedule. -# -def update_backup_schedule - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Firestore::Admin::V1::UpdateBackupScheduleRequest.new - - # Call the update_backup_schedule method. - result = client.update_backup_schedule request - - # The returned object is of type Google::Cloud::Firestore::Admin::V1::BackupSchedule. - p result -end -# [END firestore_v1_generated_FirestoreAdmin_UpdateBackupSchedule_sync] diff --git a/owl-bot-staging/google-cloud-firestore-admin-v1/snippets/firestore_admin/update_database.rb b/owl-bot-staging/google-cloud-firestore-admin-v1/snippets/firestore_admin/update_database.rb deleted file mode 100644 index 9adc30368321..000000000000 --- a/owl-bot-staging/google-cloud-firestore-admin-v1/snippets/firestore_admin/update_database.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 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 firestore_v1_generated_FirestoreAdmin_UpdateDatabase_sync] -require "google/cloud/firestore/admin/v1" - -## -# Snippet for the update_database call in the FirestoreAdmin 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::Firestore::Admin::V1::FirestoreAdmin::Client#update_database. -# -def update_database - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Firestore::Admin::V1::UpdateDatabaseRequest.new - - # Call the update_database method. - result = client.update_database 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 firestore_v1_generated_FirestoreAdmin_UpdateDatabase_sync] diff --git a/owl-bot-staging/google-cloud-firestore-admin-v1/snippets/firestore_admin/update_field.rb b/owl-bot-staging/google-cloud-firestore-admin-v1/snippets/firestore_admin/update_field.rb deleted file mode 100644 index dc94f2ad4ea4..000000000000 --- a/owl-bot-staging/google-cloud-firestore-admin-v1/snippets/firestore_admin/update_field.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 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 firestore_v1_generated_FirestoreAdmin_UpdateField_sync] -require "google/cloud/firestore/admin/v1" - -## -# Snippet for the update_field call in the FirestoreAdmin 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::Firestore::Admin::V1::FirestoreAdmin::Client#update_field. -# -def update_field - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Firestore::Admin::V1::UpdateFieldRequest.new - - # Call the update_field method. - result = client.update_field 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 firestore_v1_generated_FirestoreAdmin_UpdateField_sync] diff --git a/owl-bot-staging/google-cloud-firestore-admin-v1/snippets/snippet_metadata_google.firestore.admin.v1.json b/owl-bot-staging/google-cloud-firestore-admin-v1/snippets/snippet_metadata_google.firestore.admin.v1.json deleted file mode 100644 index 72e8d2a952ca..000000000000 --- a/owl-bot-staging/google-cloud-firestore-admin-v1/snippets/snippet_metadata_google.firestore.admin.v1.json +++ /dev/null @@ -1,935 +0,0 @@ -{ - "client_library": { - "name": "google-cloud-firestore-admin-v1", - "version": "", - "language": "RUBY", - "apis": [ - { - "id": "google.firestore.admin.v1", - "version": "v1" - } - ] - }, - "snippets": [ - { - "region_tag": "firestore_v1_generated_FirestoreAdmin_CreateIndex_sync", - "title": "Snippet for the create_index call in the FirestoreAdmin service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client#create_index.", - "file": "firestore_admin/create_index.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_index", - "full_name": "::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client#create_index", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Firestore::Admin::V1::CreateIndexRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "FirestoreAdmin::Client", - "full_name": "::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client" - }, - "method": { - "short_name": "CreateIndex", - "full_name": "google.firestore.admin.v1.FirestoreAdmin.CreateIndex", - "service": { - "short_name": "FirestoreAdmin", - "full_name": "google.firestore.admin.v1.FirestoreAdmin" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "firestore_v1_generated_FirestoreAdmin_ListIndexes_sync", - "title": "Snippet for the list_indexes call in the FirestoreAdmin service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client#list_indexes.", - "file": "firestore_admin/list_indexes.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_indexes", - "full_name": "::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client#list_indexes", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Firestore::Admin::V1::ListIndexesRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Firestore::Admin::V1::ListIndexesResponse", - "client": { - "short_name": "FirestoreAdmin::Client", - "full_name": "::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client" - }, - "method": { - "short_name": "ListIndexes", - "full_name": "google.firestore.admin.v1.FirestoreAdmin.ListIndexes", - "service": { - "short_name": "FirestoreAdmin", - "full_name": "google.firestore.admin.v1.FirestoreAdmin" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "firestore_v1_generated_FirestoreAdmin_GetIndex_sync", - "title": "Snippet for the get_index call in the FirestoreAdmin service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client#get_index.", - "file": "firestore_admin/get_index.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_index", - "full_name": "::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client#get_index", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Firestore::Admin::V1::GetIndexRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Firestore::Admin::V1::Index", - "client": { - "short_name": "FirestoreAdmin::Client", - "full_name": "::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client" - }, - "method": { - "short_name": "GetIndex", - "full_name": "google.firestore.admin.v1.FirestoreAdmin.GetIndex", - "service": { - "short_name": "FirestoreAdmin", - "full_name": "google.firestore.admin.v1.FirestoreAdmin" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "firestore_v1_generated_FirestoreAdmin_DeleteIndex_sync", - "title": "Snippet for the delete_index call in the FirestoreAdmin service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client#delete_index.", - "file": "firestore_admin/delete_index.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_index", - "full_name": "::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client#delete_index", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Firestore::Admin::V1::DeleteIndexRequest", - "name": "request" - } - ], - "result_type": "::Google::Protobuf::Empty", - "client": { - "short_name": "FirestoreAdmin::Client", - "full_name": "::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client" - }, - "method": { - "short_name": "DeleteIndex", - "full_name": "google.firestore.admin.v1.FirestoreAdmin.DeleteIndex", - "service": { - "short_name": "FirestoreAdmin", - "full_name": "google.firestore.admin.v1.FirestoreAdmin" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "firestore_v1_generated_FirestoreAdmin_GetField_sync", - "title": "Snippet for the get_field call in the FirestoreAdmin service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client#get_field.", - "file": "firestore_admin/get_field.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_field", - "full_name": "::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client#get_field", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Firestore::Admin::V1::GetFieldRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Firestore::Admin::V1::Field", - "client": { - "short_name": "FirestoreAdmin::Client", - "full_name": "::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client" - }, - "method": { - "short_name": "GetField", - "full_name": "google.firestore.admin.v1.FirestoreAdmin.GetField", - "service": { - "short_name": "FirestoreAdmin", - "full_name": "google.firestore.admin.v1.FirestoreAdmin" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "firestore_v1_generated_FirestoreAdmin_UpdateField_sync", - "title": "Snippet for the update_field call in the FirestoreAdmin service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client#update_field.", - "file": "firestore_admin/update_field.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_field", - "full_name": "::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client#update_field", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Firestore::Admin::V1::UpdateFieldRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "FirestoreAdmin::Client", - "full_name": "::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client" - }, - "method": { - "short_name": "UpdateField", - "full_name": "google.firestore.admin.v1.FirestoreAdmin.UpdateField", - "service": { - "short_name": "FirestoreAdmin", - "full_name": "google.firestore.admin.v1.FirestoreAdmin" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "firestore_v1_generated_FirestoreAdmin_ListFields_sync", - "title": "Snippet for the list_fields call in the FirestoreAdmin service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client#list_fields.", - "file": "firestore_admin/list_fields.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_fields", - "full_name": "::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client#list_fields", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Firestore::Admin::V1::ListFieldsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Firestore::Admin::V1::ListFieldsResponse", - "client": { - "short_name": "FirestoreAdmin::Client", - "full_name": "::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client" - }, - "method": { - "short_name": "ListFields", - "full_name": "google.firestore.admin.v1.FirestoreAdmin.ListFields", - "service": { - "short_name": "FirestoreAdmin", - "full_name": "google.firestore.admin.v1.FirestoreAdmin" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "firestore_v1_generated_FirestoreAdmin_ExportDocuments_sync", - "title": "Snippet for the export_documents call in the FirestoreAdmin service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client#export_documents.", - "file": "firestore_admin/export_documents.rb", - "language": "RUBY", - "client_method": { - "short_name": "export_documents", - "full_name": "::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client#export_documents", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Firestore::Admin::V1::ExportDocumentsRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "FirestoreAdmin::Client", - "full_name": "::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client" - }, - "method": { - "short_name": "ExportDocuments", - "full_name": "google.firestore.admin.v1.FirestoreAdmin.ExportDocuments", - "service": { - "short_name": "FirestoreAdmin", - "full_name": "google.firestore.admin.v1.FirestoreAdmin" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "firestore_v1_generated_FirestoreAdmin_ImportDocuments_sync", - "title": "Snippet for the import_documents call in the FirestoreAdmin service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client#import_documents.", - "file": "firestore_admin/import_documents.rb", - "language": "RUBY", - "client_method": { - "short_name": "import_documents", - "full_name": "::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client#import_documents", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Firestore::Admin::V1::ImportDocumentsRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "FirestoreAdmin::Client", - "full_name": "::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client" - }, - "method": { - "short_name": "ImportDocuments", - "full_name": "google.firestore.admin.v1.FirestoreAdmin.ImportDocuments", - "service": { - "short_name": "FirestoreAdmin", - "full_name": "google.firestore.admin.v1.FirestoreAdmin" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "firestore_v1_generated_FirestoreAdmin_CreateDatabase_sync", - "title": "Snippet for the create_database call in the FirestoreAdmin service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client#create_database.", - "file": "firestore_admin/create_database.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_database", - "full_name": "::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client#create_database", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Firestore::Admin::V1::CreateDatabaseRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "FirestoreAdmin::Client", - "full_name": "::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client" - }, - "method": { - "short_name": "CreateDatabase", - "full_name": "google.firestore.admin.v1.FirestoreAdmin.CreateDatabase", - "service": { - "short_name": "FirestoreAdmin", - "full_name": "google.firestore.admin.v1.FirestoreAdmin" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "firestore_v1_generated_FirestoreAdmin_GetDatabase_sync", - "title": "Snippet for the get_database call in the FirestoreAdmin service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client#get_database.", - "file": "firestore_admin/get_database.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_database", - "full_name": "::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client#get_database", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Firestore::Admin::V1::GetDatabaseRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Firestore::Admin::V1::Database", - "client": { - "short_name": "FirestoreAdmin::Client", - "full_name": "::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client" - }, - "method": { - "short_name": "GetDatabase", - "full_name": "google.firestore.admin.v1.FirestoreAdmin.GetDatabase", - "service": { - "short_name": "FirestoreAdmin", - "full_name": "google.firestore.admin.v1.FirestoreAdmin" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "firestore_v1_generated_FirestoreAdmin_ListDatabases_sync", - "title": "Snippet for the list_databases call in the FirestoreAdmin service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client#list_databases.", - "file": "firestore_admin/list_databases.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_databases", - "full_name": "::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client#list_databases", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Firestore::Admin::V1::ListDatabasesRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Firestore::Admin::V1::ListDatabasesResponse", - "client": { - "short_name": "FirestoreAdmin::Client", - "full_name": "::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client" - }, - "method": { - "short_name": "ListDatabases", - "full_name": "google.firestore.admin.v1.FirestoreAdmin.ListDatabases", - "service": { - "short_name": "FirestoreAdmin", - "full_name": "google.firestore.admin.v1.FirestoreAdmin" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "firestore_v1_generated_FirestoreAdmin_UpdateDatabase_sync", - "title": "Snippet for the update_database call in the FirestoreAdmin service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client#update_database.", - "file": "firestore_admin/update_database.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_database", - "full_name": "::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client#update_database", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Firestore::Admin::V1::UpdateDatabaseRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "FirestoreAdmin::Client", - "full_name": "::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client" - }, - "method": { - "short_name": "UpdateDatabase", - "full_name": "google.firestore.admin.v1.FirestoreAdmin.UpdateDatabase", - "service": { - "short_name": "FirestoreAdmin", - "full_name": "google.firestore.admin.v1.FirestoreAdmin" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "firestore_v1_generated_FirestoreAdmin_DeleteDatabase_sync", - "title": "Snippet for the delete_database call in the FirestoreAdmin service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client#delete_database.", - "file": "firestore_admin/delete_database.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_database", - "full_name": "::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client#delete_database", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Firestore::Admin::V1::DeleteDatabaseRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "FirestoreAdmin::Client", - "full_name": "::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client" - }, - "method": { - "short_name": "DeleteDatabase", - "full_name": "google.firestore.admin.v1.FirestoreAdmin.DeleteDatabase", - "service": { - "short_name": "FirestoreAdmin", - "full_name": "google.firestore.admin.v1.FirestoreAdmin" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "firestore_v1_generated_FirestoreAdmin_GetBackup_sync", - "title": "Snippet for the get_backup call in the FirestoreAdmin service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client#get_backup.", - "file": "firestore_admin/get_backup.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_backup", - "full_name": "::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client#get_backup", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Firestore::Admin::V1::GetBackupRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Firestore::Admin::V1::Backup", - "client": { - "short_name": "FirestoreAdmin::Client", - "full_name": "::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client" - }, - "method": { - "short_name": "GetBackup", - "full_name": "google.firestore.admin.v1.FirestoreAdmin.GetBackup", - "service": { - "short_name": "FirestoreAdmin", - "full_name": "google.firestore.admin.v1.FirestoreAdmin" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "firestore_v1_generated_FirestoreAdmin_ListBackups_sync", - "title": "Snippet for the list_backups call in the FirestoreAdmin service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client#list_backups.", - "file": "firestore_admin/list_backups.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_backups", - "full_name": "::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client#list_backups", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Firestore::Admin::V1::ListBackupsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Firestore::Admin::V1::ListBackupsResponse", - "client": { - "short_name": "FirestoreAdmin::Client", - "full_name": "::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client" - }, - "method": { - "short_name": "ListBackups", - "full_name": "google.firestore.admin.v1.FirestoreAdmin.ListBackups", - "service": { - "short_name": "FirestoreAdmin", - "full_name": "google.firestore.admin.v1.FirestoreAdmin" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "firestore_v1_generated_FirestoreAdmin_DeleteBackup_sync", - "title": "Snippet for the delete_backup call in the FirestoreAdmin service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client#delete_backup.", - "file": "firestore_admin/delete_backup.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_backup", - "full_name": "::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client#delete_backup", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Firestore::Admin::V1::DeleteBackupRequest", - "name": "request" - } - ], - "result_type": "::Google::Protobuf::Empty", - "client": { - "short_name": "FirestoreAdmin::Client", - "full_name": "::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client" - }, - "method": { - "short_name": "DeleteBackup", - "full_name": "google.firestore.admin.v1.FirestoreAdmin.DeleteBackup", - "service": { - "short_name": "FirestoreAdmin", - "full_name": "google.firestore.admin.v1.FirestoreAdmin" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "firestore_v1_generated_FirestoreAdmin_RestoreDatabase_sync", - "title": "Snippet for the restore_database call in the FirestoreAdmin service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client#restore_database.", - "file": "firestore_admin/restore_database.rb", - "language": "RUBY", - "client_method": { - "short_name": "restore_database", - "full_name": "::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client#restore_database", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Firestore::Admin::V1::RestoreDatabaseRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "FirestoreAdmin::Client", - "full_name": "::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client" - }, - "method": { - "short_name": "RestoreDatabase", - "full_name": "google.firestore.admin.v1.FirestoreAdmin.RestoreDatabase", - "service": { - "short_name": "FirestoreAdmin", - "full_name": "google.firestore.admin.v1.FirestoreAdmin" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "firestore_v1_generated_FirestoreAdmin_CreateBackupSchedule_sync", - "title": "Snippet for the create_backup_schedule call in the FirestoreAdmin service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client#create_backup_schedule.", - "file": "firestore_admin/create_backup_schedule.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_backup_schedule", - "full_name": "::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client#create_backup_schedule", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Firestore::Admin::V1::CreateBackupScheduleRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Firestore::Admin::V1::BackupSchedule", - "client": { - "short_name": "FirestoreAdmin::Client", - "full_name": "::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client" - }, - "method": { - "short_name": "CreateBackupSchedule", - "full_name": "google.firestore.admin.v1.FirestoreAdmin.CreateBackupSchedule", - "service": { - "short_name": "FirestoreAdmin", - "full_name": "google.firestore.admin.v1.FirestoreAdmin" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "firestore_v1_generated_FirestoreAdmin_GetBackupSchedule_sync", - "title": "Snippet for the get_backup_schedule call in the FirestoreAdmin service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client#get_backup_schedule.", - "file": "firestore_admin/get_backup_schedule.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_backup_schedule", - "full_name": "::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client#get_backup_schedule", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Firestore::Admin::V1::GetBackupScheduleRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Firestore::Admin::V1::BackupSchedule", - "client": { - "short_name": "FirestoreAdmin::Client", - "full_name": "::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client" - }, - "method": { - "short_name": "GetBackupSchedule", - "full_name": "google.firestore.admin.v1.FirestoreAdmin.GetBackupSchedule", - "service": { - "short_name": "FirestoreAdmin", - "full_name": "google.firestore.admin.v1.FirestoreAdmin" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "firestore_v1_generated_FirestoreAdmin_ListBackupSchedules_sync", - "title": "Snippet for the list_backup_schedules call in the FirestoreAdmin service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client#list_backup_schedules.", - "file": "firestore_admin/list_backup_schedules.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_backup_schedules", - "full_name": "::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client#list_backup_schedules", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Firestore::Admin::V1::ListBackupSchedulesRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Firestore::Admin::V1::ListBackupSchedulesResponse", - "client": { - "short_name": "FirestoreAdmin::Client", - "full_name": "::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client" - }, - "method": { - "short_name": "ListBackupSchedules", - "full_name": "google.firestore.admin.v1.FirestoreAdmin.ListBackupSchedules", - "service": { - "short_name": "FirestoreAdmin", - "full_name": "google.firestore.admin.v1.FirestoreAdmin" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "firestore_v1_generated_FirestoreAdmin_UpdateBackupSchedule_sync", - "title": "Snippet for the update_backup_schedule call in the FirestoreAdmin service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client#update_backup_schedule.", - "file": "firestore_admin/update_backup_schedule.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_backup_schedule", - "full_name": "::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client#update_backup_schedule", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Firestore::Admin::V1::UpdateBackupScheduleRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Firestore::Admin::V1::BackupSchedule", - "client": { - "short_name": "FirestoreAdmin::Client", - "full_name": "::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client" - }, - "method": { - "short_name": "UpdateBackupSchedule", - "full_name": "google.firestore.admin.v1.FirestoreAdmin.UpdateBackupSchedule", - "service": { - "short_name": "FirestoreAdmin", - "full_name": "google.firestore.admin.v1.FirestoreAdmin" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "firestore_v1_generated_FirestoreAdmin_DeleteBackupSchedule_sync", - "title": "Snippet for the delete_backup_schedule call in the FirestoreAdmin service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client#delete_backup_schedule.", - "file": "firestore_admin/delete_backup_schedule.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_backup_schedule", - "full_name": "::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client#delete_backup_schedule", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Firestore::Admin::V1::DeleteBackupScheduleRequest", - "name": "request" - } - ], - "result_type": "::Google::Protobuf::Empty", - "client": { - "short_name": "FirestoreAdmin::Client", - "full_name": "::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client" - }, - "method": { - "short_name": "DeleteBackupSchedule", - "full_name": "google.firestore.admin.v1.FirestoreAdmin.DeleteBackupSchedule", - "service": { - "short_name": "FirestoreAdmin", - "full_name": "google.firestore.admin.v1.FirestoreAdmin" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - } - ] -} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-firestore-admin-v1/test/google/cloud/firestore/admin/v1/firestore_admin_operations_test.rb b/owl-bot-staging/google-cloud-firestore-admin-v1/test/google/cloud/firestore/admin/v1/firestore_admin_operations_test.rb deleted file mode 100644 index e6f566485be8..000000000000 --- a/owl-bot-staging/google-cloud-firestore-admin-v1/test/google/cloud/firestore/admin/v1/firestore_admin_operations_test.rb +++ /dev/null @@ -1,389 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 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/firestore/admin/v1/firestore_admin_pb" -require "google/firestore/admin/v1/firestore_admin_services_pb" -require "google/cloud/firestore/admin/v1/firestore_admin" - -class ::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::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) - - yield @response, @operation if block_given? - - @response - end - - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - 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" - - 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"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_operations_client_stub do - # Create client - client = ::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::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 }) 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 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) 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 }, 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), 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::Firestore::Admin::V1::FirestoreAdmin::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::Firestore::Admin::V1::FirestoreAdmin::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::Firestore::Admin::V1::FirestoreAdmin::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::Firestore::Admin::V1::FirestoreAdmin::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::Firestore::Admin::V1::FirestoreAdmin::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::Firestore::Admin::V1::FirestoreAdmin::Operations::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-firestore-admin-v1/test/google/cloud/firestore/admin/v1/firestore_admin_paths_test.rb b/owl-bot-staging/google-cloud-firestore-admin-v1/test/google/cloud/firestore/admin/v1/firestore_admin_paths_test.rb deleted file mode 100644 index 44328fb6465a..000000000000 --- a/owl-bot-staging/google-cloud-firestore-admin-v1/test/google/cloud/firestore/admin/v1/firestore_admin_paths_test.rb +++ /dev/null @@ -1,131 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 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/firestore/admin/v1/firestore_admin" - -class ::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::ClientPathsTest < Minitest::Test - class DummyStub - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - end - - def test_backup_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.backup_path project: "value0", location: "value1", backup: "value2" - assert_equal "projects/value0/locations/value1/backups/value2", path - end - end - - def test_backup_schedule_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.backup_schedule_path project: "value0", database: "value1", backup_schedule: "value2" - assert_equal "projects/value0/databases/value1/backupSchedules/value2", path - end - end - - def test_collection_group_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.collection_group_path project: "value0", database: "value1", collection: "value2" - assert_equal "projects/value0/databases/value1/collectionGroups/value2", path - end - end - - def test_database_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.database_path project: "value0", database: "value1" - assert_equal "projects/value0/databases/value1", path - end - end - - def test_field_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.field_path project: "value0", database: "value1", collection: "value2", field: "value3" - assert_equal "projects/value0/databases/value1/collectionGroups/value2/fields/value3", path - end - end - - def test_index_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.index_path project: "value0", database: "value1", collection: "value2", index: "value3" - assert_equal "projects/value0/databases/value1/collectionGroups/value2/indexes/value3", path - end - end - - def test_location_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.location_path project: "value0", location: "value1" - assert_equal "projects/value0/locations/value1", 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::Firestore::Admin::V1::FirestoreAdmin::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-firestore-admin-v1/test/google/cloud/firestore/admin/v1/firestore_admin_rest_test.rb b/owl-bot-staging/google-cloud-firestore-admin-v1/test/google/cloud/firestore/admin/v1/firestore_admin_rest_test.rb deleted file mode 100644 index b9a8591631cd..000000000000 --- a/owl-bot-staging/google-cloud-firestore-admin-v1/test/google/cloud/firestore/admin/v1/firestore_admin_rest_test.rb +++ /dev/null @@ -1,1356 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 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/firestore/admin/v1/firestore_admin_pb" -require "google/cloud/firestore/admin/v1/firestore_admin/rest" - - -class ::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::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: {} - make_http_request :get, uri: uri, body: nil, params: params, options: options - end - - def make_delete_request uri:, params: {}, options: {} - make_http_request :delete, uri: uri, body: nil, params: params, options: options - end - - def make_post_request uri:, body: nil, params: {}, options: {} - make_http_request :post, uri: uri, body: body, params: params, options: options - end - - def make_patch_request uri:, body:, params: {}, options: {} - make_http_request :patch, uri: uri, body: body, params: params, options: options - end - - def make_put_request uri:, body:, params: {}, options: {} - make_http_request :put, uri: uri, body: body, params: params, options: options - 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 - end - - def test_create_index - # 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" - index = {} - - create_index_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| - 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::Firestore::Admin::V1::FirestoreAdmin::Rest::ServiceStub.stub :transcode_create_index_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_index_client_stub do - # Create client - client = ::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_index({ parent: parent, index: index }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_index parent: parent, index: index do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_index ::Google::Cloud::Firestore::Admin::V1::CreateIndexRequest.new(parent: parent, index: index) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_index({ parent: parent, index: index }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_index(::Google::Cloud::Firestore::Admin::V1::CreateIndexRequest.new(parent: parent, index: index), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_index_client_stub.call_count - end - end - end - - def test_list_indexes - # Create test objects. - client_result = ::Google::Cloud::Firestore::Admin::V1::ListIndexesResponse.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_indexes_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| - 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::Firestore::Admin::V1::FirestoreAdmin::Rest::ServiceStub.stub :transcode_list_indexes_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_indexes_client_stub do - # Create client - client = ::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_indexes({ 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_indexes 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_indexes ::Google::Cloud::Firestore::Admin::V1::ListIndexesRequest.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_indexes({ 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_indexes(::Google::Cloud::Firestore::Admin::V1::ListIndexesRequest.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_indexes_client_stub.call_count - end - end - end - - def test_get_index - # Create test objects. - client_result = ::Google::Cloud::Firestore::Admin::V1::Index.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_index_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| - 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::Firestore::Admin::V1::FirestoreAdmin::Rest::ServiceStub.stub :transcode_get_index_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_index_client_stub do - # Create client - client = ::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_index({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_index name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_index ::Google::Cloud::Firestore::Admin::V1::GetIndexRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_index({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_index(::Google::Cloud::Firestore::Admin::V1::GetIndexRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_index_client_stub.call_count - end - end - end - - def test_delete_index - # 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_index_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| - 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::Firestore::Admin::V1::FirestoreAdmin::Rest::ServiceStub.stub :transcode_delete_index_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_index_client_stub do - # Create client - client = ::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.delete_index({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.delete_index name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.delete_index ::Google::Cloud::Firestore::Admin::V1::DeleteIndexRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.delete_index({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.delete_index(::Google::Cloud::Firestore::Admin::V1::DeleteIndexRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, delete_index_client_stub.call_count - end - end - end - - def test_get_field - # Create test objects. - client_result = ::Google::Cloud::Firestore::Admin::V1::Field.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_field_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| - 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::Firestore::Admin::V1::FirestoreAdmin::Rest::ServiceStub.stub :transcode_get_field_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_field_client_stub do - # Create client - client = ::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_field({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_field name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_field ::Google::Cloud::Firestore::Admin::V1::GetFieldRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_field({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_field(::Google::Cloud::Firestore::Admin::V1::GetFieldRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_field_client_stub.call_count - end - end - end - - def test_update_field - # 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. - field = {} - update_mask = {} - - update_field_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| - 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::Firestore::Admin::V1::FirestoreAdmin::Rest::ServiceStub.stub :transcode_update_field_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_field_client_stub do - # Create client - client = ::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_field({ field: field, update_mask: update_mask }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_field field: field, update_mask: update_mask do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_field ::Google::Cloud::Firestore::Admin::V1::UpdateFieldRequest.new(field: field, update_mask: update_mask) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.update_field({ field: field, update_mask: update_mask }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.update_field(::Google::Cloud::Firestore::Admin::V1::UpdateFieldRequest.new(field: field, update_mask: update_mask), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, update_field_client_stub.call_count - end - end - end - - def test_list_fields - # Create test objects. - client_result = ::Google::Cloud::Firestore::Admin::V1::ListFieldsResponse.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_fields_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| - 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::Firestore::Admin::V1::FirestoreAdmin::Rest::ServiceStub.stub :transcode_list_fields_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_fields_client_stub do - # Create client - client = ::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_fields({ 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_fields 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_fields ::Google::Cloud::Firestore::Admin::V1::ListFieldsRequest.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_fields({ 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_fields(::Google::Cloud::Firestore::Admin::V1::ListFieldsRequest.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_fields_client_stub.call_count - end - end - end - - def test_export_documents - # 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" - collection_ids = ["hello world"] - output_uri_prefix = "hello world" - namespace_ids = ["hello world"] - snapshot_time = {} - - export_documents_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| - 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::Firestore::Admin::V1::FirestoreAdmin::Rest::ServiceStub.stub :transcode_export_documents_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, export_documents_client_stub do - # Create client - client = ::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.export_documents({ name: name, collection_ids: collection_ids, output_uri_prefix: output_uri_prefix, namespace_ids: namespace_ids, snapshot_time: snapshot_time }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.export_documents name: name, collection_ids: collection_ids, output_uri_prefix: output_uri_prefix, namespace_ids: namespace_ids, snapshot_time: snapshot_time do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.export_documents ::Google::Cloud::Firestore::Admin::V1::ExportDocumentsRequest.new(name: name, collection_ids: collection_ids, output_uri_prefix: output_uri_prefix, namespace_ids: namespace_ids, snapshot_time: snapshot_time) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.export_documents({ name: name, collection_ids: collection_ids, output_uri_prefix: output_uri_prefix, namespace_ids: namespace_ids, snapshot_time: snapshot_time }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.export_documents(::Google::Cloud::Firestore::Admin::V1::ExportDocumentsRequest.new(name: name, collection_ids: collection_ids, output_uri_prefix: output_uri_prefix, namespace_ids: namespace_ids, snapshot_time: snapshot_time), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, export_documents_client_stub.call_count - end - end - end - - def test_import_documents - # 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" - collection_ids = ["hello world"] - input_uri_prefix = "hello world" - namespace_ids = ["hello world"] - - import_documents_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| - 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::Firestore::Admin::V1::FirestoreAdmin::Rest::ServiceStub.stub :transcode_import_documents_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, import_documents_client_stub do - # Create client - client = ::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.import_documents({ name: name, collection_ids: collection_ids, input_uri_prefix: input_uri_prefix, namespace_ids: namespace_ids }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.import_documents name: name, collection_ids: collection_ids, input_uri_prefix: input_uri_prefix, namespace_ids: namespace_ids do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.import_documents ::Google::Cloud::Firestore::Admin::V1::ImportDocumentsRequest.new(name: name, collection_ids: collection_ids, input_uri_prefix: input_uri_prefix, namespace_ids: namespace_ids) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.import_documents({ name: name, collection_ids: collection_ids, input_uri_prefix: input_uri_prefix, namespace_ids: namespace_ids }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.import_documents(::Google::Cloud::Firestore::Admin::V1::ImportDocumentsRequest.new(name: name, collection_ids: collection_ids, input_uri_prefix: input_uri_prefix, namespace_ids: namespace_ids), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, import_documents_client_stub.call_count - end - end - end - - def test_create_database - # 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" - database = {} - database_id = "hello world" - - create_database_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| - 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::Firestore::Admin::V1::FirestoreAdmin::Rest::ServiceStub.stub :transcode_create_database_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_database_client_stub do - # Create client - client = ::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_database({ parent: parent, database: database, database_id: database_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_database parent: parent, database: database, database_id: database_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_database ::Google::Cloud::Firestore::Admin::V1::CreateDatabaseRequest.new(parent: parent, database: database, database_id: database_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_database({ parent: parent, database: database, database_id: database_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_database(::Google::Cloud::Firestore::Admin::V1::CreateDatabaseRequest.new(parent: parent, database: database, database_id: database_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_database_client_stub.call_count - end - end - end - - def test_get_database - # Create test objects. - client_result = ::Google::Cloud::Firestore::Admin::V1::Database.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_database_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| - 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::Firestore::Admin::V1::FirestoreAdmin::Rest::ServiceStub.stub :transcode_get_database_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_database_client_stub do - # Create client - client = ::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_database({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_database name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_database ::Google::Cloud::Firestore::Admin::V1::GetDatabaseRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_database({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_database(::Google::Cloud::Firestore::Admin::V1::GetDatabaseRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_database_client_stub.call_count - end - end - end - - def test_list_databases - # Create test objects. - client_result = ::Google::Cloud::Firestore::Admin::V1::ListDatabasesResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - - list_databases_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| - 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::Firestore::Admin::V1::FirestoreAdmin::Rest::ServiceStub.stub :transcode_list_databases_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_databases_client_stub do - # Create client - client = ::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_databases({ parent: parent }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.list_databases parent: parent do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.list_databases ::Google::Cloud::Firestore::Admin::V1::ListDatabasesRequest.new(parent: parent) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.list_databases({ parent: parent }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.list_databases(::Google::Cloud::Firestore::Admin::V1::ListDatabasesRequest.new(parent: parent), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, list_databases_client_stub.call_count - end - end - end - - def test_update_database - # 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. - database = {} - update_mask = {} - - update_database_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| - 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::Firestore::Admin::V1::FirestoreAdmin::Rest::ServiceStub.stub :transcode_update_database_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_database_client_stub do - # Create client - client = ::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_database({ database: database, update_mask: update_mask }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_database database: database, update_mask: update_mask do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_database ::Google::Cloud::Firestore::Admin::V1::UpdateDatabaseRequest.new(database: database, update_mask: update_mask) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.update_database({ database: database, update_mask: update_mask }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.update_database(::Google::Cloud::Firestore::Admin::V1::UpdateDatabaseRequest.new(database: database, update_mask: update_mask), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, update_database_client_stub.call_count - end - end - end - - def test_delete_database - # 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" - etag = "hello world" - - delete_database_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| - 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::Firestore::Admin::V1::FirestoreAdmin::Rest::ServiceStub.stub :transcode_delete_database_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_database_client_stub do - # Create client - client = ::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.delete_database({ name: name, etag: etag }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.delete_database name: name, etag: etag do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.delete_database ::Google::Cloud::Firestore::Admin::V1::DeleteDatabaseRequest.new(name: name, etag: etag) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.delete_database({ name: name, etag: etag }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.delete_database(::Google::Cloud::Firestore::Admin::V1::DeleteDatabaseRequest.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_database_client_stub.call_count - end - end - end - - def test_get_backup - # Create test objects. - client_result = ::Google::Cloud::Firestore::Admin::V1::Backup.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_backup_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| - 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::Firestore::Admin::V1::FirestoreAdmin::Rest::ServiceStub.stub :transcode_get_backup_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_backup_client_stub do - # Create client - client = ::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_backup({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_backup name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_backup ::Google::Cloud::Firestore::Admin::V1::GetBackupRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_backup({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_backup(::Google::Cloud::Firestore::Admin::V1::GetBackupRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_backup_client_stub.call_count - end - end - end - - def test_list_backups - # Create test objects. - client_result = ::Google::Cloud::Firestore::Admin::V1::ListBackupsResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - - list_backups_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| - 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::Firestore::Admin::V1::FirestoreAdmin::Rest::ServiceStub.stub :transcode_list_backups_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_backups_client_stub do - # Create client - client = ::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_backups({ parent: parent }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.list_backups parent: parent do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.list_backups ::Google::Cloud::Firestore::Admin::V1::ListBackupsRequest.new(parent: parent) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.list_backups({ parent: parent }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.list_backups(::Google::Cloud::Firestore::Admin::V1::ListBackupsRequest.new(parent: parent), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, list_backups_client_stub.call_count - end - end - end - - def test_delete_backup - # 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_backup_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| - 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::Firestore::Admin::V1::FirestoreAdmin::Rest::ServiceStub.stub :transcode_delete_backup_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_backup_client_stub do - # Create client - client = ::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.delete_backup({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.delete_backup name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.delete_backup ::Google::Cloud::Firestore::Admin::V1::DeleteBackupRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.delete_backup({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.delete_backup(::Google::Cloud::Firestore::Admin::V1::DeleteBackupRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, delete_backup_client_stub.call_count - end - end - end - - def test_restore_database - # 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" - database_id = "hello world" - backup = "hello world" - - restore_database_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| - 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::Firestore::Admin::V1::FirestoreAdmin::Rest::ServiceStub.stub :transcode_restore_database_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, restore_database_client_stub do - # Create client - client = ::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.restore_database({ parent: parent, database_id: database_id, backup: backup }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.restore_database parent: parent, database_id: database_id, backup: backup do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.restore_database ::Google::Cloud::Firestore::Admin::V1::RestoreDatabaseRequest.new(parent: parent, database_id: database_id, backup: backup) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.restore_database({ parent: parent, database_id: database_id, backup: backup }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.restore_database(::Google::Cloud::Firestore::Admin::V1::RestoreDatabaseRequest.new(parent: parent, database_id: database_id, backup: backup), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, restore_database_client_stub.call_count - end - end - end - - def test_create_backup_schedule - # Create test objects. - client_result = ::Google::Cloud::Firestore::Admin::V1::BackupSchedule.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - backup_schedule = {} - - create_backup_schedule_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| - 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::Firestore::Admin::V1::FirestoreAdmin::Rest::ServiceStub.stub :transcode_create_backup_schedule_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_backup_schedule_client_stub do - # Create client - client = ::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_backup_schedule({ parent: parent, backup_schedule: backup_schedule }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_backup_schedule parent: parent, backup_schedule: backup_schedule do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_backup_schedule ::Google::Cloud::Firestore::Admin::V1::CreateBackupScheduleRequest.new(parent: parent, backup_schedule: backup_schedule) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_backup_schedule({ parent: parent, backup_schedule: backup_schedule }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_backup_schedule(::Google::Cloud::Firestore::Admin::V1::CreateBackupScheduleRequest.new(parent: parent, backup_schedule: backup_schedule), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_backup_schedule_client_stub.call_count - end - end - end - - def test_get_backup_schedule - # Create test objects. - client_result = ::Google::Cloud::Firestore::Admin::V1::BackupSchedule.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_backup_schedule_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| - 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::Firestore::Admin::V1::FirestoreAdmin::Rest::ServiceStub.stub :transcode_get_backup_schedule_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_backup_schedule_client_stub do - # Create client - client = ::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_backup_schedule({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_backup_schedule name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_backup_schedule ::Google::Cloud::Firestore::Admin::V1::GetBackupScheduleRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_backup_schedule({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_backup_schedule(::Google::Cloud::Firestore::Admin::V1::GetBackupScheduleRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_backup_schedule_client_stub.call_count - end - end - end - - def test_list_backup_schedules - # Create test objects. - client_result = ::Google::Cloud::Firestore::Admin::V1::ListBackupSchedulesResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - - list_backup_schedules_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| - 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::Firestore::Admin::V1::FirestoreAdmin::Rest::ServiceStub.stub :transcode_list_backup_schedules_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_backup_schedules_client_stub do - # Create client - client = ::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_backup_schedules({ parent: parent }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.list_backup_schedules parent: parent do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.list_backup_schedules ::Google::Cloud::Firestore::Admin::V1::ListBackupSchedulesRequest.new(parent: parent) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.list_backup_schedules({ parent: parent }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.list_backup_schedules(::Google::Cloud::Firestore::Admin::V1::ListBackupSchedulesRequest.new(parent: parent), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, list_backup_schedules_client_stub.call_count - end - end - end - - def test_update_backup_schedule - # Create test objects. - client_result = ::Google::Cloud::Firestore::Admin::V1::BackupSchedule.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - backup_schedule = {} - update_mask = {} - - update_backup_schedule_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| - 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::Firestore::Admin::V1::FirestoreAdmin::Rest::ServiceStub.stub :transcode_update_backup_schedule_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_backup_schedule_client_stub do - # Create client - client = ::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_backup_schedule({ backup_schedule: backup_schedule, update_mask: update_mask }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_backup_schedule backup_schedule: backup_schedule, update_mask: update_mask do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_backup_schedule ::Google::Cloud::Firestore::Admin::V1::UpdateBackupScheduleRequest.new(backup_schedule: backup_schedule, update_mask: update_mask) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.update_backup_schedule({ backup_schedule: backup_schedule, update_mask: update_mask }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.update_backup_schedule(::Google::Cloud::Firestore::Admin::V1::UpdateBackupScheduleRequest.new(backup_schedule: backup_schedule, update_mask: update_mask), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, update_backup_schedule_client_stub.call_count - end - end - end - - def test_delete_backup_schedule - # 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_backup_schedule_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| - 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::Firestore::Admin::V1::FirestoreAdmin::Rest::ServiceStub.stub :transcode_delete_backup_schedule_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_backup_schedule_client_stub do - # Create client - client = ::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.delete_backup_schedule({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.delete_backup_schedule name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.delete_backup_schedule ::Google::Cloud::Firestore::Admin::V1::DeleteBackupScheduleRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.delete_backup_schedule({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.delete_backup_schedule(::Google::Cloud::Firestore::Admin::V1::DeleteBackupScheduleRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, delete_backup_schedule_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::Firestore::Admin::V1::FirestoreAdmin::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::Firestore::Admin::V1::FirestoreAdmin::Rest::Client::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-firestore-admin-v1/test/google/cloud/firestore/admin/v1/firestore_admin_test.rb b/owl-bot-staging/google-cloud-firestore-admin-v1/test/google/cloud/firestore/admin/v1/firestore_admin_test.rb deleted file mode 100644 index 9e95cdb8406e..000000000000 --- a/owl-bot-staging/google-cloud-firestore-admin-v1/test/google/cloud/firestore/admin/v1/firestore_admin_test.rb +++ /dev/null @@ -1,1520 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 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/firestore/admin/v1/firestore_admin_pb" -require "google/firestore/admin/v1/firestore_admin_services_pb" -require "google/cloud/firestore/admin/v1/firestore_admin" - -class ::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::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) - - yield @response, @operation if block_given? - - @response - end - - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - end - - def test_create_index - # 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" - index = {} - - create_index_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_index, name - assert_kind_of ::Google::Cloud::Firestore::Admin::V1::CreateIndexRequest, request - assert_equal "hello world", request["parent"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Firestore::Admin::V1::Index), request["index"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_index_client_stub do - # Create client - client = ::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_index({ parent: parent, index: index }) 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_index parent: parent, index: index 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_index ::Google::Cloud::Firestore::Admin::V1::CreateIndexRequest.new(parent: parent, index: index) 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_index({ parent: parent, index: index }, 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_index(::Google::Cloud::Firestore::Admin::V1::CreateIndexRequest.new(parent: parent, index: index), 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_index_client_stub.call_rpc_count - end - end - - def test_list_indexes - # Create GRPC objects. - grpc_response = ::Google::Cloud::Firestore::Admin::V1::ListIndexesResponse.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_indexes_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_indexes, name - assert_kind_of ::Google::Cloud::Firestore::Admin::V1::ListIndexesRequest, 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_indexes_client_stub do - # Create client - client = ::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_indexes({ 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_indexes 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_indexes ::Google::Cloud::Firestore::Admin::V1::ListIndexesRequest.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_indexes({ 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_indexes(::Google::Cloud::Firestore::Admin::V1::ListIndexesRequest.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_indexes_client_stub.call_rpc_count - end - end - - def test_get_index - # Create GRPC objects. - grpc_response = ::Google::Cloud::Firestore::Admin::V1::Index.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_index_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_index, name - assert_kind_of ::Google::Cloud::Firestore::Admin::V1::GetIndexRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_index_client_stub do - # Create client - client = ::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_index({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_index name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_index ::Google::Cloud::Firestore::Admin::V1::GetIndexRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_index({ 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_index(::Google::Cloud::Firestore::Admin::V1::GetIndexRequest.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_index_client_stub.call_rpc_count - end - end - - def test_delete_index - # 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_index_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_index, name - assert_kind_of ::Google::Cloud::Firestore::Admin::V1::DeleteIndexRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_index_client_stub do - # Create client - client = ::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_index({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.delete_index name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.delete_index ::Google::Cloud::Firestore::Admin::V1::DeleteIndexRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.delete_index({ 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_index(::Google::Cloud::Firestore::Admin::V1::DeleteIndexRequest.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_index_client_stub.call_rpc_count - end - end - - def test_get_field - # Create GRPC objects. - grpc_response = ::Google::Cloud::Firestore::Admin::V1::Field.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_field_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_field, name - assert_kind_of ::Google::Cloud::Firestore::Admin::V1::GetFieldRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_field_client_stub do - # Create client - client = ::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_field({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_field name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_field ::Google::Cloud::Firestore::Admin::V1::GetFieldRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_field({ 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_field(::Google::Cloud::Firestore::Admin::V1::GetFieldRequest.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_field_client_stub.call_rpc_count - end - end - - def test_update_field - # 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. - field = {} - update_mask = {} - - update_field_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_field, name - assert_kind_of ::Google::Cloud::Firestore::Admin::V1::UpdateFieldRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Firestore::Admin::V1::Field), request["field"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_field_client_stub do - # Create client - client = ::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_field({ field: field, update_mask: update_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_field field: field, update_mask: update_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_field ::Google::Cloud::Firestore::Admin::V1::UpdateFieldRequest.new(field: field, update_mask: update_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_field({ field: field, update_mask: update_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_field(::Google::Cloud::Firestore::Admin::V1::UpdateFieldRequest.new(field: field, update_mask: update_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_field_client_stub.call_rpc_count - end - end - - def test_list_fields - # Create GRPC objects. - grpc_response = ::Google::Cloud::Firestore::Admin::V1::ListFieldsResponse.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_fields_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_fields, name - assert_kind_of ::Google::Cloud::Firestore::Admin::V1::ListFieldsRequest, 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_fields_client_stub do - # Create client - client = ::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_fields({ 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_fields 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_fields ::Google::Cloud::Firestore::Admin::V1::ListFieldsRequest.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_fields({ 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_fields(::Google::Cloud::Firestore::Admin::V1::ListFieldsRequest.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_fields_client_stub.call_rpc_count - end - end - - def test_export_documents - # 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" - collection_ids = ["hello world"] - output_uri_prefix = "hello world" - namespace_ids = ["hello world"] - snapshot_time = {} - - export_documents_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :export_documents, name - assert_kind_of ::Google::Cloud::Firestore::Admin::V1::ExportDocumentsRequest, request - assert_equal "hello world", request["name"] - assert_equal ["hello world"], request["collection_ids"] - assert_equal "hello world", request["output_uri_prefix"] - assert_equal ["hello world"], request["namespace_ids"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Timestamp), request["snapshot_time"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, export_documents_client_stub do - # Create client - client = ::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.export_documents({ name: name, collection_ids: collection_ids, output_uri_prefix: output_uri_prefix, namespace_ids: namespace_ids, snapshot_time: snapshot_time }) 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.export_documents name: name, collection_ids: collection_ids, output_uri_prefix: output_uri_prefix, namespace_ids: namespace_ids, snapshot_time: snapshot_time 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.export_documents ::Google::Cloud::Firestore::Admin::V1::ExportDocumentsRequest.new(name: name, collection_ids: collection_ids, output_uri_prefix: output_uri_prefix, namespace_ids: namespace_ids, snapshot_time: snapshot_time) 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.export_documents({ name: name, collection_ids: collection_ids, output_uri_prefix: output_uri_prefix, namespace_ids: namespace_ids, snapshot_time: snapshot_time }, 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.export_documents(::Google::Cloud::Firestore::Admin::V1::ExportDocumentsRequest.new(name: name, collection_ids: collection_ids, output_uri_prefix: output_uri_prefix, namespace_ids: namespace_ids, snapshot_time: snapshot_time), 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, export_documents_client_stub.call_rpc_count - end - end - - def test_import_documents - # 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" - collection_ids = ["hello world"] - input_uri_prefix = "hello world" - namespace_ids = ["hello world"] - - import_documents_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :import_documents, name - assert_kind_of ::Google::Cloud::Firestore::Admin::V1::ImportDocumentsRequest, request - assert_equal "hello world", request["name"] - assert_equal ["hello world"], request["collection_ids"] - assert_equal "hello world", request["input_uri_prefix"] - assert_equal ["hello world"], request["namespace_ids"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, import_documents_client_stub do - # Create client - client = ::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.import_documents({ name: name, collection_ids: collection_ids, input_uri_prefix: input_uri_prefix, namespace_ids: namespace_ids }) 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.import_documents name: name, collection_ids: collection_ids, input_uri_prefix: input_uri_prefix, namespace_ids: namespace_ids 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.import_documents ::Google::Cloud::Firestore::Admin::V1::ImportDocumentsRequest.new(name: name, collection_ids: collection_ids, input_uri_prefix: input_uri_prefix, namespace_ids: namespace_ids) 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.import_documents({ name: name, collection_ids: collection_ids, input_uri_prefix: input_uri_prefix, namespace_ids: namespace_ids }, 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.import_documents(::Google::Cloud::Firestore::Admin::V1::ImportDocumentsRequest.new(name: name, collection_ids: collection_ids, input_uri_prefix: input_uri_prefix, namespace_ids: namespace_ids), 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, import_documents_client_stub.call_rpc_count - end - end - - def test_create_database - # 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" - database = {} - database_id = "hello world" - - create_database_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_database, name - assert_kind_of ::Google::Cloud::Firestore::Admin::V1::CreateDatabaseRequest, request - assert_equal "hello world", request["parent"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Firestore::Admin::V1::Database), request["database"] - assert_equal "hello world", request["database_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_database_client_stub do - # Create client - client = ::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_database({ parent: parent, database: database, database_id: database_id }) 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_database parent: parent, database: database, database_id: database_id 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_database ::Google::Cloud::Firestore::Admin::V1::CreateDatabaseRequest.new(parent: parent, database: database, database_id: database_id) 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_database({ parent: parent, database: database, database_id: database_id }, 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_database(::Google::Cloud::Firestore::Admin::V1::CreateDatabaseRequest.new(parent: parent, database: database, database_id: database_id), 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_database_client_stub.call_rpc_count - end - end - - def test_get_database - # Create GRPC objects. - grpc_response = ::Google::Cloud::Firestore::Admin::V1::Database.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_database_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_database, name - assert_kind_of ::Google::Cloud::Firestore::Admin::V1::GetDatabaseRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_database_client_stub do - # Create client - client = ::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_database({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_database name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_database ::Google::Cloud::Firestore::Admin::V1::GetDatabaseRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_database({ 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_database(::Google::Cloud::Firestore::Admin::V1::GetDatabaseRequest.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_database_client_stub.call_rpc_count - end - end - - def test_list_databases - # Create GRPC objects. - grpc_response = ::Google::Cloud::Firestore::Admin::V1::ListDatabasesResponse.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" - - list_databases_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_databases, name - assert_kind_of ::Google::Cloud::Firestore::Admin::V1::ListDatabasesRequest, request - assert_equal "hello world", request["parent"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_databases_client_stub do - # Create client - client = ::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_databases({ parent: parent }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.list_databases parent: parent do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.list_databases ::Google::Cloud::Firestore::Admin::V1::ListDatabasesRequest.new(parent: parent) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.list_databases({ parent: parent }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.list_databases(::Google::Cloud::Firestore::Admin::V1::ListDatabasesRequest.new(parent: parent), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, list_databases_client_stub.call_rpc_count - end - end - - def test_update_database - # 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. - database = {} - update_mask = {} - - update_database_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_database, name - assert_kind_of ::Google::Cloud::Firestore::Admin::V1::UpdateDatabaseRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Firestore::Admin::V1::Database), request["database"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_database_client_stub do - # Create client - client = ::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_database({ database: database, update_mask: update_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_database database: database, update_mask: update_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_database ::Google::Cloud::Firestore::Admin::V1::UpdateDatabaseRequest.new(database: database, update_mask: update_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_database({ database: database, update_mask: update_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_database(::Google::Cloud::Firestore::Admin::V1::UpdateDatabaseRequest.new(database: database, update_mask: update_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_database_client_stub.call_rpc_count - end - end - - def test_delete_database - # 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" - etag = "hello world" - - delete_database_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_database, name - assert_kind_of ::Google::Cloud::Firestore::Admin::V1::DeleteDatabaseRequest, request - assert_equal "hello world", request["name"] - assert_equal "hello world", request["etag"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_database_client_stub do - # Create client - client = ::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_database({ name: name, etag: etag }) 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.delete_database name: name, etag: etag 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.delete_database ::Google::Cloud::Firestore::Admin::V1::DeleteDatabaseRequest.new(name: name, etag: etag) 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.delete_database({ name: name, etag: etag }, 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.delete_database(::Google::Cloud::Firestore::Admin::V1::DeleteDatabaseRequest.new(name: name, etag: etag), 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, delete_database_client_stub.call_rpc_count - end - end - - def test_get_backup - # Create GRPC objects. - grpc_response = ::Google::Cloud::Firestore::Admin::V1::Backup.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_backup_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_backup, name - assert_kind_of ::Google::Cloud::Firestore::Admin::V1::GetBackupRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_backup_client_stub do - # Create client - client = ::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_backup({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_backup name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_backup ::Google::Cloud::Firestore::Admin::V1::GetBackupRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_backup({ 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_backup(::Google::Cloud::Firestore::Admin::V1::GetBackupRequest.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_backup_client_stub.call_rpc_count - end - end - - def test_list_backups - # Create GRPC objects. - grpc_response = ::Google::Cloud::Firestore::Admin::V1::ListBackupsResponse.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" - - list_backups_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_backups, name - assert_kind_of ::Google::Cloud::Firestore::Admin::V1::ListBackupsRequest, request - assert_equal "hello world", request["parent"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_backups_client_stub do - # Create client - client = ::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_backups({ parent: parent }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.list_backups parent: parent do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.list_backups ::Google::Cloud::Firestore::Admin::V1::ListBackupsRequest.new(parent: parent) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.list_backups({ parent: parent }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.list_backups(::Google::Cloud::Firestore::Admin::V1::ListBackupsRequest.new(parent: parent), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, list_backups_client_stub.call_rpc_count - end - end - - def test_delete_backup - # 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_backup_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_backup, name - assert_kind_of ::Google::Cloud::Firestore::Admin::V1::DeleteBackupRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_backup_client_stub do - # Create client - client = ::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_backup({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.delete_backup name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.delete_backup ::Google::Cloud::Firestore::Admin::V1::DeleteBackupRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.delete_backup({ 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_backup(::Google::Cloud::Firestore::Admin::V1::DeleteBackupRequest.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_backup_client_stub.call_rpc_count - end - end - - def test_restore_database - # 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" - database_id = "hello world" - backup = "hello world" - - restore_database_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :restore_database, name - assert_kind_of ::Google::Cloud::Firestore::Admin::V1::RestoreDatabaseRequest, request - assert_equal "hello world", request["parent"] - assert_equal "hello world", request["database_id"] - assert_equal "hello world", request["backup"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, restore_database_client_stub do - # Create client - client = ::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.restore_database({ parent: parent, database_id: database_id, backup: backup }) 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.restore_database parent: parent, database_id: database_id, backup: backup 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.restore_database ::Google::Cloud::Firestore::Admin::V1::RestoreDatabaseRequest.new(parent: parent, database_id: database_id, backup: backup) 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.restore_database({ parent: parent, database_id: database_id, backup: backup }, 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.restore_database(::Google::Cloud::Firestore::Admin::V1::RestoreDatabaseRequest.new(parent: parent, database_id: database_id, backup: backup), 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, restore_database_client_stub.call_rpc_count - end - end - - def test_create_backup_schedule - # Create GRPC objects. - grpc_response = ::Google::Cloud::Firestore::Admin::V1::BackupSchedule.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" - backup_schedule = {} - - create_backup_schedule_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_backup_schedule, name - assert_kind_of ::Google::Cloud::Firestore::Admin::V1::CreateBackupScheduleRequest, request - assert_equal "hello world", request["parent"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Firestore::Admin::V1::BackupSchedule), request["backup_schedule"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_backup_schedule_client_stub do - # Create client - client = ::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_backup_schedule({ parent: parent, backup_schedule: backup_schedule }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.create_backup_schedule parent: parent, backup_schedule: backup_schedule do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.create_backup_schedule ::Google::Cloud::Firestore::Admin::V1::CreateBackupScheduleRequest.new(parent: parent, backup_schedule: backup_schedule) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.create_backup_schedule({ parent: parent, backup_schedule: backup_schedule }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.create_backup_schedule(::Google::Cloud::Firestore::Admin::V1::CreateBackupScheduleRequest.new(parent: parent, backup_schedule: backup_schedule), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, create_backup_schedule_client_stub.call_rpc_count - end - end - - def test_get_backup_schedule - # Create GRPC objects. - grpc_response = ::Google::Cloud::Firestore::Admin::V1::BackupSchedule.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_backup_schedule_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_backup_schedule, name - assert_kind_of ::Google::Cloud::Firestore::Admin::V1::GetBackupScheduleRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_backup_schedule_client_stub do - # Create client - client = ::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_backup_schedule({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_backup_schedule name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_backup_schedule ::Google::Cloud::Firestore::Admin::V1::GetBackupScheduleRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_backup_schedule({ 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_backup_schedule(::Google::Cloud::Firestore::Admin::V1::GetBackupScheduleRequest.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_backup_schedule_client_stub.call_rpc_count - end - end - - def test_list_backup_schedules - # Create GRPC objects. - grpc_response = ::Google::Cloud::Firestore::Admin::V1::ListBackupSchedulesResponse.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" - - list_backup_schedules_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_backup_schedules, name - assert_kind_of ::Google::Cloud::Firestore::Admin::V1::ListBackupSchedulesRequest, request - assert_equal "hello world", request["parent"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_backup_schedules_client_stub do - # Create client - client = ::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_backup_schedules({ parent: parent }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.list_backup_schedules parent: parent do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.list_backup_schedules ::Google::Cloud::Firestore::Admin::V1::ListBackupSchedulesRequest.new(parent: parent) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.list_backup_schedules({ parent: parent }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.list_backup_schedules(::Google::Cloud::Firestore::Admin::V1::ListBackupSchedulesRequest.new(parent: parent), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, list_backup_schedules_client_stub.call_rpc_count - end - end - - def test_update_backup_schedule - # Create GRPC objects. - grpc_response = ::Google::Cloud::Firestore::Admin::V1::BackupSchedule.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. - backup_schedule = {} - update_mask = {} - - update_backup_schedule_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_backup_schedule, name - assert_kind_of ::Google::Cloud::Firestore::Admin::V1::UpdateBackupScheduleRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Firestore::Admin::V1::BackupSchedule), request["backup_schedule"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_backup_schedule_client_stub do - # Create client - client = ::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_backup_schedule({ backup_schedule: backup_schedule, update_mask: update_mask }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.update_backup_schedule backup_schedule: backup_schedule, update_mask: update_mask do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.update_backup_schedule ::Google::Cloud::Firestore::Admin::V1::UpdateBackupScheduleRequest.new(backup_schedule: backup_schedule, update_mask: update_mask) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.update_backup_schedule({ backup_schedule: backup_schedule, 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.update_backup_schedule(::Google::Cloud::Firestore::Admin::V1::UpdateBackupScheduleRequest.new(backup_schedule: backup_schedule, 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, update_backup_schedule_client_stub.call_rpc_count - end - end - - def test_delete_backup_schedule - # 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_backup_schedule_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_backup_schedule, name - assert_kind_of ::Google::Cloud::Firestore::Admin::V1::DeleteBackupScheduleRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_backup_schedule_client_stub do - # Create client - client = ::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_backup_schedule({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.delete_backup_schedule name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.delete_backup_schedule ::Google::Cloud::Firestore::Admin::V1::DeleteBackupScheduleRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.delete_backup_schedule({ 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_backup_schedule(::Google::Cloud::Firestore::Admin::V1::DeleteBackupScheduleRequest.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_backup_schedule_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::Firestore::Admin::V1::FirestoreAdmin::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::Firestore::Admin::V1::FirestoreAdmin::Client::Configuration, config - 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::Firestore::Admin::V1::FirestoreAdmin::Client.new do |config| - config.credentials = grpc_channel - end - end - - assert_kind_of ::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Operations, client.operations_client - end -end diff --git a/owl-bot-staging/google-cloud-firestore-admin-v1/test/helper.rb b/owl-bot-staging/google-cloud-firestore-admin-v1/test/helper.rb deleted file mode 100644 index 2d25cd69b685..000000000000 --- a/owl-bot-staging/google-cloud-firestore-admin-v1/test/helper.rb +++ /dev/null @@ -1,23 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 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"